From kwrobot at kitware.com Wed Apr 1 00:01:09 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 1 Apr 2015 00:01:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-560-gc0312d9 Message-ID: <20150401040109.CBD04AD4A7@public.kitware.com> This is an automated email from 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 c0312d9276db0c5d1ba84e574df5d10382b96a70 (commit) from 00214357ba6166d829da68a65c0d50a61c663bd5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0312d9276db0c5d1ba84e574df5d10382b96a70 commit c0312d9276db0c5d1ba84e574df5d10382b96a70 Author: Kitware Robot AuthorDate: Wed Apr 1 00:01:04 2015 -0400 Commit: Kitware Robot CommitDate: Wed Apr 1 00:01:04 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f4f3aa6..ad42d78 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150331) +set(CMake_VERSION_PATCH 20150401) #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 Apr 1 11:13:45 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 11:13:45 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1339-g78fb739 Message-ID: <20150401151345.74907ACE4A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 78fb739f9a33b22eca2339a2c33bb23ba1808781 (commit) via af61d6cb60a38069fb82f54bd7f2eb2b798bf4dc (commit) from b190c080a71b5ad153d58a40256d6144d2e84b32 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78fb739f9a33b22eca2339a2c33bb23ba1808781 commit 78fb739f9a33b22eca2339a2c33bb23ba1808781 Merge: b190c08 af61d6c Author: Brad King AuthorDate: Wed Apr 1 11:13:44 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 11:13:44 2015 -0400 Merge topic 'fix-liblzma-access-alignment' into next af61d6cb liblzma: Use unaligned access only on Intel and PowerPC archs http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af61d6cb60a38069fb82f54bd7f2eb2b798bf4dc commit af61d6cb60a38069fb82f54bd7f2eb2b798bf4dc Author: Brad King AuthorDate: Wed Apr 1 11:03:57 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 11:05:30 2015 -0400 liblzma: Use unaligned access only on Intel and PowerPC archs diff --git a/Utilities/cmliblzma/config.h.in b/Utilities/cmliblzma/config.h.in index 017c435..9c53150 100644 --- a/Utilities/cmliblzma/config.h.in +++ b/Utilities/cmliblzma/config.h.in @@ -280,4 +280,10 @@ typedef uint64_t uintmax_t; /* Define to 1 if the system supports fast unaligned access to 16-bit and 32-bit integers. */ -#define TUKLIB_FAST_UNALIGNED_ACCESS 1 +#if defined(__i386) || defined(__i386__) || defined(_M_IX86) \ + || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) \ + || defined(__amd64) || defined(__amd64__) \ + || defined(__powerpc) || defined(__powerpc__) \ + || defined(__ppc) || defined(__ppc__) || defined(__POWERPC__) +# define TUKLIB_FAST_UNALIGNED_ACCESS 1 +#endif ----------------------------------------------------------------------- Summary of changes: Utilities/cmliblzma/config.h.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 13:00:08 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 13:00:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1342-g4704f65 Message-ID: <20150401170008.1613CADC3D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4704f65dd10366137d9d04cecd70355cdd8825c0 (commit) via 6df91a60a90479a0edc403c1e6d5f6cb69747413 (commit) via f57e02b129a54bfa2fc0a4ab617e84ffb69f66bf (commit) from 78fb739f9a33b22eca2339a2c33bb23ba1808781 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4704f65dd10366137d9d04cecd70355cdd8825c0 commit 4704f65dd10366137d9d04cecd70355cdd8825c0 Merge: 78fb739 6df91a6 Author: Brad King AuthorDate: Wed Apr 1 13:00:06 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 13:00:06 2015 -0400 Merge topic 'test_cpack_symlinks' into next 6df91a60 cpack: Disable CMake Cygwin legacy warning while packaging f57e02b1 fixup! Add a test case for CPack with symbolic links in the source tree. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6df91a60a90479a0edc403c1e6d5f6cb69747413 commit 6df91a60a90479a0edc403c1e6d5f6cb69747413 Author: Brad King AuthorDate: Wed Apr 1 12:50:03 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 12:55:39 2015 -0400 cpack: Disable CMake Cygwin legacy warning while packaging In cpack we load the platform information modules to give the configuration scripts access to the host system information. CYGWIN.cmake warns unless we explicitly tell it not to warn since there is no chance for a cmake_minimum_required(VERSION) to be called. diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 6106472..00b23cd 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -203,6 +203,9 @@ int main (int argc, char const* const* argv) cmgg.SetCMakeInstance(&cminst); cmsys::auto_ptr cmlg(cmgg.CreateLocalGenerator()); cmMakefile* globalMF = cmlg->GetMakefile(); +#if defined(__CYGWIN__) + globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0"); +#endif bool cpackConfigFileSpecified = true; if ( cpackConfigFile.empty() ) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f57e02b129a54bfa2fc0a4ab617e84ffb69f66bf commit f57e02b129a54bfa2fc0a4ab617e84ffb69f66bf Author: Brad King AuthorDate: Wed Apr 1 11:46:20 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 12:55:39 2015 -0400 fixup! Add a test case for CPack with symbolic links in the source tree. diff --git a/Tests/RunCMake/CPackSymlinks/CMakeLists.txt b/Tests/RunCMake/CPackSymlinks/CMakeLists.txt deleted file mode 100644 index dbaa24c..0000000 --- a/Tests/RunCMake/CPackSymlinks/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 3.1 FATAL_ERROR) - -project(${RunCMake_TEST} NONE) -include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CPackSymlinks/CPack_TestSymlinks.cmake b/Tests/RunCMake/CPackSymlinks/CPack_TestSymlinks.cmake deleted file mode 100644 index 845c377..0000000 --- a/Tests/RunCMake/CPackSymlinks/CPack_TestSymlinks.cmake +++ /dev/null @@ -1 +0,0 @@ -include(CPack) diff --git a/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake b/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake index 3431eae..439d95e 100644 --- a/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake @@ -1,21 +1,20 @@ include(RunCMake) -function(run_cpack_symlink_test TEST_NAME) +function(run_cpack_symlink_test) set(RunCMake_TEST_NO_CLEAN TRUE) - set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${TEST_NAME}-build") - set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${TEST_NAME}-source") + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/SrcSymlinks-build") + set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/SrcSymlinks") file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}") - execute_process( - COMMAND "${CMAKE_COMMAND}" -E tar xvf - "${RunCMake_SOURCE_DIR}/testcpacksym.tar" - WORKING_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}" + run_cmake_command(SrcSymlinksTar + ${CMAKE_COMMAND} -E chdir ${RunCMake_TEST_SOURCE_DIR} + ${CMAKE_COMMAND} -E tar xvf ${RunCMake_SOURCE_DIR}/testcpacksym.tar + ) + run_cmake(SrcSymlinksCMake) + run_cmake_command(SrcSymlinksCPack + ${CMAKE_CPACK_COMMAND} --config CPackSourceConfig.cmake ) - run_cmake(${TEST_NAME}) - run_cmake_command(${TEST_NAME} ${CMAKE_CPACK_COMMAND} - --config CPackSourceConfig.cmake) endfunction() -run_cpack_symlink_test(CPack_TestSymlinks) +run_cpack_symlink_test() diff --git a/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt b/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt new file mode 100644 index 0000000..24ad124 --- /dev/null +++ b/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt @@ -0,0 +1,10 @@ +^x CMakeLists.txt +x cygwin/ +x cygwin/build.sh +x cygwin/setup.patch +x include/ +x include/src.h +x link.h +x real.h +x src/ +x src/src.h$ diff --git a/Tests/RunCMake/CPackSymlinks/testcpacksym.tar b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar index 6e5017e..31f34a0 100644 Binary files a/Tests/RunCMake/CPackSymlinks/testcpacksym.tar and b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar differ ----------------------------------------------------------------------- Summary of changes: Source/CPack/cpack.cxx | 3 +++ Tests/RunCMake/CPackSymlinks/CMakeLists.txt | 4 ---- .../CPackSymlinks/CPack_TestSymlinks.cmake | 1 - Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake | 23 ++++++++++---------- .../CPackSymlinks/SrcSymlinksTar-stdout.txt | 10 +++++++++ Tests/RunCMake/CPackSymlinks/testcpacksym.tar | Bin 10240 -> 10240 bytes 6 files changed, 24 insertions(+), 17 deletions(-) delete mode 100644 Tests/RunCMake/CPackSymlinks/CMakeLists.txt delete mode 100644 Tests/RunCMake/CPackSymlinks/CPack_TestSymlinks.cmake create mode 100644 Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 13:00:46 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 13:00:46 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1345-g1c08496 Message-ID: <20150401170046.C34DAADC4C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1c08496a772bc81169a3c3b19c4ef167c9548e8f (commit) via 8b354630d9c4601aaff6339aed518fad1012a8b6 (commit) via aca1d93bd9b9921ecef83b80bed219a2f5879500 (commit) from 4704f65dd10366137d9d04cecd70355cdd8825c0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c08496a772bc81169a3c3b19c4ef167c9548e8f commit 1c08496a772bc81169a3c3b19c4ef167c9548e8f Merge: 4704f65 8b35463 Author: Brad King AuthorDate: Wed Apr 1 13:00:46 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 13:00:46 2015 -0400 Merge topic 'test_cpack_symlinks' into next 8b354630 Tests: Add case for CPack source package with symlinks aca1d93b cpack: Disable CMake Cygwin legacy warning while packaging http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b354630d9c4601aaff6339aed518fad1012a8b6 commit 8b354630d9c4601aaff6339aed518fad1012a8b6 Author: Bill Hoffman AuthorDate: Tue Mar 31 15:04:39 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 12:57:45 2015 -0400 Tests: Add case for CPack source package with symlinks diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 7b9c810..1242332 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -203,6 +203,11 @@ add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) add_RunCMake_test(CTestCommandLine) +# Only run this test on unix platforms that support +# symbolic links +if(UNIX) + add_RunCMake_test(CPackSymlinks) +endif() set(IfacePaths_INCLUDE_DIRECTORIES_ARGS -DTEST_PROP=INCLUDE_DIRECTORIES) add_RunCMake_test(IfacePaths_INCLUDE_DIRECTORIES TEST_DIR IfacePaths) diff --git a/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake b/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake new file mode 100644 index 0000000..439d95e --- /dev/null +++ b/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake @@ -0,0 +1,20 @@ +include(RunCMake) + +function(run_cpack_symlink_test) + set(RunCMake_TEST_NO_CLEAN TRUE) + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/SrcSymlinks-build") + set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/SrcSymlinks") + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}") + run_cmake_command(SrcSymlinksTar + ${CMAKE_COMMAND} -E chdir ${RunCMake_TEST_SOURCE_DIR} + ${CMAKE_COMMAND} -E tar xvf ${RunCMake_SOURCE_DIR}/testcpacksym.tar + ) + run_cmake(SrcSymlinksCMake) + run_cmake_command(SrcSymlinksCPack + ${CMAKE_CPACK_COMMAND} --config CPackSourceConfig.cmake + ) +endfunction() + +run_cpack_symlink_test() diff --git a/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt b/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt new file mode 100644 index 0000000..24ad124 --- /dev/null +++ b/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt @@ -0,0 +1,10 @@ +^x CMakeLists.txt +x cygwin/ +x cygwin/build.sh +x cygwin/setup.patch +x include/ +x include/src.h +x link.h +x real.h +x src/ +x src/src.h$ diff --git a/Tests/RunCMake/CPackSymlinks/testcpacksym.tar b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar new file mode 100644 index 0000000..31f34a0 Binary files /dev/null and b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar differ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aca1d93bd9b9921ecef83b80bed219a2f5879500 commit aca1d93bd9b9921ecef83b80bed219a2f5879500 Author: Brad King AuthorDate: Wed Apr 1 12:50:03 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 12:57:43 2015 -0400 cpack: Disable CMake Cygwin legacy warning while packaging In cpack we load the platform information modules to give the configuration scripts access to the host system information. CYGWIN.cmake warns unless we explicitly tell it not to warn since there is no chance for a cmake_minimum_required(VERSION) to be called. diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 6106472..00b23cd 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -203,6 +203,9 @@ int main (int argc, char const* const* argv) cmgg.SetCMakeInstance(&cminst); cmsys::auto_ptr cmlg(cmgg.CreateLocalGenerator()); cmMakefile* globalMF = cmlg->GetMakefile(); +#if defined(__CYGWIN__) + globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0"); +#endif bool cpackConfigFileSpecified = true; if ( cpackConfigFile.empty() ) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 13:19:29 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 13:19:29 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-562-g0fa263d Message-ID: <20150401171929.9E147AD76D@public.kitware.com> This is an automated email from 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 0fa263d9d0a9dac9c7a574d09d8cb3d40cb603bd (commit) via 0778016a0bba246e46f628aecd64e0f8afcc0fdb (commit) from c0312d9276db0c5d1ba84e574df5d10382b96a70 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fa263d9d0a9dac9c7a574d09d8cb3d40cb603bd commit 0fa263d9d0a9dac9c7a574d09d8cb3d40cb603bd Merge: c0312d9 0778016 Author: Brad King AuthorDate: Wed Apr 1 13:19:28 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 13:19:28 2015 -0400 Merge topic 'solaris-fix-target_link_libraries-test' 0778016a Tests: Do not try to use invalid "ld -v" flag on Solaris ----------------------------------------------------------------------- Summary of changes: .../target_link_libraries/cmp0022/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 13:19:31 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 13:19:31 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-564-g6f578ee Message-ID: <20150401171931.864C2AD774@public.kitware.com> This is an automated email from 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 6f578ee3ade86f4bad786bf87c03afb0d8262249 (commit) via 3113d86df4b469abdf3852671dc985420e06d363 (commit) from 0fa263d9d0a9dac9c7a574d09d8cb3d40cb603bd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f578ee3ade86f4bad786bf87c03afb0d8262249 commit 6f578ee3ade86f4bad786bf87c03afb0d8262249 Merge: 0fa263d 3113d86 Author: Brad King AuthorDate: Wed Apr 1 13:19:30 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 13:19:30 2015 -0400 Merge topic 'suppress-osx-arch-linker-warning' 3113d86d CTestCustom: Suppress OS X universal binary link arch warnings ----------------------------------------------------------------------- Summary of changes: CTestCustom.cmake.in | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 13:19:33 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 13:19:33 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-567-gaa508a5 Message-ID: <20150401171933.EF9D0AD7FA@public.kitware.com> This is an automated email from 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 aa508a52992990fd375253bed3a1e6c392722a56 (commit) via 44990732a8c2340193667c200987503bbbcb442f (commit) via 4adf1dad2a6e462364bae81030c928599d11c24f (commit) from 6f578ee3ade86f4bad786bf87c03afb0d8262249 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa508a52992990fd375253bed3a1e6c392722a56 commit aa508a52992990fd375253bed3a1e6c392722a56 Merge: 6f578ee 4499073 Author: Brad King AuthorDate: Wed Apr 1 13:19:32 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 13:19:32 2015 -0400 Merge topic 'makefile-DELETE_ON_ERROR' 44990732 Help: Add notes for topic 'makefile-DELETE_ON_ERROR' 4adf1dad Makefile: Tell GNU make to delete rule outputs on error (#15474) ----------------------------------------------------------------------- Summary of changes: Help/release/dev/makefile-DELETE_ON_ERROR.rst | 7 +++++++ Source/cmGlobalBorlandMakefileGenerator.h | 1 + Source/cmGlobalUnixMakefileGenerator3.h | 3 +++ Source/cmGlobalWatcomWMakeGenerator.h | 1 + Source/cmMakefileTargetGenerator.cxx | 8 ++++++++ 5 files changed, 20 insertions(+) create mode 100644 Help/release/dev/makefile-DELETE_ON_ERROR.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 13:19:36 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 13:19:36 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-569-g9d456ec Message-ID: <20150401171936.5C14FAD7F7@public.kitware.com> This is an automated email from 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 9d456ec71ae0dfc4db5260d256c6b9570d5dd8cb (commit) via 7b1cdb00279908cacabada92f8a53e4986465423 (commit) from aa508a52992990fd375253bed3a1e6c392722a56 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d456ec71ae0dfc4db5260d256c6b9570d5dd8cb commit 9d456ec71ae0dfc4db5260d256c6b9570d5dd8cb Merge: aa508a5 7b1cdb0 Author: Brad King AuthorDate: Wed Apr 1 13:19:34 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 13:19:34 2015 -0400 Merge topic 'jsoncpp-isfinite' 7b1cdb00 jsoncpp: Provide 'isfinite' implementation on older AIX and HP-UX ----------------------------------------------------------------------- Summary of changes: Utilities/cmjsoncpp/src/lib_json/json_writer.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 13:19:38 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 13:19:38 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-571-g4a821a4 Message-ID: <20150401171938.5028CAD7F7@public.kitware.com> This is an automated email from 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 4a821a47f700e12534d4ce16203ad2a4404ffe64 (commit) via 93a3ec8b7705c6edfa08a59a789d193fcb4cf4c1 (commit) from 9d456ec71ae0dfc4db5260d256c6b9570d5dd8cb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a821a47f700e12534d4ce16203ad2a4404ffe64 commit 4a821a47f700e12534d4ce16203ad2a4404ffe64 Merge: 9d456ec 93a3ec8 Author: Brad King AuthorDate: Wed Apr 1 13:19:37 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 13:19:37 2015 -0400 Merge topic 'cpack-fix-preinstall-tool' 93a3ec8b CPack: Fix make tool selection during preinstall (#15483) ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 13:19:40 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 13:19:40 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-573-g0c69ca8 Message-ID: <20150401171940.8E799AD7F7@public.kitware.com> This is an automated email from 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 0c69ca831b69c9fd84a5c6335ffba0192b57f42e (commit) via b687d672815d45aab9d8043eef23405525aa98e2 (commit) from 4a821a47f700e12534d4ce16203ad2a4404ffe64 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c69ca831b69c9fd84a5c6335ffba0192b57f42e commit 0c69ca831b69c9fd84a5c6335ffba0192b57f42e Merge: 4a821a4 b687d67 Author: Brad King AuthorDate: Wed Apr 1 13:19:39 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 13:19:39 2015 -0400 Merge topic 'ctest-repeat-until-fail' b687d672 Tests: Fix RunCMake.CTestCommandLine expected output time matching ----------------------------------------------------------------------- Summary of changes: .../repeat-until-fail-ctest-stdout.txt | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 13:19:42 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 13:19:42 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-575-g0de7807 Message-ID: <20150401171942.CD2F2AD7FA@public.kitware.com> This is an automated email from 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 0de7807c36ebfbaadf0e9b45bdf9fd79360c8eaf (commit) via e86f44b72616ebce43dcd62d170f7ca90ff31fdf (commit) from 0c69ca831b69c9fd84a5c6335ffba0192b57f42e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0de7807c36ebfbaadf0e9b45bdf9fd79360c8eaf commit 0de7807c36ebfbaadf0e9b45bdf9fd79360c8eaf Merge: 0c69ca8 e86f44b Author: Brad King AuthorDate: Wed Apr 1 13:19:41 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 13:19:41 2015 -0400 Merge topic 'cpack-deb-format-cast' e86f44b7 cmCPackDebGenerator: Cast file mode to proper type for %o formatter ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackDebGenerator.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 13:19:57 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 13:19:57 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1354-g4cb9f82 Message-ID: <20150401171957.9906DAD7F5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4cb9f82505bcc8a653daa478b76dd3260ee725e5 (commit) via 0de7807c36ebfbaadf0e9b45bdf9fd79360c8eaf (commit) via 0c69ca831b69c9fd84a5c6335ffba0192b57f42e (commit) via 4a821a47f700e12534d4ce16203ad2a4404ffe64 (commit) via 9d456ec71ae0dfc4db5260d256c6b9570d5dd8cb (commit) via aa508a52992990fd375253bed3a1e6c392722a56 (commit) via 6f578ee3ade86f4bad786bf87c03afb0d8262249 (commit) via 0fa263d9d0a9dac9c7a574d09d8cb3d40cb603bd (commit) via c0312d9276db0c5d1ba84e574df5d10382b96a70 (commit) from 1c08496a772bc81169a3c3b19c4ef167c9548e8f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4cb9f82505bcc8a653daa478b76dd3260ee725e5 commit 4cb9f82505bcc8a653daa478b76dd3260ee725e5 Merge: 1c08496 0de7807 Author: Brad King AuthorDate: Wed Apr 1 13:19:51 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 13:19:51 2015 -0400 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 Wed Apr 1 14:33:21 2015 From: steveire at gmail.com (Stephen Kelly) Date: Wed, 1 Apr 2015 14:33:21 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1362-g6e16fb8 Message-ID: <20150401183321.ECC20ADA19@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 6e16fb8832cc6fffaf0661e5f120b4b4f6f09bf9 (commit) via dcbef5041fe0ee9a5d311a2095fd001802067897 (commit) via f2e07a6d90806d50b6897051c2275e38689d16e7 (commit) via aafe2821889333ee647c67e0fc55472d7903c02a (commit) via 1fcf590b146bd01a64cde30ba0b5ab7fe2e05b64 (commit) via c3a60cc9cce4881f64bd0342cc841900533719e2 (commit) via 37897347b3fd97668d4831bba11e23f9f493e759 (commit) via d7539ced649ab75919c6d769ede1fca2dc08db0e (commit) from 4cb9f82505bcc8a653daa478b76dd3260ee725e5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e16fb8832cc6fffaf0661e5f120b4b4f6f09bf9 commit 6e16fb8832cc6fffaf0661e5f120b4b4f6f09bf9 Merge: 4cb9f82 dcbef50 Author: Stephen Kelly AuthorDate: Wed Apr 1 14:33:20 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 14:33:20 2015 -0400 Merge topic 'clean-up-cmMakefile' into next dcbef504 cmMakefile: Remove ProjectName member. f2e07a6d cmMakefile: Remove unused PreOrder member. aafe2821 cmMakefile: Remove unused Prefix member. 1fcf590b cmMakefile: Remove unused SubDirectoryOrder member. c3a60cc9 cmMakefile: Remove AddExtraDirectory method. 37897347 cmMakefile: Remove unused method. d7539ced cmMakefile: Remove bogus comment. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dcbef5041fe0ee9a5d311a2095fd001802067897 commit dcbef5041fe0ee9a5d311a2095fd001802067897 Author: Stephen Kelly AuthorDate: Wed Apr 1 20:17:46 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 20:32:48 2015 +0200 cmMakefile: Remove ProjectName member. It is set at the same time as the PROJECT_NAME definition is set in cmProjectCommand, and available by chaining through parents. Implement GetProjectName() in terms of the PROJECT_NAME definition. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6fbcaeb..8ab89c3 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -117,7 +117,6 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals) this->cmHomeDirectory = mf.cmHomeDirectory; this->HomeOutputDirectory = mf.HomeOutputDirectory; this->cmCurrentListFile = mf.cmCurrentListFile; - this->ProjectName = mf.ProjectName; this->Targets = mf.Targets; this->SourceFiles = mf.SourceFiles; this->Tests = mf.Tests; @@ -248,7 +247,7 @@ void cmMakefile::Print() const std::cout << " this->cmHomeDirectory; " << this->cmHomeDirectory << std::endl; std::cout << " this->ProjectName; " - << this->ProjectName << std::endl; + << this->GetDefinition("PROJECT_NAME") << std::endl; this->PrintStringVector("this->LinkDirectories", this->LinkDirectories); #if defined(CMAKE_BUILD_WITH_CMAKE) for( std::vector::const_iterator i = @@ -1659,9 +1658,6 @@ void cmMakefile::InitializeFromParent() // link directories this->LinkDirectories = parent->LinkDirectories; - // the initial project name - this->ProjectName = parent->ProjectName; - // Copy include regular expressions. this->IncludeFileRegularExpression = parent->IncludeFileRegularExpression; this->ComplainFileRegularExpression = parent->ComplainFileRegularExpression; @@ -1993,12 +1989,6 @@ void cmMakefile::RemoveCacheDefinition(const std::string& name) this->GetCacheManager()->RemoveCacheEntry(name); } -void cmMakefile::SetProjectName(const char* p) -{ - this->ProjectName = p; -} - - void cmMakefile::AddGlobalLinkInformation(const std::string& name, cmTarget& target) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index ebfe508..f4c319c 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -334,16 +334,11 @@ public: void RemoveCacheDefinition(const std::string& name); /** - * Specify the name of the project for this build. - */ - void SetProjectName(const char*); - - /** * Get the name of the project for this build. */ const char* GetProjectName() const { - return this->ProjectName.c_str(); + return this->GetDefinition("PROJECT_NAME"); } /** Get the configurations to be generated. */ diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 61c0133..ae64789 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -20,7 +20,6 @@ bool cmProjectCommand this->SetError("PROJECT called with incorrect number of arguments"); return false; } - this->Makefile->SetProjectName(args[0].c_str()); std::string bindir = args[0]; bindir += "_BINARY_DIR"; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f2e07a6d90806d50b6897051c2275e38689d16e7 commit f2e07a6d90806d50b6897051c2275e38689d16e7 Author: Stephen Kelly AuthorDate: Wed Apr 1 20:01:52 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 20:32:48 2015 +0200 cmMakefile: Remove unused PreOrder member. Remove references from dependendent API. diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 01598bc..9d55c1a 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -122,7 +122,7 @@ bool cmAddSubDirectoryCommand::InitialPass // Add the subdirectory using the computed full paths. this->Makefile->AddSubDirectory(srcPath, binPath, - excludeFromAll, false, true); + excludeFromAll, true); return true; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6303ffe..6fbcaeb 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -101,7 +101,6 @@ cmMakefile::cmMakefile(): Internal(new Internals) this->AddDefaultDefinitions(); this->Initialize(); - this->PreOrder = false; this->GeneratingBuildSystem = false; this->SuppressWatches = false; @@ -144,7 +143,6 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals) this->FunctionBlockers = mf.FunctionBlockers; this->MacrosList = mf.MacrosList; this->Properties = mf.Properties; - this->PreOrder = mf.PreOrder; this->WarnUnused = mf.WarnUnused; this->Initialize(); this->CheckSystemVars = mf.CheckSystemVars; @@ -1694,7 +1692,7 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) } void cmMakefile::AddSubDirectory(const std::string& sub, - bool excludeFromAll, bool preorder) + bool excludeFromAll) { // the source path must be made full if it isn't already std::string srcPath = sub; @@ -1716,13 +1714,13 @@ void cmMakefile::AddSubDirectory(const std::string& sub, this->AddSubDirectory(srcPath, binPath, - excludeFromAll, preorder, false); + excludeFromAll, false); } void cmMakefile::AddSubDirectory(const std::string& srcPath, const std::string& binPath, - bool excludeFromAll, bool preorder, + bool excludeFromAll, bool immediate) { // Make sure the binary directory is unique. @@ -1744,7 +1742,6 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, { lg2->GetMakefile()->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); } - lg2->GetMakefile()->SetPreOrder(preorder); if (immediate) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 321caea..ebfe508 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -292,11 +292,10 @@ public: /** * Add a subdirectory to the build. */ - void AddSubDirectory(const std::string&, bool excludeFromAll=false, - bool preorder = false); + void AddSubDirectory(const std::string&, bool excludeFromAll=false); void AddSubDirectory(const std::string& fullSrcDir, const std::string& fullBinDir, - bool excludeFromAll, bool preorder, + bool excludeFromAll, bool immediate); /** @@ -864,10 +863,6 @@ public: ///! Initialize a makefile from its parent void InitializeFromParent(); - ///! Set/Get the preorder flag - void SetPreOrder(bool p) { this->PreOrder = p; } - bool GetPreOrder() const { return this->PreOrder; } - void AddInstallGenerator(cmInstallGenerator* g) { if(g) this->InstallGenerators.push_back(g); } std::vector& GetInstallGenerators() @@ -1056,9 +1051,6 @@ private: cmPropertyMap Properties; - // should this makefile be processed before or after processing the parent - bool PreOrder; - // Unused variable flags bool WarnUnused; bool CheckSystemVars; diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx index 93ad4f3..7cb2edc 100644 --- a/Source/cmSubdirCommand.cxx +++ b/Source/cmSubdirCommand.cxx @@ -22,7 +22,6 @@ bool cmSubdirCommand } bool res = true; bool excludeFromAll = false; - bool preorder = false; for(std::vector::const_iterator i = args.begin(); i != args.end(); ++i) @@ -34,7 +33,7 @@ bool cmSubdirCommand } if(*i == "PREORDER") { - preorder = true; + // Ignored continue; } @@ -48,7 +47,7 @@ bool cmSubdirCommand std::string(this->Makefile->GetCurrentOutputDirectory()) + "/" + i->c_str(); this->Makefile->AddSubDirectory(srcPath, binPath, - excludeFromAll, preorder, false); + excludeFromAll, false); } // otherwise it is a full path else if ( cmSystemTools::FileIsDirectory(*i) ) @@ -59,7 +58,7 @@ bool cmSubdirCommand std::string(this->Makefile->GetCurrentOutputDirectory()) + "/" + cmSystemTools::GetFilenameName(*i); this->Makefile->AddSubDirectory(*i, binPath, - excludeFromAll, preorder, false); + excludeFromAll, false); } else { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aafe2821889333ee647c67e0fc55472d7903c02a commit aafe2821889333ee647c67e0fc55472d7903c02a Author: Stephen Kelly AuthorDate: Wed Apr 1 19:48:09 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 20:32:48 2015 +0200 cmMakefile: Remove unused Prefix member. Unused since it was added in commit 1f42f521 (NEW: move from tools and config to create CMake, 2000-08-29). diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index bf33e70..6303ffe 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -113,7 +113,6 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals) this->Internal->VarInitStack.push(mf.Internal->VarInitStack.top()); this->Internal->VarUsageStack.push(mf.Internal->VarUsageStack.top()); - this->Prefix = mf.Prefix; this->cmStartDirectory = mf.cmStartDirectory; this->StartOutputDirectory = mf.StartOutputDirectory; this->cmHomeDirectory = mf.cmHomeDirectory; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 864f8b0..321caea 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -961,8 +961,6 @@ protected: // Check for a an unused variable void CheckForUnused(const char* reason, const std::string& name) const; - std::string Prefix; - std::string cmStartDirectory; std::string StartOutputDirectory; std::string cmHomeDirectory; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1fcf590b146bd01a64cde30ba0b5ab7fe2e05b64 commit 1fcf590b146bd01a64cde30ba0b5ab7fe2e05b64 Author: Stephen Kelly AuthorDate: Wed Apr 1 19:46:06 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 20:32:47 2015 +0200 cmMakefile: Remove unused SubDirectoryOrder member. The last use was removed in v2.4.0~2054 (ENH: add support for out of source source, 2005-03-14) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a89ebc5..bf33e70 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -144,7 +144,6 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals) this->LocalGenerator = mf.LocalGenerator; this->FunctionBlockers = mf.FunctionBlockers; this->MacrosList = mf.MacrosList; - this->SubDirectoryOrder = mf.SubDirectoryOrder; this->Properties = mf.Properties; this->PreOrder = mf.PreOrder; this->WarnUnused = mf.WarnUnused; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 7891f37..864f8b0 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -1051,8 +1051,6 @@ private: std::vector MacrosList; - std::map SubDirectoryOrder; - mutable cmsys::RegularExpression cmDefineRegex; mutable cmsys::RegularExpression cmDefine01Regex; mutable cmsys::RegularExpression cmAtVarRegex; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c3a60cc9cce4881f64bd0342cc841900533719e2 commit c3a60cc9cce4881f64bd0342cc841900533719e2 Author: Stephen Kelly AuthorDate: Wed Apr 1 19:35:12 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 20:32:47 2015 +0200 cmMakefile: Remove AddExtraDirectory method. It has no effect. diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index a30d992..b8238f8 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -26,7 +26,6 @@ bool cmAuxSourceDirectoryCommand::InitialPass std::string sourceListValue; std::string templateDirectory = args[0]; - this->Makefile->AddExtraDirectory(templateDirectory.c_str()); std::string tdir; if(!cmSystemTools::FileIsFullPath(templateDirectory.c_str())) { diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7f355a6..a89ebc5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -114,7 +114,6 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals) this->Internal->VarUsageStack.push(mf.Internal->VarUsageStack.top()); this->Prefix = mf.Prefix; - this->AuxSourceDirectories = mf.AuxSourceDirectories; this->cmStartDirectory = mf.cmStartDirectory; this->StartOutputDirectory = mf.StartOutputDirectory; this->cmHomeDirectory = mf.cmHomeDirectory; @@ -2256,11 +2255,6 @@ void cmMakefile::AddSourceGroup(const std::vector& name, #endif -void cmMakefile::AddExtraDirectory(const char* dir) -{ - this->AuxSourceDirectories.push_back(dir); -} - static bool mightExpandVariablesCMP0019(const char* s) { return s && *s && strstr(s,"${") && strchr(s,'}'); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5e9e87b..7891f37 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -433,11 +433,6 @@ public: bool HasCMP0054AlreadyBeenReported( cmListFileContext context) const; - /** - * Add an auxiliary directory to the build. - */ - void AddExtraDirectory(const char* dir); - void MakeStartDirectoriesCurrent() { this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", @@ -967,7 +962,6 @@ protected: void CheckForUnused(const char* reason, const std::string& name) const; std::string Prefix; - std::vector AuxSourceDirectories; // std::string cmStartDirectory; std::string StartOutputDirectory; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37897347b3fd97668d4831bba11e23f9f493e759 commit 37897347b3fd97668d4831bba11e23f9f493e759 Author: Stephen Kelly AuthorDate: Wed Apr 1 19:34:06 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 20:32:47 2015 +0200 cmMakefile: Remove unused method. The last user was removed in commit v2.4.0~1516 (ENH: removed unused files, 2005-06-20). diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 13f873c..5e9e87b 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -616,12 +616,6 @@ public: cmSourceFile* GetOrCreateSource(const std::string& sourceName, bool generated = false); - /** - * Obtain a list of auxiliary source directories. - */ - const std::vector& GetAuxSourceDirectories() const - {return this->AuxSourceDirectories;} - //@{ /** * Return a list of extensions associated with source and header http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7539ced649ab75919c6d769ede1fca2dc08db0e commit d7539ced649ab75919c6d769ede1fca2dc08db0e Author: Stephen Kelly AuthorDate: Wed Apr 1 19:33:41 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 20:32:47 2015 +0200 cmMakefile: Remove bogus comment. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index e98f1d9..13f873c 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -438,10 +438,6 @@ public: */ void AddExtraDirectory(const char* dir); - - /** - * Add an auxiliary directory to the build. - */ void MakeStartDirectoriesCurrent() { this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", ----------------------------------------------------------------------- Summary of changes: Source/cmAddSubDirectoryCommand.cxx | 2 +- Source/cmAuxSourceDirectoryCommand.cxx | 1 - Source/cmMakefile.cxx | 29 ++++-------------------- Source/cmMakefile.h | 39 +++----------------------------- Source/cmProjectCommand.cxx | 1 - Source/cmSubdirCommand.cxx | 7 +++--- 6 files changed, 11 insertions(+), 68 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Wed Apr 1 15:04:28 2015 From: steveire at gmail.com (Stephen Kelly) Date: Wed, 1 Apr 2015 15:04:28 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1364-gae11f76 Message-ID: <20150401190428.B62B0AD91E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ae11f760358c8bd05f95eb81118bd08bd88aa416 (commit) via 4f663fbb8dd72855e36b697d16cd609be656b993 (commit) from 6e16fb8832cc6fffaf0661e5f120b4b4f6f09bf9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ae11f760358c8bd05f95eb81118bd08bd88aa416 commit ae11f760358c8bd05f95eb81118bd08bd88aa416 Merge: 6e16fb8 4f663fb Author: Stephen Kelly AuthorDate: Wed Apr 1 15:04:28 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 15:04:28 2015 -0400 Merge topic 'clean-up-cmMakefile' into next 4f663fbb fixup! cmMakefile: Remove ProjectName member. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f663fbb8dd72855e36b697d16cd609be656b993 commit 4f663fbb8dd72855e36b697d16cd609be656b993 Author: Stephen Kelly AuthorDate: Wed Apr 1 21:03:56 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 21:03:56 2015 +0200 fixup! cmMakefile: Remove ProjectName member. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index f4c319c..ff53987 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -338,7 +338,8 @@ public: */ const char* GetProjectName() const { - return this->GetDefinition("PROJECT_NAME"); + const char* def = this->GetDefinition("PROJECT_NAME"); + return def ? def : ""; } /** Get the configurations to be generated. */ ----------------------------------------------------------------------- Summary of changes: Source/cmMakefile.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Wed Apr 1 15:06:50 2015 From: steveire at gmail.com (Stephen Kelly) Date: Wed, 1 Apr 2015 15:06:50 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1366-g0134ce0 Message-ID: <20150401190650.A4C99ADB85@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0134ce0e8c10e23d1d33fca8b65d817ff07a05e5 (commit) via 9c59989b400c535791e71d561f556596f33f145e (commit) from ae11f760358c8bd05f95eb81118bd08bd88aa416 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0134ce0e8c10e23d1d33fca8b65d817ff07a05e5 commit 0134ce0e8c10e23d1d33fca8b65d817ff07a05e5 Merge: ae11f76 9c59989 Author: Stephen Kelly AuthorDate: Wed Apr 1 15:06:49 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 15:06:49 2015 -0400 Merge topic 'clean-up-cmMakefile' into next 9c59989b Revert "cmMakefile: Remove ProjectName member." http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c59989b400c535791e71d561f556596f33f145e commit 9c59989b400c535791e71d561f556596f33f145e Author: Stephen Kelly AuthorDate: Wed Apr 1 21:05:28 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 21:06:06 2015 +0200 Revert "cmMakefile: Remove ProjectName member." diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 8ab89c3..6fbcaeb 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -117,6 +117,7 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals) this->cmHomeDirectory = mf.cmHomeDirectory; this->HomeOutputDirectory = mf.HomeOutputDirectory; this->cmCurrentListFile = mf.cmCurrentListFile; + this->ProjectName = mf.ProjectName; this->Targets = mf.Targets; this->SourceFiles = mf.SourceFiles; this->Tests = mf.Tests; @@ -247,7 +248,7 @@ void cmMakefile::Print() const std::cout << " this->cmHomeDirectory; " << this->cmHomeDirectory << std::endl; std::cout << " this->ProjectName; " - << this->GetDefinition("PROJECT_NAME") << std::endl; + << this->ProjectName << std::endl; this->PrintStringVector("this->LinkDirectories", this->LinkDirectories); #if defined(CMAKE_BUILD_WITH_CMAKE) for( std::vector::const_iterator i = @@ -1658,6 +1659,9 @@ void cmMakefile::InitializeFromParent() // link directories this->LinkDirectories = parent->LinkDirectories; + // the initial project name + this->ProjectName = parent->ProjectName; + // Copy include regular expressions. this->IncludeFileRegularExpression = parent->IncludeFileRegularExpression; this->ComplainFileRegularExpression = parent->ComplainFileRegularExpression; @@ -1989,6 +1993,12 @@ void cmMakefile::RemoveCacheDefinition(const std::string& name) this->GetCacheManager()->RemoveCacheEntry(name); } +void cmMakefile::SetProjectName(const char* p) +{ + this->ProjectName = p; +} + + void cmMakefile::AddGlobalLinkInformation(const std::string& name, cmTarget& target) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index ff53987..ebfe508 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -334,12 +334,16 @@ public: void RemoveCacheDefinition(const std::string& name); /** + * Specify the name of the project for this build. + */ + void SetProjectName(const char*); + + /** * Get the name of the project for this build. */ const char* GetProjectName() const { - const char* def = this->GetDefinition("PROJECT_NAME"); - return def ? def : ""; + return this->ProjectName.c_str(); } /** Get the configurations to be generated. */ diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index ae64789..61c0133 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -20,6 +20,7 @@ bool cmProjectCommand this->SetError("PROJECT called with incorrect number of arguments"); return false; } + this->Makefile->SetProjectName(args[0].c_str()); std::string bindir = args[0]; bindir += "_BINARY_DIR"; ----------------------------------------------------------------------- Summary of changes: Source/cmMakefile.cxx | 12 +++++++++++- Source/cmMakefile.h | 8 ++++++-- Source/cmProjectCommand.cxx | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 15:07:05 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 15:07:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1368-ga678294 Message-ID: <20150401190705.B85C2ADB84@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a6782941026ce348d124e59e6c47c68e46585537 (commit) via dfbc299c33d8dafbd258f0d9d096cb5c33f5aaf1 (commit) from 0134ce0e8c10e23d1d33fca8b65d817ff07a05e5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6782941026ce348d124e59e6c47c68e46585537 commit a6782941026ce348d124e59e6c47c68e46585537 Merge: 0134ce0 dfbc299 Author: Brad King AuthorDate: Wed Apr 1 15:07:04 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 15:07:04 2015 -0400 Merge topic 'vs-xaml' into next dfbc299c VS: Add support for XAML source files http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dfbc299c33d8dafbd258f0d9d096cb5c33f5aaf1 commit dfbc299c33d8dafbd258f0d9d096cb5c33f5aaf1 Author: Gilles Khouzam AuthorDate: Tue Mar 31 13:49:39 2015 -0700 Commit: Brad King CommitDate: Wed Apr 1 14:40:16 2015 -0400 VS: Add support for XAML source files XAML files are by default of type Page in the vcxproj and can be overriden by setting the VS_XAML_TYPE property. The .cpp and .h file of the same name are automatically added as depending on the XAML file. New VSXaml test builds a basic XAML WindowsStore 8.1 app with VS2013. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 1dff33e..76dd279 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -298,6 +298,7 @@ Properties on Source Files /prop_sf/VS_SHADER_FLAGS /prop_sf/VS_SHADER_MODEL /prop_sf/VS_SHADER_TYPE + /prop_sf/VS_XAML_TYPE /prop_sf/WRAP_EXCLUDE /prop_sf/XCODE_EXPLICIT_FILE_TYPE /prop_sf/XCODE_LAST_KNOWN_FILE_TYPE diff --git a/Help/prop_sf/VS_XAML_TYPE.rst b/Help/prop_sf/VS_XAML_TYPE.rst new file mode 100644 index 0000000..e92191d --- /dev/null +++ b/Help/prop_sf/VS_XAML_TYPE.rst @@ -0,0 +1,6 @@ +VS_XAML_TYPE +------------ + +Mark a XAML source file as a different type than the default ``Page``. +The most common usage would be to set the default App.xaml file as +ApplicationDefinition. diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index e0af47a..41d12d7 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -56,6 +56,7 @@ struct ResxTag {}; struct ModuleDefinitionFileTag {}; struct AppManifestTag{}; struct CertificatesTag{}; +struct XamlTag{}; template struct IsSameTag @@ -98,6 +99,20 @@ struct DoAccept data.ExpectedResxHeaders.insert(hFileName); data.ResxSources.push_back(f); } + static void Do(cmGeneratorTarget::XamlData& data, cmSourceFile* f) + { + // Build and save the name of the corresponding .h and .cpp file + // This relationship will be used later when building the project files. + // Both names would have been auto generated from Visual Studio + // where the user supplied the file name and Visual Studio + // appended the suffix. + std::string xaml = f->GetFullPath(); + std::string hFileName = xaml + ".h"; + std::string cppFileName = xaml + ".cpp"; + data.ExpectedXamlHeaders.insert(hFileName); + data.ExpectedXamlSources.insert(cppFileName); + data.XamlSources.push_back(f); + } static void Do(std::string& data, cmSourceFile* f) { data = f->GetFullPath(); @@ -186,6 +201,10 @@ struct TagVisitor { DoAccept::Result>::Do(this->Data, sf); } + else if (ext == "xaml") + { + DoAccept::Result>::Do(this->Data, sf); + } else if(this->Header.find(sf->GetFullPath().c_str())) { DoAccept::Result>::Do(this->Data, sf); @@ -438,6 +457,36 @@ cmGeneratorTarget } //---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedXamlHeaders(std::set& headers, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + headers = data.ExpectedXamlHeaders; +} + +//---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedXamlSources(std::set& srcs, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + srcs = data.ExpectedXamlSources; +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget +::GetXamlSources(std::vector& srcs, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + srcs = data.XamlSources; +} + +//---------------------------------------------------------------------------- bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, const std::string& config) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index c329cf5..c79aa72 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -58,6 +58,12 @@ public: const std::string& config) const; void GetCertificates(std::vector&, const std::string& config) const; + void GetXamlSources(std::vector&, + const std::string& config) const; + void GetExpectedXamlHeaders(std::set&, + const std::string& config) const; + void GetExpectedXamlSources(std::set&, + const std::string& config) const; void ComputeObjectMapping(); @@ -132,6 +138,13 @@ public: mutable std::set ExpectedResxHeaders; mutable std::vector ResxSources; }; + + struct XamlData { + std::set ExpectedXamlHeaders; + std::set ExpectedXamlSources; + std::vector XamlSources; + }; + private: friend class cmTargetTraceDependencies; struct SourceEntry { std::vector Depends; }; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 19444ed..80babca 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -461,6 +461,7 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteAllSources(); this->WriteDotNetReferences(); this->WriteEmbeddedResourceGroup(); + this->WriteXamlFilesGroup(); this->WriteWinRTReferences(); this->WriteProjectReferences(); this->WriteString( @@ -522,8 +523,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() this->WriteString("", 3); std::string hFileName = obj.substr(0, obj.find_last_of(".")) + ".h"; - (*this->BuildFileStream ) << hFileName; - this->WriteString("\n", 3); + (*this->BuildFileStream) << hFileName << "\n"; std::vector const * configs = this->GlobalGenerator->GetConfigurations(); @@ -546,6 +546,38 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() } } +void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup() +{ + std::vector xamlObjs; + this->GeneratorTarget->GetXamlSources(xamlObjs, ""); + if (!xamlObjs.empty()) + { + this->WriteString("\n", 1); + for (std::vector::const_iterator oi = xamlObjs.begin(); + oi != xamlObjs.end(); ++oi) + { + std::string obj = (*oi)->GetFullPath(); + std::string xamlType; + const char * xamlTypeProperty = (*oi)->GetProperty("VS_XAML_TYPE"); + if (xamlTypeProperty == nullptr) + { + xamlType = "Page"; + } + else + { + xamlType = xamlTypeProperty; + } + + this->WriteSource(xamlType, *oi, ">\n"); + this->WriteString("Designer\n", 3); + this->WriteString("BuildFileStream) << xamlType << ">\n"; + + } + this->WriteString("\n", 1); + } +} + void cmVisualStudio10TargetGenerator::WriteTargetSpecificReferences() { if(this->MSTools) @@ -1192,12 +1224,21 @@ WriteGroupSources(const char* name, void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf) { - if(this->IsResxHeader(sf->GetFullPath())) + std::string const& fileName = sf->GetFullPath(); + if (this->IsResxHeader(fileName)) { this->WriteSource("ClInclude", sf, ">\n"); this->WriteString("CppForm\n", 3); this->WriteString("\n", 2); } + else if (this->IsXamlHeader(fileName)) + { + this->WriteSource("ClInclude", sf, ">\n"); + this->WriteString("", 3); + std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); + (*this->BuildFileStream) << xamlFileName << "\n"; + this->WriteString("\n", 2); + } else { this->WriteSource("ClInclude", sf); @@ -1669,6 +1710,17 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( " ", "\n", lang); } } + if (this->IsXamlSource(source->GetFullPath())) + { + (*this->BuildFileStream) << firstString; + firstString = ""; // only do firstString once + hasFlags = true; + this->WriteString("", 3); + const std::string& fileName = source->GetFullPath(); + std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); + (*this->BuildFileStream) << xamlFileName << "\n"; + } + return hasFlags; } @@ -2749,6 +2801,28 @@ bool cmVisualStudio10TargetGenerator:: return it != expectedResxHeaders.end(); } +bool cmVisualStudio10TargetGenerator:: +IsXamlHeader(const std::string& headerFile) +{ + std::set expectedXamlHeaders; + this->GeneratorTarget->GetExpectedXamlHeaders(expectedXamlHeaders, ""); + + std::set::const_iterator it = + expectedXamlHeaders.find(headerFile); + return it != expectedXamlHeaders.end(); +} + +bool cmVisualStudio10TargetGenerator:: +IsXamlSource(const std::string& sourceFile) +{ + std::set expectedXamlSources; + this->GeneratorTarget->GetExpectedXamlSources(expectedXamlSources, ""); + + std::set::const_iterator it = + expectedXamlSources.find(sourceFile); + return it != expectedXamlSources.end(); +} + void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() { bool isAppContainer = false; diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index a02dfa8..a2776de 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -69,6 +69,7 @@ private: void WriteEmbeddedResourceGroup(); void WriteWinRTReferences(); void WriteWinRTPackageCertificateKeyFile(); + void WriteXamlFilesGroup(); void WritePathAndIncrementalLinkOptions(); void WriteItemDefinitionGroups(); void VerifyNecessaryFiles(); @@ -119,6 +120,8 @@ private: void AddMissingSourceGroups(std::set& groupsUsed, const std::vector& allGroups); bool IsResxHeader(const std::string& headerFile); + bool IsXamlHeader(const std::string& headerFile); + bool IsXamlSource(const std::string& headerFile); cmIDEFlagTable const* GetClFlagTable() const; cmIDEFlagTable const* GetRcFlagTable() const; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5944d08..1df39aa 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1927,6 +1927,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1) add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013 ARM" WindowsStore 8.1) add_test_VSWinStorePhone(vs12-store81-X64 "Visual Studio 12 2013 Win64" WindowsStore 8.1) + + add_test(NAME VSXaml COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSXaml" + "${CMake_BINARY_DIR}/Tests/VSXaml" + --build-generator "Visual Studio 12 2013" + --build-project VSXaml + --build-config $ + --build-options -DCMAKE_SYSTEM_NAME=WindowsStore + -DCMAKE_SYSTEM_VERSION=8.1 + ) endif() if(vs11 AND wp80) add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0) diff --git a/Tests/VSWindowsFormsResx/CMakeLists.txt b/Tests/VSWindowsFormsResx/CMakeLists.txt index 4373810..43c4833 100644 --- a/Tests/VSWindowsFormsResx/CMakeLists.txt +++ b/Tests/VSWindowsFormsResx/CMakeLists.txt @@ -14,7 +14,7 @@ include(CheckCXXSourceCompiles) include(CheckIncludeFile) # Note: The designable form is assumed to have a .h extension as is default in Visual Studio. -# Node: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio +# Note: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio set(TARGET_H WindowsFormsResx/MyForm.h diff --git a/Tests/VSXaml/App.xaml b/Tests/VSXaml/App.xaml new file mode 100644 index 0000000..eecf2c1 --- /dev/null +++ b/Tests/VSXaml/App.xaml @@ -0,0 +1,7 @@ +? + + diff --git a/Tests/VSXaml/App.xaml.cpp b/Tests/VSXaml/App.xaml.cpp new file mode 100644 index 0000000..334dc1f --- /dev/null +++ b/Tests/VSXaml/App.xaml.cpp @@ -0,0 +1,125 @@ +?// +// App.xaml.cpp +// Implementation of the App class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace VSXaml; + +using namespace Platform; +using namespace Windows::ApplicationModel; +using namespace Windows::ApplicationModel::Activation; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Interop; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 + +/// +/// Initializes the singleton application object. This is the first line of authored code +/// executed, and as such is the logical equivalent of main() or WinMain(). +/// +App::App() +{ + InitializeComponent(); + Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending); +} + +/// +/// Invoked when the application is launched normally by the end user. Other entry points +/// will be used such as when the application is launched to open a specific file. +/// +/// Details about the launch request and process. +void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) +{ + +#if _DEBUG + // Show graphics profiling information while debugging. + if (IsDebuggerPresent()) + { + // Display the current frame rate counters + DebugSettings->EnableFrameRateCounter = true; + } +#endif + + auto rootFrame = dynamic_cast(Window::Current->Content); + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == nullptr) + { + // Create a Frame to act as the navigation context and associate it with + // a SuspensionManager key + rootFrame = ref new Frame(); + + // Set the default language + rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0); + + rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed); + + if (e->PreviousExecutionState == ApplicationExecutionState::Terminated) + { + // TODO: Restore the saved session state only when appropriate, scheduling the + // final launch steps after the restore is complete + + } + + if (rootFrame->Content == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); + } + // Place the frame in the current Window + Window::Current->Content = rootFrame; + // Ensure the current window is active + Window::Current->Activate(); + } + else + { + if (rootFrame->Content == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); + } + // Ensure the current window is active + Window::Current->Activate(); + } +} + +/// +/// Invoked when application execution is being suspended. Application state is saved +/// without knowing whether the application will be terminated or resumed with the contents +/// of memory still intact. +/// +/// The source of the suspend request. +/// Details about the suspend request. +void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e) +{ + (void) sender; // Unused parameter + (void) e; // Unused parameter + + //TODO: Save application state and stop any background activity +} + +/// +/// Invoked when Navigation to a certain page fails +/// +/// The Frame which failed navigation +/// Details about the navigation failure +void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e) +{ + throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name); +} \ No newline at end of file diff --git a/Tests/VSXaml/App.xaml.h b/Tests/VSXaml/App.xaml.h new file mode 100644 index 0000000..1f65bda --- /dev/null +++ b/Tests/VSXaml/App.xaml.h @@ -0,0 +1,27 @@ +?// +// App.xaml.h +// Declaration of the App class. +// + +#pragma once + +#include "App.g.h" + +namespace VSXaml +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + ref class App sealed + { + protected: + virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override; + + internal: + App(); + + private: + void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e); + void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e); + }; +} diff --git a/Tests/VSXaml/Assets/Logo.scale-100.png b/Tests/VSXaml/Assets/Logo.scale-100.png new file mode 100644 index 0000000..e26771c Binary files /dev/null and b/Tests/VSXaml/Assets/Logo.scale-100.png differ diff --git a/Tests/VSXaml/Assets/SmallLogo.scale-100.png b/Tests/VSXaml/Assets/SmallLogo.scale-100.png new file mode 100644 index 0000000..1eb0d9d Binary files /dev/null and b/Tests/VSXaml/Assets/SmallLogo.scale-100.png differ diff --git a/Tests/VSXaml/Assets/SplashScreen.scale-100.png b/Tests/VSXaml/Assets/SplashScreen.scale-100.png new file mode 100644 index 0000000..c951e03 Binary files /dev/null and b/Tests/VSXaml/Assets/SplashScreen.scale-100.png differ diff --git a/Tests/VSXaml/Assets/StoreLogo.scale-100.png b/Tests/VSXaml/Assets/StoreLogo.scale-100.png new file mode 100644 index 0000000..dcb6727 Binary files /dev/null and b/Tests/VSXaml/Assets/StoreLogo.scale-100.png differ diff --git a/Tests/VSXaml/CMakeLists.txt b/Tests/VSXaml/CMakeLists.txt new file mode 100644 index 0000000..f384c82 --- /dev/null +++ b/Tests/VSXaml/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.2) +project(VSXaml) + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +set(SOURCE_FILES + App.xaml.cpp + MainPage.xaml.cpp + pch.cpp + ) + +set(HEADER_FILES + App.xaml.h + MainPage.xaml.h + pch.h + ) + +set(XAML_FILES + App.xaml + MainPage.xaml + ) + +set(ASSET_FILES + Assets/Logo.scale-100.png + Assets/SmallLogo.scale-100.png + Assets/SplashScreen.scale-100.png + Assets/StoreLogo.scale-100.png + ) + +set(CONTENT_FILES + Package.appxmanifest + ) + +set(RESOURCE_FILES + ${CONTENT_FILES} ${ASSET_FILES} + VSXaml_TemporaryKey.pfx) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets") + +set_property(SOURCE "App.xaml" PROPERTY VS_XAML_TYPE "ApplicationDefinition") + +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +source_group("Resource Files" FILES ${RESOURCE_FILES}) +source_group("Xaml Files" FILES ${XAML_FILES}) + +add_executable(VSXaml WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES} ${XAML_FILES}) +set_property(TARGET VSXaml PROPERTY VS_WINRT_COMPONENT TRUE) diff --git a/Tests/VSXaml/MainPage.xaml b/Tests/VSXaml/MainPage.xaml new file mode 100644 index 0000000..62139ca --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml @@ -0,0 +1,14 @@ +? + + + + + diff --git a/Tests/VSXaml/MainPage.xaml.cpp b/Tests/VSXaml/MainPage.xaml.cpp new file mode 100644 index 0000000..d0a64e8 --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml.cpp @@ -0,0 +1,27 @@ +?// +// MainPage.xaml.cpp +// Implementation of the MainPage class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace VSXaml; + +using namespace Platform; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 + +MainPage::MainPage() +{ + InitializeComponent(); +} diff --git a/Tests/VSXaml/MainPage.xaml.h b/Tests/VSXaml/MainPage.xaml.h new file mode 100644 index 0000000..ccc781b --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml.h @@ -0,0 +1,21 @@ +?// +// MainPage.xaml.h +// Declaration of the MainPage class. +// + +#pragma once + +#include "MainPage.g.h" + +namespace VSXaml +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public ref class MainPage sealed + { + public: + MainPage(); + + }; +} diff --git a/Tests/VSXaml/Package.appxmanifest b/Tests/VSXaml/Package.appxmanifest new file mode 100644 index 0000000..873a64a --- /dev/null +++ b/Tests/VSXaml/Package.appxmanifest @@ -0,0 +1,41 @@ +? + + + + + + VSXaml + Microsoft + Assets\StoreLogo.png + + + + 6.3.0 + 6.3.0 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/VSXaml/VSXaml_TemporaryKey.pfx b/Tests/VSXaml/VSXaml_TemporaryKey.pfx new file mode 100644 index 0000000..1cad999 Binary files /dev/null and b/Tests/VSXaml/VSXaml_TemporaryKey.pfx differ diff --git a/Tests/VSXaml/pch.cpp b/Tests/VSXaml/pch.cpp new file mode 100644 index 0000000..01484ff --- /dev/null +++ b/Tests/VSXaml/pch.cpp @@ -0,0 +1,6 @@ +?// +// pch.cpp +// Include the standard header and generate the precompiled header. +// + +#include "pch.h" diff --git a/Tests/VSXaml/pch.h b/Tests/VSXaml/pch.h new file mode 100644 index 0000000..2c4354d --- /dev/null +++ b/Tests/VSXaml/pch.h @@ -0,0 +1,11 @@ +?// +// pch.h +// Header for standard system include files. +// + +#pragma once + +#include +#include + +#include "App.xaml.h" ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 1 + Help/prop_sf/VS_XAML_TYPE.rst | 6 + Source/cmGeneratorTarget.cxx | 49 ++++++++ Source/cmGeneratorTarget.h | 13 ++ Source/cmVisualStudio10TargetGenerator.cxx | 80 ++++++++++++- Source/cmVisualStudio10TargetGenerator.h | 3 + Tests/CMakeLists.txt | 11 ++ Tests/VSWindowsFormsResx/CMakeLists.txt | 2 +- Tests/VSXaml/App.xaml | 7 ++ Tests/VSXaml/App.xaml.cpp | 125 ++++++++++++++++++++ Tests/VSXaml/App.xaml.h | 27 +++++ .../VSXaml/Assets/Logo.scale-100.png | Bin 801 -> 801 bytes .../VSXaml/Assets/SmallLogo.scale-100.png | Bin 329 -> 329 bytes .../VSXaml/Assets/SplashScreen.scale-100.png | Bin 2146 -> 2146 bytes .../VSXaml/Assets/StoreLogo.scale-100.png | Bin 429 -> 429 bytes Tests/VSXaml/CMakeLists.txt | 52 ++++++++ Tests/VSXaml/MainPage.xaml | 14 +++ Tests/VSXaml/MainPage.xaml.cpp | 27 +++++ Tests/VSXaml/MainPage.xaml.h | 21 ++++ Tests/VSXaml/Package.appxmanifest | 41 +++++++ .../VSXaml/VSXaml_TemporaryKey.pfx | Bin 2560 -> 2560 bytes Tests/VSXaml/pch.cpp | 6 + Tests/VSXaml/pch.h | 11 ++ 23 files changed, 492 insertions(+), 4 deletions(-) create mode 100644 Help/prop_sf/VS_XAML_TYPE.rst create mode 100644 Tests/VSXaml/App.xaml create mode 100644 Tests/VSXaml/App.xaml.cpp create mode 100644 Tests/VSXaml/App.xaml.h copy Templates/Windows/Logo.png => Tests/VSXaml/Assets/Logo.scale-100.png (100%) copy Templates/Windows/SmallLogo.png => Tests/VSXaml/Assets/SmallLogo.scale-100.png (100%) copy Templates/Windows/SplashScreen.png => Tests/VSXaml/Assets/SplashScreen.scale-100.png (100%) copy Templates/Windows/StoreLogo.png => Tests/VSXaml/Assets/StoreLogo.scale-100.png (100%) create mode 100644 Tests/VSXaml/CMakeLists.txt create mode 100644 Tests/VSXaml/MainPage.xaml create mode 100644 Tests/VSXaml/MainPage.xaml.cpp create mode 100644 Tests/VSXaml/MainPage.xaml.h create mode 100644 Tests/VSXaml/Package.appxmanifest copy Templates/Windows/Windows_TemporaryKey.pfx => Tests/VSXaml/VSXaml_TemporaryKey.pfx (100%) create mode 100644 Tests/VSXaml/pch.cpp create mode 100644 Tests/VSXaml/pch.h hooks/post-receive -- CMake From steveire at gmail.com Wed Apr 1 15:08:28 2015 From: steveire at gmail.com (Stephen Kelly) Date: Wed, 1 Apr 2015 15:08:28 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1370-ga7d2520 Message-ID: <20150401190828.1D19DADBC3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a7d2520836725e9dcc8611ee24c6e80f7fefb14b (commit) via 30dd4f8ef80674b0ec32f6edfd7b1c6740776dfc (commit) from a6782941026ce348d124e59e6c47c68e46585537 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7d2520836725e9dcc8611ee24c6e80f7fefb14b commit a7d2520836725e9dcc8611ee24c6e80f7fefb14b Merge: a678294 30dd4f8 Author: Stephen Kelly AuthorDate: Wed Apr 1 15:08:26 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 15:08:26 2015 -0400 Merge topic 'clean-up-cmMakefile' into next 30dd4f8e cmMakefiles: Don't treat DEFINITIONS as a built-in property. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=30dd4f8ef80674b0ec32f6edfd7b1c6740776dfc commit 30dd4f8ef80674b0ec32f6edfd7b1c6740776dfc Author: Stephen Kelly AuthorDate: Wed Apr 1 20:53:31 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 21:07:19 2015 +0200 cmMakefiles: Don't treat DEFINITIONS as a built-in property. Add policy CMP0059 to cover this change. This is part of cleaning up cmMakefile - The DefineFlagsOrig member should not need to exist. diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst new file mode 100644 index 0000000..a2fb157 --- /dev/null +++ b/Help/policy/CMP0059.rst @@ -0,0 +1,16 @@ +CMP0059 +------- + +Don't treat ``DEFINITIONS`` as a built-in directory property. + +CMake 3.3 and above no longer make a list of definitions available through +the :prop_dir:`DEFINITIONS` directory property. + +The ``OLD`` behavior for this policy is to provide the list of flags given +so far to the :command:`add_definitions` command. The ``NEW`` behavior is +to behave as a normal user-defined directory property. + +This policy was introduced in CMake version 3.3. +CMake version |release| warns when the policy is not set and uses +``OLD`` behavior. Use the :command:`cmake_policy` command to set +it to ``OLD`` or ``NEW`` explicitly. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6fbcaeb..ec1d814 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4209,8 +4209,19 @@ const char *cmMakefile::GetProperty(const std::string& prop, } else if (prop == "DEFINITIONS") { - output += this->DefineFlagsOrig; - return output.c_str(); + switch(this->GetPolicyStatus(cmPolicies::CMP0059)) + { + case cmPolicies::WARN: + this->IssueMessage(cmake::AUTHOR_WARNING, this->GetPolicies()-> + GetPolicyWarning(cmPolicies::CMP0059)); + case cmPolicies::OLD: + output += this->DefineFlagsOrig; + return output.c_str(); + case cmPolicies::NEW: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + break; + } } else if (prop == "LINK_DIRECTORIES") { diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 592df8f..0a61bca 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -385,6 +385,11 @@ cmPolicies::cmPolicies() CMP0058, "CMP0058", "Ninja requires custom command byproducts to be explicit.", 3,3,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0059, "CMP0059", + "Do no treat DEFINITIONS as a built-in directory property.", + 3,3,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index b18b337..ced9d8c 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -116,6 +116,8 @@ public: CMP0057, ///< Disallow multiple MAIN_DEPENDENCY specifications /// for the same file. CMP0058, ///< Ninja requires custom command byproducts to be explicit + CMP0059, ///< Do not treat ``DEFINITIONS`` as a built-in directory + /// property. /** \brief Always the last entry. * diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt b/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt new file mode 100644 index 0000000..76992d8 --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt @@ -0,0 +1,2 @@ +DEFS: +CUSTOM CONTENT:CUSTOM_CONTENT diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake b/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake new file mode 100644 index 0000000..f7b9303 --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake @@ -0,0 +1,17 @@ + +cmake_policy(SET CMP0059 NEW) + +add_definitions(-DSOME_DEF) + +get_property(defs DIRECTORY . + PROPERTY DEFINITIONS +) +message("DEFS:${defs}") + +set_property(DIRECTORY . + PROPERTY DEFINITIONS CUSTOM_CONTENT +) +get_property(content DIRECTORY . + PROPERTY DEFINITIONS +) +message("CUSTOM CONTENT:${content}") diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt b/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt new file mode 100644 index 0000000..e35e8c5 --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt @@ -0,0 +1,2 @@ +DEFS: -DSOME_DEF +CUSTOM CONTENT: -DSOME_DEF diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake b/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake new file mode 100644 index 0000000..2555774 --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake @@ -0,0 +1,17 @@ + +cmake_policy(SET CMP0059 OLD) + +add_definitions(-DSOME_DEF) + +get_property(defs DIRECTORY . + PROPERTY DEFINITIONS +) +message("DEFS:${defs}") + +set_property(DIRECTORY . + PROPERTY DEFINITIONS CUSTOM_CONTENT +) +get_property(content DIRECTORY . + PROPERTY DEFINITIONS +) +message("CUSTOM CONTENT:${content}") diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt new file mode 100644 index 0000000..4e04d15 --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt @@ -0,0 +1,18 @@ +CMake Warning \(dev\) at CMP0059-WARN.cmake:6 \(get_property\): + Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory + property. Run "cmake --help-policy CMP0059" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +DEFS: -DSOME_DEF +CMake Warning \(dev\) at CMP0059-WARN.cmake:14 \(get_property\): + Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory + property. Run "cmake --help-policy CMP0059" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CUSTOM CONTENT: -DSOME_DEF diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake b/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake new file mode 100644 index 0000000..9d0b49c --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake @@ -0,0 +1,17 @@ + + + +add_definitions(-DSOME_DEF) + +get_property(defs DIRECTORY . + PROPERTY DEFINITIONS +) +message("DEFS:${defs}") + +set_property(DIRECTORY . + PROPERTY DEFINITIONS CUSTOM_CONTENT +) +get_property(content DIRECTORY . + PROPERTY DEFINITIONS +) +message("CUSTOM CONTENT:${content}") diff --git a/Tests/RunCMake/CMP0059/CMakeLists.txt b/Tests/RunCMake/CMP0059/CMakeLists.txt new file mode 100644 index 0000000..ef2163c --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.1) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0059/RunCMakeTest.cmake b/Tests/RunCMake/CMP0059/RunCMakeTest.cmake new file mode 100644 index 0000000..9b57579 --- /dev/null +++ b/Tests/RunCMake/CMP0059/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0059-OLD) +run_cmake(CMP0059-NEW) +run_cmake(CMP0059-WARN) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 7b9c810..6daf27a 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -64,6 +64,7 @@ add_RunCMake_test(CMP0053) add_RunCMake_test(CMP0054) add_RunCMake_test(CMP0055) add_RunCMake_test(CMP0057) +add_RunCMake_test(CMP0059) if(CMAKE_GENERATOR STREQUAL "Ninja") add_RunCMake_test(Ninja) endif() ----------------------------------------------------------------------- Summary of changes: Help/policy/CMP0059.rst | 16 ++++++++++++++++ Source/cmMakefile.cxx | 15 +++++++++++++-- Source/cmPolicies.cxx | 5 +++++ Source/cmPolicies.h | 2 ++ .../CMP0059-NEW-result.txt} | 0 Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt | 2 ++ Tests/RunCMake/CMP0059/CMP0059-NEW.cmake | 17 +++++++++++++++++ .../CMP0059-OLD-result.txt} | 0 Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt | 2 ++ Tests/RunCMake/CMP0059/CMP0059-OLD.cmake | 17 +++++++++++++++++ .../CMP0059-WARN-result.txt} | 0 Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt | 18 ++++++++++++++++++ Tests/RunCMake/CMP0059/CMP0059-WARN.cmake | 17 +++++++++++++++++ Tests/RunCMake/{CMP0055 => CMP0059}/CMakeLists.txt | 0 Tests/RunCMake/CMP0059/RunCMakeTest.cmake | 5 +++++ Tests/RunCMake/CMakeLists.txt | 1 + 16 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 Help/policy/CMP0059.rst copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0059/CMP0059-NEW-result.txt} (100%) create mode 100644 Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt create mode 100644 Tests/RunCMake/CMP0059/CMP0059-NEW.cmake copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0059/CMP0059-OLD-result.txt} (100%) create mode 100644 Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt create mode 100644 Tests/RunCMake/CMP0059/CMP0059-OLD.cmake copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0059/CMP0059-WARN-result.txt} (100%) create mode 100644 Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt create mode 100644 Tests/RunCMake/CMP0059/CMP0059-WARN.cmake copy Tests/RunCMake/{CMP0055 => CMP0059}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/CMP0059/RunCMakeTest.cmake hooks/post-receive -- CMake From steveire at gmail.com Wed Apr 1 15:20:38 2015 From: steveire at gmail.com (Stephen Kelly) Date: Wed, 1 Apr 2015 15:20:38 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1372-gffa3e4b Message-ID: <20150401192038.D3094AD87A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ffa3e4bffacd9d48a045039e74c7a66c00e52e21 (commit) via 064625f2bad266ef19d2154b54abbcfedecd180b (commit) from a7d2520836725e9dcc8611ee24c6e80f7fefb14b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ffa3e4bffacd9d48a045039e74c7a66c00e52e21 commit ffa3e4bffacd9d48a045039e74c7a66c00e52e21 Merge: a7d2520 064625f Author: Stephen Kelly AuthorDate: Wed Apr 1 15:20:38 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 15:20:38 2015 -0400 Merge topic 'clean-up-cmMakefile' into next 064625f2 Extend Help. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=064625f2bad266ef19d2154b54abbcfedecd180b commit 064625f2bad266ef19d2154b54abbcfedecd180b Author: Stephen Kelly AuthorDate: Wed Apr 1 21:20:10 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 21:20:10 2015 +0200 Extend Help. diff --git a/Help/prop_dir/DEFINITIONS.rst b/Help/prop_dir/DEFINITIONS.rst index 22f7c15..79ac3f3 100644 --- a/Help/prop_dir/DEFINITIONS.rst +++ b/Help/prop_dir/DEFINITIONS.rst @@ -1,8 +1,13 @@ DEFINITIONS ----------- -For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS instead. +For CMake 2.4 compatibility only. Use :prop_dir:`COMPILE_DEFINITIONS` +instead. This read-only property specifies the list of flags given so far to -the add_definitions command. It is intended for debugging purposes. -Use the COMPILE_DEFINITIONS instead. +the :command:`add_definitions` command. It is intended for debugging +purposes. Use the :prop_dir:`COMPILE_DEFINITIONS` directory property +instead. + +This built-in read-only property does not exist if policy +:policy:`CMP0059` is set to ``NEW``. diff --git a/Help/release/dev/remove-DEFINITIONS-directory-property.rst b/Help/release/dev/remove-DEFINITIONS-directory-property.rst new file mode 100644 index 0000000..d8e50f0 --- /dev/null +++ b/Help/release/dev/remove-DEFINITIONS-directory-property.rst @@ -0,0 +1,6 @@ +remove-DEFINITIONS-property +--------------------------- + +* The :command:`add_definitions()` command no longer causes a + :prop_dir:`DEFINITIONS` directory property to be populated. See policy + :policy:`CMP0059`. ----------------------------------------------------------------------- Summary of changes: Help/prop_dir/DEFINITIONS.rst | 11 ++++++++--- Help/release/dev/remove-DEFINITIONS-directory-property.rst | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 Help/release/dev/remove-DEFINITIONS-directory-property.rst hooks/post-receive -- CMake From steveire at gmail.com Wed Apr 1 15:22:03 2015 From: steveire at gmail.com (Stephen Kelly) Date: Wed, 1 Apr 2015 15:22:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1374-g4f51a06 Message-ID: <20150401192203.54711AD966@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4f51a06046cb500c742a97a25bf5c7a83ac474bb (commit) via 9e3c8ebf0ab87d29303f4e16c301a23b8fd79cf1 (commit) from ffa3e4bffacd9d48a045039e74c7a66c00e52e21 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f51a06046cb500c742a97a25bf5c7a83ac474bb commit 4f51a06046cb500c742a97a25bf5c7a83ac474bb Merge: ffa3e4b 9e3c8eb Author: Stephen Kelly AuthorDate: Wed Apr 1 15:22:02 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 15:22:02 2015 -0400 Merge topic 'clean-up-cmMakefile' into next 9e3c8ebf Extend Help. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e3c8ebf0ab87d29303f4e16c301a23b8fd79cf1 commit 9e3c8ebf0ab87d29303f4e16c301a23b8fd79cf1 Author: Stephen Kelly AuthorDate: Wed Apr 1 21:21:46 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 1 21:21:46 2015 +0200 Extend Help. diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst index a2fb157..e40f450 100644 --- a/Help/policy/CMP0059.rst +++ b/Help/policy/CMP0059.rst @@ -4,7 +4,8 @@ CMP0059 Don't treat ``DEFINITIONS`` as a built-in directory property. CMake 3.3 and above no longer make a list of definitions available through -the :prop_dir:`DEFINITIONS` directory property. +the :prop_dir:`DEFINITIONS` directory property. The +:prop_dir:`COMPILE_DEFINITIONS` directory property may be used instead. The ``OLD`` behavior for this policy is to provide the list of flags given so far to the :command:`add_definitions` command. The ``NEW`` behavior is ----------------------------------------------------------------------- Summary of changes: Help/policy/CMP0059.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 15:41:31 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 15:41:31 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1376-gc6dd116 Message-ID: <20150401194131.14D79ABF82@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c6dd1161e1b558c364db187ea60e83ae42c98846 (commit) via 078c732185ff610c55707ae66be0a787c78bd2e2 (commit) from 4f51a06046cb500c742a97a25bf5c7a83ac474bb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6dd1161e1b558c364db187ea60e83ae42c98846 commit c6dd1161e1b558c364db187ea60e83ae42c98846 Merge: 4f51a06 078c732 Author: Brad King AuthorDate: Wed Apr 1 15:41:30 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 15:41:30 2015 -0400 Merge topic 'xcode-source-type-metal' into next 078c7321 Xcode: Add file type for Metal shader files http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=078c732185ff610c55707ae66be0a787c78bd2e2 commit 078c732185ff610c55707ae66be0a787c78bd2e2 Author: Sean James AuthorDate: Wed Apr 1 15:02:42 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 15:15:22 2015 -0400 Xcode: Add file type for Metal shader files diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index f139ad1..5e584a4 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -865,6 +865,10 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext, { sourcecode += ".asm"; } + else if (ext == "metal") + { + sourcecode += ".metal"; + } //else // { // // Already specialized above or we leave sourcecode == "sourcecode" ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalXCodeGenerator.cxx | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 16:00:37 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 16:00:37 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1378-g1e1aeda Message-ID: <20150401200037.A79D3ADB61@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1e1aeda71ce556388b343fe260c1b3f6453b945e (commit) via 6dc53a464c1237b30bc57b03082e9d1cd61157c2 (commit) from c6dd1161e1b558c364db187ea60e83ae42c98846 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e1aeda71ce556388b343fe260c1b3f6453b945e commit 1e1aeda71ce556388b343fe260c1b3f6453b945e Merge: c6dd116 6dc53a4 Author: Brad King AuthorDate: Wed Apr 1 16:00:37 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 16:00:37 2015 -0400 Merge topic 'clean-up-cmMakefile' into next 6dc53a46 Help: Mention CMP0059 in toctree http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6dc53a464c1237b30bc57b03082e9d1cd61157c2 commit 6dc53a464c1237b30bc57b03082e9d1cd61157c2 Author: Brad King AuthorDate: Wed Apr 1 15:59:29 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 15:59:29 2015 -0400 Help: Mention CMP0059 in toctree diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 228df14..d2960de 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -116,3 +116,4 @@ All Policies /policy/CMP0056 /policy/CMP0057 /policy/CMP0058 + /policy/CMP0059 ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-policies.7.rst | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 16:30:13 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 16:30:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1382-g6f7cdfd Message-ID: <20150401203013.954BAADBEF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 6f7cdfdde45d0c0c7a994c67d096e78f36aa8ce9 (commit) via 77d466ec556bf6722e20d0c7a9b253d69f113c6c (commit) via 91eb736390b69d186edda8a1105d898cd58a77ca (commit) via c6593511bb1b5f9b73df972ef92c6c9b0a045304 (commit) from 1e1aeda71ce556388b343fe260c1b3f6453b945e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f7cdfdde45d0c0c7a994c67d096e78f36aa8ce9 commit 6f7cdfdde45d0c0c7a994c67d096e78f36aa8ce9 Merge: 1e1aeda 77d466e Author: Brad King AuthorDate: Wed Apr 1 16:30:12 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 16:30:12 2015 -0400 Merge topic 'doc-set-command' into next 77d466ec Help: Document conversion of PATH/FILEPATH cache values to absolute paths 91eb7363 Help: Rewrite 'set` command documentation c6593511 Help: Add link target to cmake-language.7 variables section http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77d466ec556bf6722e20d0c7a9b253d69f113c6c commit 77d466ec556bf6722e20d0c7a9b253d69f113c6c Author: Brad King AuthorDate: Wed Apr 1 16:25:42 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 16:29:52 2015 -0400 Help: Document conversion of PATH/FILEPATH cache values to absolute paths Suggested-by: Roger Leigh diff --git a/Help/command/set.rst b/Help/command/set.rst index 9f2bf72..d04b880 100644 --- a/Help/command/set.rst +++ b/Help/command/set.rst @@ -70,6 +70,15 @@ Furthermore, any normal variable binding in the current scope will be removed to expose the newly cached value to any immediately following evaluation. +It is possible for the cache entry to exist prior to the call but +have no type set if it was created on the :manual:`cmake(1)` command +line by a user through the ``-D=`` option without +specifying a type. In this case the ``set`` command will add the +type. Furthermore, if the ```` is ``PATH`` or ``FILEPATH`` +and the ```` provided on the command line is a relative path, +then the ``set`` command will treat the path as relative to the +current working directory and convert it to an absolute path. + Set Environment Variable ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt index 363d0aa..986b541 100644 --- a/Help/manual/OPTIONS_BUILD.txt +++ b/Help/manual/OPTIONS_BUILD.txt @@ -10,7 +10,7 @@ containing SET commands that use the CACHE option, not a cache-format file. -``-D :=`` +``-D :=, -D =`` Create a cmake cache entry. When cmake is first run in an empty build tree, it creates a @@ -19,6 +19,14 @@ takes priority over the project's default value. The option may be repeated for as many cache entries as desired. + If the ``:`` portion is given it must be one of the types + specified by the :command:`set` command documentation for its + ``CACHE`` signature. + If the ``:`` portion is omitted the entry will be created + with no type if it does not exist with a type already. If a + command in the project sets the type to ``PATH`` or ``FILEPATH`` + then the ```` will be converted to an absolute path. + ``-U `` Remove matching entries from CMake cache. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91eb736390b69d186edda8a1105d898cd58a77ca commit 91eb736390b69d186edda8a1105d898cd58a77ca Author: Brad King AuthorDate: Wed Apr 1 16:24:39 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 16:29:52 2015 -0400 Help: Rewrite 'set` command documentation Much of the information in the old set() command documentation is now covered in the cmake-language(7) manual. Rewrite the documentation with this in mind. Split up the signatures for each kind of variable into different subsections. diff --git a/Help/command/set.rst b/Help/command/set.rst index 7a59550..9f2bf72 100644 --- a/Help/command/set.rst +++ b/Help/command/set.rst @@ -1,116 +1,80 @@ set --- -Set a CMake, cache or environment variable to a given value. +Set a normal, cache, or environment variable to a given value. +See the :ref:`cmake-language(7) variables ` +documentation for the scopes and interaction of normal variables +and cache entries. + +Signatures of this command that specify a ``...`` placeholder +expect zero or more arguments. Multiple arguments will be joined as +a :ref:`;-list ` to form the actual variable +value to be set. Zero arguments will cause normal variables to be +unset. See the :command:`unset` command to unset variables explicitly. + +Set Normal Variable +^^^^^^^^^^^^^^^^^^^ :: - set( - [[CACHE [FORCE]] | PARENT_SCOPE]) + set( ... [PARENT_SCOPE]) + +Set the given ```` in the current function or directory scope. + +If the ``PARENT_SCOPE`` option is given the variable will be set in +the scope above the current scope. Each new directory or function +creates a new scope. This command will set the value of a variable +into the parent directory or calling function (whichever is applicable +to the case at hand). -Within CMake sets to the value . is -expanded before is set to it. Normally, set will set a -regular CMake variable. If CACHE is present, then the is -put in the cache instead, unless it is already in the cache. See -section 'Variable types in CMake' below for details of regular and -cache variables and their interactions. If CACHE is used, and - are required. is used by the CMake GUI to choose a -widget with which the user sets a value. The value for may be -one of +Set Cache Entry +^^^^^^^^^^^^^^^ :: - FILEPATH = File chooser dialog. - PATH = Directory chooser dialog. - STRING = Arbitrary string. - BOOL = Boolean ON/OFF checkbox. - INTERNAL = No GUI entry (used for persistent variables). + set( ... CACHE [FORCE]) -If is INTERNAL, the cache variable is marked as internal, and -will not be shown to the user in tools like cmake-gui. This is -intended for values that should be persisted in the cache, but which -users should not normally change. INTERNAL implies FORCE. +Set the given cache ```` (cache entry). Since cache entries +are meant to provide user-settable values this does not overwrite +existing cache entries by default. Use the ``FORCE`` option to +overwrite existing entries. -Normally, set(...CACHE...) creates cache variables, but does not -modify them. If FORCE is specified, the value of the cache variable -is set, even if the variable is already in the cache. This should -normally be avoided, as it will remove any changes to the cache -variable's value by the user. +The ```` must be specified as one of: -If PARENT_SCOPE is present, the variable will be set in the scope -above the current scope. Each new directory or function creates a new -scope. This command will set the value of a variable into the parent -directory or calling function (whichever is applicable to the case at -hand). PARENT_SCOPE cannot be combined with CACHE. +``BOOL`` + Boolean ``ON/OFF`` value. :manual:`cmake-gui(1)` offers a checkbox. -If is not specified then the variable is removed instead of -set. See also: the unset() command. +``FILEPATH`` + Path to a file on disk. :manual:`cmake-gui(1)` offers a file dialog. -:: +``PATH`` + Path to a directory on disk. :manual:`cmake-gui(1)` offers a file dialog. + +``STRING`` + A line of text. :manual:`cmake-gui(1)` offers a text field or a + drop-down selection if the :prop_cache:`STRINGS` cache entry + property is set. - set( ... ) +``INTERNAL`` + A line of text. :manual:`cmake-gui(1)` does not show internal entries. + They may be used to store variables persistently across runs. + Use of this type implies ``FORCE``. -In this case is set to a semicolon separated list of -values. +The ```` must be specified as a line of text providing +a quick summary of the option for presentation to :manual:`cmake-gui(1)` +users. - can be an environment variable such as: +If the cache entry does not exist prior to the call or the ``FORCE`` +option is given then the cache entry will be set to the given value. +Furthermore, any normal variable binding in the current scope will +be removed to expose the newly cached value to any immediately +following evaluation. + +Set Environment Variable +^^^^^^^^^^^^^^^^^^^^^^^^ :: - set( ENV{PATH} /home/martink ) - -in which case the environment variable will be set. - -*** Variable types in CMake *** - -In CMake there are two types of variables: normal variables and cache -variables. Normal variables are meant for the internal use of the -script (just like variables in most programming languages); they are -not persisted across CMake runs. Cache variables (unless set with -INTERNAL) are mostly intended for configuration settings where the -first CMake run determines a suitable default value, which the user -can then override, by editing the cache with tools such as ccmake or -cmake-gui. Cache variables are stored in the CMake cache file, and -are persisted across CMake runs. - -Both types can exist at the same time with the same name but different -values. When ${FOO} is evaluated, CMake first looks for a normal -variable 'FOO' in scope and uses it if set. If and only if no normal -variable exists then it falls back to the cache variable 'FOO'. - -Some examples: - -The code 'set(FOO "x")' sets the normal variable 'FOO'. It does not -touch the cache, but it will hide any existing cache value 'FOO'. - -The code 'set(FOO "x" CACHE ...)' checks for 'FOO' in the cache, -ignoring any normal variable of the same name. If 'FOO' is in the -cache then nothing happens to either the normal variable or the cache -variable. If 'FOO' is not in the cache, then it is added to the -cache. - -Finally, whenever a cache variable is added or modified by a command, -CMake also *removes* the normal variable of the same name from the -current scope so that an immediately following evaluation of it will -expose the newly cached value. - -Normally projects should avoid using normal and cache variables of the -same name, as this interaction can be hard to follow. However, in -some situations it can be useful. One example (used by some -projects): - -A project has a subproject in its source tree. The child project has -its own CMakeLists.txt, which is included from the parent -CMakeLists.txt using add_subdirectory(). Now, if the parent and the -child project provide the same option (for example a compiler option), -the parent gets the first chance to add a user-editable option to the -cache. Normally, the child would then use the same value that the -parent uses. However, it may be necessary to hard-code the value for -the child project's option while still allowing the user to edit the -value used by the parent project. The parent project can achieve this -simply by setting a normal variable with the same name as the option -in a scope sufficient to hide the option's cache variable from the -child completely. The parent has already set the cache variable, so -the child's set(...CACHE...) will do nothing, and evaluating the -option variable will use the value from the normal variable, which -hides the cache variable. + set(ENV{} ...) + +Set the current process environment ```` to the given value. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6593511bb1b5f9b73df972ef92c6c9b0a045304 commit c6593511bb1b5f9b73df972ef92c6c9b0a045304 Author: Brad King AuthorDate: Wed Apr 1 16:24:24 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 16:24:24 2015 -0400 Help: Add link target to cmake-language.7 variables section diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 4a9f0b5..41542c9 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -485,6 +485,8 @@ The :command:`macro`/:command:`endmacro`, and :command:`function`/:command:`endfunction` commands delimit code blocks to be recorded for later invocation as commands. +.. _`CMake Language Variables`: + Variables ========= ----------------------------------------------------------------------- Summary of changes: Help/command/set.rst | 163 ++++++++++++++++---------------------- Help/manual/OPTIONS_BUILD.txt | 10 ++- Help/manual/cmake-language.7.rst | 2 + 3 files changed, 79 insertions(+), 96 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 16:34:18 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 16:34:18 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1384-gf35eabe Message-ID: <20150401203418.091E1ADC82@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f35eabe9e13b51c50d06dfa32924cddbdd863f28 (commit) via a293dcb561e3961c1d55f2fc8ccaaf1b4f17204c (commit) from 6f7cdfdde45d0c0c7a994c67d096e78f36aa8ce9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f35eabe9e13b51c50d06dfa32924cddbdd863f28 commit f35eabe9e13b51c50d06dfa32924cddbdd863f28 Merge: 6f7cdfd a293dcb Author: Brad King AuthorDate: Wed Apr 1 16:34:17 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 16:34:17 2015 -0400 Merge topic 'fix-test-CMakeELF-read-only-source' into next a293dcb5 Tests: Fix CMake.ELF test with read-only source (#15489) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a293dcb561e3961c1d55f2fc8ccaaf1b4f17204c commit a293dcb561e3961c1d55f2fc8ccaaf1b4f17204c Author: Bill Newcomb AuthorDate: Wed Apr 1 13:13:35 2015 -0700 Commit: Brad King CommitDate: Wed Apr 1 16:34:04 2015 -0400 Tests: Fix CMake.ELF test with read-only source (#15489) When the cmake sources are all set to read-only (e.g. after importing into perforce), the CMake.ELF test fails because the copy of the binary is also read-only and cannot be modified. Fix this by copying the binary without source permissions. diff --git a/Tests/CMakeTests/ELFTest.cmake.in b/Tests/CMakeTests/ELFTest.cmake.in index 0271abb..4635778 100644 --- a/Tests/CMakeTests/ELFTest.cmake.in +++ b/Tests/CMakeTests/ELFTest.cmake.in @@ -11,7 +11,7 @@ set(out "@CMAKE_CURRENT_BINARY_DIR@/ELF-Out") file(REMOVE_RECURSE "${out}") file(MAKE_DIRECTORY "${out}") foreach(f ${names}) - file(COPY ${in}/${f} DESTINATION ${out}) + file(COPY ${in}/${f} DESTINATION ${out} NO_SOURCE_PERMISSIONS) list(APPEND files "${out}/${f}") endforeach() ----------------------------------------------------------------------- Summary of changes: Tests/CMakeTests/ELFTest.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 1 16:40:44 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 1 Apr 2015 16:40:44 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1386-ge1f67dd Message-ID: <20150401204044.5C976AB89F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e1f67dde426de4ab2c2e9013972bc51b81883cd0 (commit) via c146d78ae0c80e97114d11a5e50eb4094101ee61 (commit) from f35eabe9e13b51c50d06dfa32924cddbdd863f28 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e1f67dde426de4ab2c2e9013972bc51b81883cd0 commit e1f67dde426de4ab2c2e9013972bc51b81883cd0 Merge: f35eabe c146d78 Author: Brad King AuthorDate: Wed Apr 1 16:40:43 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 1 16:40:43 2015 -0400 Merge topic 'vs-xaml' into next c146d78a fixup! VS: Add support for XAML source files http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c146d78ae0c80e97114d11a5e50eb4094101ee61 commit c146d78ae0c80e97114d11a5e50eb4094101ee61 Author: Brad King AuthorDate: Wed Apr 1 16:40:04 2015 -0400 Commit: Brad King CommitDate: Wed Apr 1 16:40:09 2015 -0400 fixup! VS: Add support for XAML source files Do not use C++11 nullptr. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 80babca..ae6116f 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -559,13 +559,13 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup() std::string obj = (*oi)->GetFullPath(); std::string xamlType; const char * xamlTypeProperty = (*oi)->GetProperty("VS_XAML_TYPE"); - if (xamlTypeProperty == nullptr) + if (xamlTypeProperty) { - xamlType = "Page"; + xamlType = xamlTypeProperty; } else { - xamlType = xamlTypeProperty; + xamlType = "Page"; } this->WriteSource(xamlType, *oi, ">\n"); ----------------------------------------------------------------------- Summary of changes: Source/cmVisualStudio10TargetGenerator.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Apr 2 00:01:06 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 2 Apr 2015 00:01:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-576-gf707460 Message-ID: <20150402040106.605E4AD4E4@public.kitware.com> This is an automated email from 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 f707460e42949e4ca372bf23892a7d6fb9eb1b86 (commit) from 0de7807c36ebfbaadf0e9b45bdf9fd79360c8eaf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f707460e42949e4ca372bf23892a7d6fb9eb1b86 commit f707460e42949e4ca372bf23892a7d6fb9eb1b86 Author: Kitware Robot AuthorDate: Thu Apr 2 00:01:04 2015 -0400 Commit: Kitware Robot CommitDate: Thu Apr 2 00:01:04 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ad42d78..19d6c87 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150401) +set(CMake_VERSION_PATCH 20150402) #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 Apr 2 09:15:58 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 09:15:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1388-g829b8cd Message-ID: <20150402131558.CCF7CACD03@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 829b8cda7ce51877d946627beb3335a2ac4806c5 (commit) via 42579f6c0ed3fe25264d23cb5e949d07acd94221 (commit) from e1f67dde426de4ab2c2e9013972bc51b81883cd0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=829b8cda7ce51877d946627beb3335a2ac4806c5 commit 829b8cda7ce51877d946627beb3335a2ac4806c5 Merge: e1f67dd 42579f6 Author: Brad King AuthorDate: Thu Apr 2 09:15:57 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 2 09:15:57 2015 -0400 Merge topic 'vs-xaml' into next 42579f6c fixup! VS: Add support for XAML source files http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42579f6c0ed3fe25264d23cb5e949d07acd94221 commit 42579f6c0ed3fe25264d23cb5e949d07acd94221 Author: Brad King AuthorDate: Thu Apr 2 09:15:02 2015 -0400 Commit: Brad King CommitDate: Thu Apr 2 09:15:10 2015 -0400 fixup! VS: Add support for XAML source files Wrap long lines. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index ae6116f..dad6f93 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -553,8 +553,8 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup() if (!xamlObjs.empty()) { this->WriteString("\n", 1); - for (std::vector::const_iterator oi = xamlObjs.begin(); - oi != xamlObjs.end(); ++oi) + for (std::vector::const_iterator + oi = xamlObjs.begin(); oi != xamlObjs.end(); ++oi) { std::string obj = (*oi)->GetFullPath(); std::string xamlType; ----------------------------------------------------------------------- Summary of changes: Source/cmVisualStudio10TargetGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 2 12:57:22 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 12:57:22 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-578-g1a77591 Message-ID: <20150402165724.D3897AD957@public.kitware.com> This is an automated email from 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 1a775917a5bf012d5b0610f6b01d8438fca6d12f (commit) via 078c732185ff610c55707ae66be0a787c78bd2e2 (commit) from f707460e42949e4ca372bf23892a7d6fb9eb1b86 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1a775917a5bf012d5b0610f6b01d8438fca6d12f commit 1a775917a5bf012d5b0610f6b01d8438fca6d12f Merge: f707460 078c732 Author: Brad King AuthorDate: Thu Apr 2 12:57:18 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 2 12:57:18 2015 -0400 Merge topic 'xcode-source-type-metal' 078c7321 Xcode: Add file type for Metal shader files ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalXCodeGenerator.cxx | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 2 12:57:27 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 12:57:27 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-582-ga5b4d19 Message-ID: <20150402165730.9044DAD966@public.kitware.com> This is an automated email from 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 a5b4d197695c52c7756faa4d4dcc17b02c9d161f (commit) via 77d466ec556bf6722e20d0c7a9b253d69f113c6c (commit) via 91eb736390b69d186edda8a1105d898cd58a77ca (commit) via c6593511bb1b5f9b73df972ef92c6c9b0a045304 (commit) from 1a775917a5bf012d5b0610f6b01d8438fca6d12f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5b4d197695c52c7756faa4d4dcc17b02c9d161f commit a5b4d197695c52c7756faa4d4dcc17b02c9d161f Merge: 1a77591 77d466e Author: Brad King AuthorDate: Thu Apr 2 12:57:26 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 2 12:57:26 2015 -0400 Merge topic 'doc-set-command' 77d466ec Help: Document conversion of PATH/FILEPATH cache values to absolute paths 91eb7363 Help: Rewrite 'set` command documentation c6593511 Help: Add link target to cmake-language.7 variables section ----------------------------------------------------------------------- Summary of changes: Help/command/set.rst | 163 ++++++++++++++++---------------------- Help/manual/OPTIONS_BUILD.txt | 10 ++- Help/manual/cmake-language.7.rst | 2 + 3 files changed, 79 insertions(+), 96 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 2 12:57:33 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 12:57:33 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-584-ge6caa47 Message-ID: <20150402165734.29B31AD45B@public.kitware.com> This is an automated email from 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 e6caa47fa652d3e24a2c29a72faf82499e324eaa (commit) via a293dcb561e3961c1d55f2fc8ccaaf1b4f17204c (commit) from a5b4d197695c52c7756faa4d4dcc17b02c9d161f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6caa47fa652d3e24a2c29a72faf82499e324eaa commit e6caa47fa652d3e24a2c29a72faf82499e324eaa Merge: a5b4d19 a293dcb Author: Brad King AuthorDate: Thu Apr 2 12:57:31 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 2 12:57:31 2015 -0400 Merge topic 'fix-test-CMakeELF-read-only-source' a293dcb5 Tests: Fix CMake.ELF test with read-only source (#15489) ----------------------------------------------------------------------- Summary of changes: Tests/CMakeTests/ELFTest.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 2 12:57:37 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 12:57:37 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-586-gde97f41 Message-ID: <20150402165737.8B9A1AD96C@public.kitware.com> This is an automated email from 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 de97f41cf30b09d44d6c2874897b4bf694c91ba3 (commit) via af61d6cb60a38069fb82f54bd7f2eb2b798bf4dc (commit) from e6caa47fa652d3e24a2c29a72faf82499e324eaa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de97f41cf30b09d44d6c2874897b4bf694c91ba3 commit de97f41cf30b09d44d6c2874897b4bf694c91ba3 Merge: e6caa47 af61d6c Author: Brad King AuthorDate: Thu Apr 2 12:57:35 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 2 12:57:35 2015 -0400 Merge topic 'fix-liblzma-access-alignment' af61d6cb liblzma: Use unaligned access only on Intel and PowerPC archs ----------------------------------------------------------------------- Summary of changes: Utilities/cmliblzma/config.h.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 2 12:57:44 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 12:57:44 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-593-g9780859 Message-ID: <20150402165746.8B4B2AD965@public.kitware.com> This is an automated email from 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 9780859b7e06e00d75b90aad1f706a401434a04a (commit) via f2e07a6d90806d50b6897051c2275e38689d16e7 (commit) via aafe2821889333ee647c67e0fc55472d7903c02a (commit) via 1fcf590b146bd01a64cde30ba0b5ab7fe2e05b64 (commit) via c3a60cc9cce4881f64bd0342cc841900533719e2 (commit) via 37897347b3fd97668d4831bba11e23f9f493e759 (commit) via d7539ced649ab75919c6d769ede1fca2dc08db0e (commit) from de97f41cf30b09d44d6c2874897b4bf694c91ba3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9780859b7e06e00d75b90aad1f706a401434a04a commit 9780859b7e06e00d75b90aad1f706a401434a04a Merge: de97f41 f2e07a6 Author: Brad King AuthorDate: Thu Apr 2 12:57:41 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 2 12:57:41 2015 -0400 Merge topic 'clean-up-cmMakefile' f2e07a6d cmMakefile: Remove unused PreOrder member. aafe2821 cmMakefile: Remove unused Prefix member. 1fcf590b cmMakefile: Remove unused SubDirectoryOrder member. c3a60cc9 cmMakefile: Remove AddExtraDirectory method. 37897347 cmMakefile: Remove unused method. d7539ced cmMakefile: Remove bogus comment. ----------------------------------------------------------------------- Summary of changes: Source/cmAddSubDirectoryCommand.cxx | 2 +- Source/cmAuxSourceDirectoryCommand.cxx | 1 - Source/cmMakefile.cxx | 17 +++-------------- Source/cmMakefile.h | 32 ++------------------------------ Source/cmSubdirCommand.cxx | 7 +++---- 5 files changed, 9 insertions(+), 50 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 2 12:58:58 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 12:58:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1395-g1707b43 Message-ID: <20150402165858.D4841AD9B7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1707b43eb2bf1932798ec3deaff053b5cd168458 (commit) via 9780859b7e06e00d75b90aad1f706a401434a04a (commit) via de97f41cf30b09d44d6c2874897b4bf694c91ba3 (commit) via e6caa47fa652d3e24a2c29a72faf82499e324eaa (commit) via a5b4d197695c52c7756faa4d4dcc17b02c9d161f (commit) via 1a775917a5bf012d5b0610f6b01d8438fca6d12f (commit) via f707460e42949e4ca372bf23892a7d6fb9eb1b86 (commit) from 829b8cda7ce51877d946627beb3335a2ac4806c5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1707b43eb2bf1932798ec3deaff053b5cd168458 commit 1707b43eb2bf1932798ec3deaff053b5cd168458 Merge: 829b8cd 9780859 Author: Brad King AuthorDate: Thu Apr 2 12:58:48 2015 -0400 Commit: Brad King CommitDate: Thu Apr 2 12:58:48 2015 -0400 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 Apr 2 13:05:41 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 13:05:41 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1397-g7969184 Message-ID: <20150402170549.44D74ADB28@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7969184a10e58e609f203032ff3ac902d8d92d3b (commit) via 06f61c26cfa19a47610ad718a784bdd7db105cf8 (commit) from 1707b43eb2bf1932798ec3deaff053b5cd168458 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7969184a10e58e609f203032ff3ac902d8d92d3b commit 7969184a10e58e609f203032ff3ac902d8d92d3b Merge: 1707b43 06f61c2 Author: Brad King AuthorDate: Thu Apr 2 13:05:39 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 2 13:05:39 2015 -0400 Merge topic 'remove-DEFINITIONS-directory-property' into next 06f61c26 Do not treat DEFINITIONS as a built-in directory property http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06f61c26cfa19a47610ad718a784bdd7db105cf8 commit 06f61c26cfa19a47610ad718a784bdd7db105cf8 Author: Stephen Kelly AuthorDate: Wed Apr 1 20:53:31 2015 +0200 Commit: Brad King CommitDate: Thu Apr 2 13:00:48 2015 -0400 Do not treat DEFINITIONS as a built-in directory property Add policy CMP0059 to cover this change. The property has been deprecated since CMake 2.4 anyway. This will help clean up cmMakefile -- the DefineFlagsOrig member should not need to exist. diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 228df14..d2960de 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -116,3 +116,4 @@ All Policies /policy/CMP0056 /policy/CMP0057 /policy/CMP0058 + /policy/CMP0059 diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst new file mode 100644 index 0000000..e40f450 --- /dev/null +++ b/Help/policy/CMP0059.rst @@ -0,0 +1,17 @@ +CMP0059 +------- + +Don't treat ``DEFINITIONS`` as a built-in directory property. + +CMake 3.3 and above no longer make a list of definitions available through +the :prop_dir:`DEFINITIONS` directory property. The +:prop_dir:`COMPILE_DEFINITIONS` directory property may be used instead. + +The ``OLD`` behavior for this policy is to provide the list of flags given +so far to the :command:`add_definitions` command. The ``NEW`` behavior is +to behave as a normal user-defined directory property. + +This policy was introduced in CMake version 3.3. +CMake version |release| warns when the policy is not set and uses +``OLD`` behavior. Use the :command:`cmake_policy` command to set +it to ``OLD`` or ``NEW`` explicitly. diff --git a/Help/prop_dir/DEFINITIONS.rst b/Help/prop_dir/DEFINITIONS.rst index 22f7c15..79ac3f3 100644 --- a/Help/prop_dir/DEFINITIONS.rst +++ b/Help/prop_dir/DEFINITIONS.rst @@ -1,8 +1,13 @@ DEFINITIONS ----------- -For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS instead. +For CMake 2.4 compatibility only. Use :prop_dir:`COMPILE_DEFINITIONS` +instead. This read-only property specifies the list of flags given so far to -the add_definitions command. It is intended for debugging purposes. -Use the COMPILE_DEFINITIONS instead. +the :command:`add_definitions` command. It is intended for debugging +purposes. Use the :prop_dir:`COMPILE_DEFINITIONS` directory property +instead. + +This built-in read-only property does not exist if policy +:policy:`CMP0059` is set to ``NEW``. diff --git a/Help/release/dev/remove-DEFINITIONS-directory-property.rst b/Help/release/dev/remove-DEFINITIONS-directory-property.rst new file mode 100644 index 0000000..d8e50f0 --- /dev/null +++ b/Help/release/dev/remove-DEFINITIONS-directory-property.rst @@ -0,0 +1,6 @@ +remove-DEFINITIONS-property +--------------------------- + +* The :command:`add_definitions()` command no longer causes a + :prop_dir:`DEFINITIONS` directory property to be populated. See policy + :policy:`CMP0059`. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6fbcaeb..ec1d814 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4209,8 +4209,19 @@ const char *cmMakefile::GetProperty(const std::string& prop, } else if (prop == "DEFINITIONS") { - output += this->DefineFlagsOrig; - return output.c_str(); + switch(this->GetPolicyStatus(cmPolicies::CMP0059)) + { + case cmPolicies::WARN: + this->IssueMessage(cmake::AUTHOR_WARNING, this->GetPolicies()-> + GetPolicyWarning(cmPolicies::CMP0059)); + case cmPolicies::OLD: + output += this->DefineFlagsOrig; + return output.c_str(); + case cmPolicies::NEW: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + break; + } } else if (prop == "LINK_DIRECTORIES") { diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 592df8f..0a61bca 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -385,6 +385,11 @@ cmPolicies::cmPolicies() CMP0058, "CMP0058", "Ninja requires custom command byproducts to be explicit.", 3,3,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0059, "CMP0059", + "Do no treat DEFINITIONS as a built-in directory property.", + 3,3,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index b18b337..ced9d8c 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -116,6 +116,8 @@ public: CMP0057, ///< Disallow multiple MAIN_DEPENDENCY specifications /// for the same file. CMP0058, ///< Ninja requires custom command byproducts to be explicit + CMP0059, ///< Do not treat ``DEFINITIONS`` as a built-in directory + /// property. /** \brief Always the last entry. * diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt b/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt new file mode 100644 index 0000000..76992d8 --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt @@ -0,0 +1,2 @@ +DEFS: +CUSTOM CONTENT:CUSTOM_CONTENT diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake b/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake new file mode 100644 index 0000000..f7b9303 --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake @@ -0,0 +1,17 @@ + +cmake_policy(SET CMP0059 NEW) + +add_definitions(-DSOME_DEF) + +get_property(defs DIRECTORY . + PROPERTY DEFINITIONS +) +message("DEFS:${defs}") + +set_property(DIRECTORY . + PROPERTY DEFINITIONS CUSTOM_CONTENT +) +get_property(content DIRECTORY . + PROPERTY DEFINITIONS +) +message("CUSTOM CONTENT:${content}") diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt b/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt new file mode 100644 index 0000000..e35e8c5 --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt @@ -0,0 +1,2 @@ +DEFS: -DSOME_DEF +CUSTOM CONTENT: -DSOME_DEF diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake b/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake new file mode 100644 index 0000000..2555774 --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake @@ -0,0 +1,17 @@ + +cmake_policy(SET CMP0059 OLD) + +add_definitions(-DSOME_DEF) + +get_property(defs DIRECTORY . + PROPERTY DEFINITIONS +) +message("DEFS:${defs}") + +set_property(DIRECTORY . + PROPERTY DEFINITIONS CUSTOM_CONTENT +) +get_property(content DIRECTORY . + PROPERTY DEFINITIONS +) +message("CUSTOM CONTENT:${content}") diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt new file mode 100644 index 0000000..4e04d15 --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt @@ -0,0 +1,18 @@ +CMake Warning \(dev\) at CMP0059-WARN.cmake:6 \(get_property\): + Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory + property. Run "cmake --help-policy CMP0059" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +DEFS: -DSOME_DEF +CMake Warning \(dev\) at CMP0059-WARN.cmake:14 \(get_property\): + Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory + property. Run "cmake --help-policy CMP0059" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CUSTOM CONTENT: -DSOME_DEF diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake b/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake new file mode 100644 index 0000000..9d0b49c --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake @@ -0,0 +1,17 @@ + + + +add_definitions(-DSOME_DEF) + +get_property(defs DIRECTORY . + PROPERTY DEFINITIONS +) +message("DEFS:${defs}") + +set_property(DIRECTORY . + PROPERTY DEFINITIONS CUSTOM_CONTENT +) +get_property(content DIRECTORY . + PROPERTY DEFINITIONS +) +message("CUSTOM CONTENT:${content}") diff --git a/Tests/RunCMake/CMP0059/CMakeLists.txt b/Tests/RunCMake/CMP0059/CMakeLists.txt new file mode 100644 index 0000000..ef2163c --- /dev/null +++ b/Tests/RunCMake/CMP0059/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.1) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0059/RunCMakeTest.cmake b/Tests/RunCMake/CMP0059/RunCMakeTest.cmake new file mode 100644 index 0000000..9b57579 --- /dev/null +++ b/Tests/RunCMake/CMP0059/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0059-OLD) +run_cmake(CMP0059-NEW) +run_cmake(CMP0059-WARN) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 7b9c810..6daf27a 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -64,6 +64,7 @@ add_RunCMake_test(CMP0053) add_RunCMake_test(CMP0054) add_RunCMake_test(CMP0055) add_RunCMake_test(CMP0057) +add_RunCMake_test(CMP0059) if(CMAKE_GENERATOR STREQUAL "Ninja") add_RunCMake_test(Ninja) endif() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 2 13:06:06 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 13:06:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-595-g0983825 Message-ID: <20150402170607.051F4ADB39@public.kitware.com> This is an automated email from 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 098382505746a0f7c21f521a7a13e4a6836d12ac (commit) via 06f61c26cfa19a47610ad718a784bdd7db105cf8 (commit) from 9780859b7e06e00d75b90aad1f706a401434a04a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=098382505746a0f7c21f521a7a13e4a6836d12ac commit 098382505746a0f7c21f521a7a13e4a6836d12ac Merge: 9780859 06f61c2 Author: Brad King AuthorDate: Thu Apr 2 13:06:03 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 2 13:06:03 2015 -0400 Merge topic 'remove-DEFINITIONS-directory-property' 06f61c26 Do not treat DEFINITIONS as a built-in directory property ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-policies.7.rst | 1 + Help/policy/CMP0059.rst | 17 +++++++++++++++++ Help/prop_dir/DEFINITIONS.rst | 11 ++++++++--- .../dev/remove-DEFINITIONS-directory-property.rst | 6 ++++++ Source/cmMakefile.cxx | 15 +++++++++++++-- Source/cmPolicies.cxx | 5 +++++ Source/cmPolicies.h | 2 ++ .../CMP0059-NEW-result.txt} | 0 Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt | 2 ++ Tests/RunCMake/CMP0059/CMP0059-NEW.cmake | 17 +++++++++++++++++ .../CMP0059-OLD-result.txt} | 0 Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt | 2 ++ Tests/RunCMake/CMP0059/CMP0059-OLD.cmake | 17 +++++++++++++++++ .../CMP0059-WARN-result.txt} | 0 Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt | 18 ++++++++++++++++++ Tests/RunCMake/CMP0059/CMP0059-WARN.cmake | 17 +++++++++++++++++ Tests/RunCMake/{CMP0055 => CMP0059}/CMakeLists.txt | 0 Tests/RunCMake/CMP0059/RunCMakeTest.cmake | 5 +++++ Tests/RunCMake/CMakeLists.txt | 1 + 19 files changed, 131 insertions(+), 5 deletions(-) create mode 100644 Help/policy/CMP0059.rst create mode 100644 Help/release/dev/remove-DEFINITIONS-directory-property.rst copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0059/CMP0059-NEW-result.txt} (100%) create mode 100644 Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt create mode 100644 Tests/RunCMake/CMP0059/CMP0059-NEW.cmake copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0059/CMP0059-OLD-result.txt} (100%) create mode 100644 Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt create mode 100644 Tests/RunCMake/CMP0059/CMP0059-OLD.cmake copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0059/CMP0059-WARN-result.txt} (100%) create mode 100644 Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt create mode 100644 Tests/RunCMake/CMP0059/CMP0059-WARN.cmake copy Tests/RunCMake/{CMP0055 => CMP0059}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/CMP0059/RunCMakeTest.cmake hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 2 13:06:27 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 13:06:27 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1399-g4ec4aa7 Message-ID: <20150402170632.CBC24ADB44@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4ec4aa74ed6faac31eb752a18cc4978f74471bd1 (commit) via 098382505746a0f7c21f521a7a13e4a6836d12ac (commit) from 7969184a10e58e609f203032ff3ac902d8d92d3b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ec4aa74ed6faac31eb752a18cc4978f74471bd1 commit 4ec4aa74ed6faac31eb752a18cc4978f74471bd1 Merge: 7969184 0983825 Author: Brad King AuthorDate: Thu Apr 2 13:06:19 2015 -0400 Commit: Brad King CommitDate: Thu Apr 2 13:06:19 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 2 13:21:11 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 2 Apr 2015 13:21:11 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1401-g82c65ba Message-ID: <20150402172111.E61C1AD185@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 82c65ba5c5c9a5bb5a0f4582c1e719a7159a763b (commit) via 82c51a8ac6c4a8fba127402d96f8269492f3a115 (commit) from 4ec4aa74ed6faac31eb752a18cc4978f74471bd1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82c65ba5c5c9a5bb5a0f4582c1e719a7159a763b commit 82c65ba5c5c9a5bb5a0f4582c1e719a7159a763b Merge: 4ec4aa7 82c51a8 Author: Brad King AuthorDate: Thu Apr 2 13:21:10 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 2 13:21:10 2015 -0400 Merge topic 'fix-liblzma-XL-optimize' into next 82c51a8a liblzma: Disable XL compiler optimizations in one source to avoid crash http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82c51a8ac6c4a8fba127402d96f8269492f3a115 commit 82c51a8ac6c4a8fba127402d96f8269492f3a115 Author: Brad King AuthorDate: Thu Apr 2 13:16:23 2015 -0400 Commit: Brad King CommitDate: Thu Apr 2 13:17:57 2015 -0400 liblzma: Disable XL compiler optimizations in one source to avoid crash Somehow optimizations of lzma_lzma_optimum_normal by the IBM XL C compiler cause it to crash. Simply disable optimizations of this source file with a pragma. diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c index d3a6348..fc54d8d 100644 --- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c +++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c @@ -8,6 +8,9 @@ // You can do whatever you want with this file. // /////////////////////////////////////////////////////////////////////////////// +#if defined(__IBMC__) +# pragma options optimize=0 +#endif #include "lzma_encoder_private.h" #include "fastpos.h" ----------------------------------------------------------------------- Summary of changes: Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c | 3 +++ 1 file changed, 3 insertions(+) hooks/post-receive -- CMake From jamesbigler at gmail.com Thu Apr 2 19:12:57 2015 From: jamesbigler at gmail.com (James Bigler) Date: Thu, 2 Apr 2015 19:12:57 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1403-gfdf5e06 Message-ID: <20150402231257.D9F63ACAB0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fdf5e062c75d6d55f8e8fa8f3f6dd0efe3663340 (commit) via 06fa63da7d37bfd28ea1f82704f8140fe1493bab (commit) from 82c65ba5c5c9a5bb5a0f4582c1e719a7159a763b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fdf5e062c75d6d55f8e8fa8f3f6dd0efe3663340 commit fdf5e062c75d6d55f8e8fa8f3f6dd0efe3663340 Merge: 82c65ba 06fa63d Author: James Bigler AuthorDate: Thu Apr 2 19:12:56 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 2 19:12:56 2015 -0400 Merge topic 'FindCUDA.cmake/StaticRuntime' into next 06fa63da Use the static version of the CUDA runtime library if available. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06fa63da7d37bfd28ea1f82704f8140fe1493bab commit 06fa63da7d37bfd28ea1f82704f8140fe1493bab Author: James Bigler AuthorDate: Tue Mar 31 14:13:04 2015 -0600 Commit: James Bigler CommitDate: Tue Mar 31 14:13:04 2015 -0600 Use the static version of the CUDA runtime library if available. Beginning in CUDA 5.5 a static version of the cuda runtime library became available. Since nvcc defaults to using this library over the shared version, FindCUDA will also default to using this version. There are many advantages to using the static version (most importantly to avoid conflicts with multiple versions when building a CUDA based library). If you don't want to use this feature set the cache variable CUDA_USE_STATIC_CUDA_RUNTIME to OFF. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 81e1cad..8f80993 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -106,6 +106,11 @@ # CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and # CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. # +# CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) +# -- When enabled the static version of the CUDA runtime library will be used +# in CUDA_LIBRARIES. If the version of CUDA configured doesn't support +# this option, then it will be silently disabled. +# # CUDA_VERBOSE_BUILD (Default OFF) # -- Set to ON to see all the commands used when building the CUDA file. When # using a Makefile generator the value defaults to VERBOSE (run make @@ -272,6 +277,8 @@ # CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS # implementation (alterative to: # CUDA_ADD_CUBLAS_TO_TARGET macro). +# CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. +# Only available for CUDA version 5.5+ # CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. # Only available for CUDA version 4.0+. # CUDA_curand_LIBRARY -- CUDA Random Number Generation library. @@ -518,11 +525,12 @@ macro(cuda_unset_include_and_libraries) # This only existed in the 3.0 version of the CUDA toolkit unset(CUDA_CUDARTEMU_LIBRARY CACHE) endif() - unset(CUDA_cupti_LIBRARY CACHE) + unset(CUDA_cudart_static_LIBRARY CACHE) unset(CUDA_cublas_LIBRARY CACHE) unset(CUDA_cublasemu_LIBRARY CACHE) unset(CUDA_cufft_LIBRARY CACHE) unset(CUDA_cufftemu_LIBRARY CACHE) + unset(CUDA_cupti_LIBRARY CACHE) unset(CUDA_curand_LIBRARY CACHE) unset(CUDA_cusolver_LIBRARY CACHE) unset(CUDA_cusparse_LIBRARY CACHE) @@ -532,6 +540,8 @@ macro(cuda_unset_include_and_libraries) unset(CUDA_npps_LIBRARY CACHE) unset(CUDA_nvcuvenc_LIBRARY CACHE) unset(CUDA_nvcuvid_LIBRARY CACHE) + + unset(CUDA_USE_STATIC_CUDA_RUNTIME CACHE) endmacro() # Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, @@ -539,8 +549,8 @@ endmacro() if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") unset(CUDA_TOOLKIT_TARGET_DIR CACHE) unset(CUDA_NVCC_EXECUTABLE CACHE) - unset(CUDA_VERSION CACHE) cuda_unset_include_and_libraries() + unset(CUDA_VERSION CACHE) endif() if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") @@ -696,6 +706,53 @@ if(CUDA_VERSION VERSION_EQUAL "3.0") CUDA_CUDARTEMU_LIBRARY ) endif() +if(NOT CUDA_VERSION VERSION_LESS "5.5") + cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") + mark_as_advanced(CUDA_cudart_static_LIBRARY) +endif() +if(CUDA_cudart_static_LIBRARY) + # Set whether to use the static cuda runtime. + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) +else() + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" OFF) +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + if(UNIX) + # Check for the dependent libraries. Here we look for pthreads. + if (DEFINED CMAKE_THREAD_PREFER_PTHREAD) + set(_cuda_cmake_thread_prefer_pthread ${CMAKE_THREAD_PREFER_PTHREAD}) + endif() + set(CMAKE_THREAD_PREFER_PTHREAD 1) + + # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} + # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and + # -Werror causes the try_compile to fail. We will just temporarily disable other flags + # when doing the find_package command here. + set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) + set(CMAKE_C_FLAGS "-fPIC") + find_package(Threads REQUIRED) + set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) + + if (DEFINED _cuda_cmake_thread_prefer_pthread) + set(CMAKE_THREAD_PREFER_PTHREAD ${_cuda_cmake_thread_prefer_pthread}) + unset(_cuda_cmake_thread_prefer_pthread) + else() + unset(CMAKE_THREAD_PREFER_PTHREAD) + endif() + if (NOT APPLE) + # Here is librt that has things such as, clock_gettime, shm_open, and shm_unlink. + find_library(CUDA_rt_LIBRARY rt) + find_library(CUDA_dl_LIBRARY dl) + if (NOT CUDA_rt_LIBRARY) + message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") + endif() + if (NOT CUDA_dl_LIBRARY) + message(WARNING "Expecting to find libdl for libcudart_static, but didn't find it.") + endif() + endif() + endif() +endif() # CUPTI library showed up in cuda toolkit 4.0 if(NOT CUDA_VERSION VERSION_LESS "4.0") @@ -703,12 +760,32 @@ if(NOT CUDA_VERSION VERSION_LESS "4.0") mark_as_advanced(CUDA_cupti_LIBRARY) endif() +# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are +# using the CUDA runtime. For the dynamic version of the runtime, most of the +# dependencies are brough in, but for the static version there are additional libraries +# and linker commands needed. +# Initialize to empty +set(CUDA_LIBRARIES) + # If we are using emulation mode and we found the cudartemu library then use # that one instead of cudart. if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) - set(CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) +elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) + if (CUDA_rt_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) + endif() + if (CUDA_dl_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_dl_LIBRARY}) + endif() + if(APPLE) + # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that + # the static cuda runtime can find it at runtime. + list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) + endif() else() - set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) endif() # 1.1 toolkit on linux doesn't appear to have a separate library on ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 85 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Apr 3 00:01:07 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 3 Apr 2015 00:01:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-596-g2978a55 Message-ID: <20150403040107.C72B6AD7F5@public.kitware.com> This is an automated email from 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 2978a5549acd9a55582ab42ae774e75ddf2b606f (commit) from 098382505746a0f7c21f521a7a13e4a6836d12ac (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2978a5549acd9a55582ab42ae774e75ddf2b606f commit 2978a5549acd9a55582ab42ae774e75ddf2b606f Author: Kitware Robot AuthorDate: Fri Apr 3 00:01:04 2015 -0400 Commit: Kitware Robot CommitDate: Fri Apr 3 00:01:04 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 19d6c87..8a93101 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150402) +set(CMake_VERSION_PATCH 20150403) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From nilsgladitz at gmail.com Fri Apr 3 06:12:39 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Fri, 3 Apr 2015 06:12:39 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1407-gf7660ff Message-ID: <20150403101239.72E43AC435@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f7660ff8ca19f72de10d47698e5389700587148a (commit) via 93551ec45ffcb1f00e88a3e47f1c6cdedda783e8 (commit) via 3a427288c06f9dd0261b227360be2ec448e9b6f3 (commit) via 2cfcdd2b870025d776d0b5c246764f09594bdc34 (commit) from fdf5e062c75d6d55f8e8fa8f3f6dd0efe3663340 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f7660ff8ca19f72de10d47698e5389700587148a commit f7660ff8ca19f72de10d47698e5389700587148a Merge: fdf5e06 93551ec Author: Nils Gladitz AuthorDate: Fri Apr 3 06:12:33 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 06:12:33 2015 -0400 Merge topic 'gcov-module-coverage-exclude' into next 93551ec4 CTestCoverageCollectGCOV: Extended test case for CTEST_CUSTOM_COVERAGE_EXCLUDE 3a427288 CTestCoverageCollectGCOV: Skip unnecessary loop iterations 2cfcdd2b CTestCoverageCollectGCOV: Support CTEST_CUSTOM_COVERAGE_EXCLUDE http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=93551ec45ffcb1f00e88a3e47f1c6cdedda783e8 commit 93551ec45ffcb1f00e88a3e47f1c6cdedda783e8 Author: Nils Gladitz AuthorDate: Fri Apr 3 11:42:37 2015 +0200 Commit: Nils Gladitz CommitDate: Fri Apr 3 11:42:37 2015 +0200 CTestCoverageCollectGCOV: Extended test case for CTEST_CUSTOM_COVERAGE_EXCLUDE diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5944d08..2a54648 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2350,7 +2350,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ) set_tests_properties(CTestCoverageCollectGCOV PROPERTIES PASS_REGULAR_EXPRESSION - "PASSED with correct output.*Testing/CoverageInfo/echoargs.gcov") + "PASSED with correct output.*Testing/CoverageInfo/main.cpp.gcov") configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake.in" diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/3rdparty/foo.cpp b/Tests/CTestCoverageCollectGCOV/TestProject/3rdparty/foo.cpp new file mode 100644 index 0000000..85e6cd8 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/3rdparty/foo.cpp @@ -0,0 +1 @@ +void foo() {} diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt b/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt new file mode 100644 index 0000000..a492fd3 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.2) + +project(TestProject CXX) + +include(CTest) + +add_executable(myexecutable + main.cpp + 3rdparty/foo.cpp + extra/extra.cpp +) + +set_property(SOURCE main.cpp APPEND PROPERTY LABELS SourceLabel) +set_property(TARGET myexecutable APPEND PROPERTY LABELS TargetLabel) + +add_custom_command(TARGET myexecutable + POST_BUILD + COMMAND ${CMAKE_COMMAND} - + -DTARGET=myexecutable + "-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}" + "-DSOURCES=$" + -P "${CMAKE_CURRENT_SOURCE_DIR}/fake_compile_time_gcno.cmake" + VERBATIM +) + +add_test(NAME mytest + COMMAND ${CMAKE_COMMAND} + "-DMYEXECUTABLE=$" + "-DTARGETDIR=${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/myexecutable.dir" + -P "${CMAKE_CURRENT_SOURCE_DIR}/fake_run_time_gcda.cmake" +) + +set_property(TEST mytest APPEND PROPERTY LABELS TestLabel) diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/extra/extra.cpp b/Tests/CTestCoverageCollectGCOV/TestProject/extra/extra.cpp new file mode 100644 index 0000000..c3a2c12 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/extra/extra.cpp @@ -0,0 +1 @@ +void extra() {} diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake b/Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake new file mode 100644 index 0000000..5c87589 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake @@ -0,0 +1,5 @@ +foreach(source ${SOURCES}) + file(WRITE "CMakeFiles/${TARGET}.dir/${source}.gcno" + "${SOURCE_DIR}/${source}" + ) +endforeach() diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/fake_run_time_gcda.cmake b/Tests/CTestCoverageCollectGCOV/TestProject/fake_run_time_gcda.cmake new file mode 100644 index 0000000..26ce2bd --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/fake_run_time_gcda.cmake @@ -0,0 +1,12 @@ +execute_process(COMMAND ${MYEXECUTABLE} RESULT_VARIABLE RESULT) + +if(NOT RESULT_VARIABLE STREQUAL "0") + message("Test failure") +endif() + +file(GLOB_RECURSE gcno_files "${TARGETDIR}/*.gcno") + +foreach(gcno_file ${gcno_files}) + string(REPLACE ".gcno" ".gcda" gcda_file "${gcno_file}") + configure_file(${gcno_file} ${gcda_file} COPYONLY) +endforeach() diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/main.cpp b/Tests/CTestCoverageCollectGCOV/TestProject/main.cpp new file mode 100644 index 0000000..237c8ce --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/main.cpp @@ -0,0 +1 @@ +int main() {} diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake index e704f14..c7b563f 100644 --- a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake +++ b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake @@ -3,6 +3,12 @@ foreach(I RANGE 0 ${CMAKE_ARGC}) 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") + +get_filename_component(gcda_name ${gcda_file} NAME) +string(REPLACE ".gcda" ".gcov" gcov_name "${gcda_name}") + +file(STRINGS "${gcda_file}" source_file LIMIT_COUNT 1) + +file(WRITE "${CMAKE_SOURCE_DIR}/${gcov_name}" + " -: 0:Source:${source_file}" +) diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in index 4bdcb10..c5613fb 100644 --- a/Tests/CTestCoverageCollectGCOV/test.cmake.in +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -1,16 +1,21 @@ 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_PROJECT_NAME "TestProject") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/TestProject") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV/TestProject") set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") + +ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + ctest_start(Experimental) ctest_configure() ctest_build() ctest_test() -file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeFiles/echoargs.dir/echoargs.gcda -"dummy -") +list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE + "/foo/something" + "/3rdparty/" + "/bar/somethingelse" +) include(CTestCoverageCollectGCOV) set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar) @@ -27,9 +32,10 @@ execute_process(COMMAND WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) set(expected_out -"Testing/CoverageInfo/echoargs.gcov +"Testing/CoverageInfo/main.cpp.gcov +Testing/CoverageInfo/extra.cpp.gcov Testing/CoverageInfo/data.json -CMakeFiles/echoargs.dir/Labels.json +CMakeFiles/myexecutable.dir/Labels.json ") if("${out}" STREQUAL "${expected_out}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a427288c06f9dd0261b227360be2ec448e9b6f3 commit 3a427288c06f9dd0261b227360be2ec448e9b6f3 Author: Nils Gladitz AuthorDate: Thu Apr 2 20:39:42 2015 +0200 Commit: Nils Gladitz CommitDate: Thu Apr 2 20:39:42 2015 +0200 CTestCoverageCollectGCOV: Skip unnecessary loop iterations diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 0a74e97..db86751 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -162,12 +162,14 @@ function(ctest_coverage_collect_gcov) endif() foreach(exclude_entry ${CTEST_CUSTOM_COVERAGE_EXCLUDE}) - if(NOT is_excluded AND source_file MATCHES "${exclude_entry}") + if(source_file MATCHES "${exclude_entry}") set(is_excluded true) if(NOT GCOV_QUIET) message("Excluding coverage for: ${source_file} which matches ${exclude_entry}") endif() + + break() endif() endforeach() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2cfcdd2b870025d776d0b5c246764f09594bdc34 commit 2cfcdd2b870025d776d0b5c246764f09594bdc34 Author: Nils Gladitz AuthorDate: Thu Apr 2 17:02:08 2015 +0200 Commit: Nils Gladitz CommitDate: Thu Apr 2 17:02:08 2015 +0200 CTestCoverageCollectGCOV: Support CTEST_CUSTOM_COVERAGE_EXCLUDE diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 4519627..0a74e97 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -147,8 +147,35 @@ function(ctest_coverage_collect_gcov) \"Binary\": \"${binary_dir}\" }") # collect the gcov files + set(unfiltered_gcov_files) + file(GLOB_RECURSE unfiltered_gcov_files RELATIVE ${binary_dir} "${coverage_dir}/*.gcov") + set(gcov_files) - file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${coverage_dir}/*.gcov") + foreach(gcov_file ${unfiltered_gcov_files}) + file(STRINGS ${binary_dir}/${gcov_file} first_line LIMIT_COUNT 1) + + set(is_excluded false) + if(first_line MATCHES "^ -: 0:Source:(.*)$") + set(source_file ${CMAKE_MATCH_1}) + elseif(NOT GCOV_QUIET) + message(STATUS "Could not determine source file corresponding to: ${gcov_file}") + endif() + + foreach(exclude_entry ${CTEST_CUSTOM_COVERAGE_EXCLUDE}) + if(NOT is_excluded AND source_file MATCHES "${exclude_entry}") + set(is_excluded true) + + if(NOT GCOV_QUIET) + message("Excluding coverage for: ${source_file} which matches ${exclude_entry}") + endif() + endif() + endforeach() + + if(NOT is_excluded) + list(APPEND gcov_files ${gcov_file}) + endif() + endforeach() + # 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 | 31 +++++++++++++++++- Tests/CMakeLists.txt | 2 +- .../TestProject/3rdparty/foo.cpp | 1 + .../TestProject/CMakeLists.txt | 33 ++++++++++++++++++++ .../TestProject/extra/extra.cpp | 1 + .../TestProject/fake_compile_time_gcno.cmake | 5 +++ .../TestProject/fake_run_time_gcda.cmake | 12 +++++++ .../TestProject/main.cpp} | 0 Tests/CTestCoverageCollectGCOV/fakegcov.cmake | 12 +++++-- Tests/CTestCoverageCollectGCOV/test.cmake.in | 22 ++++++++----- 10 files changed, 106 insertions(+), 13 deletions(-) create mode 100644 Tests/CTestCoverageCollectGCOV/TestProject/3rdparty/foo.cpp create mode 100644 Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt create mode 100644 Tests/CTestCoverageCollectGCOV/TestProject/extra/extra.cpp create mode 100644 Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake create mode 100644 Tests/CTestCoverageCollectGCOV/TestProject/fake_run_time_gcda.cmake copy Tests/{MissingInstall/mybin.cpp => CTestCoverageCollectGCOV/TestProject/main.cpp} (100%) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 09:17:13 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 09:17:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1409-g9fce9cc Message-ID: <20150403131713.0A800ACDFF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9fce9cca2b01f896c075cf2599a38fb6bba5ed0e (commit) via 4a25ee113cd132e15e4d3b5c5073da76c02a5473 (commit) from f7660ff8ca19f72de10d47698e5389700587148a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fce9cca2b01f896c075cf2599a38fb6bba5ed0e commit 9fce9cca2b01f896c075cf2599a38fb6bba5ed0e Merge: f7660ff 4a25ee1 Author: Brad King AuthorDate: Fri Apr 3 09:17:12 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 09:17:12 2015 -0400 Merge topic 'test_cpack_symlinks' into next 4a25ee11 fixup! Tests: Add case for CPack source package with symlinks http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a25ee113cd132e15e4d3b5c5073da76c02a5473 commit 4a25ee113cd132e15e4d3b5c5073da76c02a5473 Author: Brad King AuthorDate: Fri Apr 3 09:08:42 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 09:08:42 2015 -0400 fixup! Tests: Add case for CPack source package with symlinks diff --git a/Tests/RunCMake/CPackSymlinks/testcpacksym.tar b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar index 31f34a0..a44c656 100644 Binary files a/Tests/RunCMake/CPackSymlinks/testcpacksym.tar and b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar differ ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CPackSymlinks/testcpacksym.tar | Bin 10240 -> 10240 bytes 1 file changed, 0 insertions(+), 0 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 10:03:39 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 10:03:39 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1416-g503f2fd Message-ID: <20150403140339.EFFE2ADB9E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 503f2fdd8a96c2c2ac634f1af2388d834f8e9093 (commit) via 4f172a45b89d02e085ea9cea38794d9b3c6703b8 (commit) via 05da22062ac477587890de7e7c180cc7e8cd5d88 (commit) via cdee12f605cbde35172b45e37acb832bae1b4bc5 (commit) via 42aca28a6dc4f460b60c3c82819706132afb89cd (commit) via eee05f2243f9dd68a7ac445716936f8e5f0db0ff (commit) via 603bfe4e998bb951bd6cd888c665d666c498d67a (commit) from 9fce9cca2b01f896c075cf2599a38fb6bba5ed0e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=503f2fdd8a96c2c2ac634f1af2388d834f8e9093 commit 503f2fdd8a96c2c2ac634f1af2388d834f8e9093 Merge: 9fce9cc 4f172a4 Author: Brad King AuthorDate: Fri Apr 3 10:03:38 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 10:03:38 2015 -0400 Merge topic 'doc-target_link_libraries' into next 4f172a45 Help: Revise target_link_libraries command documentation 05da2206 Help: Update discussion of relocable packages in cmake-packages(7) cdee12f6 Help: Reorganize and refine discussion of relocatable packages 42aca28a Help: Place relocatable package notes in their own subsections eee05f22 Help: Fix typo in cmake-packages(7) manual 603bfe4e Help: Fix syntax in non-relocatable usage requirements example http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f172a45b89d02e085ea9cea38794d9b3c6703b8 commit 4f172a45b89d02e085ea9cea38794d9b3c6703b8 Author: Brad King AuthorDate: Thu Apr 2 15:41:06 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 10:03:17 2015 -0400 Help: Revise target_link_libraries command documentation Organize the documentation into subsections to separate the signatures. Refactor the discussion of allowed link items into bullet points and expand into more detail on each. diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index 88a555a..e0b1667 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -1,38 +1,102 @@ target_link_libraries --------------------- -Link a target to given libraries. +.. only:: html + + .. contents:: + +Specify libraries or flags to use when linking a given target and/or +its dependents. :ref:`Usage requirements ` +from linked library targets will be propagated. Usage requirements +of a target's dependencies affect compilation of its own sources. + +Overview +^^^^^^^^ + +This command has several signatures as detailed in subsections below. +All of them have the general form:: + + target_link_libraries( ... ... ...) + +The named ```` must have been created in the current directory by +a command such as :command:`add_executable` or :command:`add_library`. +Repeated calls for the same ```` append items in the order called. +Each ```` may be: + +* **A library target name**: The generated link line will have the + full path to the linkable library file associated with the target. + The buildsystem will have a dependency to re-link ```` if + the library file changes. + + The named target must be created by :command:`add_library` within + the project or as an :ref:`IMPORTED library `. + If it is created within the project an ordering dependency will + automatically be added in the build system to make sure the named + library target is up-to-date before the ```` links. + +* **A full path to a library file**: The generated link line will + normally preserve the full path to the file. However, there are + some cases where CMake must ask the linker to search for the library + (e.g. ``-lfoo``), such as when it appears in a system library directory + that the compiler front-end may replace with an alternative. + Either way, the buildsystem will have a dependency to re-link + ```` if the library file changes. + + If the library file is in a Mac OSX framework, the ``Headers`` directory + of the framework will also be processed as a + :ref:`usage requirement `. This has the same + effect as passing the framework directory as an include directory. + +* **A plain library name**: The generated link line will ask the linker + to search for the library (e.g. ``-lfoo``). + +* **A link flag**: Item names starting with ``-``, but not ``-l`` or + ``-framework``, are treated as linker flags. Note that such flags will + be treated like any other library link item for purposes of transitive + dependencies, so they are generally safe to specify only as private link + items that will not propagate to dependents. + +* A ``debug``, ``optimized``, or ``general`` keyword immediately followed + by another ````. The item following such a keyword will be used + only for the corresponding build configuration. The ``debug`` keyword + corresponds to the ``Debug`` configuration (or to configurations named + in the :prop_gbl:`DEBUG_CONFIGURATIONS` global property if it is set). + The ``optimized`` keyword corresponds to all other configurations. The + ``general`` keyword corresponds to all configurations, and is purely + optional. Higher granularity may be achieved for per-configuration + rules by creating and linking to + :ref:`IMPORTED library targets `. + +Arguments to ``target_link_libraries`` may use "generator expressions" +with the syntax ``$<...>``. Note however, that generator expressions +will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`. +See the :manual:`cmake-generator-expressions(7)` manual for available +expressions. See the :manual:`cmake-buildsystem(7)` manual for more on +defining buildsystem properties. + +Libraries for a Target and/or its Dependents +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +:: + + target_link_libraries( + ... + [ ...]...) + +The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` keywords can be used to +specify both the link dependencies and the link interface in one command. +Libraries and targets following ``PUBLIC`` are linked to, and are made +part of the link interface. Libraries and targets following ``PRIVATE`` +are linked to, but are not made part of the link interface. Libraries +following ``INTERFACE`` are appended to the link interface and are not +used for linking ````. + +Libraries for both a Target and its Dependents +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: - target_link_libraries( [item1 [item2 [...]]] - [[debug|optimized|general] ] ...) - -Specify libraries or flags to use when linking a given target. The -named ```` must have been created in the current directory by a -command such as :command:`add_executable` or :command:`add_library`. The -remaining arguments specify library names or flags. Repeated calls for -the same ```` append items in the order called. - -If a library name matches that of another target in the project a -dependency will automatically be added in the build system to make sure -the library being linked is up-to-date before the target links. Item names -starting with ``-``, but not ``-l`` or ``-framework``, are treated as -linker flags. Note that such flags will be treated like any other library -link item for purposes of transitive dependencies, so they are generally -safe to specify only as private link items that will not propagate to -dependents of ````. - -A ``debug``, ``optimized``, or ``general`` keyword indicates that the -library immediately following it is to be used only for the -corresponding build configuration. The ``debug`` keyword corresponds to -the Debug configuration (or to configurations named in the -:prop_gbl:`DEBUG_CONFIGURATIONS` global property if it is set). The -``optimized`` keyword corresponds to all other configurations. The -``general`` keyword corresponds to all configurations, and is purely -optional (assumed if omitted). Higher granularity may be achieved for -per-configuration rules by creating and linking to -:ref:`IMPORTED library targets `. + target_link_libraries( ...) Library dependencies are transitive by default with this signature. When this target is linked into another target then the libraries @@ -45,37 +109,34 @@ by setting the property directly. When :policy:`CMP0022` is not set to of this command may set the property making any libraries linked exclusively by this signature private. -CMake will also propagate :ref:`usage requirements ` -from linked library targets. Usage requirements of dependencies affect -compilation of sources in the ````. - -If an ```` is a library in a Mac OX framework, the ``Headers`` -directory of the framework will also be processed as a -:ref:`usage requirement `. This has the same -effect as passing the framework directory as an include directory. - --------------------------------------------------------------------------- +Libraries for a Target and/or its Dependents (Legacy) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: target_link_libraries( - ... - [ ... ] ...]) + ... + [ ...]...) -The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` keywords can be used to -specify both the link dependencies and the link interface in one command. -Libraries and targets following ``PUBLIC`` are linked to, and are made -part of the link interface. Libraries and targets following ``PRIVATE`` -are linked to, but are not made part of the link interface. Libraries -following ``INTERFACE`` are appended to the link interface and are not -used for linking ````. +The ``LINK_PUBLIC`` and ``LINK_PRIVATE`` modes can be used to specify both +the link dependencies and the link interface in one command. --------------------------------------------------------------------------- +This signature is for compatibility only. Prefer the ``PUBLIC`` or +``PRIVATE`` keywords instead. + +Libraries and targets following ``LINK_PUBLIC`` are linked to, and are +made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy +:policy:`CMP0022` is not ``NEW``, they are also made part of the +:prop_tgt:`LINK_INTERFACE_LIBRARIES`. Libraries and targets following +``LINK_PRIVATE`` are linked to, but are not made part of the +:prop_tgt:`INTERFACE_LINK_LIBRARIES` (or :prop_tgt:`LINK_INTERFACE_LIBRARIES`). + +Libraries for Dependents Only (Legacy) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: - target_link_libraries( LINK_INTERFACE_LIBRARIES - [[debug|optimized|general] ] ...) + target_link_libraries( LINK_INTERFACE_LIBRARIES ...) The ``LINK_INTERFACE_LIBRARIES`` mode appends the libraries to the :prop_tgt:`INTERFACE_LINK_LIBRARIES` target property instead of using them @@ -99,28 +160,8 @@ is not ``NEW``, they are also appended to the ``general`` (or without any keyword) are treated as if specified for both ``debug`` and ``optimized``. --------------------------------------------------------------------------- - -:: - - target_link_libraries( - - [[debug|optimized|general] ] ... - [ - [[debug|optimized|general] ] ...]) - -The ``LINK_PUBLIC`` and ``LINK_PRIVATE`` modes can be used to specify both -the link dependencies and the link interface in one command. - -This signature is for compatibility only. Prefer the ``PUBLIC`` or -``PRIVATE`` keywords instead. - -Libraries and targets following ``LINK_PUBLIC`` are linked to, and are -made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy -:policy:`CMP0022` is not ``NEW``, they are also made part of the -:prop_tgt:`LINK_INTERFACE_LIBRARIES`. Libraries and targets following -``LINK_PRIVATE`` are linked to, but are not made part of the -:prop_tgt:`INTERFACE_LINK_LIBRARIES` (or :prop_tgt:`LINK_INTERFACE_LIBRARIES`). +Cyclic Dependencies of Static Libraries +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The library dependency graph is normally acyclic (a DAG), but in the case of mutually-dependent ``STATIC`` libraries CMake allows the graph to @@ -139,17 +180,11 @@ For example, the code links ``main`` to ``A B A B``. While one repetition is usually sufficient, pathological object file and symbol arrangements can require -more. One may handle such cases by manually repeating the component in -the last ``target_link_libraries`` call. However, if two archives are -really so interdependent they should probably be combined into a single -archive. - -Arguments to target_link_libraries may use "generator expressions" -with the syntax ``$<...>``. Note however, that generator expressions -will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`. -See the :manual:`cmake-generator-expressions(7)` manual for available -expressions. See the :manual:`cmake-buildsystem(7)` manual for more on -defining buildsystem properties. +more. One may handle such cases by using the +:prop_tgt:`LINK_INTERFACE_MULTIPLICITY` target property or by manually +repeating the component in the last ``target_link_libraries`` call. +However, if two archives are really so interdependent they should probably +be combined into a single archive, perhaps by using :ref:`Object Libraries`. Creating Relocatable Packages ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05da22062ac477587890de7e7c180cc7e8cd5d88 commit 05da22062ac477587890de7e7c180cc7e8cd5d88 Author: Brad King AuthorDate: Fri Apr 3 09:57:05 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 09:57:05 2015 -0400 Help: Update discussion of relocable packages in cmake-packages(7) Explain at the beginning of the section the requirements for a package to be relocatable to justify the rest of the section content. Generalize example to use fictional package names instead of real ones, especially because FindBoost provides no alternative yet. Reword the discussion to represent the preferred approach as "ideal" but also suggest workarounds when find modules do not provide the imported targets. diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index 28c0798..b9073a5 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -475,6 +475,10 @@ without installation. Consumers of the build tree can simply ensure that the Creating Relocatable Packages ----------------------------- +A relocatable package must not reference absolute paths of files on +the machine where the package is built that will not exist on the +machines where the package may be installed. + Packages created by :command:`install(EXPORT)` are designed to be relocatable, using paths relative to the location of the package itself. When defining the interface of a target for ``EXPORT``, keep in mind that the include @@ -509,34 +513,56 @@ This also applies to paths referencing external dependencies. It is not advisable to populate any properties which may contain paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevant to dependencies. -That would hard-code into installed packages the include directory or library -paths for dependencies **as found on the machine the package was made on**. - -That is, code like this is incorrect for targets which will be used to -generate config file packages: +For example, this code may not work well for a relocatable package: .. code-block:: cmake target_link_libraries(ClimbingStats INTERFACE - ${Boost_LIBRARIES} ${OtherDep_LIBRARIES} + ${Foo_LIBRARIES} ${Bar_LIBRARIES} ) target_include_directories(ClimbingStats INTERFACE - "$" + "$" ) -Dependencies must provide their own :ref:`IMPORTED targets ` -which have their own :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and -:prop_tgt:`IMPORTED_LOCATION` populated appropriately. Those -:ref:`IMPORTED targets ` may then be -used with the :command:`target_link_libraries` command for ``ClimbingStats``. - -That way, when a consumer uses the installed package, the -consumer will run the appropriate :command:`find_package` command (via the -find_dependency macro described below) to find -the dependencies on their own machine and populate the -:ref:`IMPORTED targets ` with appropriate paths. Note that -many modules currently shipped with CMake do not currently provide -:ref:`IMPORTED targets `. +The referenced variables may contain the absolute paths to libraries +and include directories **as found on the machine the package was made on**. +This would create a package with hard-coded paths to dependencies and not +suitable for relocation. + +Ideally such dependencies should be used through their own +:ref:`IMPORTED targets ` that have their own +:prop_tgt:`IMPORTED_LOCATION` and usage requirement properties +such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` populated +appropriately. Those imported targets may then be used with +the :command:`target_link_libraries` command for ``ClimbingStats``: + +.. code-block:: cmake + + target_link_libraries(ClimbingStats INTERFACE Foo::Foo Bar::Bar) + +With this approach the package references its external dependencies +only through the names of :ref:`IMPORTED targets `. +When a consumer uses the installed package, the consumer will run the +appropriate :command:`find_package` commands (via the ``find_dependency`` +macro described above) to find the dependencies and populate the +imported targets with appropriate paths on their own machine. + +Unfortunately many :manual:`modules ` shipped with +CMake do not yet provide :ref:`IMPORTED targets ` +because their development pre-dated this approach. This may improve +incrementally over time. Workarounds to create relocatable packages +using such modules include: + +* When building the package, specify each ``Foo_LIBRARY`` cache + entry as just a library name, e.g. ``-DFoo_LIBRARY=foo``. This + tells the corresponding find module to populate the ``Foo_LIBRARIES`` + with just ``foo`` to ask the linker to search for the library + instead of hard-coding a path. + +* Or, after installing the package content but before creating the + package installation binary for redistribution, manually replace + the absolute paths with placeholders for substitution by the + installation tool when the package is installed. .. _`Package Registry`: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cdee12f605cbde35172b45e37acb832bae1b4bc5 commit cdee12f605cbde35172b45e37acb832bae1b4bc5 Author: Brad King AuthorDate: Thu Apr 2 16:12:00 2015 -0400 Commit: Brad King CommitDate: Thu Apr 2 17:19:52 2015 -0400 Help: Reorganize and refine discussion of relocatable packages Re-organize the content added to the cmake-packages(7) manual by * commit v3.0.0-rc1~184^2 (Help: Document export(EXPORT) in the cmake-packages manual, 2013-12-23), * commit v3.0.0-rc1~154^2~1 (Help: Add notes about relocatability of config-file packages, 2014-01-07), * and commit v3.2.0-rc1~345^2 (Help: Warn that paths should not be used in INTERFACE_ build properties, 2014-11-22). These commits broke the natural flow of the original manual and made wording after the new content make less sense. Move the content into new subsections to restore the flow of the original manual and to make explicitly the purpose of the new content. Shorten the relocatable usage requirement "warnings". Refer to the new cmake-packages(7) manual subsection to reduce duplication. Also clarify the distinction between paths to library dependencies and paths to their header files. diff --git a/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt b/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt index 33f7183..a54d728 100644 --- a/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt +++ b/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt @@ -1,30 +1,18 @@ Note that it is not advisable to populate the ``INSTALL_INTERFACE`` of the -|INTERFACE_PROPERTY_LINK| of a target with paths for dependencies. -That would hard-code into installed packages the include directory paths -for dependencies **as found on the machine the package was made on**. +|INTERFACE_PROPERTY_LINK| of a target with absolute paths to the include +directories of dependencies. That would hard-code into installed packages +the include directory paths for dependencies +**as found on the machine the package was made on**. The ``INSTALL_INTERFACE`` of the |INTERFACE_PROPERTY_LINK| is only -suitable for specifying the required include directories of the target itself, -not its dependencies. +suitable for specifying the required include directories for headers +provided with the target itself, not those provided by the transitive +dependencies listed in its :prop_tgt:`INTERFACE_LINK_LIBRARIES` target +property. Those dependencies should themselves be targets that specify +their own header locations in |INTERFACE_PROPERTY_LINK|. -That is, code like this is incorrect for targets which will be used to -generate :manual:`cmake-packages(7)`: - -.. code-block:: cmake - - target_include_directories(mylib INTERFACE - $ - ) - -Dependencies must provide their own :ref:`IMPORTED targets ` -which have their own |INTERFACE_PROPERTY_LINK| populated -appropriately. Those :ref:`IMPORTED targets ` may then be -used with the :command:`target_link_libraries` command for ``mylib``. - -That way, when a consumer uses the installed package, the -consumer will run the appropriate :command:`find_package` command to find -the dependencies on their own machine and populate the -:ref:`IMPORTED targets ` with appropriate paths. See -:ref:`Creating Packages` for more. Note that many modules currently shipped -with CMake do not currently provide :ref:`IMPORTED targets `. +See the :ref:`Creating Relocatable Packages` section of the +:manual:`cmake-packages(7)` manual for discussion of additional care +that must be taken when specifying usage requirements while creating +packages for redistribution. diff --git a/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt b/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt index ceefa4d..46e84ac 100644 --- a/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt +++ b/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt @@ -1,23 +1,10 @@ Note that it is not advisable to populate the -|INTERFACE_PROPERTY_LINK| of a target with paths for dependencies. -That would hard-code into installed packages the include directory paths +|INTERFACE_PROPERTY_LINK| of a target with absolute paths to dependencies. +That would hard-code into installed packages the library file paths for dependencies **as found on the machine the package was made on**. -That is, code like this is incorrect for targets which will be used to -generate :manual:`cmake-packages(7)`: - -.. code-block:: cmake - - target_link_libraries(mylib INTERFACE - ${Boost_LIBRARIES};${OtherDep_LIBRARIES} - ) - -Dependencies must provide their own :ref:`IMPORTED targets ` -which have their own :prop_tgt:`IMPORTED_LOCATION` populated -appropriately. That way, when a consumer uses the installed package, the -consumer will run the appropriate :command:`find_package` command to find -the dependencies on their own machine and populate the -:ref:`IMPORTED targets ` with appropriate paths. See -:ref:`Creating Packages` for more. Note that many modules currently shipped -with CMake do not currently provide :ref:`IMPORTED targets `. +See the :ref:`Creating Relocatable Packages` section of the +:manual:`cmake-packages(7)` manual for discussion of additional care +that must be taken when specifying usage requirements while creating +packages for redistribution. diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index 002f2c2..ae5e58e 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -143,6 +143,11 @@ use particular :prop_tgt:`COMPILE_OPTIONS` or the properties must be **requirements**, not merely recommendations or convenience. +See the :ref:`Creating Relocatable Packages` section of the +:manual:`cmake-packages(7)` manual for discussion of additional care +that must be taken when specifying usage requirements while creating +packages for redistribution. + Target Properties ----------------- diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index 6ee9df9..28c0798 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -373,38 +373,6 @@ attempt to use version 3 together with version 4. Packages can choose to employ such a pattern if different major versions of the package are designed to be incompatible. -Note that it is not advisable to populate any properties which may contain -paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and -:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevant to dependencies. -That would hard-code into installed packages the include directory or library -paths for dependencies **as found on the machine the package was made on**. - -That is, code like this is incorrect for targets which will be used to -generate config file packages: - -.. code-block:: cmake - - target_link_libraries(ClimbingStats INTERFACE - ${Boost_LIBRARIES} ${OtherDep_LIBRARIES} - ) - target_include_directories(ClimbingStats INTERFACE - "$" - ) - -Dependencies must provide their own :ref:`IMPORTED targets ` -which have their own :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and -:prop_tgt:`IMPORTED_LOCATION` populated appropriately. Those -:ref:`IMPORTED targets ` may then be -used with the :command:`target_link_libraries` command for ``ClimbingStats``. - -That way, when a consumer uses the installed package, the -consumer will run the appropriate :command:`find_package` command (via the -find_dependency macro described below) to find -the dependencies on their own machine and populate the -:ref:`IMPORTED targets ` with appropriate paths. Note that -many modules currently shipped with CMake do not currently provide -:ref:`IMPORTED targets `. - A ``NAMESPACE`` with double-colons is specified when exporting the targets for installation. This convention of double-colons gives CMake a hint that the name is an :prop_tgt:`IMPORTED` target when it is used by downstreams @@ -418,6 +386,9 @@ directory in the :variable:`CMAKE_INSTALL_PREFIX`. When the ``IMPORTED`` target is used by downsteam, it automatically consumes the entries from that property. +Creating a Package Configuration File +------------------------------------- + In this case, the ``ClimbingStatsConfig.cmake`` file could be as simple as: .. code-block:: cmake @@ -429,44 +400,6 @@ should be provided by the ``ClimbingStats`` package, they should be in a separate file which is installed to the same location as the ``ClimbingStatsConfig.cmake`` file, and included from there. -Packages created by :command:`install(EXPORT)` are designed to be relocatable, -using paths relative to the location of the package itself. When defining -the interface of a target for ``EXPORT``, keep in mind that the include -directories should be specified as relative paths which are relative to the -:variable:`CMAKE_INSTALL_PREFIX`: - -.. code-block:: cmake - - target_include_directories(tgt INTERFACE - # Wrong, not relocatable: - $ - ) - - target_include_directories(tgt INTERFACE - # Ok, relocatable: - $ - ) - -The ``$`` -:manual:`generator expression ` may be used as -a placeholder for the install prefix without resulting in a non-relocatable -package. This is necessary if complex generator expressions are used: - -.. code-block:: cmake - - target_include_directories(tgt INTERFACE - # Ok, relocatable: - $:$/include/TgtName>> - ) - -The :command:`export(EXPORT)` command creates an :prop_tgt:`IMPORTED` targets -definition file which is specific to the build-tree, and is not relocatable. -This can similiarly be used with a suitable package configuration file and -package version file to define a package for the build tree which may be used -without installation. Consumers of the build tree can simply ensure that the -:variable:`CMAKE_PREFIX_PATH` contains the build directory, or set the -``ClimbingStats_DIR`` to ``/ClimbingStats`` in the cache. - This can also be extended to cover dependencies: .. code-block:: cmake @@ -526,6 +459,85 @@ could not be found because an invalid component was specified. This message variable can be set for any case where the ``_FOUND`` variable is set to ``False``, and will be displayed to the user. +Creating a Package Configuration File for the Build Tree +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The :command:`export(EXPORT)` command creates an :prop_tgt:`IMPORTED` targets +definition file which is specific to the build-tree, and is not relocatable. +This can similiarly be used with a suitable package configuration file and +package version file to define a package for the build tree which may be used +without installation. Consumers of the build tree can simply ensure that the +:variable:`CMAKE_PREFIX_PATH` contains the build directory, or set the +``ClimbingStats_DIR`` to ``/ClimbingStats`` in the cache. + +.. _`Creating Relocatable Packages`: + +Creating Relocatable Packages +----------------------------- + +Packages created by :command:`install(EXPORT)` are designed to be relocatable, +using paths relative to the location of the package itself. When defining +the interface of a target for ``EXPORT``, keep in mind that the include +directories should be specified as relative paths which are relative to the +:variable:`CMAKE_INSTALL_PREFIX`: + +.. code-block:: cmake + + target_include_directories(tgt INTERFACE + # Wrong, not relocatable: + $ + ) + + target_include_directories(tgt INTERFACE + # Ok, relocatable: + $ + ) + +The ``$`` +:manual:`generator expression ` may be used as +a placeholder for the install prefix without resulting in a non-relocatable +package. This is necessary if complex generator expressions are used: + +.. code-block:: cmake + + target_include_directories(tgt INTERFACE + # Ok, relocatable: + $:$/include/TgtName>> + ) + +This also applies to paths referencing external dependencies. +It is not advisable to populate any properties which may contain +paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and +:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevant to dependencies. +That would hard-code into installed packages the include directory or library +paths for dependencies **as found on the machine the package was made on**. + +That is, code like this is incorrect for targets which will be used to +generate config file packages: + +.. code-block:: cmake + + target_link_libraries(ClimbingStats INTERFACE + ${Boost_LIBRARIES} ${OtherDep_LIBRARIES} + ) + target_include_directories(ClimbingStats INTERFACE + "$" + ) + +Dependencies must provide their own :ref:`IMPORTED targets ` +which have their own :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and +:prop_tgt:`IMPORTED_LOCATION` populated appropriately. Those +:ref:`IMPORTED targets ` may then be +used with the :command:`target_link_libraries` command for ``ClimbingStats``. + +That way, when a consumer uses the installed package, the +consumer will run the appropriate :command:`find_package` command (via the +find_dependency macro described below) to find +the dependencies on their own machine and populate the +:ref:`IMPORTED targets ` with appropriate paths. Note that +many modules currently shipped with CMake do not currently provide +:ref:`IMPORTED targets `. + .. _`Package Registry`: Package Registry http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42aca28a6dc4f460b60c3c82819706132afb89cd commit 42aca28a6dc4f460b60c3c82819706132afb89cd Author: Brad King AuthorDate: Thu Apr 2 15:45:48 2015 -0400 Commit: Brad King CommitDate: Thu Apr 2 17:19:03 2015 -0400 Help: Place relocatable package notes in their own subsections These notes apply only for the use case of creating a package for redistribution on machines other than that where it is built. Clarify this to readers by placing the discussion in dedicated sections titled accordingly. diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst index 1d236ce..30ec2cb 100644 --- a/Help/command/target_include_directories.rst +++ b/Help/command/target_include_directories.rst @@ -55,5 +55,8 @@ installation prefix. For example: $ # /include/mylib ) +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` .. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index e6a82b6..88a555a 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -49,9 +49,6 @@ CMake will also propagate :ref:`usage requirements ` from linked library targets. Usage requirements of dependencies affect compilation of sources in the ````. -.. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_LINK_LIBRARIES` -.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt - If an ```` is a library in a Mac OX framework, the ``Headers`` directory of the framework will also be processed as a :ref:`usage requirement `. This has the same @@ -153,3 +150,9 @@ will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. + +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_LINK_LIBRARIES` +.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt diff --git a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst index 1cfd7a8..b1c40b2 100644 --- a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst @@ -22,5 +22,8 @@ installation prefix. For example: $ # /include/mylib ) +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_INCLUDE_DIRECTORIES`` .. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst index 55b7b8d..832d12b 100644 --- a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst +++ b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst @@ -17,5 +17,8 @@ with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_LINK_LIBRARIES`` .. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt diff --git a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst index 2e859eb..2dcf45c 100644 --- a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst +++ b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst @@ -24,5 +24,8 @@ property if policy :policy:`CMP0022` is ``NEW``. This property is deprecated. Use :prop_tgt:`INTERFACE_LINK_LIBRARIES` instead. +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. |INTERFACE_PROPERTY_LINK| replace:: ``LINK_INTERFACE_LIBRARIES`` .. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt diff --git a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst index 7f2b5dd..22ee5a6 100644 --- a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst +++ b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst @@ -13,5 +13,8 @@ property if policy :policy:`CMP0022` is ``NEW``. This property is deprecated. Use :prop_tgt:`INTERFACE_LINK_LIBRARIES` instead. +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. |INTERFACE_PROPERTY_LINK| replace:: ``LINK_INTERFACE_LIBRARIES_`` .. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eee05f2243f9dd68a7ac445716936f8e5f0db0ff commit eee05f2243f9dd68a7ac445716936f8e5f0db0ff Author: Brad King AuthorDate: Thu Apr 2 17:17:36 2015 -0400 Commit: Brad King CommitDate: Thu Apr 2 17:18:41 2015 -0400 Help: Fix typo in cmake-packages(7) manual relevnt => relevant diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index b477cab..6ee9df9 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -375,7 +375,7 @@ to be incompatible. Note that it is not advisable to populate any properties which may contain paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and -:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevnt to dependencies. +:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevant to dependencies. That would hard-code into installed packages the include directory or library paths for dependencies **as found on the machine the package was made on**. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=603bfe4e998bb951bd6cd888c665d666c498d67a commit 603bfe4e998bb951bd6cd888c665d666c498d67a Author: Brad King AuthorDate: Thu Apr 2 16:16:14 2015 -0400 Commit: Brad King CommitDate: Thu Apr 2 16:18:29 2015 -0400 Help: Fix syntax in non-relocatable usage requirements example The example in cmake-packages(7) is meant to be incorrect for use of absolute paths, not for its syntax. diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index 3367ba4..b477cab 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -385,11 +385,11 @@ generate config file packages: .. code-block:: cmake target_link_libraries(ClimbingStats INTERFACE - ${Boost_LIBRARIES};${OtherDep_LIBRARIES}> - ) + ${Boost_LIBRARIES} ${OtherDep_LIBRARIES} + ) target_include_directories(ClimbingStats INTERFACE - $ - ) + "$" + ) Dependencies must provide their own :ref:`IMPORTED targets ` which have their own :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and ----------------------------------------------------------------------- Summary of changes: Help/command/target_include_directories.rst | 3 + Help/command/target_link_libraries.rst | 210 ++++++++++++-------- .../INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt | 38 ++-- Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt | 25 +-- Help/manual/cmake-buildsystem.7.rst | 5 + Help/manual/cmake-packages.7.rst | 178 ++++++++++------- Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst | 3 + Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst | 3 + Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst | 3 + Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst | 3 + 10 files changed, 271 insertions(+), 200 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 10:13:36 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 10:13:36 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1418-g2c1a865 Message-ID: <20150403141336.B91B6AC06B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2c1a8659b984d95a73e04342c466c790d3a67c09 (commit) via fafe3a5114d5e190200a4b06b4cf70a93aa79e7a (commit) from 503f2fdd8a96c2c2ac634f1af2388d834f8e9093 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c1a8659b984d95a73e04342c466c790d3a67c09 commit 2c1a8659b984d95a73e04342c466c790d3a67c09 Merge: 503f2fd fafe3a5 Author: Brad King AuthorDate: Fri Apr 3 10:13:35 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 10:13:35 2015 -0400 Merge topic 'FindCUDA.cmake/StaticRuntime' into next fafe3a51 Help: Add notes for topic 'FindCUDA.cmake/StaticRuntime' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fafe3a5114d5e190200a4b06b4cf70a93aa79e7a commit fafe3a5114d5e190200a4b06b4cf70a93aa79e7a Author: Brad King AuthorDate: Fri Apr 3 10:12:32 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 10:12:32 2015 -0400 Help: Add notes for topic 'FindCUDA.cmake/StaticRuntime' diff --git a/Help/release/dev/FindCUDA-StaticRuntime.rst b/Help/release/dev/FindCUDA-StaticRuntime.rst new file mode 100644 index 0000000..112596c --- /dev/null +++ b/Help/release/dev/FindCUDA-StaticRuntime.rst @@ -0,0 +1,7 @@ +FindCUDA-StaticRuntime +---------------------- + +* The :module:`FindCUDA` module now defaults to using the static + CUDA runtime library if it is available. A new + ``CUDA_USE_STATIC_CUDA_RUNTIME`` option is offered to control + this behavior. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/FindCUDA-StaticRuntime.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Help/release/dev/FindCUDA-StaticRuntime.rst hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 10:14:16 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 10:14:16 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1420-gd98ab5a Message-ID: <20150403141416.87549AC553@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d98ab5a1dc910d66e073e8fbd263f6973ed8d73c (commit) via 89e9ed1b08176641781bb2f563927289edd96bc1 (commit) from 2c1a8659b984d95a73e04342c466c790d3a67c09 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d98ab5a1dc910d66e073e8fbd263f6973ed8d73c commit d98ab5a1dc910d66e073e8fbd263f6973ed8d73c Merge: 2c1a865 89e9ed1 Author: Brad King AuthorDate: Fri Apr 3 10:14:15 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 10:14:15 2015 -0400 Merge topic 'FindCUDA.cmake/StaticRuntime' into next 89e9ed1b FindCUDA: Use the static CUDA runtime library if available http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=89e9ed1b08176641781bb2f563927289edd96bc1 commit 89e9ed1b08176641781bb2f563927289edd96bc1 Author: James Bigler AuthorDate: Tue Mar 31 14:13:04 2015 -0600 Commit: Brad King CommitDate: Fri Apr 3 10:13:52 2015 -0400 FindCUDA: Use the static CUDA runtime library if available Beginning in CUDA 5.5 a static version of the cuda runtime library became available. Since nvcc defaults to using this library over the shared version, FindCUDA will also default to using this version. There are many advantages to using the static version (most importantly to avoid conflicts with multiple versions when building a CUDA based library). Offer a CUDA_USE_STATIC_CUDA_RUNTIME option to control this behavior. diff --git a/Help/release/dev/FindCUDA-StaticRuntime.rst b/Help/release/dev/FindCUDA-StaticRuntime.rst new file mode 100644 index 0000000..112596c --- /dev/null +++ b/Help/release/dev/FindCUDA-StaticRuntime.rst @@ -0,0 +1,7 @@ +FindCUDA-StaticRuntime +---------------------- + +* The :module:`FindCUDA` module now defaults to using the static + CUDA runtime library if it is available. A new + ``CUDA_USE_STATIC_CUDA_RUNTIME`` option is offered to control + this behavior. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 81e1cad..8f80993 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -106,6 +106,11 @@ # CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and # CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. # +# CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) +# -- When enabled the static version of the CUDA runtime library will be used +# in CUDA_LIBRARIES. If the version of CUDA configured doesn't support +# this option, then it will be silently disabled. +# # CUDA_VERBOSE_BUILD (Default OFF) # -- Set to ON to see all the commands used when building the CUDA file. When # using a Makefile generator the value defaults to VERBOSE (run make @@ -272,6 +277,8 @@ # CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS # implementation (alterative to: # CUDA_ADD_CUBLAS_TO_TARGET macro). +# CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. +# Only available for CUDA version 5.5+ # CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. # Only available for CUDA version 4.0+. # CUDA_curand_LIBRARY -- CUDA Random Number Generation library. @@ -518,11 +525,12 @@ macro(cuda_unset_include_and_libraries) # This only existed in the 3.0 version of the CUDA toolkit unset(CUDA_CUDARTEMU_LIBRARY CACHE) endif() - unset(CUDA_cupti_LIBRARY CACHE) + unset(CUDA_cudart_static_LIBRARY CACHE) unset(CUDA_cublas_LIBRARY CACHE) unset(CUDA_cublasemu_LIBRARY CACHE) unset(CUDA_cufft_LIBRARY CACHE) unset(CUDA_cufftemu_LIBRARY CACHE) + unset(CUDA_cupti_LIBRARY CACHE) unset(CUDA_curand_LIBRARY CACHE) unset(CUDA_cusolver_LIBRARY CACHE) unset(CUDA_cusparse_LIBRARY CACHE) @@ -532,6 +540,8 @@ macro(cuda_unset_include_and_libraries) unset(CUDA_npps_LIBRARY CACHE) unset(CUDA_nvcuvenc_LIBRARY CACHE) unset(CUDA_nvcuvid_LIBRARY CACHE) + + unset(CUDA_USE_STATIC_CUDA_RUNTIME CACHE) endmacro() # Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, @@ -539,8 +549,8 @@ endmacro() if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") unset(CUDA_TOOLKIT_TARGET_DIR CACHE) unset(CUDA_NVCC_EXECUTABLE CACHE) - unset(CUDA_VERSION CACHE) cuda_unset_include_and_libraries() + unset(CUDA_VERSION CACHE) endif() if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") @@ -696,6 +706,53 @@ if(CUDA_VERSION VERSION_EQUAL "3.0") CUDA_CUDARTEMU_LIBRARY ) endif() +if(NOT CUDA_VERSION VERSION_LESS "5.5") + cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") + mark_as_advanced(CUDA_cudart_static_LIBRARY) +endif() +if(CUDA_cudart_static_LIBRARY) + # Set whether to use the static cuda runtime. + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) +else() + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" OFF) +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + if(UNIX) + # Check for the dependent libraries. Here we look for pthreads. + if (DEFINED CMAKE_THREAD_PREFER_PTHREAD) + set(_cuda_cmake_thread_prefer_pthread ${CMAKE_THREAD_PREFER_PTHREAD}) + endif() + set(CMAKE_THREAD_PREFER_PTHREAD 1) + + # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} + # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and + # -Werror causes the try_compile to fail. We will just temporarily disable other flags + # when doing the find_package command here. + set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) + set(CMAKE_C_FLAGS "-fPIC") + find_package(Threads REQUIRED) + set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) + + if (DEFINED _cuda_cmake_thread_prefer_pthread) + set(CMAKE_THREAD_PREFER_PTHREAD ${_cuda_cmake_thread_prefer_pthread}) + unset(_cuda_cmake_thread_prefer_pthread) + else() + unset(CMAKE_THREAD_PREFER_PTHREAD) + endif() + if (NOT APPLE) + # Here is librt that has things such as, clock_gettime, shm_open, and shm_unlink. + find_library(CUDA_rt_LIBRARY rt) + find_library(CUDA_dl_LIBRARY dl) + if (NOT CUDA_rt_LIBRARY) + message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") + endif() + if (NOT CUDA_dl_LIBRARY) + message(WARNING "Expecting to find libdl for libcudart_static, but didn't find it.") + endif() + endif() + endif() +endif() # CUPTI library showed up in cuda toolkit 4.0 if(NOT CUDA_VERSION VERSION_LESS "4.0") @@ -703,12 +760,32 @@ if(NOT CUDA_VERSION VERSION_LESS "4.0") mark_as_advanced(CUDA_cupti_LIBRARY) endif() +# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are +# using the CUDA runtime. For the dynamic version of the runtime, most of the +# dependencies are brough in, but for the static version there are additional libraries +# and linker commands needed. +# Initialize to empty +set(CUDA_LIBRARIES) + # If we are using emulation mode and we found the cudartemu library then use # that one instead of cudart. if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) - set(CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) +elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) + if (CUDA_rt_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) + endif() + if (CUDA_dl_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_dl_LIBRARY}) + endif() + if(APPLE) + # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that + # the static cuda runtime can find it at runtime. + list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) + endif() else() - set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) endif() # 1.1 toolkit on linux doesn't appear to have a separate library on ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 10:15:30 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 10:15:30 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1422-ge4ecfe3 Message-ID: <20150403141530.641E7ACD52@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e4ecfe3573f66ab009c156e34e3365942573a362 (commit) via 7fea2b77df2d70283f4918a8ff52836dbc68db6b (commit) from d98ab5a1dc910d66e073e8fbd263f6973ed8d73c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4ecfe3573f66ab009c156e34e3365942573a362 commit e4ecfe3573f66ab009c156e34e3365942573a362 Merge: d98ab5a 7fea2b7 Author: Brad King AuthorDate: Fri Apr 3 10:15:29 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 10:15:29 2015 -0400 Merge topic 'FindCUDA.cmake/StaticRuntime' into next 7fea2b77 FindCUDA: Use the static CUDA runtime library if available (#15482) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7fea2b77df2d70283f4918a8ff52836dbc68db6b commit 7fea2b77df2d70283f4918a8ff52836dbc68db6b Author: James Bigler AuthorDate: Tue Mar 31 14:13:04 2015 -0600 Commit: Brad King CommitDate: Fri Apr 3 10:15:17 2015 -0400 FindCUDA: Use the static CUDA runtime library if available (#15482) Beginning in CUDA 5.5 a static version of the cuda runtime library became available. Since nvcc defaults to using this library over the shared version, FindCUDA will also default to using this version. There are many advantages to using the static version (most importantly to avoid conflicts with multiple versions when building a CUDA based library). Offer a CUDA_USE_STATIC_CUDA_RUNTIME option to control this behavior. diff --git a/Help/release/dev/FindCUDA-StaticRuntime.rst b/Help/release/dev/FindCUDA-StaticRuntime.rst new file mode 100644 index 0000000..112596c --- /dev/null +++ b/Help/release/dev/FindCUDA-StaticRuntime.rst @@ -0,0 +1,7 @@ +FindCUDA-StaticRuntime +---------------------- + +* The :module:`FindCUDA` module now defaults to using the static + CUDA runtime library if it is available. A new + ``CUDA_USE_STATIC_CUDA_RUNTIME`` option is offered to control + this behavior. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 81e1cad..8f80993 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -106,6 +106,11 @@ # CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and # CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. # +# CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) +# -- When enabled the static version of the CUDA runtime library will be used +# in CUDA_LIBRARIES. If the version of CUDA configured doesn't support +# this option, then it will be silently disabled. +# # CUDA_VERBOSE_BUILD (Default OFF) # -- Set to ON to see all the commands used when building the CUDA file. When # using a Makefile generator the value defaults to VERBOSE (run make @@ -272,6 +277,8 @@ # CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS # implementation (alterative to: # CUDA_ADD_CUBLAS_TO_TARGET macro). +# CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. +# Only available for CUDA version 5.5+ # CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. # Only available for CUDA version 4.0+. # CUDA_curand_LIBRARY -- CUDA Random Number Generation library. @@ -518,11 +525,12 @@ macro(cuda_unset_include_and_libraries) # This only existed in the 3.0 version of the CUDA toolkit unset(CUDA_CUDARTEMU_LIBRARY CACHE) endif() - unset(CUDA_cupti_LIBRARY CACHE) + unset(CUDA_cudart_static_LIBRARY CACHE) unset(CUDA_cublas_LIBRARY CACHE) unset(CUDA_cublasemu_LIBRARY CACHE) unset(CUDA_cufft_LIBRARY CACHE) unset(CUDA_cufftemu_LIBRARY CACHE) + unset(CUDA_cupti_LIBRARY CACHE) unset(CUDA_curand_LIBRARY CACHE) unset(CUDA_cusolver_LIBRARY CACHE) unset(CUDA_cusparse_LIBRARY CACHE) @@ -532,6 +540,8 @@ macro(cuda_unset_include_and_libraries) unset(CUDA_npps_LIBRARY CACHE) unset(CUDA_nvcuvenc_LIBRARY CACHE) unset(CUDA_nvcuvid_LIBRARY CACHE) + + unset(CUDA_USE_STATIC_CUDA_RUNTIME CACHE) endmacro() # Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, @@ -539,8 +549,8 @@ endmacro() if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") unset(CUDA_TOOLKIT_TARGET_DIR CACHE) unset(CUDA_NVCC_EXECUTABLE CACHE) - unset(CUDA_VERSION CACHE) cuda_unset_include_and_libraries() + unset(CUDA_VERSION CACHE) endif() if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") @@ -696,6 +706,53 @@ if(CUDA_VERSION VERSION_EQUAL "3.0") CUDA_CUDARTEMU_LIBRARY ) endif() +if(NOT CUDA_VERSION VERSION_LESS "5.5") + cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") + mark_as_advanced(CUDA_cudart_static_LIBRARY) +endif() +if(CUDA_cudart_static_LIBRARY) + # Set whether to use the static cuda runtime. + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) +else() + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" OFF) +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + if(UNIX) + # Check for the dependent libraries. Here we look for pthreads. + if (DEFINED CMAKE_THREAD_PREFER_PTHREAD) + set(_cuda_cmake_thread_prefer_pthread ${CMAKE_THREAD_PREFER_PTHREAD}) + endif() + set(CMAKE_THREAD_PREFER_PTHREAD 1) + + # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} + # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and + # -Werror causes the try_compile to fail. We will just temporarily disable other flags + # when doing the find_package command here. + set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) + set(CMAKE_C_FLAGS "-fPIC") + find_package(Threads REQUIRED) + set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) + + if (DEFINED _cuda_cmake_thread_prefer_pthread) + set(CMAKE_THREAD_PREFER_PTHREAD ${_cuda_cmake_thread_prefer_pthread}) + unset(_cuda_cmake_thread_prefer_pthread) + else() + unset(CMAKE_THREAD_PREFER_PTHREAD) + endif() + if (NOT APPLE) + # Here is librt that has things such as, clock_gettime, shm_open, and shm_unlink. + find_library(CUDA_rt_LIBRARY rt) + find_library(CUDA_dl_LIBRARY dl) + if (NOT CUDA_rt_LIBRARY) + message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") + endif() + if (NOT CUDA_dl_LIBRARY) + message(WARNING "Expecting to find libdl for libcudart_static, but didn't find it.") + endif() + endif() + endif() +endif() # CUPTI library showed up in cuda toolkit 4.0 if(NOT CUDA_VERSION VERSION_LESS "4.0") @@ -703,12 +760,32 @@ if(NOT CUDA_VERSION VERSION_LESS "4.0") mark_as_advanced(CUDA_cupti_LIBRARY) endif() +# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are +# using the CUDA runtime. For the dynamic version of the runtime, most of the +# dependencies are brough in, but for the static version there are additional libraries +# and linker commands needed. +# Initialize to empty +set(CUDA_LIBRARIES) + # If we are using emulation mode and we found the cudartemu library then use # that one instead of cudart. if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) - set(CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) +elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) + if (CUDA_rt_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) + endif() + if (CUDA_dl_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_dl_LIBRARY}) + endif() + if(APPLE) + # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that + # the static cuda runtime can find it at runtime. + list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) + endif() else() - set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) endif() # 1.1 toolkit on linux doesn't appear to have a separate library on ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 10:17:15 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 10:17:15 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-598-g4bf56c3 Message-ID: <20150403141715.85E0EACEED@public.kitware.com> This is an automated email from 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 4bf56c331beb38ee5a2245829277460f7e9333ad (commit) via 82c51a8ac6c4a8fba127402d96f8269492f3a115 (commit) from 2978a5549acd9a55582ab42ae774e75ddf2b606f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bf56c331beb38ee5a2245829277460f7e9333ad commit 4bf56c331beb38ee5a2245829277460f7e9333ad Merge: 2978a55 82c51a8 Author: Brad King AuthorDate: Fri Apr 3 10:17:14 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 10:17:14 2015 -0400 Merge topic 'fix-liblzma-XL-optimize' 82c51a8a liblzma: Disable XL compiler optimizations in one source to avoid crash ----------------------------------------------------------------------- Summary of changes: Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c | 3 +++ 1 file changed, 3 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 10:17:17 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 10:17:17 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-600-ge46224a Message-ID: <20150403141717.D33D9ACEEE@public.kitware.com> This is an automated email from 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 e46224a7cdbcbbfce63f21096bf2b4a5f01c3c13 (commit) via 7fea2b77df2d70283f4918a8ff52836dbc68db6b (commit) from 4bf56c331beb38ee5a2245829277460f7e9333ad (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e46224a7cdbcbbfce63f21096bf2b4a5f01c3c13 commit e46224a7cdbcbbfce63f21096bf2b4a5f01c3c13 Merge: 4bf56c3 7fea2b7 Author: Brad King AuthorDate: Fri Apr 3 10:17:16 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 10:17:16 2015 -0400 Merge topic 'FindCUDA.cmake/StaticRuntime' 7fea2b77 FindCUDA: Use the static CUDA runtime library if available (#15482) ----------------------------------------------------------------------- Summary of changes: Help/release/dev/FindCUDA-StaticRuntime.rst | 7 +++ Modules/FindCUDA.cmake | 85 +++++++++++++++++++++++++-- 2 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 Help/release/dev/FindCUDA-StaticRuntime.rst hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 10:17:37 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 10:17:37 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1426-g006f549 Message-ID: <20150403141737.AF260ACEFC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 006f54976dc6aee8aee37730171b19724cac852a (commit) via e46224a7cdbcbbfce63f21096bf2b4a5f01c3c13 (commit) via 4bf56c331beb38ee5a2245829277460f7e9333ad (commit) via 2978a5549acd9a55582ab42ae774e75ddf2b606f (commit) from e4ecfe3573f66ab009c156e34e3365942573a362 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=006f54976dc6aee8aee37730171b19724cac852a commit 006f54976dc6aee8aee37730171b19724cac852a Merge: e4ecfe3 e46224a Author: Brad King AuthorDate: Fri Apr 3 10:17:29 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 10:17:29 2015 -0400 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 Apr 3 10:53:53 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 10:53:53 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1433-gb887785 Message-ID: <20150403145353.2AC43AD8B6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b887785b7a0c921ef59f1de451d2f26f343c33b1 (commit) via 2e6ea309b38acc915aff0b6dec13c5eda1ad1739 (commit) via 3af137824d993ca0a7c18c0768efb12b76154ad0 (commit) via 227992c3a693bb56ee6f6600a10c6eb19c6fb311 (commit) via 031d894fb882ca2e8c2269ba1674578f82155420 (commit) via 6e331ce9d47c8f9adbf29ee0158b4307debbc02c (commit) via ba9b9d79fb1a753c564be44e17e2d3b979f8108c (commit) from 006f54976dc6aee8aee37730171b19724cac852a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b887785b7a0c921ef59f1de451d2f26f343c33b1 commit b887785b7a0c921ef59f1de451d2f26f343c33b1 Merge: 006f549 2e6ea309 Author: Brad King AuthorDate: Fri Apr 3 10:53:52 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 10:53:52 2015 -0400 Merge topic 'doc-target_link_libraries' into next 2e6ea309 Help: Revise target_link_libraries command documentation 3af13782 Help: Update discussion of relocable packages in cmake-packages(7) 227992c3 Help: Reorganize and refine discussion of relocatable packages 031d894f Help: Place relocatable package notes in their own subsections 6e331ce9 Help: Fix typo in cmake-packages(7) manual ba9b9d79 Help: Fix syntax in non-relocatable usage requirements example http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e6ea309b38acc915aff0b6dec13c5eda1ad1739 commit 2e6ea309b38acc915aff0b6dec13c5eda1ad1739 Author: Brad King AuthorDate: Thu Apr 2 15:41:06 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 10:52:36 2015 -0400 Help: Revise target_link_libraries command documentation Organize the documentation into subsections to separate the signatures. Refactor the discussion of allowed link items into bullet points and expand into more detail on each. diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index 88a555a..e0b1667 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -1,38 +1,102 @@ target_link_libraries --------------------- -Link a target to given libraries. +.. only:: html + + .. contents:: + +Specify libraries or flags to use when linking a given target and/or +its dependents. :ref:`Usage requirements ` +from linked library targets will be propagated. Usage requirements +of a target's dependencies affect compilation of its own sources. + +Overview +^^^^^^^^ + +This command has several signatures as detailed in subsections below. +All of them have the general form:: + + target_link_libraries( ... ... ...) + +The named ```` must have been created in the current directory by +a command such as :command:`add_executable` or :command:`add_library`. +Repeated calls for the same ```` append items in the order called. +Each ```` may be: + +* **A library target name**: The generated link line will have the + full path to the linkable library file associated with the target. + The buildsystem will have a dependency to re-link ```` if + the library file changes. + + The named target must be created by :command:`add_library` within + the project or as an :ref:`IMPORTED library `. + If it is created within the project an ordering dependency will + automatically be added in the build system to make sure the named + library target is up-to-date before the ```` links. + +* **A full path to a library file**: The generated link line will + normally preserve the full path to the file. However, there are + some cases where CMake must ask the linker to search for the library + (e.g. ``-lfoo``), such as when it appears in a system library directory + that the compiler front-end may replace with an alternative. + Either way, the buildsystem will have a dependency to re-link + ```` if the library file changes. + + If the library file is in a Mac OSX framework, the ``Headers`` directory + of the framework will also be processed as a + :ref:`usage requirement `. This has the same + effect as passing the framework directory as an include directory. + +* **A plain library name**: The generated link line will ask the linker + to search for the library (e.g. ``-lfoo``). + +* **A link flag**: Item names starting with ``-``, but not ``-l`` or + ``-framework``, are treated as linker flags. Note that such flags will + be treated like any other library link item for purposes of transitive + dependencies, so they are generally safe to specify only as private link + items that will not propagate to dependents. + +* A ``debug``, ``optimized``, or ``general`` keyword immediately followed + by another ````. The item following such a keyword will be used + only for the corresponding build configuration. The ``debug`` keyword + corresponds to the ``Debug`` configuration (or to configurations named + in the :prop_gbl:`DEBUG_CONFIGURATIONS` global property if it is set). + The ``optimized`` keyword corresponds to all other configurations. The + ``general`` keyword corresponds to all configurations, and is purely + optional. Higher granularity may be achieved for per-configuration + rules by creating and linking to + :ref:`IMPORTED library targets `. + +Arguments to ``target_link_libraries`` may use "generator expressions" +with the syntax ``$<...>``. Note however, that generator expressions +will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`. +See the :manual:`cmake-generator-expressions(7)` manual for available +expressions. See the :manual:`cmake-buildsystem(7)` manual for more on +defining buildsystem properties. + +Libraries for a Target and/or its Dependents +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +:: + + target_link_libraries( + ... + [ ...]...) + +The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` keywords can be used to +specify both the link dependencies and the link interface in one command. +Libraries and targets following ``PUBLIC`` are linked to, and are made +part of the link interface. Libraries and targets following ``PRIVATE`` +are linked to, but are not made part of the link interface. Libraries +following ``INTERFACE`` are appended to the link interface and are not +used for linking ````. + +Libraries for both a Target and its Dependents +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: - target_link_libraries( [item1 [item2 [...]]] - [[debug|optimized|general] ] ...) - -Specify libraries or flags to use when linking a given target. The -named ```` must have been created in the current directory by a -command such as :command:`add_executable` or :command:`add_library`. The -remaining arguments specify library names or flags. Repeated calls for -the same ```` append items in the order called. - -If a library name matches that of another target in the project a -dependency will automatically be added in the build system to make sure -the library being linked is up-to-date before the target links. Item names -starting with ``-``, but not ``-l`` or ``-framework``, are treated as -linker flags. Note that such flags will be treated like any other library -link item for purposes of transitive dependencies, so they are generally -safe to specify only as private link items that will not propagate to -dependents of ````. - -A ``debug``, ``optimized``, or ``general`` keyword indicates that the -library immediately following it is to be used only for the -corresponding build configuration. The ``debug`` keyword corresponds to -the Debug configuration (or to configurations named in the -:prop_gbl:`DEBUG_CONFIGURATIONS` global property if it is set). The -``optimized`` keyword corresponds to all other configurations. The -``general`` keyword corresponds to all configurations, and is purely -optional (assumed if omitted). Higher granularity may be achieved for -per-configuration rules by creating and linking to -:ref:`IMPORTED library targets `. + target_link_libraries( ...) Library dependencies are transitive by default with this signature. When this target is linked into another target then the libraries @@ -45,37 +109,34 @@ by setting the property directly. When :policy:`CMP0022` is not set to of this command may set the property making any libraries linked exclusively by this signature private. -CMake will also propagate :ref:`usage requirements ` -from linked library targets. Usage requirements of dependencies affect -compilation of sources in the ````. - -If an ```` is a library in a Mac OX framework, the ``Headers`` -directory of the framework will also be processed as a -:ref:`usage requirement `. This has the same -effect as passing the framework directory as an include directory. - --------------------------------------------------------------------------- +Libraries for a Target and/or its Dependents (Legacy) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: target_link_libraries( - ... - [ ... ] ...]) + ... + [ ...]...) -The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` keywords can be used to -specify both the link dependencies and the link interface in one command. -Libraries and targets following ``PUBLIC`` are linked to, and are made -part of the link interface. Libraries and targets following ``PRIVATE`` -are linked to, but are not made part of the link interface. Libraries -following ``INTERFACE`` are appended to the link interface and are not -used for linking ````. +The ``LINK_PUBLIC`` and ``LINK_PRIVATE`` modes can be used to specify both +the link dependencies and the link interface in one command. --------------------------------------------------------------------------- +This signature is for compatibility only. Prefer the ``PUBLIC`` or +``PRIVATE`` keywords instead. + +Libraries and targets following ``LINK_PUBLIC`` are linked to, and are +made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy +:policy:`CMP0022` is not ``NEW``, they are also made part of the +:prop_tgt:`LINK_INTERFACE_LIBRARIES`. Libraries and targets following +``LINK_PRIVATE`` are linked to, but are not made part of the +:prop_tgt:`INTERFACE_LINK_LIBRARIES` (or :prop_tgt:`LINK_INTERFACE_LIBRARIES`). + +Libraries for Dependents Only (Legacy) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: - target_link_libraries( LINK_INTERFACE_LIBRARIES - [[debug|optimized|general] ] ...) + target_link_libraries( LINK_INTERFACE_LIBRARIES ...) The ``LINK_INTERFACE_LIBRARIES`` mode appends the libraries to the :prop_tgt:`INTERFACE_LINK_LIBRARIES` target property instead of using them @@ -99,28 +160,8 @@ is not ``NEW``, they are also appended to the ``general`` (or without any keyword) are treated as if specified for both ``debug`` and ``optimized``. --------------------------------------------------------------------------- - -:: - - target_link_libraries( - - [[debug|optimized|general] ] ... - [ - [[debug|optimized|general] ] ...]) - -The ``LINK_PUBLIC`` and ``LINK_PRIVATE`` modes can be used to specify both -the link dependencies and the link interface in one command. - -This signature is for compatibility only. Prefer the ``PUBLIC`` or -``PRIVATE`` keywords instead. - -Libraries and targets following ``LINK_PUBLIC`` are linked to, and are -made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy -:policy:`CMP0022` is not ``NEW``, they are also made part of the -:prop_tgt:`LINK_INTERFACE_LIBRARIES`. Libraries and targets following -``LINK_PRIVATE`` are linked to, but are not made part of the -:prop_tgt:`INTERFACE_LINK_LIBRARIES` (or :prop_tgt:`LINK_INTERFACE_LIBRARIES`). +Cyclic Dependencies of Static Libraries +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The library dependency graph is normally acyclic (a DAG), but in the case of mutually-dependent ``STATIC`` libraries CMake allows the graph to @@ -139,17 +180,11 @@ For example, the code links ``main`` to ``A B A B``. While one repetition is usually sufficient, pathological object file and symbol arrangements can require -more. One may handle such cases by manually repeating the component in -the last ``target_link_libraries`` call. However, if two archives are -really so interdependent they should probably be combined into a single -archive. - -Arguments to target_link_libraries may use "generator expressions" -with the syntax ``$<...>``. Note however, that generator expressions -will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`. -See the :manual:`cmake-generator-expressions(7)` manual for available -expressions. See the :manual:`cmake-buildsystem(7)` manual for more on -defining buildsystem properties. +more. One may handle such cases by using the +:prop_tgt:`LINK_INTERFACE_MULTIPLICITY` target property or by manually +repeating the component in the last ``target_link_libraries`` call. +However, if two archives are really so interdependent they should probably +be combined into a single archive, perhaps by using :ref:`Object Libraries`. Creating Relocatable Packages ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3af137824d993ca0a7c18c0768efb12b76154ad0 commit 3af137824d993ca0a7c18c0768efb12b76154ad0 Author: Brad King AuthorDate: Fri Apr 3 09:57:05 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 10:52:35 2015 -0400 Help: Update discussion of relocable packages in cmake-packages(7) Explain at the beginning of the section the requirements for a package to be relocatable to justify the rest of the section content. Generalize example to use fictional package names instead of real ones, especially because FindBoost provides no alternative yet. Reword the discussion to represent the preferred approach as "ideal" but also suggest workarounds when find modules do not provide the imported targets. diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index 28c0798..b9073a5 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -475,6 +475,10 @@ without installation. Consumers of the build tree can simply ensure that the Creating Relocatable Packages ----------------------------- +A relocatable package must not reference absolute paths of files on +the machine where the package is built that will not exist on the +machines where the package may be installed. + Packages created by :command:`install(EXPORT)` are designed to be relocatable, using paths relative to the location of the package itself. When defining the interface of a target for ``EXPORT``, keep in mind that the include @@ -509,34 +513,56 @@ This also applies to paths referencing external dependencies. It is not advisable to populate any properties which may contain paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevant to dependencies. -That would hard-code into installed packages the include directory or library -paths for dependencies **as found on the machine the package was made on**. - -That is, code like this is incorrect for targets which will be used to -generate config file packages: +For example, this code may not work well for a relocatable package: .. code-block:: cmake target_link_libraries(ClimbingStats INTERFACE - ${Boost_LIBRARIES} ${OtherDep_LIBRARIES} + ${Foo_LIBRARIES} ${Bar_LIBRARIES} ) target_include_directories(ClimbingStats INTERFACE - "$" + "$" ) -Dependencies must provide their own :ref:`IMPORTED targets ` -which have their own :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and -:prop_tgt:`IMPORTED_LOCATION` populated appropriately. Those -:ref:`IMPORTED targets ` may then be -used with the :command:`target_link_libraries` command for ``ClimbingStats``. - -That way, when a consumer uses the installed package, the -consumer will run the appropriate :command:`find_package` command (via the -find_dependency macro described below) to find -the dependencies on their own machine and populate the -:ref:`IMPORTED targets ` with appropriate paths. Note that -many modules currently shipped with CMake do not currently provide -:ref:`IMPORTED targets `. +The referenced variables may contain the absolute paths to libraries +and include directories **as found on the machine the package was made on**. +This would create a package with hard-coded paths to dependencies and not +suitable for relocation. + +Ideally such dependencies should be used through their own +:ref:`IMPORTED targets ` that have their own +:prop_tgt:`IMPORTED_LOCATION` and usage requirement properties +such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` populated +appropriately. Those imported targets may then be used with +the :command:`target_link_libraries` command for ``ClimbingStats``: + +.. code-block:: cmake + + target_link_libraries(ClimbingStats INTERFACE Foo::Foo Bar::Bar) + +With this approach the package references its external dependencies +only through the names of :ref:`IMPORTED targets `. +When a consumer uses the installed package, the consumer will run the +appropriate :command:`find_package` commands (via the ``find_dependency`` +macro described above) to find the dependencies and populate the +imported targets with appropriate paths on their own machine. + +Unfortunately many :manual:`modules ` shipped with +CMake do not yet provide :ref:`IMPORTED targets ` +because their development pre-dated this approach. This may improve +incrementally over time. Workarounds to create relocatable packages +using such modules include: + +* When building the package, specify each ``Foo_LIBRARY`` cache + entry as just a library name, e.g. ``-DFoo_LIBRARY=foo``. This + tells the corresponding find module to populate the ``Foo_LIBRARIES`` + with just ``foo`` to ask the linker to search for the library + instead of hard-coding a path. + +* Or, after installing the package content but before creating the + package installation binary for redistribution, manually replace + the absolute paths with placeholders for substitution by the + installation tool when the package is installed. .. _`Package Registry`: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=227992c3a693bb56ee6f6600a10c6eb19c6fb311 commit 227992c3a693bb56ee6f6600a10c6eb19c6fb311 Author: Brad King AuthorDate: Thu Apr 2 16:12:00 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 10:52:24 2015 -0400 Help: Reorganize and refine discussion of relocatable packages Re-organize the content added to the cmake-packages(7) manual by * commit v3.0.0-rc1~184^2 (Help: Document export(EXPORT) in the cmake-packages manual, 2013-12-23), * commit v3.0.0-rc1~154^2~1 (Help: Add notes about relocatability of config-file packages, 2014-01-07), and * commit v3.2.0-rc1~345^2 (Help: Warn that paths should not be used in INTERFACE_ build properties, 2014-11-22). These commits broke the natural flow of the original manual and made wording after the new content make less sense. Move the content into new subsections to restore the flow of the original manual and to make explicitly the purpose of the new content. Shorten the relocatable usage requirement "warnings". Refer to the new cmake-packages(7) manual subsection to reduce duplication. Also clarify the distinction between paths to library dependencies and paths to their header files. diff --git a/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt b/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt index 33f7183..a54d728 100644 --- a/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt +++ b/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt @@ -1,30 +1,18 @@ Note that it is not advisable to populate the ``INSTALL_INTERFACE`` of the -|INTERFACE_PROPERTY_LINK| of a target with paths for dependencies. -That would hard-code into installed packages the include directory paths -for dependencies **as found on the machine the package was made on**. +|INTERFACE_PROPERTY_LINK| of a target with absolute paths to the include +directories of dependencies. That would hard-code into installed packages +the include directory paths for dependencies +**as found on the machine the package was made on**. The ``INSTALL_INTERFACE`` of the |INTERFACE_PROPERTY_LINK| is only -suitable for specifying the required include directories of the target itself, -not its dependencies. +suitable for specifying the required include directories for headers +provided with the target itself, not those provided by the transitive +dependencies listed in its :prop_tgt:`INTERFACE_LINK_LIBRARIES` target +property. Those dependencies should themselves be targets that specify +their own header locations in |INTERFACE_PROPERTY_LINK|. -That is, code like this is incorrect for targets which will be used to -generate :manual:`cmake-packages(7)`: - -.. code-block:: cmake - - target_include_directories(mylib INTERFACE - $ - ) - -Dependencies must provide their own :ref:`IMPORTED targets ` -which have their own |INTERFACE_PROPERTY_LINK| populated -appropriately. Those :ref:`IMPORTED targets ` may then be -used with the :command:`target_link_libraries` command for ``mylib``. - -That way, when a consumer uses the installed package, the -consumer will run the appropriate :command:`find_package` command to find -the dependencies on their own machine and populate the -:ref:`IMPORTED targets ` with appropriate paths. See -:ref:`Creating Packages` for more. Note that many modules currently shipped -with CMake do not currently provide :ref:`IMPORTED targets `. +See the :ref:`Creating Relocatable Packages` section of the +:manual:`cmake-packages(7)` manual for discussion of additional care +that must be taken when specifying usage requirements while creating +packages for redistribution. diff --git a/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt b/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt index ceefa4d..46e84ac 100644 --- a/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt +++ b/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt @@ -1,23 +1,10 @@ Note that it is not advisable to populate the -|INTERFACE_PROPERTY_LINK| of a target with paths for dependencies. -That would hard-code into installed packages the include directory paths +|INTERFACE_PROPERTY_LINK| of a target with absolute paths to dependencies. +That would hard-code into installed packages the library file paths for dependencies **as found on the machine the package was made on**. -That is, code like this is incorrect for targets which will be used to -generate :manual:`cmake-packages(7)`: - -.. code-block:: cmake - - target_link_libraries(mylib INTERFACE - ${Boost_LIBRARIES};${OtherDep_LIBRARIES} - ) - -Dependencies must provide their own :ref:`IMPORTED targets ` -which have their own :prop_tgt:`IMPORTED_LOCATION` populated -appropriately. That way, when a consumer uses the installed package, the -consumer will run the appropriate :command:`find_package` command to find -the dependencies on their own machine and populate the -:ref:`IMPORTED targets ` with appropriate paths. See -:ref:`Creating Packages` for more. Note that many modules currently shipped -with CMake do not currently provide :ref:`IMPORTED targets `. +See the :ref:`Creating Relocatable Packages` section of the +:manual:`cmake-packages(7)` manual for discussion of additional care +that must be taken when specifying usage requirements while creating +packages for redistribution. diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index 002f2c2..ae5e58e 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -143,6 +143,11 @@ use particular :prop_tgt:`COMPILE_OPTIONS` or the properties must be **requirements**, not merely recommendations or convenience. +See the :ref:`Creating Relocatable Packages` section of the +:manual:`cmake-packages(7)` manual for discussion of additional care +that must be taken when specifying usage requirements while creating +packages for redistribution. + Target Properties ----------------- diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index 6ee9df9..28c0798 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -373,38 +373,6 @@ attempt to use version 3 together with version 4. Packages can choose to employ such a pattern if different major versions of the package are designed to be incompatible. -Note that it is not advisable to populate any properties which may contain -paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and -:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevant to dependencies. -That would hard-code into installed packages the include directory or library -paths for dependencies **as found on the machine the package was made on**. - -That is, code like this is incorrect for targets which will be used to -generate config file packages: - -.. code-block:: cmake - - target_link_libraries(ClimbingStats INTERFACE - ${Boost_LIBRARIES} ${OtherDep_LIBRARIES} - ) - target_include_directories(ClimbingStats INTERFACE - "$" - ) - -Dependencies must provide their own :ref:`IMPORTED targets ` -which have their own :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and -:prop_tgt:`IMPORTED_LOCATION` populated appropriately. Those -:ref:`IMPORTED targets ` may then be -used with the :command:`target_link_libraries` command for ``ClimbingStats``. - -That way, when a consumer uses the installed package, the -consumer will run the appropriate :command:`find_package` command (via the -find_dependency macro described below) to find -the dependencies on their own machine and populate the -:ref:`IMPORTED targets ` with appropriate paths. Note that -many modules currently shipped with CMake do not currently provide -:ref:`IMPORTED targets `. - A ``NAMESPACE`` with double-colons is specified when exporting the targets for installation. This convention of double-colons gives CMake a hint that the name is an :prop_tgt:`IMPORTED` target when it is used by downstreams @@ -418,6 +386,9 @@ directory in the :variable:`CMAKE_INSTALL_PREFIX`. When the ``IMPORTED`` target is used by downsteam, it automatically consumes the entries from that property. +Creating a Package Configuration File +------------------------------------- + In this case, the ``ClimbingStatsConfig.cmake`` file could be as simple as: .. code-block:: cmake @@ -429,44 +400,6 @@ should be provided by the ``ClimbingStats`` package, they should be in a separate file which is installed to the same location as the ``ClimbingStatsConfig.cmake`` file, and included from there. -Packages created by :command:`install(EXPORT)` are designed to be relocatable, -using paths relative to the location of the package itself. When defining -the interface of a target for ``EXPORT``, keep in mind that the include -directories should be specified as relative paths which are relative to the -:variable:`CMAKE_INSTALL_PREFIX`: - -.. code-block:: cmake - - target_include_directories(tgt INTERFACE - # Wrong, not relocatable: - $ - ) - - target_include_directories(tgt INTERFACE - # Ok, relocatable: - $ - ) - -The ``$`` -:manual:`generator expression ` may be used as -a placeholder for the install prefix without resulting in a non-relocatable -package. This is necessary if complex generator expressions are used: - -.. code-block:: cmake - - target_include_directories(tgt INTERFACE - # Ok, relocatable: - $:$/include/TgtName>> - ) - -The :command:`export(EXPORT)` command creates an :prop_tgt:`IMPORTED` targets -definition file which is specific to the build-tree, and is not relocatable. -This can similiarly be used with a suitable package configuration file and -package version file to define a package for the build tree which may be used -without installation. Consumers of the build tree can simply ensure that the -:variable:`CMAKE_PREFIX_PATH` contains the build directory, or set the -``ClimbingStats_DIR`` to ``/ClimbingStats`` in the cache. - This can also be extended to cover dependencies: .. code-block:: cmake @@ -526,6 +459,85 @@ could not be found because an invalid component was specified. This message variable can be set for any case where the ``_FOUND`` variable is set to ``False``, and will be displayed to the user. +Creating a Package Configuration File for the Build Tree +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The :command:`export(EXPORT)` command creates an :prop_tgt:`IMPORTED` targets +definition file which is specific to the build-tree, and is not relocatable. +This can similiarly be used with a suitable package configuration file and +package version file to define a package for the build tree which may be used +without installation. Consumers of the build tree can simply ensure that the +:variable:`CMAKE_PREFIX_PATH` contains the build directory, or set the +``ClimbingStats_DIR`` to ``/ClimbingStats`` in the cache. + +.. _`Creating Relocatable Packages`: + +Creating Relocatable Packages +----------------------------- + +Packages created by :command:`install(EXPORT)` are designed to be relocatable, +using paths relative to the location of the package itself. When defining +the interface of a target for ``EXPORT``, keep in mind that the include +directories should be specified as relative paths which are relative to the +:variable:`CMAKE_INSTALL_PREFIX`: + +.. code-block:: cmake + + target_include_directories(tgt INTERFACE + # Wrong, not relocatable: + $ + ) + + target_include_directories(tgt INTERFACE + # Ok, relocatable: + $ + ) + +The ``$`` +:manual:`generator expression ` may be used as +a placeholder for the install prefix without resulting in a non-relocatable +package. This is necessary if complex generator expressions are used: + +.. code-block:: cmake + + target_include_directories(tgt INTERFACE + # Ok, relocatable: + $:$/include/TgtName>> + ) + +This also applies to paths referencing external dependencies. +It is not advisable to populate any properties which may contain +paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and +:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevant to dependencies. +That would hard-code into installed packages the include directory or library +paths for dependencies **as found on the machine the package was made on**. + +That is, code like this is incorrect for targets which will be used to +generate config file packages: + +.. code-block:: cmake + + target_link_libraries(ClimbingStats INTERFACE + ${Boost_LIBRARIES} ${OtherDep_LIBRARIES} + ) + target_include_directories(ClimbingStats INTERFACE + "$" + ) + +Dependencies must provide their own :ref:`IMPORTED targets ` +which have their own :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and +:prop_tgt:`IMPORTED_LOCATION` populated appropriately. Those +:ref:`IMPORTED targets ` may then be +used with the :command:`target_link_libraries` command for ``ClimbingStats``. + +That way, when a consumer uses the installed package, the +consumer will run the appropriate :command:`find_package` command (via the +find_dependency macro described below) to find +the dependencies on their own machine and populate the +:ref:`IMPORTED targets ` with appropriate paths. Note that +many modules currently shipped with CMake do not currently provide +:ref:`IMPORTED targets `. + .. _`Package Registry`: Package Registry http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=031d894fb882ca2e8c2269ba1674578f82155420 commit 031d894fb882ca2e8c2269ba1674578f82155420 Author: Brad King AuthorDate: Thu Apr 2 15:45:48 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 10:52:22 2015 -0400 Help: Place relocatable package notes in their own subsections These notes apply only for the use case of creating a package for redistribution on machines other than that where it is built. Clarify this to readers by placing the discussion in dedicated sections titled accordingly. diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst index 1d236ce..30ec2cb 100644 --- a/Help/command/target_include_directories.rst +++ b/Help/command/target_include_directories.rst @@ -55,5 +55,8 @@ installation prefix. For example: $ # /include/mylib ) +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` .. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index e6a82b6..88a555a 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -49,9 +49,6 @@ CMake will also propagate :ref:`usage requirements ` from linked library targets. Usage requirements of dependencies affect compilation of sources in the ````. -.. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_LINK_LIBRARIES` -.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt - If an ```` is a library in a Mac OX framework, the ``Headers`` directory of the framework will also be processed as a :ref:`usage requirement `. This has the same @@ -153,3 +150,9 @@ will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. + +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_LINK_LIBRARIES` +.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt diff --git a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst index 1cfd7a8..b1c40b2 100644 --- a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst @@ -22,5 +22,8 @@ installation prefix. For example: $ # /include/mylib ) +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_INCLUDE_DIRECTORIES`` .. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst index 55b7b8d..832d12b 100644 --- a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst +++ b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst @@ -17,5 +17,8 @@ with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_LINK_LIBRARIES`` .. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt diff --git a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst index 2e859eb..2dcf45c 100644 --- a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst +++ b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst @@ -24,5 +24,8 @@ property if policy :policy:`CMP0022` is ``NEW``. This property is deprecated. Use :prop_tgt:`INTERFACE_LINK_LIBRARIES` instead. +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. |INTERFACE_PROPERTY_LINK| replace:: ``LINK_INTERFACE_LIBRARIES`` .. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt diff --git a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst index 7f2b5dd..22ee5a6 100644 --- a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst +++ b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst @@ -13,5 +13,8 @@ property if policy :policy:`CMP0022` is ``NEW``. This property is deprecated. Use :prop_tgt:`INTERFACE_LINK_LIBRARIES` instead. +Creating Relocatable Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. |INTERFACE_PROPERTY_LINK| replace:: ``LINK_INTERFACE_LIBRARIES_`` .. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e331ce9d47c8f9adbf29ee0158b4307debbc02c commit 6e331ce9d47c8f9adbf29ee0158b4307debbc02c Author: Brad King AuthorDate: Thu Apr 2 17:17:36 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 10:52:21 2015 -0400 Help: Fix typo in cmake-packages(7) manual relevnt => relevant diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index b477cab..6ee9df9 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -375,7 +375,7 @@ to be incompatible. Note that it is not advisable to populate any properties which may contain paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and -:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevnt to dependencies. +:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevant to dependencies. That would hard-code into installed packages the include directory or library paths for dependencies **as found on the machine the package was made on**. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ba9b9d79fb1a753c564be44e17e2d3b979f8108c commit ba9b9d79fb1a753c564be44e17e2d3b979f8108c Author: Brad King AuthorDate: Thu Apr 2 16:16:14 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 10:52:16 2015 -0400 Help: Fix syntax in non-relocatable usage requirements example The example in cmake-packages(7) is meant to be incorrect for use of absolute paths, not for its syntax. diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index 3367ba4..b477cab 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -385,11 +385,11 @@ generate config file packages: .. code-block:: cmake target_link_libraries(ClimbingStats INTERFACE - ${Boost_LIBRARIES};${OtherDep_LIBRARIES}> - ) + ${Boost_LIBRARIES} ${OtherDep_LIBRARIES} + ) target_include_directories(ClimbingStats INTERFACE - $ - ) + "$" + ) Dependencies must provide their own :ref:`IMPORTED targets ` which have their own :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 10:59:16 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 10:59:16 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1435-g019805b Message-ID: <20150403145916.DD254AD9E7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 019805b0e83d8d5800ec997cdc598357f08202e2 (commit) via b50b5e8bab2a2e2a98b388ddb61887306fcb58e1 (commit) from b887785b7a0c921ef59f1de451d2f26f343c33b1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=019805b0e83d8d5800ec997cdc598357f08202e2 commit 019805b0e83d8d5800ec997cdc598357f08202e2 Merge: b887785 b50b5e8 Author: Brad King AuthorDate: Fri Apr 3 10:59:15 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 10:59:15 2015 -0400 Merge topic 'vs-xaml' into next b50b5e8b Help: Add notes for topic 'vs-xaml' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b50b5e8bab2a2e2a98b388ddb61887306fcb58e1 commit b50b5e8bab2a2e2a98b388ddb61887306fcb58e1 Author: Brad King AuthorDate: Fri Apr 3 10:58:20 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 10:58:20 2015 -0400 Help: Add notes for topic 'vs-xaml' diff --git a/Help/release/dev/vs-xaml.rst b/Help/release/dev/vs-xaml.rst new file mode 100644 index 0000000..6fdc659 --- /dev/null +++ b/Help/release/dev/vs-xaml.rst @@ -0,0 +1,6 @@ +vs-xaml +------- + +* The Visual Studio generators learned to support ``.xaml`` + source files and automatically associate them with corresponding + ``.h`` and ``.cpp`` sources. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/vs-xaml.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Help/release/dev/vs-xaml.rst hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 10:59:55 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 10:59:55 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1437-gc2f4911 Message-ID: <20150403145955.67483ADA02@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c2f49115c4f749f38008595056b80b2d96a35ad3 (commit) via 66a15714a3f685b69bb0d6e7ab53e63aef2d10bc (commit) from 019805b0e83d8d5800ec997cdc598357f08202e2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c2f49115c4f749f38008595056b80b2d96a35ad3 commit c2f49115c4f749f38008595056b80b2d96a35ad3 Merge: 019805b 66a1571 Author: Brad King AuthorDate: Fri Apr 3 10:59:54 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 10:59:54 2015 -0400 Merge topic 'vs-xaml' into next 66a15714 VS: Add support for XAML source files http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=66a15714a3f685b69bb0d6e7ab53e63aef2d10bc commit 66a15714a3f685b69bb0d6e7ab53e63aef2d10bc Author: Gilles Khouzam AuthorDate: Tue Mar 31 13:49:39 2015 -0700 Commit: Brad King CommitDate: Fri Apr 3 10:59:30 2015 -0400 VS: Add support for XAML source files XAML files are by default of type Page in the vcxproj and can be overriden by setting the VS_XAML_TYPE property. The .cpp and .h file of the same name are automatically added as depending on the XAML file. New VSXaml test builds a basic XAML WindowsStore 8.1 app with VS2013. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 1dff33e..76dd279 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -298,6 +298,7 @@ Properties on Source Files /prop_sf/VS_SHADER_FLAGS /prop_sf/VS_SHADER_MODEL /prop_sf/VS_SHADER_TYPE + /prop_sf/VS_XAML_TYPE /prop_sf/WRAP_EXCLUDE /prop_sf/XCODE_EXPLICIT_FILE_TYPE /prop_sf/XCODE_LAST_KNOWN_FILE_TYPE diff --git a/Help/prop_sf/VS_XAML_TYPE.rst b/Help/prop_sf/VS_XAML_TYPE.rst new file mode 100644 index 0000000..e92191d --- /dev/null +++ b/Help/prop_sf/VS_XAML_TYPE.rst @@ -0,0 +1,6 @@ +VS_XAML_TYPE +------------ + +Mark a XAML source file as a different type than the default ``Page``. +The most common usage would be to set the default App.xaml file as +ApplicationDefinition. diff --git a/Help/release/dev/vs-xaml.rst b/Help/release/dev/vs-xaml.rst new file mode 100644 index 0000000..6fdc659 --- /dev/null +++ b/Help/release/dev/vs-xaml.rst @@ -0,0 +1,6 @@ +vs-xaml +------- + +* The Visual Studio generators learned to support ``.xaml`` + source files and automatically associate them with corresponding + ``.h`` and ``.cpp`` sources. diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index e0af47a..41d12d7 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -56,6 +56,7 @@ struct ResxTag {}; struct ModuleDefinitionFileTag {}; struct AppManifestTag{}; struct CertificatesTag{}; +struct XamlTag{}; template struct IsSameTag @@ -98,6 +99,20 @@ struct DoAccept data.ExpectedResxHeaders.insert(hFileName); data.ResxSources.push_back(f); } + static void Do(cmGeneratorTarget::XamlData& data, cmSourceFile* f) + { + // Build and save the name of the corresponding .h and .cpp file + // This relationship will be used later when building the project files. + // Both names would have been auto generated from Visual Studio + // where the user supplied the file name and Visual Studio + // appended the suffix. + std::string xaml = f->GetFullPath(); + std::string hFileName = xaml + ".h"; + std::string cppFileName = xaml + ".cpp"; + data.ExpectedXamlHeaders.insert(hFileName); + data.ExpectedXamlSources.insert(cppFileName); + data.XamlSources.push_back(f); + } static void Do(std::string& data, cmSourceFile* f) { data = f->GetFullPath(); @@ -186,6 +201,10 @@ struct TagVisitor { DoAccept::Result>::Do(this->Data, sf); } + else if (ext == "xaml") + { + DoAccept::Result>::Do(this->Data, sf); + } else if(this->Header.find(sf->GetFullPath().c_str())) { DoAccept::Result>::Do(this->Data, sf); @@ -438,6 +457,36 @@ cmGeneratorTarget } //---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedXamlHeaders(std::set& headers, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + headers = data.ExpectedXamlHeaders; +} + +//---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedXamlSources(std::set& srcs, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + srcs = data.ExpectedXamlSources; +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget +::GetXamlSources(std::vector& srcs, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + srcs = data.XamlSources; +} + +//---------------------------------------------------------------------------- bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, const std::string& config) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index c329cf5..c79aa72 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -58,6 +58,12 @@ public: const std::string& config) const; void GetCertificates(std::vector&, const std::string& config) const; + void GetXamlSources(std::vector&, + const std::string& config) const; + void GetExpectedXamlHeaders(std::set&, + const std::string& config) const; + void GetExpectedXamlSources(std::set&, + const std::string& config) const; void ComputeObjectMapping(); @@ -132,6 +138,13 @@ public: mutable std::set ExpectedResxHeaders; mutable std::vector ResxSources; }; + + struct XamlData { + std::set ExpectedXamlHeaders; + std::set ExpectedXamlSources; + std::vector XamlSources; + }; + private: friend class cmTargetTraceDependencies; struct SourceEntry { std::vector Depends; }; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 19444ed..dad6f93 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -461,6 +461,7 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteAllSources(); this->WriteDotNetReferences(); this->WriteEmbeddedResourceGroup(); + this->WriteXamlFilesGroup(); this->WriteWinRTReferences(); this->WriteProjectReferences(); this->WriteString( @@ -522,8 +523,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() this->WriteString("", 3); std::string hFileName = obj.substr(0, obj.find_last_of(".")) + ".h"; - (*this->BuildFileStream ) << hFileName; - this->WriteString("\n", 3); + (*this->BuildFileStream) << hFileName << "\n"; std::vector const * configs = this->GlobalGenerator->GetConfigurations(); @@ -546,6 +546,38 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() } } +void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup() +{ + std::vector xamlObjs; + this->GeneratorTarget->GetXamlSources(xamlObjs, ""); + if (!xamlObjs.empty()) + { + this->WriteString("\n", 1); + for (std::vector::const_iterator + oi = xamlObjs.begin(); oi != xamlObjs.end(); ++oi) + { + std::string obj = (*oi)->GetFullPath(); + std::string xamlType; + const char * xamlTypeProperty = (*oi)->GetProperty("VS_XAML_TYPE"); + if (xamlTypeProperty) + { + xamlType = xamlTypeProperty; + } + else + { + xamlType = "Page"; + } + + this->WriteSource(xamlType, *oi, ">\n"); + this->WriteString("Designer\n", 3); + this->WriteString("BuildFileStream) << xamlType << ">\n"; + + } + this->WriteString("\n", 1); + } +} + void cmVisualStudio10TargetGenerator::WriteTargetSpecificReferences() { if(this->MSTools) @@ -1192,12 +1224,21 @@ WriteGroupSources(const char* name, void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf) { - if(this->IsResxHeader(sf->GetFullPath())) + std::string const& fileName = sf->GetFullPath(); + if (this->IsResxHeader(fileName)) { this->WriteSource("ClInclude", sf, ">\n"); this->WriteString("CppForm\n", 3); this->WriteString("\n", 2); } + else if (this->IsXamlHeader(fileName)) + { + this->WriteSource("ClInclude", sf, ">\n"); + this->WriteString("", 3); + std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); + (*this->BuildFileStream) << xamlFileName << "\n"; + this->WriteString("\n", 2); + } else { this->WriteSource("ClInclude", sf); @@ -1669,6 +1710,17 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( " ", "\n", lang); } } + if (this->IsXamlSource(source->GetFullPath())) + { + (*this->BuildFileStream) << firstString; + firstString = ""; // only do firstString once + hasFlags = true; + this->WriteString("", 3); + const std::string& fileName = source->GetFullPath(); + std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); + (*this->BuildFileStream) << xamlFileName << "\n"; + } + return hasFlags; } @@ -2749,6 +2801,28 @@ bool cmVisualStudio10TargetGenerator:: return it != expectedResxHeaders.end(); } +bool cmVisualStudio10TargetGenerator:: +IsXamlHeader(const std::string& headerFile) +{ + std::set expectedXamlHeaders; + this->GeneratorTarget->GetExpectedXamlHeaders(expectedXamlHeaders, ""); + + std::set::const_iterator it = + expectedXamlHeaders.find(headerFile); + return it != expectedXamlHeaders.end(); +} + +bool cmVisualStudio10TargetGenerator:: +IsXamlSource(const std::string& sourceFile) +{ + std::set expectedXamlSources; + this->GeneratorTarget->GetExpectedXamlSources(expectedXamlSources, ""); + + std::set::const_iterator it = + expectedXamlSources.find(sourceFile); + return it != expectedXamlSources.end(); +} + void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() { bool isAppContainer = false; diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index a02dfa8..a2776de 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -69,6 +69,7 @@ private: void WriteEmbeddedResourceGroup(); void WriteWinRTReferences(); void WriteWinRTPackageCertificateKeyFile(); + void WriteXamlFilesGroup(); void WritePathAndIncrementalLinkOptions(); void WriteItemDefinitionGroups(); void VerifyNecessaryFiles(); @@ -119,6 +120,8 @@ private: void AddMissingSourceGroups(std::set& groupsUsed, const std::vector& allGroups); bool IsResxHeader(const std::string& headerFile); + bool IsXamlHeader(const std::string& headerFile); + bool IsXamlSource(const std::string& headerFile); cmIDEFlagTable const* GetClFlagTable() const; cmIDEFlagTable const* GetRcFlagTable() const; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5944d08..1df39aa 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1927,6 +1927,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1) add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013 ARM" WindowsStore 8.1) add_test_VSWinStorePhone(vs12-store81-X64 "Visual Studio 12 2013 Win64" WindowsStore 8.1) + + add_test(NAME VSXaml COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSXaml" + "${CMake_BINARY_DIR}/Tests/VSXaml" + --build-generator "Visual Studio 12 2013" + --build-project VSXaml + --build-config $ + --build-options -DCMAKE_SYSTEM_NAME=WindowsStore + -DCMAKE_SYSTEM_VERSION=8.1 + ) endif() if(vs11 AND wp80) add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0) diff --git a/Tests/VSWindowsFormsResx/CMakeLists.txt b/Tests/VSWindowsFormsResx/CMakeLists.txt index 4373810..43c4833 100644 --- a/Tests/VSWindowsFormsResx/CMakeLists.txt +++ b/Tests/VSWindowsFormsResx/CMakeLists.txt @@ -14,7 +14,7 @@ include(CheckCXXSourceCompiles) include(CheckIncludeFile) # Note: The designable form is assumed to have a .h extension as is default in Visual Studio. -# Node: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio +# Note: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio set(TARGET_H WindowsFormsResx/MyForm.h diff --git a/Tests/VSXaml/App.xaml b/Tests/VSXaml/App.xaml new file mode 100644 index 0000000..eecf2c1 --- /dev/null +++ b/Tests/VSXaml/App.xaml @@ -0,0 +1,7 @@ +? + + diff --git a/Tests/VSXaml/App.xaml.cpp b/Tests/VSXaml/App.xaml.cpp new file mode 100644 index 0000000..334dc1f --- /dev/null +++ b/Tests/VSXaml/App.xaml.cpp @@ -0,0 +1,125 @@ +?// +// App.xaml.cpp +// Implementation of the App class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace VSXaml; + +using namespace Platform; +using namespace Windows::ApplicationModel; +using namespace Windows::ApplicationModel::Activation; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Interop; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 + +/// +/// Initializes the singleton application object. This is the first line of authored code +/// executed, and as such is the logical equivalent of main() or WinMain(). +/// +App::App() +{ + InitializeComponent(); + Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending); +} + +/// +/// Invoked when the application is launched normally by the end user. Other entry points +/// will be used such as when the application is launched to open a specific file. +/// +/// Details about the launch request and process. +void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) +{ + +#if _DEBUG + // Show graphics profiling information while debugging. + if (IsDebuggerPresent()) + { + // Display the current frame rate counters + DebugSettings->EnableFrameRateCounter = true; + } +#endif + + auto rootFrame = dynamic_cast(Window::Current->Content); + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == nullptr) + { + // Create a Frame to act as the navigation context and associate it with + // a SuspensionManager key + rootFrame = ref new Frame(); + + // Set the default language + rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0); + + rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed); + + if (e->PreviousExecutionState == ApplicationExecutionState::Terminated) + { + // TODO: Restore the saved session state only when appropriate, scheduling the + // final launch steps after the restore is complete + + } + + if (rootFrame->Content == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); + } + // Place the frame in the current Window + Window::Current->Content = rootFrame; + // Ensure the current window is active + Window::Current->Activate(); + } + else + { + if (rootFrame->Content == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); + } + // Ensure the current window is active + Window::Current->Activate(); + } +} + +/// +/// Invoked when application execution is being suspended. Application state is saved +/// without knowing whether the application will be terminated or resumed with the contents +/// of memory still intact. +/// +/// The source of the suspend request. +/// Details about the suspend request. +void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e) +{ + (void) sender; // Unused parameter + (void) e; // Unused parameter + + //TODO: Save application state and stop any background activity +} + +/// +/// Invoked when Navigation to a certain page fails +/// +/// The Frame which failed navigation +/// Details about the navigation failure +void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e) +{ + throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name); +} \ No newline at end of file diff --git a/Tests/VSXaml/App.xaml.h b/Tests/VSXaml/App.xaml.h new file mode 100644 index 0000000..1f65bda --- /dev/null +++ b/Tests/VSXaml/App.xaml.h @@ -0,0 +1,27 @@ +?// +// App.xaml.h +// Declaration of the App class. +// + +#pragma once + +#include "App.g.h" + +namespace VSXaml +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + ref class App sealed + { + protected: + virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override; + + internal: + App(); + + private: + void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e); + void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e); + }; +} diff --git a/Tests/VSXaml/Assets/Logo.scale-100.png b/Tests/VSXaml/Assets/Logo.scale-100.png new file mode 100644 index 0000000..e26771c Binary files /dev/null and b/Tests/VSXaml/Assets/Logo.scale-100.png differ diff --git a/Tests/VSXaml/Assets/SmallLogo.scale-100.png b/Tests/VSXaml/Assets/SmallLogo.scale-100.png new file mode 100644 index 0000000..1eb0d9d Binary files /dev/null and b/Tests/VSXaml/Assets/SmallLogo.scale-100.png differ diff --git a/Tests/VSXaml/Assets/SplashScreen.scale-100.png b/Tests/VSXaml/Assets/SplashScreen.scale-100.png new file mode 100644 index 0000000..c951e03 Binary files /dev/null and b/Tests/VSXaml/Assets/SplashScreen.scale-100.png differ diff --git a/Tests/VSXaml/Assets/StoreLogo.scale-100.png b/Tests/VSXaml/Assets/StoreLogo.scale-100.png new file mode 100644 index 0000000..dcb6727 Binary files /dev/null and b/Tests/VSXaml/Assets/StoreLogo.scale-100.png differ diff --git a/Tests/VSXaml/CMakeLists.txt b/Tests/VSXaml/CMakeLists.txt new file mode 100644 index 0000000..f384c82 --- /dev/null +++ b/Tests/VSXaml/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.2) +project(VSXaml) + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +set(SOURCE_FILES + App.xaml.cpp + MainPage.xaml.cpp + pch.cpp + ) + +set(HEADER_FILES + App.xaml.h + MainPage.xaml.h + pch.h + ) + +set(XAML_FILES + App.xaml + MainPage.xaml + ) + +set(ASSET_FILES + Assets/Logo.scale-100.png + Assets/SmallLogo.scale-100.png + Assets/SplashScreen.scale-100.png + Assets/StoreLogo.scale-100.png + ) + +set(CONTENT_FILES + Package.appxmanifest + ) + +set(RESOURCE_FILES + ${CONTENT_FILES} ${ASSET_FILES} + VSXaml_TemporaryKey.pfx) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets") + +set_property(SOURCE "App.xaml" PROPERTY VS_XAML_TYPE "ApplicationDefinition") + +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +source_group("Resource Files" FILES ${RESOURCE_FILES}) +source_group("Xaml Files" FILES ${XAML_FILES}) + +add_executable(VSXaml WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES} ${XAML_FILES}) +set_property(TARGET VSXaml PROPERTY VS_WINRT_COMPONENT TRUE) diff --git a/Tests/VSXaml/MainPage.xaml b/Tests/VSXaml/MainPage.xaml new file mode 100644 index 0000000..62139ca --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml @@ -0,0 +1,14 @@ +? + + + + + diff --git a/Tests/VSXaml/MainPage.xaml.cpp b/Tests/VSXaml/MainPage.xaml.cpp new file mode 100644 index 0000000..d0a64e8 --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml.cpp @@ -0,0 +1,27 @@ +?// +// MainPage.xaml.cpp +// Implementation of the MainPage class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace VSXaml; + +using namespace Platform; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 + +MainPage::MainPage() +{ + InitializeComponent(); +} diff --git a/Tests/VSXaml/MainPage.xaml.h b/Tests/VSXaml/MainPage.xaml.h new file mode 100644 index 0000000..ccc781b --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml.h @@ -0,0 +1,21 @@ +?// +// MainPage.xaml.h +// Declaration of the MainPage class. +// + +#pragma once + +#include "MainPage.g.h" + +namespace VSXaml +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public ref class MainPage sealed + { + public: + MainPage(); + + }; +} diff --git a/Tests/VSXaml/Package.appxmanifest b/Tests/VSXaml/Package.appxmanifest new file mode 100644 index 0000000..873a64a --- /dev/null +++ b/Tests/VSXaml/Package.appxmanifest @@ -0,0 +1,41 @@ +? + + + + + + VSXaml + Microsoft + Assets\StoreLogo.png + + + + 6.3.0 + 6.3.0 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/VSXaml/VSXaml_TemporaryKey.pfx b/Tests/VSXaml/VSXaml_TemporaryKey.pfx new file mode 100644 index 0000000..1cad999 Binary files /dev/null and b/Tests/VSXaml/VSXaml_TemporaryKey.pfx differ diff --git a/Tests/VSXaml/pch.cpp b/Tests/VSXaml/pch.cpp new file mode 100644 index 0000000..01484ff --- /dev/null +++ b/Tests/VSXaml/pch.cpp @@ -0,0 +1,6 @@ +?// +// pch.cpp +// Include the standard header and generate the precompiled header. +// + +#include "pch.h" diff --git a/Tests/VSXaml/pch.h b/Tests/VSXaml/pch.h new file mode 100644 index 0000000..2c4354d --- /dev/null +++ b/Tests/VSXaml/pch.h @@ -0,0 +1,11 @@ +?// +// pch.h +// Header for standard system include files. +// + +#pragma once + +#include +#include + +#include "App.xaml.h" ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 11:09:53 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 11:09:53 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1439-g4b0e1f9 Message-ID: <20150403150953.A38AFAA94C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4b0e1f93a52b005d332537bf0ae9062022a27a1f (commit) via dda66be2e4adae370e37de38a1dd1334192cd4f3 (commit) from c2f49115c4f749f38008595056b80b2d96a35ad3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4b0e1f93a52b005d332537bf0ae9062022a27a1f commit 4b0e1f93a52b005d332537bf0ae9062022a27a1f Merge: c2f4911 dda66be Author: Brad King AuthorDate: Fri Apr 3 11:09:52 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 11:09:52 2015 -0400 Merge topic 'add-GreenHills-MULTI-generator' into next dda66be2 Revert topic 'add-GreenHills-MULTI-generator' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dda66be2e4adae370e37de38a1dd1334192cd4f3 commit dda66be2e4adae370e37de38a1dd1334192cd4f3 Author: Brad King AuthorDate: Fri Apr 3 11:09:28 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 11:09:28 2015 -0400 Revert topic 'add-GreenHills-MULTI-generator' It will be restored after further revisions are made. diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst deleted file mode 100644 index 79695f1..0000000 --- a/Help/generator/Green Hills MULTI.rst +++ /dev/null @@ -1,11 +0,0 @@ -Green Hills MULTI ------------------ - -Generates Green Hills MULTI project files. - -Customizations are available through the following cache variables: - -* ``GHS_BSP_NAME`` -* ``GHS_CUSTOMIZATION`` -* ``GHS_GPJ_MACROS`` -* ``GHS_OS_DIR`` diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst index ce9f5c8..804229b 100644 --- a/Help/manual/cmake-generators.7.rst +++ b/Help/manual/cmake-generators.7.rst @@ -56,7 +56,6 @@ one may launch CMake from any environment. .. toctree:: :maxdepth: 1 - /generator/Green Hills MULTI /generator/Visual Studio 6 /generator/Visual Studio 7 /generator/Visual Studio 7 .NET 2003 diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 5282872..c342dbe 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -181,7 +181,6 @@ Variables that Describe the System /variable/CMAKE_SYSTEM_VERSION /variable/CYGWIN /variable/ENV - /variable/GHS-MULTI /variable/MINGW /variable/MSVC10 /variable/MSVC11 diff --git a/Help/variable/CMAKE_MAKE_PROGRAM.rst b/Help/variable/CMAKE_MAKE_PROGRAM.rst index 85b098b..f1d88a5 100644 --- a/Help/variable/CMAKE_MAKE_PROGRAM.rst +++ b/Help/variable/CMAKE_MAKE_PROGRAM.rst @@ -56,10 +56,6 @@ to configure the project: the CMake cache then CMake will use the specified value if possible. -* The :generator:`Green Hills MULTI` generator sets this to ``gbuild``. - If a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to - the CMake cache then CMake will use the specified value. - The ``CMAKE_MAKE_PROGRAM`` variable is set for use by project code. The value is also used by the :manual:`cmake(1)` ``--build`` and :manual:`ctest(1)` ``--build-and-test`` tools to launch the native diff --git a/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst b/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst index 2f5313b..8ad89f1 100644 --- a/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst +++ b/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst @@ -6,5 +6,3 @@ The name of the CPU CMake is building for. This variable is the same as :variable:`CMAKE_HOST_SYSTEM_PROCESSOR` if you build for the host system instead of the target system when cross compiling. - -* The Green Hills MULTI generator sets this to ``ARM`` by default diff --git a/Help/variable/GHS-MULTI.rst b/Help/variable/GHS-MULTI.rst deleted file mode 100644 index 0f91be8..0000000 --- a/Help/variable/GHS-MULTI.rst +++ /dev/null @@ -1,4 +0,0 @@ -GHS-MULTI ---------- - -True when using Green Hills MULTI diff --git a/Modules/Compiler/GHS-C.cmake b/Modules/Compiler/GHS-C.cmake deleted file mode 100644 index 836d741..0000000 --- a/Modules/Compiler/GHS-C.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set(CMAKE_C_VERBOSE_FLAG "-v") - -set(CMAKE_C_FLAGS_INIT "") -set(CMAKE_C_FLAGS_DEBUG_INIT "-Odebug -g") -set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Ospace") -set(CMAKE_C_FLAGS_RELEASE_INIT "-O") -set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O -g") diff --git a/Modules/Compiler/GHS-CXX.cmake b/Modules/Compiler/GHS-CXX.cmake deleted file mode 100644 index cd449f7..0000000 --- a/Modules/Compiler/GHS-CXX.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set(CMAKE_CXX_VERBOSE_FLAG "-v") - -set(CMAKE_CXX_FLAGS_INIT "") -set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g") -set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Ospace") -set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O -g") diff --git a/Modules/Compiler/GHS-DetermineCompiler.cmake b/Modules/Compiler/GHS-DetermineCompiler.cmake deleted file mode 100644 index 56d24e2..0000000 --- a/Modules/Compiler/GHS-DetermineCompiler.cmake +++ /dev/null @@ -1,6 +0,0 @@ -set(_compiler_id_pp_test "defined(__INTEGRITY)") - -set(_compiler_id_version_compute " -# define @PREFIX at COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEGRITY_MAJOR_VERSION) -# define @PREFIX at COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEGRITY_MINOR_VERSION) -# define @PREFIX at COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEGRITY_PATCH_VERSION)") diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index c844aed..466090b 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -405,8 +405,6 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret) else() set (_boost_COMPILER "-il") endif() - elseif (GHSMULTI) - set(_boost_COMPILER "-ghs") elseif (MSVC14) set(_boost_COMPILER "-vc140") elseif (MSVC12) @@ -779,8 +777,7 @@ endif() # ------------------------------------------------------------------------ set(Boost_LIB_PREFIX "") -if ( (GHSMULTI AND Boost_USE_STATIC_LIBS) OR - (WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) ) +if ( WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) set(Boost_LIB_PREFIX "lib") endif() diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake deleted file mode 100644 index 342ad21..0000000 --- a/Modules/Platform/GHS-MULTI-Initialize.cmake +++ /dev/null @@ -1,29 +0,0 @@ - -#============================================================================= -# Copyright 2015 Geoffrey Viola -# -# 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.) - -#Setup Greenhills MULTI specific compilation information -find_path(GHS_INT_DIRECTORY INTEGRITY.ld PATHS - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware6433c345;InstallLocation]" #int1122 - "C:/ghs/int1122" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware289b6625;InstallLocation]" #int1104 - "C:/ghs/int1104" - DOC "Path to integrity directory" - ) -set(GHS_OS_DIR ${GHS_INT_DIRECTORY} CACHE PATH "OS directory") -set(GHS_PRIMARY_TARGET "arm_integrity.tgt" CACHE STRING "target for compilation") -set(GHS_BSP_NAME "simarm" CACHE STRING "BSP name") -set(GHS_CUSTOMIZATION "" CACHE FILEPATH "optional GHS customization") -mark_as_advanced(GHS_CUSTOMIZATION) -set(GHS_GPJ_MACROS "" CACHE STRING "optional GHS macros generated in the .gpjs for legacy reasons") -mark_as_advanced(GHS_GPJ_MACROS) diff --git a/Modules/Platform/GHS-MULTI.cmake b/Modules/Platform/GHS-MULTI.cmake deleted file mode 100644 index 211cf3e..0000000 --- a/Modules/Platform/GHS-MULTI.cmake +++ /dev/null @@ -1,27 +0,0 @@ - -#============================================================================= -# Copyright 2015 Geoffrey Viola -# -# 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.) - -# This module is shared by multiple languages; use include blocker. - -if(__GHSMULTI) - return() -endif() -set(__GHSMULTI 1) - -set(GHSMULTI 1) - -set(CMAKE_FIND_LIBRARY_PREFIXES "") -set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") - -include(Platform/WindowsPaths) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 064b827..04f6a81 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -472,14 +472,6 @@ if (WIN32) cmVisualStudioSlnParser.cxx cmVisualStudioWCEPlatformParser.h cmVisualStudioWCEPlatformParser.cxx - cmGlobalGhsMultiGenerator.cxx - cmGlobalGhsMultiGenerator.h - cmLocalGhsMultiGenerator.cxx - cmLocalGhsMultiGenerator.h - cmGhsMultiTargetGenerator.cxx - cmGhsMultiTargetGenerator.h - cmGhsMultiGpj.cxx - cmGhsMultiGpj.h ) endif() endif () @@ -507,7 +499,6 @@ set(SRCS ${SRCS} cmNinjaUtilityTargetGenerator.cxx cmNinjaUtilityTargetGenerator.h ) - if(WIN32 AND NOT CYGWIN) set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501) add_executable(cmcldeps cmcldeps.cxx) diff --git a/Source/cmGhsMultiGpj.cxx b/Source/cmGhsMultiGpj.cxx deleted file mode 100644 index e47d583..0000000 --- a/Source/cmGhsMultiGpj.cxx +++ /dev/null @@ -1,41 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2015 Geoffrey Viola - - 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 "cmGhsMultiGpj.h" - -#include "cmGeneratedFileStream.h" - -void GhsMultiGpj::WriteGpjTag(Types const gpjType, - cmGeneratedFileStream *const filestream) -{ - char const *tag; - switch (gpjType) - { - case INTERGRITY_APPLICATION: - tag = "INTEGRITY Application"; - break; - case PROJECT: - tag = "Project"; - break; - case PROGRAM: - tag = "Program"; - break; - case REFERENCE: - tag = "Reference"; - break; - case SUBPROJECT: - tag = "Subproject"; - break; - default: - tag = ""; - } - *filestream << "[" << tag << "]" << std::endl; -} diff --git a/Source/cmGhsMultiGpj.h b/Source/cmGhsMultiGpj.h deleted file mode 100644 index 7e5b942..0000000 --- a/Source/cmGhsMultiGpj.h +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2015 Geoffrey Viola - - 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 cmGhsMultiGpj_h -#define cmGhsMultiGpj_h - -class cmGeneratedFileStream; - -class GhsMultiGpj -{ -public: - enum Types - { - INTERGRITY_APPLICATION, - PROJECT, - PROGRAM, - REFERENCE, - SUBPROJECT - }; - - static void WriteGpjTag(Types const gpjType, - cmGeneratedFileStream *filestream); -}; - -#endif // ! cmGhsMultiGpjType_h diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx deleted file mode 100644 index 0c3595b..0000000 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ /dev/null @@ -1,518 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2015 Geoffrey Viola - - 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 "cmGhsMultiTargetGenerator.h" -#include "cmGlobalGhsMultiGenerator.h" -#include "cmLocalGhsMultiGenerator.h" -#include "cmMakefile.h" -#include "cmTarget.h" -#include "cmGeneratedFileStream.h" -#include "cmSourceFile.h" -#include -#include - -std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic"); - -cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmTarget const *target) - : Target(target) - , LocalGenerator(static_cast( - target->GetMakefile()->GetLocalGenerator())) - , Makefile(target->GetMakefile()) - , TargetGroup(DetermineIfTargetGroup()) - , DynamicDownload(false) -{ - char const *folderProp = this->Target->GetProperty("FOLDER"); - this->RelBuildFilePath = NULL == folderProp ? "" : folderProp; - cmSystemTools::ConvertToUnixSlashes(this->RelBuildFilePath); - if (!this->RelBuildFilePath.empty()) - { - this->RelBuildFilePath += "/"; - } - this->RelBuildFilePath += this->Target->GetName() + "/"; - - this->RelOutputFileName = - this->RelBuildFilePath + this->Target->GetName() + ".a"; - - this->RelBuildFileName = this->RelBuildFilePath; - std::string BuildFileName; - BuildFileName = this->Target->GetName(); - BuildFileName += cmGlobalGhsMultiGenerator::FILE_EXTENSION; - this->RelBuildFileName += BuildFileName; - - std::string absPathToRoot(this->Makefile->GetHomeOutputDirectory()); - if (!cmHasLiteralSuffix(absPathToRoot, "/")) - { - absPathToRoot += "/"; - } - this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath; - this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName; - this->AbsOutputFileName = absPathToRoot + this->RelOutputFileName; -} - -cmGhsMultiTargetGenerator::~cmGhsMultiTargetGenerator() -{ - cmDeleteAll(this->FolderBuildStreams); -} - -void cmGhsMultiTargetGenerator::Generate() -{ - const std::vector objectSources = this->GetSources(); - if (!objectSources.empty() && this->IncludeThisTarget()) - { - if (!cmSystemTools::FileExists(this->AbsBuildFilePath.c_str())) - { - cmSystemTools::MakeDirectory(this->AbsBuildFilePath.c_str()); - } - cmGlobalGhsMultiGenerator::Open(std::string(""), this->AbsBuildFileName, - &this->FolderBuildStreams); - cmGlobalGhsMultiGenerator::OpenBuildFileStream( - this->GetFolderBuildStreams()); - std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); - if (0 == config.length()) - { - config = "RELEASE"; - } - const std::string language(this->Target->GetLinkerLanguage(config)); - config = cmSystemTools::UpperCase(config); - this->DynamicDownload = this->DetermineIfDynamicDownload(config, language); - if (this->DynamicDownload) - { - *this->GetFolderBuildStreams() << "#component integrity_dynamic_download" - << std::endl; - } - GhsMultiGpj::WriteGpjTag(this->GetGpjTag(), this->GetFolderBuildStreams()); - cmGlobalGhsMultiGenerator::WriteDisclaimer(this->GetFolderBuildStreams()); - - bool const notKernel = this->IsNotKernel(config, language); - this->WriteTypeSpecifics(config, notKernel); - this->WriteDebugOptions(config, notKernel); - this->WriteCompilerOptions(config, language); - this->WriteCompilerFlags(); - this->WriteCompilerDefinitions(config, language); - this->WriteIncludes(config, language); - this->WriteTargetLinkLibraries(); - this->WriteCustomCommands(); - if (this->DynamicDownload) - { - *this->GetFolderBuildStreams() << " " << this->DDOption << std::endl; - } - - this->WriteSources(objectSources); - } -} - -bool cmGhsMultiTargetGenerator::IncludeThisTarget() -{ - bool output = true; - char const *excludeFromAll = this->Target->GetProperty("EXCLUDE_FROM_ALL"); - if (NULL != excludeFromAll && '1' == excludeFromAll[0] && - '\0' == excludeFromAll[1]) - { - output = false; - } - return output; -} - -std::vector cmGhsMultiTargetGenerator::GetSources() const -{ - std::vector output; - std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); - this->Target->GetSourceFiles(output, config); - return output; -} - -GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag() const -{ - GhsMultiGpj::Types output; - if (this->IsTargetGroup()) - { - output = GhsMultiGpj::INTERGRITY_APPLICATION; - } - else - { - output = GhsMultiGpj::PROGRAM; - } - return output; -} - -cmGlobalGhsMultiGenerator* -cmGhsMultiTargetGenerator::GetGlobalGenerator() const -{ - return static_cast( - this->LocalGenerator->GetGlobalGenerator()); -} - -void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config, - bool const notKernel) -{ - std::string outputDir(this->GetOutputDirectory(config)); - std::string outputFilename(this->GetOutputFilename(config)); - - if (this->Target->GetType() == cmTarget::STATIC_LIBRARY) - { - *this->GetFolderBuildStreams() << " -relobj" << std::endl; - *this->GetFolderBuildStreams() << " {optgroup=GhsCommonOptions} -o \"" - << outputDir << outputFilename << ".a\"" - << std::endl; - } - else if (this->Target->GetType() == cmTarget::EXECUTABLE) - { - if (notKernel && !this->IsTargetGroup()) - { - *this->GetFolderBuildStreams() << " -relprog" << std::endl; - } - if (this->IsTargetGroup()) - { - *this->GetFolderBuildStreams() << " -non_shared" << std::endl; - *this->GetFolderBuildStreams() << " -o \"" << outputDir - << outputFilename << ".elf\"" - << std::endl; - } - else - { - *this->GetFolderBuildStreams() << " {optgroup=GhsCommonOptions} -o \"" - << outputDir << outputFilename << ".as\"" - << std::endl; - } - } -} - -void cmGhsMultiTargetGenerator::WriteDebugOptions(std::string const &config, - bool const notKernel) -{ - if ("DEBUG" == config) - { - if (notKernel) - { - *this->GetFolderBuildStreams() << " -G" << std::endl; - *this->GetFolderBuildStreams() << " -Onone" << std::endl; - } - else - { - *this->GetFolderBuildStreams() << " -ldebug" << std::endl; - } - } - else if (notKernel) - { - *this->GetFolderBuildStreams() << " -O" << std::endl; - } -} - -void cmGhsMultiTargetGenerator::WriteCompilerOptions( - std::string const &config, const std::string &language) -{ - std::vector options; - this->Target->GetCompileOptions(options, config, language); - bool hasStartfileDirProp = false; - std::string const startFilePropName("-startfile_dir="); - for (std::vector::const_iterator options_i = options.begin(); - options_i != options.end(); ++options_i) - { - std::string option = *options_i; - if (this->DDOption != option) - { - if (option.length() >= startFilePropName.length() && - startFilePropName == option.substr(0, startFilePropName.length())) - { - hasStartfileDirProp = true; - } - cmSystemTools::ConvertToUnixSlashes(option); - *this->GetFolderBuildStreams() << " " << option << std::endl; - } - } - - // If this property is relative, make it relative to the root lists file - if (!hasStartfileDirProp && this->GetGlobalGenerator()->IsOSDirRelative()) - { - *this->GetFolderBuildStreams() << " " << startFilePropName << "\"" - << this->Makefile->GetHomeOutputDirectory() - << "/$(__LIBS_DIR_BASE)/$(__BSP_NAME)\"" - << std::endl; - } -} - -void cmGhsMultiTargetGenerator::WriteCompilerFlags() -{ - char const *const compileFlags = this->Target->GetProperty("COMPILE_FLAGS"); - if (NULL != compileFlags) - { - *this->GetFolderBuildStreams() << " " << compileFlags << std::endl; - } -} - -void cmGhsMultiTargetGenerator::WriteCompilerDefinitions( - const std::string &config, const std::string &language) -{ - std::vector compileDefinitions; - this->Target->GetCompileDefinitions(compileDefinitions, config, language); - for (std::vector::const_iterator cdI = - compileDefinitions.begin(); - cdI != compileDefinitions.end(); ++cdI) - { - *this->GetFolderBuildStreams() << " -D" << (*cdI) << std::endl; - } -} - -void cmGhsMultiTargetGenerator::WriteIncludes(const std::string &config, - const std::string &language) -{ - std::vector includes = - this->Target->GetIncludeDirectories(config, language); - for (std::vector::const_iterator includes_i = includes.begin(); - includes_i != includes.end(); ++includes_i) - { - *this->GetFolderBuildStreams() << " -I\"" << *includes_i << "\"" - << std::endl; - } -} - -void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries() -{ - // library directories - cmTargetDependSet tds = - this->GetGlobalGenerator()->GetTargetDirectDepends(*this->Target); - for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end(); - ++tdsI) - { - cmTarget const *tg(*tdsI); - cmGhsMultiTargetGenerator gmtg(tg); - *this->GetFolderBuildStreams() << " -L\"" << gmtg.GetAbsBuildFilePath() - << "\"" << std::endl; - } - // library targets - cmTarget::LinkLibraryVectorType llv = - this->Target->GetOriginalLinkLibraries(); - for (cmTarget::LinkLibraryVectorType::const_iterator llvI = llv.begin(); - llvI != llv.end(); ++llvI) - { - std::string libName = llvI->first; - // if it is a user defined target get the full path to the lib - cmTarget *tg(GetGlobalGenerator()->FindTarget(libName)); - if (NULL != tg) - { - cmGhsMultiTargetGenerator gmtg(tg); - libName = tg->GetName() + ".a"; - } - *this->GetFolderBuildStreams() << " -l\"" << libName << "\"" - << std::endl; - } -} - -void cmGhsMultiTargetGenerator::WriteCustomCommands() -{ - WriteCustomCommandsHelper(this->Target->GetPreBuildCommands(), - cmTarget::PRE_BUILD); - WriteCustomCommandsHelper(this->Target->GetPostBuildCommands(), - cmTarget::POST_BUILD); -} - -void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper( - std::vector const &commandsSet, - cmTarget::CustomCommandType const commandType) -{ - for (std::vector::const_iterator commandsSetI = - commandsSet.begin(); - commandsSetI != commandsSet.end(); ++commandsSetI) - { - cmCustomCommandLines const &commands = commandsSetI->GetCommandLines(); - for (cmCustomCommandLines::const_iterator commandI = commands.begin(); - commandI != commands.end(); ++commandI) - { - switch (commandType) - { - case cmTarget::PRE_BUILD: - *this->GetFolderBuildStreams() << " :preexecShellSafe="; - break; - case cmTarget::POST_BUILD: - *this->GetFolderBuildStreams() << " :postexecShellSafe="; - break; - default: - assert("Only pre and post are supported"); - } - cmCustomCommandLine const &command = *commandI; - for (cmCustomCommandLine::const_iterator commandLineI = command.begin(); - commandLineI != command.end(); ++commandLineI) - { - if (!command.empty()) - { - *this->GetFolderBuildStreams() - << (command.begin() == commandLineI ? "'" : " "); - } - *this->GetFolderBuildStreams() << *commandLineI; - } - if (!command.empty()) - { - *this->GetFolderBuildStreams() << "'" << std::endl; - } - } - } -} - -void cmGhsMultiTargetGenerator::WriteSources( - std::vector const &objectSources) -{ - for (std::vector::const_iterator si = objectSources.begin(); - si != objectSources.end(); ++si) - { - std::vector sourceGroups(this->Makefile->GetSourceGroups()); - char const *sourceFullPath = (*si)->GetFullPath().c_str(); - cmSourceGroup *sourceGroup = - this->Makefile->FindSourceGroup(sourceFullPath, sourceGroups); - std::string sgPath(sourceGroup->GetFullName()); - cmSystemTools::ConvertToUnixSlashes(sgPath); - cmGlobalGhsMultiGenerator::AddFilesUpToPath( - this->GetFolderBuildStreams(), &this->FolderBuildStreams, - this->Makefile->GetHomeOutputDirectory(), sgPath, - GhsMultiGpj::SUBPROJECT, this->RelBuildFilePath); - - if ((*si)->GetExtension() == ".int") - { - *this->FolderBuildStreams[sgPath] << "\"" << (*si)->GetFullPath() << "\"" - << std::endl; - } - else - { - *this->FolderBuildStreams[sgPath] << (*si)->GetFullPath() << std::endl; - } - - if ("ld" != (*si)->GetExtension() && "int" != (*si)->GetExtension() && - "bsp" != (*si)->GetExtension()) - { - this->WriteObjectLangOverride(this->FolderBuildStreams[sgPath], (*si)); - - this->WriteObjectDir(this->FolderBuildStreams[sgPath], - this->AbsBuildFilePath + sgPath); - } - } -} - -void cmGhsMultiTargetGenerator::WriteObjectLangOverride( - cmGeneratedFileStream *fileStream, cmSourceFile *sourceFile) -{ - const char *rawLangProp = sourceFile->GetProperty("LANGUAGE"); - if (NULL != rawLangProp) - { - std::string sourceLangProp(rawLangProp); - std::string extension(sourceFile->GetExtension()); - if ("CXX" == sourceLangProp && ("c" == extension || "C" == extension)) - { - *fileStream << " -dotciscxx" << std::endl; - } - } -} - -void cmGhsMultiTargetGenerator::WriteObjectDir( - cmGeneratedFileStream *fileStream, std::string const &dir) -{ - std::string workingDir(dir); - cmSystemTools::ConvertToUnixSlashes(workingDir); - if (!workingDir.empty()) - { - workingDir += "/"; - } - workingDir += "Objs"; - *fileStream << " -object_dir=\"" << workingDir << "\"" << std::endl; -} - -std::string -cmGhsMultiTargetGenerator::GetOutputDirectory(const std::string &config) const -{ - std::string outputDir(AbsBuildFilePath); - - const char *runtimeOutputProp = - this->Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY"); - if (NULL != runtimeOutputProp) - { - outputDir = runtimeOutputProp; - } - - std::string configCapped(cmSystemTools::UpperCase(config)); - const char *runtimeOutputSProp = - this->Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY_" + configCapped); - if (NULL != runtimeOutputSProp) - { - outputDir = runtimeOutputSProp; - } - cmSystemTools::ConvertToUnixSlashes(outputDir); - - if (!outputDir.empty()) - { - outputDir += "/"; - } - - return outputDir; -} - -std::string -cmGhsMultiTargetGenerator::GetOutputFilename(const std::string &config) const -{ - std::string outputFilename(this->Target->GetName()); - - const char *outputNameProp = this->Target->GetProperty("OUTPUT_NAME"); - if (NULL != outputNameProp) - { - outputFilename = outputNameProp; - } - - std::string configCapped(cmSystemTools::UpperCase(config)); - const char *outputNameSProp = - this->Target->GetProperty(configCapped + "_OUTPUT_NAME"); - if (NULL != outputNameSProp) - { - outputFilename = outputNameSProp; - } - - return outputFilename; -} - -bool cmGhsMultiTargetGenerator::IsNotKernel(std::string const &config, - const std::string &language) -{ - bool output; - std::vector options; - this->Target->GetCompileOptions(options, config, language); - output = - options.end() == std::find(options.begin(), options.end(), "-kernel"); - return output; -} - -bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup() -{ - bool output = false; - std::vector sources = this->GetSources(); - for (std::vector::const_iterator sources_i = sources.begin(); - sources.end() != sources_i; ++sources_i) - { - if ("int" == (*sources_i)->GetExtension()) - { - output = true; - } - } - return output; -} - -bool cmGhsMultiTargetGenerator::DetermineIfDynamicDownload( - std::string const &config, const std::string &language) -{ - std::vector options; - bool output = false; - this->Target->GetCompileOptions(options, config, language); - for (std::vector::const_iterator options_i = options.begin(); - options_i != options.end(); ++options_i) - { - std::string option = *options_i; - if (this->DDOption == option) - { - output = true; - } - } - return output; -} diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h deleted file mode 100644 index 3eecc60..0000000 --- a/Source/cmGhsMultiTargetGenerator.h +++ /dev/null @@ -1,105 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2015 Geoffrey Viola - - 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 cmGhsMultiTargetGenerator_h -#define cmGhsMultiTargetGenerator_h - -#include "cmStandardIncludes.h" -#include "cmTarget.h" -#include "cmGhsMultiGpj.h" - -class cmGeneratedFileStream; -class cmGlobalGhsMultiGenerator; -class cmLocalGhsMultiGenerator; -class cmMakefile; -class cmSourceFile; -class cmGeneratedFileStream; -class cmCustomCommand; - -class cmGhsMultiTargetGenerator -{ -public: - cmGhsMultiTargetGenerator(cmTarget const *target); - - virtual ~cmGhsMultiTargetGenerator(); - - virtual void Generate(); - - bool IncludeThisTarget(); - std::vector GetSources() const; - GhsMultiGpj::Types GetGpjTag() const; - const char *GetAbsBuildFilePath() const - { - return this->AbsBuildFilePath.c_str(); - } - const char *GetRelBuildFileName() const - { - return this->RelBuildFileName.c_str(); - } - const char *GetAbsBuildFileName() const - { - return this->AbsBuildFileName.c_str(); - } - const char *GetAbsOutputFileName() const - { - return this->AbsOutputFileName.c_str(); - } - -private: - cmGlobalGhsMultiGenerator *GetGlobalGenerator() const; - cmGeneratedFileStream *GetFolderBuildStreams() - { - return this->FolderBuildStreams[""]; - }; - bool IsTargetGroup() const { return this->TargetGroup; } - - void WriteTypeSpecifics(const std::string &config, bool notKernel); - void WriteDebugOptions(std::string const &config, bool notKernel); - void WriteCompilerOptions(const std::string &config, - const std::string &language); - void WriteCompilerFlags(); - void WriteCompilerDefinitions(const std::string &config, - const std::string &language); - void WriteIncludes(const std::string &config, const std::string &language); - void WriteTargetLinkLibraries(); - void WriteCustomCommands(); - void - WriteCustomCommandsHelper(std::vector const &commandsSet, - cmTarget::CustomCommandType commandType); - void WriteSources(std::vector const &objectSources); - static void WriteObjectLangOverride(cmGeneratedFileStream *fileStream, - cmSourceFile *sourceFile); - static void WriteObjectDir(cmGeneratedFileStream *fileStream, - std::string const &dir); - std::string GetOutputDirectory(const std::string &config) const; - std::string GetOutputFilename(const std::string &config) const; - - bool IsNotKernel(std::string const &config, const std::string &language); - bool DetermineIfTargetGroup(); - bool DetermineIfDynamicDownload(std::string const &config, - const std::string &language); - - cmTarget const *Target; - cmLocalGhsMultiGenerator *LocalGenerator; - cmMakefile *Makefile; - std::string AbsBuildFilePath; - std::string RelBuildFilePath; - std::string AbsBuildFileName; - std::string RelBuildFileName; - std::string RelOutputFileName; - std::string AbsOutputFileName; - std::map FolderBuildStreams; - bool TargetGroup; - bool DynamicDownload; - static std::string const DDOption; -}; - -#endif // ! cmGhsMultiTargetGenerator_h diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx deleted file mode 100644 index c7337d8..0000000 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ /dev/null @@ -1,532 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2015 Geoffrey Viola - - 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 "cmGlobalGhsMultiGenerator.h" -#include "cmLocalGhsMultiGenerator.h" -#include "cmMakefile.h" -#include "cmVersion.h" -#include "cmGeneratedFileStream.h" -#include "cmGhsMultiTargetGenerator.h" -#include -#include - -const char *cmGlobalGhsMultiGenerator::FILE_EXTENSION = ".gpj"; -const char *cmGlobalGhsMultiGenerator::DEFAULT_MAKE_PROGRAM = "gbuild"; - -cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator() - : OSDirRelative(false) -{ - this->GhsBuildCommandInitialized = false; -} - -cmGlobalGhsMultiGenerator::~cmGlobalGhsMultiGenerator() -{ - cmDeleteAll(TargetFolderBuildStreams); -} - -cmLocalGenerator *cmGlobalGhsMultiGenerator::CreateLocalGenerator() -{ - cmLocalGenerator *lg = new cmLocalGhsMultiGenerator; - lg->SetGlobalGenerator(this); - this->SetCurrentLocalGenerator(lg); - return lg; -} - -void cmGlobalGhsMultiGenerator::GetDocumentation(cmDocumentationEntry &entry) -{ - entry.Name = GetActualName(); - entry.Brief = "Generates Green Hills MULTI files (experimental)."; -} - -void cmGlobalGhsMultiGenerator::EnableLanguage( - std::vector const &l, cmMakefile *mf, bool optional) -{ - mf->AddDefinition("CMAKE_SYSTEM_NAME", "GHS-MULTI"); - mf->AddDefinition("CMAKE_SYSTEM_PROCESSOR", "ARM"); - - const std::string ghsCompRoot(GetCompRoot()); - mf->AddDefinition("GHS_COMP_ROOT", ghsCompRoot.c_str()); - std::string ghsCompRootStart = - 0 == ghsCompRootStart.size() ? "" : ghsCompRoot + "/"; - mf->AddDefinition("CMAKE_C_COMPILER", - std::string(ghsCompRootStart + "ccarm.exe").c_str()); - mf->AddDefinition("CMAKE_C_COMPILER_ID_RUN", "TRUE"); - mf->AddDefinition("CMAKE_C_COMPILER_ID", "GHS"); - mf->AddDefinition("CMAKE_C_COMPILER_FORCED", "TRUE"); - - mf->AddDefinition("CMAKE_CXX_COMPILER", - std::string(ghsCompRootStart + "cxarm.exe").c_str()); - mf->AddDefinition("CMAKE_CXX_COMPILER_ID_RUN", "TRUE"); - mf->AddDefinition("CMAKE_CXX_COMPILER_ID", "GHS"); - mf->AddDefinition("CMAKE_CXX_COMPILER_FORCED", "TRUE"); - - if (!ghsCompRoot.empty()) - { - static const char *compPreFix = "comp_"; - std::string compFilename = - cmsys::SystemTools::FindLastString(ghsCompRoot.c_str(), compPreFix); - cmsys::SystemTools::ReplaceString(compFilename, compPreFix, ""); - mf->AddDefinition("CMAKE_SYSTEM_VERSION", compFilename.c_str()); - } - - mf->AddDefinition("GHSMULTI", "1"); // identifier for user CMake files - this->cmGlobalGenerator::EnableLanguage(l, mf, optional); -} - -void cmGlobalGhsMultiGenerator::FindMakeProgram(cmMakefile *mf) -{ - // The GHS 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->GetGhsBuildCommand().c_str()); - } -} - -std::string const &cmGlobalGhsMultiGenerator::GetGhsBuildCommand() -{ - if (!this->GhsBuildCommandInitialized) - { - this->GhsBuildCommandInitialized = true; - this->GhsBuildCommand = this->FindGhsBuildCommand(); - } - return this->GhsBuildCommand; -} - -std::string cmGlobalGhsMultiGenerator::FindGhsBuildCommand() -{ - std::vector userPaths; - userPaths.push_back(this->GetCompRoot()); - std::string makeProgram = - cmSystemTools::FindProgram(DEFAULT_MAKE_PROGRAM, userPaths); - if (makeProgram.empty()) - { - makeProgram = DEFAULT_MAKE_PROGRAM; - } - return makeProgram; -} - -std::string cmGlobalGhsMultiGenerator::GetCompRoot() -{ - std::string output; - - const std::vector - potentialDirsHardPaths(GetCompRootHardPaths()); - const std::vector potentialDirsRegistry(GetCompRootRegistry()); - - std::vector potentialDirsComplete; - potentialDirsComplete.insert(potentialDirsComplete.end(), - potentialDirsHardPaths.begin(), - potentialDirsHardPaths.end()); - potentialDirsComplete.insert(potentialDirsComplete.end(), - potentialDirsRegistry.begin(), - potentialDirsRegistry.end()); - - // Use latest version - std::string outputDirName; - for (std::vector::const_iterator potentialDirsCompleteIt = - potentialDirsComplete.begin(); - potentialDirsCompleteIt != potentialDirsComplete.end(); - ++potentialDirsCompleteIt) - { - const std::string dirName( - cmsys::SystemTools::GetFilenameName(*potentialDirsCompleteIt)); - if (dirName.compare(outputDirName) > 0) - { - output = *potentialDirsCompleteIt; - outputDirName = dirName; - } - } - - return output; -} - -std::vector cmGlobalGhsMultiGenerator::GetCompRootHardPaths() -{ - std::vector output; - cmSystemTools::Glob("C:/ghs", "comp_[^;]+", output); - for (std::vector::iterator outputIt = output.begin(); - outputIt != output.end(); ++outputIt) - { - *outputIt = "C:/ghs/" + *outputIt; - } - return output; -} - -std::vector cmGlobalGhsMultiGenerator::GetCompRootRegistry() -{ - std::vector output(2); - cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_" - "MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\" - "Windows\\CurrentVersion\\Uninstall\\" - "GreenHillsSoftwared771f1b4;InstallLocation", - output[0]); - cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_" - "MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\" - "Windows\\CurrentVersion\\Uninstall\\" - "GreenHillsSoftware9881cef6;InstallLocation", - output[1]); - return output; -} - -void cmGlobalGhsMultiGenerator::OpenBuildFileStream( - std::string const &filepath, cmGeneratedFileStream **filestream) -{ - // Get a stream where to generate things. - if (NULL == *filestream) - { - *filestream = new cmGeneratedFileStream(filepath.c_str()); - if (NULL != *filestream) - { - OpenBuildFileStream(*filestream); - } - } -} - -void cmGlobalGhsMultiGenerator::OpenBuildFileStream( - cmGeneratedFileStream *filestream) -{ - *filestream << "#!gbuild" << std::endl; -} - -void cmGlobalGhsMultiGenerator::OpenBuildFileStream() -{ - // Compute GHS MULTI's build file path. - std::string buildFilePath = - this->GetCMakeInstance()->GetHomeOutputDirectory(); - buildFilePath += "/"; - buildFilePath += "default"; - buildFilePath += FILE_EXTENSION; - - this->Open(std::string(""), buildFilePath, &this->TargetFolderBuildStreams); - OpenBuildFileStream(GetBuildFileStream()); - - char const *osDir = - this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR"); - if (NULL == osDir) - { - osDir = ""; - cmSystemTools::Error("GHS_OS_DIR cache variable must be set"); - } - else - { - this->GetCMakeInstance()->MarkCliAsUsed("GHS_OS_DIR"); - } - std::string fOSDir(this->trimQuotes(osDir)); - cmSystemTools::ReplaceString(fOSDir, "\\", "/"); - if (!fOSDir.empty() && ('c' == fOSDir[0] || 'C' == fOSDir[0])) - { - this->OSDirRelative = false; - } - else - { - this->OSDirRelative = true; - } - - char const *bspName = - this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME"); - if (NULL == bspName) - { - bspName = ""; - cmSystemTools::Error("GHS_BSP_NAME cache variable must be set"); - } - else - { - this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME"); - } - std::string fBspName(this->trimQuotes(bspName)); - cmSystemTools::ReplaceString(fBspName, "\\", "/"); - this->WriteMacros(); - this->WriteHighLevelDirectives(); - - GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, this->GetBuildFileStream()); - this->WriteDisclaimer(this->GetBuildFileStream()); - *this->GetBuildFileStream() << "# Top Level Project File" << std::endl; - if (!fBspName.empty()) - { - *this->GetBuildFileStream() << " -bsp " << fBspName << std::endl; - } - this->WriteCompilerOptions(fOSDir); -} - -void cmGlobalGhsMultiGenerator::CloseBuildFileStream( - cmGeneratedFileStream **filestream) -{ - if (filestream) - { - delete *filestream; - *filestream = NULL; - } - else - { - cmSystemTools::Error("Build file stream was not open."); - } -} - -void cmGlobalGhsMultiGenerator::Generate() -{ - this->cmGlobalGenerator::Generate(); - - if (!this->LocalGenerators.empty()) - { - this->OpenBuildFileStream(); - - // Build all the folder build files - for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) - { - cmLocalGhsMultiGenerator *lg = - static_cast(this->LocalGenerators[i]); - cmGeneratorTargetsType tgts = lg->GetMakefile()->GetGeneratorTargets(); - this->UpdateBuildFiles(tgts); - } - } - - cmDeleteAll(TargetFolderBuildStreams); - this->TargetFolderBuildStreams.clear(); -} - -void cmGlobalGhsMultiGenerator::GenerateBuildCommand( - std::vector &makeCommand, const std::string &makeProgram, - const std::string & /*projectName*/, const std::string & /*projectDir*/, - const std::string &targetName, const std::string & /*config*/, - bool /*fast*/, bool /*verbose*/, - std::vector const &makeOptions) -{ - makeCommand.push_back( - this->SelectMakeProgram(makeProgram, this->GetGhsBuildCommand()) - ); - - makeCommand.insert(makeCommand.end(), - makeOptions.begin(), makeOptions.end()); - if (!targetName.empty()) - { - if (targetName == "clean") - { - makeCommand.push_back("-clean"); - } - else - { - makeCommand.push_back(targetName); - } - } -} - -void cmGlobalGhsMultiGenerator::WriteMacros() -{ - char const *ghsGpjMacros = - this->GetCMakeInstance()->GetCacheDefinition("GHS_GPJ_MACROS"); - if (NULL != ghsGpjMacros) - { - std::vector expandedList; - cmSystemTools::ExpandListArgument(std::string(ghsGpjMacros), expandedList); - for (std::vector::const_iterator expandedListI = - expandedList.begin(); - expandedListI != expandedList.end(); ++expandedListI) - { - *this->GetBuildFileStream() << "macro " << *expandedListI << std::endl; - } - } -} - -void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives() -{ - *this->GetBuildFileStream() << "primaryTarget=arm_integrity.tgt" - << std::endl; - char const *const customization = - this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION"); - if (NULL != customization && strlen(customization) > 0) - { - *this->GetBuildFileStream() << "customization=" - << trimQuotes(customization) - << std::endl; - this->GetCMakeInstance()->MarkCliAsUsed("GHS_CUSTOMIZATION"); - } -} - -void cmGlobalGhsMultiGenerator::WriteCompilerOptions(std::string const &fOSDir) -{ - *this->GetBuildFileStream() << " -os_dir=\"" << fOSDir << "\"" - << std::endl; - *this->GetBuildFileStream() << " --link_once_templates" << std::endl; -} - -void cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream *os) -{ - (*os) << "#" << std::endl - << "# CMAKE generated file: DO NOT EDIT!" << std::endl - << "# Generated by \"" << GetActualName() << "\"" - << " Generator, CMake Version " << cmVersion::GetMajorVersion() << "." - << cmVersion::GetMinorVersion() << std::endl - << "#" << std::endl; -} - -void cmGlobalGhsMultiGenerator::AddFilesUpToPath( - cmGeneratedFileStream *mainBuildFile, - std::map *targetFolderBuildStreams, - char const *homeOutputDirectory, std::string const &path, - GhsMultiGpj::Types projType, std::string const &relPath) -{ - std::string workingPath(path); - cmSystemTools::ConvertToUnixSlashes(workingPath); - std::vector splitPath = - cmSystemTools::SplitString(workingPath); - std::string workingRelPath(relPath); - cmSystemTools::ConvertToUnixSlashes(workingRelPath); - if (!workingRelPath.empty()) - { - workingRelPath += "/"; - } - std::string pathUpTo; - for (std::vector::const_iterator splitPathI = - splitPath.begin(); - splitPath.end() != splitPathI; ++splitPathI) - { - pathUpTo += *splitPathI; - if (targetFolderBuildStreams->end() == - targetFolderBuildStreams->find(pathUpTo)) - { - AddFilesUpToPathNewBuildFile( - mainBuildFile, targetFolderBuildStreams, homeOutputDirectory, - pathUpTo, splitPath.begin() == splitPathI, workingRelPath, projType); - } - AddFilesUpToPathAppendNextFile(targetFolderBuildStreams, pathUpTo, - splitPathI, splitPath.end(), projType); - pathUpTo += "/"; - } -} - -void cmGlobalGhsMultiGenerator::Open( - std::string const &mapKeyName, std::string const &fileName, - std::map *fileMap) -{ - if (fileMap->end() == fileMap->find(fileName)) - { - cmGeneratedFileStream *temp(new cmGeneratedFileStream); - temp->open(fileName.c_str()); - (*fileMap)[mapKeyName] = temp; - } -} - -void cmGlobalGhsMultiGenerator::AddFilesUpToPathNewBuildFile( - cmGeneratedFileStream *mainBuildFile, - std::map *targetFolderBuildStreams, - char const *homeOutputDirectory, std::string const &pathUpTo, - bool const isFirst, std::string const &relPath, - GhsMultiGpj::Types const projType) -{ - // create folders up to file path - std::string absPath = std::string(homeOutputDirectory) + "/" + relPath; - std::string newPath = absPath + pathUpTo; - if (!cmSystemTools::FileExists(newPath.c_str())) - { - cmSystemTools::MakeDirectory(newPath.c_str()); - } - - // Write out to filename for first time - std::string relFilename(GetFileNameFromPath(pathUpTo)); - std::string absFilename = absPath + relFilename; - Open(pathUpTo, absFilename, targetFolderBuildStreams); - OpenBuildFileStream((*targetFolderBuildStreams)[pathUpTo]); - GhsMultiGpj::WriteGpjTag(projType, (*targetFolderBuildStreams)[pathUpTo]); - WriteDisclaimer((*targetFolderBuildStreams)[pathUpTo]); - - // Add to main build file - if (isFirst) - { - *mainBuildFile << relFilename << " "; - GhsMultiGpj::WriteGpjTag(projType, mainBuildFile); - } -} - -void cmGlobalGhsMultiGenerator::AddFilesUpToPathAppendNextFile( - std::map *targetFolderBuildStreams, - std::string const &pathUpTo, - std::vector::const_iterator splitPathI, - std::vector::const_iterator end, - GhsMultiGpj::Types const projType) -{ - std::vector::const_iterator splitPathNextI = splitPathI + 1; - if (end != splitPathNextI && - targetFolderBuildStreams->end() == - targetFolderBuildStreams->find(pathUpTo + "/" + *splitPathNextI)) - { - std::string nextFilename(*splitPathNextI); - nextFilename = GetFileNameFromPath(nextFilename); - *(*targetFolderBuildStreams)[pathUpTo] << nextFilename << " "; - GhsMultiGpj::WriteGpjTag(projType, (*targetFolderBuildStreams)[pathUpTo]); - } -} - -std::string -cmGlobalGhsMultiGenerator::GetFileNameFromPath(std::string const &path) -{ - std::string output(path); - if (!path.empty()) - { - cmSystemTools::ConvertToUnixSlashes(output); - std::vector splitPath = cmSystemTools::SplitString(output); - output += "/" + splitPath.back() + FILE_EXTENSION; - } - return output; -} - -void cmGlobalGhsMultiGenerator::UpdateBuildFiles( - cmGeneratorTargetsType const &tgts) -{ - for (cmGeneratorTargetsType::const_iterator tgtsI = tgts.begin(); - tgtsI != tgts.end(); ++tgtsI) - { - cmGhsMultiTargetGenerator gmtg(tgtsI->first); - if (!gmtg.GetSources().empty() && gmtg.IncludeThisTarget()) - { - char const *rawFolderName = tgtsI->first->GetProperty("FOLDER"); - if (NULL == rawFolderName) - { - rawFolderName = ""; - } - std::string folderName(rawFolderName); - if (this->TargetFolderBuildStreams.end() == - this->TargetFolderBuildStreams.find(folderName)) - { - this->AddFilesUpToPath( - GetBuildFileStream(), &this->TargetFolderBuildStreams, - this->GetCMakeInstance()->GetHomeOutputDirectory(), folderName, - GhsMultiGpj::PROJECT); - } - std::vector splitPath = - cmSystemTools::SplitString(gmtg.GetRelBuildFileName()); - std::string foldNameRelBuildFile(*(splitPath.end() - 2) + "/" + - splitPath.back()); - *this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile - << " "; - GhsMultiGpj::WriteGpjTag(gmtg.GetGpjTag(), - this->TargetFolderBuildStreams[folderName]); - } - } -} - -std::string cmGlobalGhsMultiGenerator::trimQuotes(std::string const &str) -{ - std::string result; - result.reserve(str.size()); - for (const char *ch = str.c_str(); *ch != '\0'; ++ch) - { - if (*ch != '"') - { - result += *ch; - } - } - return result; -} diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h deleted file mode 100644 index 2fea75a..0000000 --- a/Source/cmGlobalGhsMultiGenerator.h +++ /dev/null @@ -1,126 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2015 Geoffrey Viola - - 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 cmGhsMultiGenerator_h -#define cmGhsMultiGenerator_h - -#include "cmGlobalGeneratorFactory.h" -#include "cmGlobalGenerator.h" -#include "cmGhsMultiGpj.h" - -class cmGeneratedFileStream; - -class cmGlobalGhsMultiGenerator : public cmGlobalGenerator -{ -public: - /// The default name of GHS MULTI's build file. Typically: monolith.gpj. - static const char *FILE_EXTENSION; - - cmGlobalGhsMultiGenerator(); - ~cmGlobalGhsMultiGenerator(); - - static cmGlobalGeneratorFactory *NewFactory() - { return new cmGlobalGeneratorSimpleFactory(); } - - ///! create the correct local generator - virtual cmLocalGenerator *CreateLocalGenerator(); - - /// @return the name of this generator. - static std::string GetActualName() { return "Green Hills MULTI"; } - ///! Get the name for this generator - virtual std::string GetName() const { return this->GetActualName(); } - - /// Overloaded methods. @see cmGlobalGenerator::GetDocumentation() - static void GetDocumentation(cmDocumentationEntry &entry); - - /** - * Try to determine system information such as shared library - * extension, pthreads, byte order etc. - */ - virtual void EnableLanguage(std::vector const &languages, - cmMakefile *, bool optional); - /* - * Determine what program to use for building the project. - */ - virtual void FindMakeProgram(cmMakefile *); - - cmGeneratedFileStream *GetBuildFileStream() - { - return this->TargetFolderBuildStreams[""]; - } - - static void OpenBuildFileStream(std::string const &filepath, - cmGeneratedFileStream **filestream); - static void OpenBuildFileStream(cmGeneratedFileStream *filestream); - static void CloseBuildFileStream(cmGeneratedFileStream **filestream); - /// Write the common disclaimer text at the top of each build file. - static void WriteDisclaimer(std::ostream *os); - std::vector GetLibDirs() { return this->LibDirs; } - - static void AddFilesUpToPath( - cmGeneratedFileStream *mainBuildFile, - std::map *targetFolderBuildStreams, - char const *homeOutputDirectory, std::string const &path, - GhsMultiGpj::Types projType, std::string const &relPath = ""); - static void Open(std::string const &mapKeyName, std::string const &fileName, - std::map *fileMap); - - static std::string trimQuotes(std::string const &str); - inline bool IsOSDirRelative() { return this->OSDirRelative; } - -protected: - virtual void Generate(); - virtual void GenerateBuildCommand( - std::vector &makeCommand, const std::string &makeProgram, - const std::string &projectName, const std::string &projectDir, - const std::string &targetName, const std::string &config, bool fast, - bool verbose, - std::vector const& makeOptions = std::vector() - ); - -private: - std::string const &GetGhsBuildCommand(); - std::string FindGhsBuildCommand(); - std::string GetCompRoot(); - std::vector GetCompRootHardPaths(); - std::vector GetCompRootRegistry(); - void OpenBuildFileStream(); - - void WriteMacros(); - void WriteHighLevelDirectives(); - void WriteCompilerOptions(std::string const &fOSDir); - - static void AddFilesUpToPathNewBuildFile( - cmGeneratedFileStream *mainBuildFile, - std::map *targetFolderBuildStreams, - char const *homeOutputDirectory, std::string const &pathUpTo, - bool isFirst, std::string const &relPath, GhsMultiGpj::Types projType); - static void AddFilesUpToPathAppendNextFile( - std::map *targetFolderBuildStreams, - std::string const &pathUpTo, - std::vector::const_iterator splitPathI, - std::vector::const_iterator end, - GhsMultiGpj::Types projType); - static std::string GetFileNameFromPath(std::string const &path); - void UpdateBuildFiles(cmGeneratorTargetsType const &tgts); - - std::vector TargetSubProjects; - std::map TargetFolderBuildStreams; - - std::vector LibDirs; - - bool OSDirRelative; - bool GhsBuildCommandInitialized; - std::string GhsBuildCommand; - static const char *DEFAULT_MAKE_PROGRAM; -}; - -#endif diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 2ade825..f74f1e0 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -576,7 +576,6 @@ bool cmGlobalNinjaGenerator::UsingMinGW = false; // Implemented by: // cmGlobalUnixMakefileGenerator3 -// cmGlobalGhsMultiGenerator // cmGlobalVisualStudio10Generator // cmGlobalVisualStudio6Generator // cmGlobalVisualStudio7Generator diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx deleted file mode 100644 index 8773715..0000000 --- a/Source/cmLocalGhsMultiGenerator.cxx +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2015 Geoffrey Viola - - 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 "cmLocalGhsMultiGenerator.h" -#include "cmGlobalGhsMultiGenerator.h" -#include "cmGeneratorTarget.h" -#include "cmMakefile.h" -#include "cmGhsMultiTargetGenerator.h" -#include "cmGeneratedFileStream.h" - -cmLocalGhsMultiGenerator::cmLocalGhsMultiGenerator() {} - -cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator() {} - -void cmLocalGhsMultiGenerator::Generate() -{ - cmGeneratorTargetsType tgts = this->GetMakefile()->GetGeneratorTargets(); - if (!tgts.empty()) - { - for (cmGeneratorTargetsType::iterator l = tgts.begin(); l != tgts.end(); - ++l) - { - cmGhsMultiTargetGenerator tg(l->second->Target); - tg.Generate(); - } - } -} - -// Implemented in: -// cmLocalGenerator. -// Used in: -// Source/cmMakefile.cxx -// Source/cmGlobalGenerator.cxx -void cmLocalGhsMultiGenerator::Configure() -{ - // Compute the path to use when referencing the current output - // directory from the top output directory. - this->HomeRelativeOutputPath = - this->Convert(this->Makefile->GetStartOutputDirectory(), HOME_OUTPUT); - if (this->HomeRelativeOutputPath == ".") - { - this->HomeRelativeOutputPath = ""; - } - this->cmLocalGenerator::Configure(); -} diff --git a/Source/cmLocalGhsMultiGenerator.h b/Source/cmLocalGhsMultiGenerator.h deleted file mode 100644 index a8df3e7..0000000 --- a/Source/cmLocalGhsMultiGenerator.h +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2015 Geoffrey Viola - - 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 cmLocalGhsMultiGenerator_h -#define cmLocalGhsMultiGenerator_h - -#include "cmLocalGenerator.h" - -class cmGeneratedFileStream; - -/** \class cmLocalGhsMultiGenerator - * \brief Write Green Hills MULTI project files. - * - * cmLocalGhsMultiGenerator produces a set of .gpj - * file for each target in its mirrored directory. - */ -class cmLocalGhsMultiGenerator : public cmLocalGenerator -{ -public: - cmLocalGhsMultiGenerator(); - - virtual ~cmLocalGhsMultiGenerator(); - - /// @returns the relative path between the HomeOutputDirectory and this - /// local generators StartOutputDirectory. - std::string GetHomeRelativeOutputPath() const - { - return this->HomeRelativeOutputPath; - } - - /** - * Generate the makefile for this directory. - */ - virtual void Generate(); - - /// Overloaded methods. @see cmLocalGenerator::Configure() - virtual void Configure(); - const char *GetBuildFileName() { return this->BuildFileName.c_str(); } - -protected: - virtual bool CustomCommandUseLocal() const { return true; } - -private: - std::string BuildFileName; - std::string HomeRelativeOutputPath; -}; - -#endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 631397b..51df7f2 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -63,7 +63,6 @@ # include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h" # include "cmGlobalJOMMakefileGenerator.h" -# include "cmGlobalGhsMultiGenerator.h" # define CMAKE_HAVE_VS_GENERATORS # endif # include "cmGlobalMSYSMakefileGenerator.h" @@ -1842,8 +1841,6 @@ void cmake::AddDefaultGenerators() cmGlobalNMakeMakefileGenerator::NewFactory()); this->Generators.push_back( cmGlobalJOMMakefileGenerator::NewFactory()); - this->Generators.push_back( - cmGlobalGhsMultiGenerator::NewFactory()); # endif this->Generators.push_back( cmGlobalMSYSMakefileGenerator::NewFactory()); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 87727c7..49fd02b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1938,23 +1938,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() endif() - if (CMake_TEST_GreenHillsMULTI) - macro(add_test_GhsMulti name primaryTarget bspName) - add_test(NAME GhsMulti.${name} COMMAND ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/GhsMulti" - "${CMake_BINARY_DIR}/Tests/GhsMulti/${name}" - --build-generator "Green Hills MULTI" - --build-project ReturnNum - --build-config $ - --build-options -DGHS_PRIMARY_TARGET=${primaryTarget} - -DGHS_BSP_NAME=${bspName} - ) - endmacro () - add_test_GhsMulti("arm_integrity_simarm" "arm_integrity.tgt" "simarm") - add_test_GhsMulti("arm64_integrity_simarm" "arm64_integrity.tgt" "simarm") - endif () - if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ") macro(add_test_VSNsightTegra name generator) add_test(NAME VSNsightTegra.${name} COMMAND ${CMAKE_CTEST_COMMAND} diff --git a/Tests/GhsMulti/CMakeLists.txt b/Tests/GhsMulti/CMakeLists.txt deleted file mode 100644 index 6e15ba9..0000000 --- a/Tests/GhsMulti/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(ReturnNum) - -add_subdirectory(ReturnNum) diff --git a/Tests/GhsMulti/ReturnNum/App/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/App/CMakeLists.txt deleted file mode 100644 index 2adbd4e..0000000 --- a/Tests/GhsMulti/ReturnNum/App/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Lib) -add_executable(App Main.c) -target_link_libraries(App Lib) -target_compile_options(App PUBLIC "-non_shared") diff --git a/Tests/GhsMulti/ReturnNum/App/Main.c b/Tests/GhsMulti/ReturnNum/App/Main.c deleted file mode 100644 index 1133834..0000000 --- a/Tests/GhsMulti/ReturnNum/App/Main.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "HelperFun.h" - -int main(int argc, const char* argv[]) -{ - int out; - out = giveNum(); - return out; -} diff --git a/Tests/GhsMulti/ReturnNum/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/CMakeLists.txt deleted file mode 100644 index 7bcc5f9..0000000 --- a/Tests/GhsMulti/ReturnNum/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(App) -add_subdirectory(Int) -add_subdirectory(Lib) diff --git a/Tests/GhsMulti/ReturnNum/Int/AppDD.int b/Tests/GhsMulti/ReturnNum/Int/AppDD.int deleted file mode 100644 index 9e22b5e..0000000 --- a/Tests/GhsMulti/ReturnNum/Int/AppDD.int +++ /dev/null @@ -1,12 +0,0 @@ -# Input File for the Integrate utility for use with the INTEGRITY real-time -# operating system by Green Hills Software. -# Before editing this file, refer to the Integrate Reference Manual. - -Kernel - Filename DynamicDownload -EndKernel - -AddressSpace App - Filename "App/App.as" - Language C -EndAddressSpace diff --git a/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt deleted file mode 100644 index 44c5de1..0000000 --- a/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_executable(AppDD AppDD.int Default.bsp) diff --git a/Tests/GhsMulti/ReturnNum/Int/Default.bsp b/Tests/GhsMulti/ReturnNum/Int/Default.bsp deleted file mode 100644 index 224ec29..0000000 --- a/Tests/GhsMulti/ReturnNum/Int/Default.bsp +++ /dev/null @@ -1,35 +0,0 @@ -# Target description File for the Integrate utility for use with the -# INTEGRITY real-time operating system by Green Hills Software. -# Before editing this file, refer to your Integrate documentation. -# default.bsp is appropriate for INTEGRITY applications which are -# fully linked with the kernel (for RAM or ROM) or dynamically downloaded. -# -# MinimumAddress must match the value of .ramend in the linker directives -# file used for the KernelSpace program - see default.ld for more info. -# The MaximumAddress used here allows memory mappings to be specified -# for up to the 16 MB mark in RAM. Intex will not permit programs -# that require more memory for its mappings. If the board has less -# memory, this number can be reduced by the user. - -Target - MinimumAddress .ramend - MaximumAddress .ramlimit - Clock StandardTick - EndClock - Clock HighResTimer - EndClock - IODevice "SerialDev0" - InitialKernelObjects 200 - DefaultStartIt false - DefaultMaxPriority 255 - DefaultPriority 127 - DefaultWeight 1 - DefaultMaxWeight 255 - DefaultHeapSize 0x10000 - LastVirtualAddress 0x3fffffff - PageSize 0x1000 - ArchitectedPageSize 0x1000 - ArchitectedPageSize 0x10000 - ArchitectedPageSize 0x100000 - DefaultMemoryRegionSize 0x20000 -EndTarget diff --git a/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt deleted file mode 100644 index 9c822da..0000000 --- a/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_library(Lib HelperFun.c HelperFun.h) \ No newline at end of file diff --git a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.c b/Tests/GhsMulti/ReturnNum/Lib/HelperFun.c deleted file mode 100644 index d7515d7..0000000 --- a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.c +++ /dev/null @@ -1,4 +0,0 @@ -int giveNum(void) -{ - return 1; -} diff --git a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.h b/Tests/GhsMulti/ReturnNum/Lib/HelperFun.h deleted file mode 100644 index 00971b0..0000000 --- a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.h +++ /dev/null @@ -1 +0,0 @@ -int giveNum(void); ----------------------------------------------------------------------- Summary of changes: Help/generator/Green Hills MULTI.rst | 11 - Help/manual/cmake-generators.7.rst | 1 - Help/manual/cmake-variables.7.rst | 1 - Help/variable/CMAKE_MAKE_PROGRAM.rst | 4 - Help/variable/CMAKE_SYSTEM_PROCESSOR.rst | 2 - Help/variable/GHS-MULTI.rst | 4 - Modules/Compiler/GHS-C.cmake | 7 - Modules/Compiler/GHS-CXX.cmake | 7 - Modules/Compiler/GHS-DetermineCompiler.cmake | 6 - Modules/FindBoost.cmake | 5 +- Modules/Platform/GHS-MULTI-Initialize.cmake | 29 -- Modules/Platform/GHS-MULTI.cmake | 27 -- Source/CMakeLists.txt | 9 - Source/cmGhsMultiGpj.cxx | 41 -- Source/cmGhsMultiGpj.h | 33 -- Source/cmGhsMultiTargetGenerator.cxx | 518 ------------------------- Source/cmGhsMultiTargetGenerator.h | 105 ----- Source/cmGlobalGhsMultiGenerator.cxx | 532 -------------------------- Source/cmGlobalGhsMultiGenerator.h | 126 ------ Source/cmGlobalNinjaGenerator.cxx | 1 - Source/cmLocalGhsMultiGenerator.cxx | 53 --- Source/cmLocalGhsMultiGenerator.h | 56 --- Source/cmake.cxx | 3 - Tests/CMakeLists.txt | 17 - Tests/GhsMulti/CMakeLists.txt | 4 - Tests/GhsMulti/ReturnNum/App/CMakeLists.txt | 4 - Tests/GhsMulti/ReturnNum/App/Main.c | 8 - Tests/GhsMulti/ReturnNum/CMakeLists.txt | 3 - Tests/GhsMulti/ReturnNum/Int/AppDD.int | 12 - Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt | 1 - Tests/GhsMulti/ReturnNum/Int/Default.bsp | 35 -- Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt | 1 - Tests/GhsMulti/ReturnNum/Lib/HelperFun.c | 4 - Tests/GhsMulti/ReturnNum/Lib/HelperFun.h | 1 - 34 files changed, 1 insertion(+), 1670 deletions(-) delete mode 100644 Help/generator/Green Hills MULTI.rst delete mode 100644 Help/variable/GHS-MULTI.rst delete mode 100644 Modules/Compiler/GHS-C.cmake delete mode 100644 Modules/Compiler/GHS-CXX.cmake delete mode 100644 Modules/Compiler/GHS-DetermineCompiler.cmake delete mode 100644 Modules/Platform/GHS-MULTI-Initialize.cmake delete mode 100644 Modules/Platform/GHS-MULTI.cmake delete mode 100644 Source/cmGhsMultiGpj.cxx delete mode 100644 Source/cmGhsMultiGpj.h delete mode 100644 Source/cmGhsMultiTargetGenerator.cxx delete mode 100644 Source/cmGhsMultiTargetGenerator.h delete mode 100644 Source/cmGlobalGhsMultiGenerator.cxx delete mode 100644 Source/cmGlobalGhsMultiGenerator.h delete mode 100644 Source/cmLocalGhsMultiGenerator.cxx delete mode 100644 Source/cmLocalGhsMultiGenerator.h delete mode 100644 Tests/GhsMulti/CMakeLists.txt delete mode 100644 Tests/GhsMulti/ReturnNum/App/CMakeLists.txt delete mode 100644 Tests/GhsMulti/ReturnNum/App/Main.c delete mode 100644 Tests/GhsMulti/ReturnNum/CMakeLists.txt delete mode 100644 Tests/GhsMulti/ReturnNum/Int/AppDD.int delete mode 100644 Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt delete mode 100644 Tests/GhsMulti/ReturnNum/Int/Default.bsp delete mode 100644 Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt delete mode 100644 Tests/GhsMulti/ReturnNum/Lib/HelperFun.c delete mode 100644 Tests/GhsMulti/ReturnNum/Lib/HelperFun.h hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 11:10:56 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 11:10:56 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1441-ga9dac6a Message-ID: <20150403151056.9D490AB92F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a9dac6a3003102b33da94545a7469cf52b6c726e (commit) via 6ed6ef6237fedc0c187163d8b6c26fb0c9ca43c7 (commit) from 4b0e1f93a52b005d332537bf0ae9062022a27a1f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a9dac6a3003102b33da94545a7469cf52b6c726e commit a9dac6a3003102b33da94545a7469cf52b6c726e Merge: 4b0e1f9 6ed6ef6 Author: Brad King AuthorDate: Fri Apr 3 11:10:55 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 11:10:55 2015 -0400 Merge topic 'doc-generator-groups' into next 6ed6ef62 Help: Split cmake-generators(7) into linkable subsections http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ed6ef6237fedc0c187163d8b6c26fb0c9ca43c7 commit 6ed6ef6237fedc0c187163d8b6c26fb0c9ca43c7 Author: Brad King AuthorDate: Fri Apr 3 11:04:57 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 11:04:57 2015 -0400 Help: Split cmake-generators(7) into linkable subsections Many places in our documentation refer to "Makefile Generators" or "Visual Studio" generators as a group of generators. Give such places a linkable document section to reference since they cannot cross-reference the individual generators in the groups. diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst index 804229b..6f76fb1 100644 --- a/Help/manual/cmake-generators.7.rst +++ b/Help/manual/cmake-generators.7.rst @@ -34,6 +34,11 @@ These generators support command-line build tools. In order to use them, one must launch CMake from a command-line prompt whose environment is already configured for the chosen compiler and build tool. +.. _`Makefile Generators`: + +Makefile Generators +^^^^^^^^^^^^^^^^^^^ + .. toctree:: :maxdepth: 1 @@ -42,10 +47,17 @@ already configured for the chosen compiler and build tool. /generator/MinGW Makefiles /generator/NMake Makefiles /generator/NMake Makefiles JOM - /generator/Ninja /generator/Unix Makefiles /generator/Watcom WMake +Ninja Generator +^^^^^^^^^^^^^^^ + +.. toctree:: + :maxdepth: 1 + + /generator/Ninja + IDE Build Tool Generators ------------------------- @@ -53,6 +65,11 @@ These generators support Integrated Development Environment (IDE) project files. Since the IDEs configure their own environment one may launch CMake from any environment. +.. _`Visual Studio Generators`: + +Visual Studio Generators +^^^^^^^^^^^^^^^^^^^^^^^^ + .. toctree:: :maxdepth: 1 @@ -65,6 +82,13 @@ one may launch CMake from any environment. /generator/Visual Studio 11 2012 /generator/Visual Studio 12 2013 /generator/Visual Studio 14 2015 + +Xcode Generator +^^^^^^^^^^^^^^^ + +.. toctree:: + :maxdepth: 1 + /generator/Xcode Extra Generators ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-generators.7.rst | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From nilsgladitz at gmail.com Fri Apr 3 12:06:43 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Fri, 3 Apr 2015 12:06:43 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1443-g3767353 Message-ID: <20150403160643.77CA3ADBE6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 376735330961be67cef3a0ccd9a3e9d377427860 (commit) via bfbf0bc02d8e689eb71c15b9230e4b122080efdb (commit) from a9dac6a3003102b33da94545a7469cf52b6c726e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=376735330961be67cef3a0ccd9a3e9d377427860 commit 376735330961be67cef3a0ccd9a3e9d377427860 Merge: a9dac6a bfbf0bc Author: Nils Gladitz AuthorDate: Fri Apr 3 12:06:42 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 12:06:42 2015 -0400 Merge topic 'gcov-module-coverage-exclude' into next bfbf0bc0 CTestCoverageCollectGCOV: Fix visual studio test issues http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bfbf0bc02d8e689eb71c15b9230e4b122080efdb commit bfbf0bc02d8e689eb71c15b9230e4b122080efdb Author: Nils Gladitz AuthorDate: Fri Apr 3 18:05:35 2015 +0200 Commit: Nils Gladitz CommitDate: Fri Apr 3 18:05:35 2015 +0200 CTestCoverageCollectGCOV: Fix visual studio test issues diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2a54648..d9988b2 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2345,6 +2345,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" @ONLY ESCAPE_QUOTES) add_test(CTestCoverageCollectGCOV ${CMAKE_CTEST_COMMAND} + -C \${CTEST_CONFIGURATION_TYPE} -S "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" -VV --output-log "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/testOut.log" ) diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt b/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt index a492fd3..ce6fac4 100644 --- a/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt +++ b/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt @@ -4,21 +4,29 @@ project(TestProject CXX) include(CTest) -add_executable(myexecutable +set(SOURCES main.cpp 3rdparty/foo.cpp extra/extra.cpp ) +add_executable(myexecutable ${SOURCES}) + set_property(SOURCE main.cpp APPEND PROPERTY LABELS SourceLabel) set_property(TARGET myexecutable APPEND PROPERTY LABELS TargetLabel) +set(MYEXECUTABLE_INFO_FILE "${CMAKE_CURRENT_BINARY_DIR}/myexecutable_info.cmake") + +file(WRITE "${MYEXECUTABLE_INFO_FILE}" " + set(TARGET myexecutable) + set(SOURCE_DIR \"${CMAKE_CURRENT_SOURCE_DIR}\") + set(SOURCES \"${SOURCES}\") +") + add_custom_command(TARGET myexecutable POST_BUILD - COMMAND ${CMAKE_COMMAND} - - -DTARGET=myexecutable - "-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}" - "-DSOURCES=$" + COMMAND ${CMAKE_COMMAND} + "-DINFO_FILE=${MYEXECUTABLE_INFO_FILE}" -P "${CMAKE_CURRENT_SOURCE_DIR}/fake_compile_time_gcno.cmake" VERBATIM ) diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake b/Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake index 5c87589..881460b 100644 --- a/Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake +++ b/Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake @@ -1,3 +1,5 @@ +include("${INFO_FILE}") + foreach(source ${SOURCES}) file(WRITE "CMakeFiles/${TARGET}.dir/${source}.gcno" "${SOURCE_DIR}/${source}" diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in index c5613fb..29f7e7f 100644 --- a/Tests/CTestCoverageCollectGCOV/test.cmake.in +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -27,16 +27,21 @@ ctest_coverage_collect_gcov( GCOV_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}) + ${CMAKE_COMMAND} -E tar tf ${tar_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +string(REPLACE "\n" ";" out "${out}") +list(SORT out) set(expected_out -"Testing/CoverageInfo/main.cpp.gcov -Testing/CoverageInfo/extra.cpp.gcov -Testing/CoverageInfo/data.json -CMakeFiles/myexecutable.dir/Labels.json -") + CMakeFiles/myexecutable.dir/Labels.json + Testing/CoverageInfo/data.json + Testing/CoverageInfo/extra.cpp.gcov + Testing/CoverageInfo/main.cpp.gcov +) if("${out}" STREQUAL "${expected_out}") message("PASSED with correct output: ${out}") ----------------------------------------------------------------------- Summary of changes: Tests/CMakeLists.txt | 1 + .../TestProject/CMakeLists.txt | 18 ++++++++++++----- .../TestProject/fake_compile_time_gcno.cmake | 2 ++ Tests/CTestCoverageCollectGCOV/test.cmake.in | 21 ++++++++++++-------- 4 files changed, 29 insertions(+), 13 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:24:20 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:24:20 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1445-g8ef0be1 Message-ID: <20150403172420.2AAB3AD3B9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8ef0be186ceb31671a17b539ee4602da23c33a0d (commit) via af924827120f39f1a7a940bc3f6bc487665145d9 (commit) from 376735330961be67cef3a0ccd9a3e9d377427860 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8ef0be186ceb31671a17b539ee4602da23c33a0d commit 8ef0be186ceb31671a17b539ee4602da23c33a0d Merge: 3767353 af92482 Author: Brad King AuthorDate: Fri Apr 3 13:24:19 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 13:24:19 2015 -0400 Merge topic 'makefile-depscan-BOM' into next af924827 Makefile: Tolerate a BOM while scanning source dependencies (#15493) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af924827120f39f1a7a940bc3f6bc487665145d9 commit af924827120f39f1a7a940bc3f6bc487665145d9 Author: Brad King AuthorDate: Fri Apr 3 11:15:12 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 13:04:57 2015 -0400 Makefile: Tolerate a BOM while scanning source dependencies (#15493) Otherwise an #include directive on the first line of a source file is ignored if the file contains a Byte-Order-Mark. Suggested-by: Aleksey Konovalov diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 63d8fa6..6cdd4c1 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -242,13 +242,22 @@ bool cmDependsC::WriteDependencies(const std::set& sources, cmsys::ifstream fin(fullName.c_str()); if(fin) { - // Add this file as a dependency. - dependencies.insert(fullName); + cmsys::FStream::BOM bom = cmsys::FStream::ReadBOM(fin); + if(bom == cmsys::FStream::BOM_None || + bom == cmsys::FStream::BOM_UTF8) + { + // Add this file as a dependency. + dependencies.insert(fullName); - // Scan this file for new dependencies. Pass the directory - // containing the file to handle double-quote includes. - std::string dir = cmSystemTools::GetFilenamePath(fullName); - this->Scan(fin, dir.c_str(), fullName); + // Scan this file for new dependencies. Pass the directory + // containing the file to handle double-quote includes. + std::string dir = cmSystemTools::GetFilenamePath(fullName); + this->Scan(fin, dir.c_str(), fullName); + } + else + { + // Skip file with encoding we do not implement. + } } } } diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index a9c49e7..e8b4584 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -80,3 +80,29 @@ run_cmake(D_nested_cache) set(RunCMake_TEST_OPTIONS "-DFOO:STRING=-DBAR:BOOL=BAZ") run_cmake(D_typed_nested_cache) + +function(run_cmake_depends) + set(RunCMake_TEST_SOURCE_DIR "${RunCMake_SOURCE_DIR}/cmake_depends") + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/cmake_depends-build") + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + file(WRITE "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/DepTarget.dir/DependInfo.cmake" " +set(CMAKE_DEPENDS_LANGUAGES \"C\") +set(CMAKE_DEPENDS_CHECK_C + \"${RunCMake_TEST_SOURCE_DIR}/test.c\" + \"${RunCMake_TEST_BINARY_DIR}/CMakeFiles/DepTarget.dir/test.c.o\" + ) +") + file(WRITE "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/CMakeDirectoryInformation.cmake" " +set(CMAKE_RELATIVE_PATH_TOP_SOURCE \"${RunCMake_TEST_SOURCE_DIR}\") +set(CMAKE_RELATIVE_PATH_TOP_BINARY \"${RunCMake_TEST_BINARY_DIR}\") +") + run_cmake_command(cmake_depends ${CMAKE_COMMAND} -E cmake_depends + "Unix Makefiles" + ${RunCMake_TEST_SOURCE_DIR} ${RunCMake_TEST_SOURCE_DIR} + ${RunCMake_TEST_BINARY_DIR} ${RunCMake_TEST_BINARY_DIR} + ${RunCMake_TEST_BINARY_DIR}/CMakeFiles/DepTarget.dir/DependInfo.cmake + ) +endfunction() +run_cmake_depends() diff --git a/Tests/RunCMake/CommandLine/cmake_depends-check.cmake b/Tests/RunCMake/CommandLine/cmake_depends-check.cmake new file mode 100644 index 0000000..031478b --- /dev/null +++ b/Tests/RunCMake/CommandLine/cmake_depends-check.cmake @@ -0,0 +1,13 @@ +set(depend_make "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/DepTarget.dir/depend.make") +if(EXISTS "${depend_make}") + file(READ "${depend_make}" depend_make_content) + string(REGEX REPLACE "\n+$" "" depend_make_content "${depend_make_content}") + if(NOT depend_make_content MATCHES " +CMakeFiles/DepTarget.dir/test.c.o: .*/Tests/RunCMake/CommandLine/cmake_depends/test.c +CMakeFiles/DepTarget.dir/test.c.o: .*/Tests/RunCMake/CommandLine/cmake_depends/test.h$") + string(REPLACE "\n" "\n " depend_make_content " ${depend_make_content}") + set(RunCMake_TEST_FAILED "depend.make does not have expected content:\n${depend_make_content}") + endif() +else() + set(RunCMake_TEST_FAILED "depend.make missing:\n ${depend_make}") +endif() diff --git a/Tests/RunCMake/CommandLine/cmake_depends-stdout.txt b/Tests/RunCMake/CommandLine/cmake_depends-stdout.txt new file mode 100644 index 0000000..8fe092b --- /dev/null +++ b/Tests/RunCMake/CommandLine/cmake_depends-stdout.txt @@ -0,0 +1 @@ +^Scanning dependencies of target DepTarget$ diff --git a/Tests/RunCMake/CommandLine/cmake_depends/test.c b/Tests/RunCMake/CommandLine/cmake_depends/test.c new file mode 100644 index 0000000..92c056f --- /dev/null +++ b/Tests/RunCMake/CommandLine/cmake_depends/test.c @@ -0,0 +1,2 @@ +?#include "test.h" +#include "test_UTF-16LE.h" diff --git a/Tests/RunCMake/CommandLine/cmake_depends/test.h b/Tests/RunCMake/CommandLine/cmake_depends/test.h new file mode 100644 index 0000000..fd87388 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cmake_depends/test.h @@ -0,0 +1 @@ +void test(void) {} diff --git a/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h b/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h new file mode 100644 index 0000000..bf56ec6 Binary files /dev/null and b/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h differ ----------------------------------------------------------------------- Summary of changes: Source/cmDependsC.cxx | 21 +++++++++++----- Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 26 ++++++++++++++++++++ .../RunCMake/CommandLine/cmake_depends-check.cmake | 13 ++++++++++ .../RunCMake/CommandLine/cmake_depends-stdout.txt | 1 + Tests/RunCMake/CommandLine/cmake_depends/test.c | 2 ++ Tests/RunCMake/CommandLine/cmake_depends/test.h | 1 + .../CommandLine/cmake_depends/test_UTF-16LE.h | Bin 0 -> 58 bytes 7 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 Tests/RunCMake/CommandLine/cmake_depends-check.cmake create mode 100644 Tests/RunCMake/CommandLine/cmake_depends-stdout.txt create mode 100644 Tests/RunCMake/CommandLine/cmake_depends/test.c create mode 100644 Tests/RunCMake/CommandLine/cmake_depends/test.h create mode 100644 Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:38:04 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:38:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-602-g84136c5 Message-ID: <20150403173804.1CABDADB0E@public.kitware.com> This is an automated email from 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 84136c5a83bf9e1caf158a37f987465a8f39f8d0 (commit) via 6ed6ef6237fedc0c187163d8b6c26fb0c9ca43c7 (commit) from e46224a7cdbcbbfce63f21096bf2b4a5f01c3c13 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=84136c5a83bf9e1caf158a37f987465a8f39f8d0 commit 84136c5a83bf9e1caf158a37f987465a8f39f8d0 Merge: e46224a 6ed6ef6 Author: Brad King AuthorDate: Fri Apr 3 13:38:03 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 13:38:03 2015 -0400 Merge topic 'doc-generator-groups' 6ed6ef62 Help: Split cmake-generators(7) into linkable subsections ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-generators.7.rst | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:38:06 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:38:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-608-gb6b77bb Message-ID: <20150403173806.09F25ADB1E@public.kitware.com> This is an automated email from 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 b6b77bb750f30c452053ad4c28e4c69b1e7950e0 (commit) via 3af137824d993ca0a7c18c0768efb12b76154ad0 (commit) via 227992c3a693bb56ee6f6600a10c6eb19c6fb311 (commit) via 031d894fb882ca2e8c2269ba1674578f82155420 (commit) via 6e331ce9d47c8f9adbf29ee0158b4307debbc02c (commit) via ba9b9d79fb1a753c564be44e17e2d3b979f8108c (commit) from 84136c5a83bf9e1caf158a37f987465a8f39f8d0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b6b77bb750f30c452053ad4c28e4c69b1e7950e0 commit b6b77bb750f30c452053ad4c28e4c69b1e7950e0 Merge: 84136c5 3af1378 Author: Brad King AuthorDate: Fri Apr 3 13:38:04 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 13:38:04 2015 -0400 Merge topic 'doc-relocatable-usage-requirements' 3af13782 Help: Update discussion of relocable packages in cmake-packages(7) 227992c3 Help: Reorganize and refine discussion of relocatable packages 031d894f Help: Place relocatable package notes in their own subsections 6e331ce9 Help: Fix typo in cmake-packages(7) manual ba9b9d79 Help: Fix syntax in non-relocatable usage requirements example ----------------------------------------------------------------------- Summary of changes: Help/command/target_include_directories.rst | 3 + Help/command/target_link_libraries.rst | 9 +- .../INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt | 38 ++--- Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt | 25 +-- Help/manual/cmake-buildsystem.7.rst | 5 + Help/manual/cmake-packages.7.rst | 178 ++++++++++++-------- Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst | 3 + Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst | 3 + Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst | 3 + Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst | 3 + 10 files changed, 153 insertions(+), 117 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:38:19 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:38:19 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1448-g11ba38d Message-ID: <20150403173819.0AA42ADB0D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 11ba38d71755f63deaadca5d04e1fba9f30fba93 (commit) via b6b77bb750f30c452053ad4c28e4c69b1e7950e0 (commit) via 84136c5a83bf9e1caf158a37f987465a8f39f8d0 (commit) from 8ef0be186ceb31671a17b539ee4602da23c33a0d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=11ba38d71755f63deaadca5d04e1fba9f30fba93 commit 11ba38d71755f63deaadca5d04e1fba9f30fba93 Merge: 8ef0be1 b6b77bb Author: Brad King AuthorDate: Fri Apr 3 13:38:12 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 13:38:12 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:39:39 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:39:39 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1450-g3e6403f Message-ID: <20150403173939.0BBA8AB238@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3e6403fda35e95867bdc41ccb77b59513a9cbf80 (commit) via 562133b5606b7a4c811e7f67ef70756dfdb5234a (commit) from 11ba38d71755f63deaadca5d04e1fba9f30fba93 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e6403fda35e95867bdc41ccb77b59513a9cbf80 commit 3e6403fda35e95867bdc41ccb77b59513a9cbf80 Merge: 11ba38d 562133b Author: Brad King AuthorDate: Fri Apr 3 13:39:38 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 13:39:38 2015 -0400 Merge topic 'vs-xaml' into next 562133b5 VS: Add support for XAML source files http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=562133b5606b7a4c811e7f67ef70756dfdb5234a commit 562133b5606b7a4c811e7f67ef70756dfdb5234a Author: Gilles Khouzam AuthorDate: Tue Mar 31 13:49:39 2015 -0700 Commit: Brad King CommitDate: Fri Apr 3 13:39:01 2015 -0400 VS: Add support for XAML source files XAML files are by default of type Page in the vcxproj and can be overriden by setting the VS_XAML_TYPE property. The .cpp and .h file of the same name are automatically added as depending on the XAML file. New VSXaml test builds a basic XAML WindowsStore 8.1 app with VS2013. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 1dff33e..76dd279 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -298,6 +298,7 @@ Properties on Source Files /prop_sf/VS_SHADER_FLAGS /prop_sf/VS_SHADER_MODEL /prop_sf/VS_SHADER_TYPE + /prop_sf/VS_XAML_TYPE /prop_sf/WRAP_EXCLUDE /prop_sf/XCODE_EXPLICIT_FILE_TYPE /prop_sf/XCODE_LAST_KNOWN_FILE_TYPE diff --git a/Help/prop_sf/VS_XAML_TYPE.rst b/Help/prop_sf/VS_XAML_TYPE.rst new file mode 100644 index 0000000..e92191d --- /dev/null +++ b/Help/prop_sf/VS_XAML_TYPE.rst @@ -0,0 +1,6 @@ +VS_XAML_TYPE +------------ + +Mark a XAML source file as a different type than the default ``Page``. +The most common usage would be to set the default App.xaml file as +ApplicationDefinition. diff --git a/Help/release/dev/vs-xaml.rst b/Help/release/dev/vs-xaml.rst new file mode 100644 index 0000000..6fdc659 --- /dev/null +++ b/Help/release/dev/vs-xaml.rst @@ -0,0 +1,6 @@ +vs-xaml +------- + +* The Visual Studio generators learned to support ``.xaml`` + source files and automatically associate them with corresponding + ``.h`` and ``.cpp`` sources. diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index e0af47a..41d12d7 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -56,6 +56,7 @@ struct ResxTag {}; struct ModuleDefinitionFileTag {}; struct AppManifestTag{}; struct CertificatesTag{}; +struct XamlTag{}; template struct IsSameTag @@ -98,6 +99,20 @@ struct DoAccept data.ExpectedResxHeaders.insert(hFileName); data.ResxSources.push_back(f); } + static void Do(cmGeneratorTarget::XamlData& data, cmSourceFile* f) + { + // Build and save the name of the corresponding .h and .cpp file + // This relationship will be used later when building the project files. + // Both names would have been auto generated from Visual Studio + // where the user supplied the file name and Visual Studio + // appended the suffix. + std::string xaml = f->GetFullPath(); + std::string hFileName = xaml + ".h"; + std::string cppFileName = xaml + ".cpp"; + data.ExpectedXamlHeaders.insert(hFileName); + data.ExpectedXamlSources.insert(cppFileName); + data.XamlSources.push_back(f); + } static void Do(std::string& data, cmSourceFile* f) { data = f->GetFullPath(); @@ -186,6 +201,10 @@ struct TagVisitor { DoAccept::Result>::Do(this->Data, sf); } + else if (ext == "xaml") + { + DoAccept::Result>::Do(this->Data, sf); + } else if(this->Header.find(sf->GetFullPath().c_str())) { DoAccept::Result>::Do(this->Data, sf); @@ -438,6 +457,36 @@ cmGeneratorTarget } //---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedXamlHeaders(std::set& headers, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + headers = data.ExpectedXamlHeaders; +} + +//---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedXamlSources(std::set& srcs, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + srcs = data.ExpectedXamlSources; +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget +::GetXamlSources(std::vector& srcs, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + srcs = data.XamlSources; +} + +//---------------------------------------------------------------------------- bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, const std::string& config) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index c329cf5..c79aa72 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -58,6 +58,12 @@ public: const std::string& config) const; void GetCertificates(std::vector&, const std::string& config) const; + void GetXamlSources(std::vector&, + const std::string& config) const; + void GetExpectedXamlHeaders(std::set&, + const std::string& config) const; + void GetExpectedXamlSources(std::set&, + const std::string& config) const; void ComputeObjectMapping(); @@ -132,6 +138,13 @@ public: mutable std::set ExpectedResxHeaders; mutable std::vector ResxSources; }; + + struct XamlData { + std::set ExpectedXamlHeaders; + std::set ExpectedXamlSources; + std::vector XamlSources; + }; + private: friend class cmTargetTraceDependencies; struct SourceEntry { std::vector Depends; }; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 19444ed..dad6f93 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -461,6 +461,7 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteAllSources(); this->WriteDotNetReferences(); this->WriteEmbeddedResourceGroup(); + this->WriteXamlFilesGroup(); this->WriteWinRTReferences(); this->WriteProjectReferences(); this->WriteString( @@ -522,8 +523,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() this->WriteString("", 3); std::string hFileName = obj.substr(0, obj.find_last_of(".")) + ".h"; - (*this->BuildFileStream ) << hFileName; - this->WriteString("\n", 3); + (*this->BuildFileStream) << hFileName << "\n"; std::vector const * configs = this->GlobalGenerator->GetConfigurations(); @@ -546,6 +546,38 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() } } +void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup() +{ + std::vector xamlObjs; + this->GeneratorTarget->GetXamlSources(xamlObjs, ""); + if (!xamlObjs.empty()) + { + this->WriteString("\n", 1); + for (std::vector::const_iterator + oi = xamlObjs.begin(); oi != xamlObjs.end(); ++oi) + { + std::string obj = (*oi)->GetFullPath(); + std::string xamlType; + const char * xamlTypeProperty = (*oi)->GetProperty("VS_XAML_TYPE"); + if (xamlTypeProperty) + { + xamlType = xamlTypeProperty; + } + else + { + xamlType = "Page"; + } + + this->WriteSource(xamlType, *oi, ">\n"); + this->WriteString("Designer\n", 3); + this->WriteString("BuildFileStream) << xamlType << ">\n"; + + } + this->WriteString("\n", 1); + } +} + void cmVisualStudio10TargetGenerator::WriteTargetSpecificReferences() { if(this->MSTools) @@ -1192,12 +1224,21 @@ WriteGroupSources(const char* name, void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf) { - if(this->IsResxHeader(sf->GetFullPath())) + std::string const& fileName = sf->GetFullPath(); + if (this->IsResxHeader(fileName)) { this->WriteSource("ClInclude", sf, ">\n"); this->WriteString("CppForm\n", 3); this->WriteString("\n", 2); } + else if (this->IsXamlHeader(fileName)) + { + this->WriteSource("ClInclude", sf, ">\n"); + this->WriteString("", 3); + std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); + (*this->BuildFileStream) << xamlFileName << "\n"; + this->WriteString("\n", 2); + } else { this->WriteSource("ClInclude", sf); @@ -1669,6 +1710,17 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( " ", "\n", lang); } } + if (this->IsXamlSource(source->GetFullPath())) + { + (*this->BuildFileStream) << firstString; + firstString = ""; // only do firstString once + hasFlags = true; + this->WriteString("", 3); + const std::string& fileName = source->GetFullPath(); + std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); + (*this->BuildFileStream) << xamlFileName << "\n"; + } + return hasFlags; } @@ -2749,6 +2801,28 @@ bool cmVisualStudio10TargetGenerator:: return it != expectedResxHeaders.end(); } +bool cmVisualStudio10TargetGenerator:: +IsXamlHeader(const std::string& headerFile) +{ + std::set expectedXamlHeaders; + this->GeneratorTarget->GetExpectedXamlHeaders(expectedXamlHeaders, ""); + + std::set::const_iterator it = + expectedXamlHeaders.find(headerFile); + return it != expectedXamlHeaders.end(); +} + +bool cmVisualStudio10TargetGenerator:: +IsXamlSource(const std::string& sourceFile) +{ + std::set expectedXamlSources; + this->GeneratorTarget->GetExpectedXamlSources(expectedXamlSources, ""); + + std::set::const_iterator it = + expectedXamlSources.find(sourceFile); + return it != expectedXamlSources.end(); +} + void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() { bool isAppContainer = false; diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index a02dfa8..a2776de 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -69,6 +69,7 @@ private: void WriteEmbeddedResourceGroup(); void WriteWinRTReferences(); void WriteWinRTPackageCertificateKeyFile(); + void WriteXamlFilesGroup(); void WritePathAndIncrementalLinkOptions(); void WriteItemDefinitionGroups(); void VerifyNecessaryFiles(); @@ -119,6 +120,8 @@ private: void AddMissingSourceGroups(std::set& groupsUsed, const std::vector& allGroups); bool IsResxHeader(const std::string& headerFile); + bool IsXamlHeader(const std::string& headerFile); + bool IsXamlSource(const std::string& headerFile); cmIDEFlagTable const* GetClFlagTable() const; cmIDEFlagTable const* GetRcFlagTable() const; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5944d08..1df39aa 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1927,6 +1927,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1) add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013 ARM" WindowsStore 8.1) add_test_VSWinStorePhone(vs12-store81-X64 "Visual Studio 12 2013 Win64" WindowsStore 8.1) + + add_test(NAME VSXaml COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSXaml" + "${CMake_BINARY_DIR}/Tests/VSXaml" + --build-generator "Visual Studio 12 2013" + --build-project VSXaml + --build-config $ + --build-options -DCMAKE_SYSTEM_NAME=WindowsStore + -DCMAKE_SYSTEM_VERSION=8.1 + ) endif() if(vs11 AND wp80) add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0) diff --git a/Tests/VSWindowsFormsResx/CMakeLists.txt b/Tests/VSWindowsFormsResx/CMakeLists.txt index 4373810..43c4833 100644 --- a/Tests/VSWindowsFormsResx/CMakeLists.txt +++ b/Tests/VSWindowsFormsResx/CMakeLists.txt @@ -14,7 +14,7 @@ include(CheckCXXSourceCompiles) include(CheckIncludeFile) # Note: The designable form is assumed to have a .h extension as is default in Visual Studio. -# Node: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio +# Note: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio set(TARGET_H WindowsFormsResx/MyForm.h diff --git a/Tests/VSXaml/App.xaml b/Tests/VSXaml/App.xaml new file mode 100644 index 0000000..eecf2c1 --- /dev/null +++ b/Tests/VSXaml/App.xaml @@ -0,0 +1,7 @@ +? + + diff --git a/Tests/VSXaml/App.xaml.cpp b/Tests/VSXaml/App.xaml.cpp new file mode 100644 index 0000000..334dc1f --- /dev/null +++ b/Tests/VSXaml/App.xaml.cpp @@ -0,0 +1,125 @@ +?// +// App.xaml.cpp +// Implementation of the App class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace VSXaml; + +using namespace Platform; +using namespace Windows::ApplicationModel; +using namespace Windows::ApplicationModel::Activation; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Interop; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 + +/// +/// Initializes the singleton application object. This is the first line of authored code +/// executed, and as such is the logical equivalent of main() or WinMain(). +/// +App::App() +{ + InitializeComponent(); + Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending); +} + +/// +/// Invoked when the application is launched normally by the end user. Other entry points +/// will be used such as when the application is launched to open a specific file. +/// +/// Details about the launch request and process. +void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) +{ + +#if _DEBUG + // Show graphics profiling information while debugging. + if (IsDebuggerPresent()) + { + // Display the current frame rate counters + DebugSettings->EnableFrameRateCounter = true; + } +#endif + + auto rootFrame = dynamic_cast(Window::Current->Content); + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == nullptr) + { + // Create a Frame to act as the navigation context and associate it with + // a SuspensionManager key + rootFrame = ref new Frame(); + + // Set the default language + rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0); + + rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed); + + if (e->PreviousExecutionState == ApplicationExecutionState::Terminated) + { + // TODO: Restore the saved session state only when appropriate, scheduling the + // final launch steps after the restore is complete + + } + + if (rootFrame->Content == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); + } + // Place the frame in the current Window + Window::Current->Content = rootFrame; + // Ensure the current window is active + Window::Current->Activate(); + } + else + { + if (rootFrame->Content == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); + } + // Ensure the current window is active + Window::Current->Activate(); + } +} + +/// +/// Invoked when application execution is being suspended. Application state is saved +/// without knowing whether the application will be terminated or resumed with the contents +/// of memory still intact. +/// +/// The source of the suspend request. +/// Details about the suspend request. +void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e) +{ + (void) sender; // Unused parameter + (void) e; // Unused parameter + + //TODO: Save application state and stop any background activity +} + +/// +/// Invoked when Navigation to a certain page fails +/// +/// The Frame which failed navigation +/// Details about the navigation failure +void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e) +{ + throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name); +} \ No newline at end of file diff --git a/Tests/VSXaml/App.xaml.h b/Tests/VSXaml/App.xaml.h new file mode 100644 index 0000000..1f65bda --- /dev/null +++ b/Tests/VSXaml/App.xaml.h @@ -0,0 +1,27 @@ +?// +// App.xaml.h +// Declaration of the App class. +// + +#pragma once + +#include "App.g.h" + +namespace VSXaml +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + ref class App sealed + { + protected: + virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override; + + internal: + App(); + + private: + void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e); + void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e); + }; +} diff --git a/Tests/VSXaml/Assets/Logo.scale-100.png b/Tests/VSXaml/Assets/Logo.scale-100.png new file mode 100644 index 0000000..e26771c Binary files /dev/null and b/Tests/VSXaml/Assets/Logo.scale-100.png differ diff --git a/Tests/VSXaml/Assets/SmallLogo.scale-100.png b/Tests/VSXaml/Assets/SmallLogo.scale-100.png new file mode 100644 index 0000000..1eb0d9d Binary files /dev/null and b/Tests/VSXaml/Assets/SmallLogo.scale-100.png differ diff --git a/Tests/VSXaml/Assets/SplashScreen.scale-100.png b/Tests/VSXaml/Assets/SplashScreen.scale-100.png new file mode 100644 index 0000000..c951e03 Binary files /dev/null and b/Tests/VSXaml/Assets/SplashScreen.scale-100.png differ diff --git a/Tests/VSXaml/Assets/StoreLogo.scale-100.png b/Tests/VSXaml/Assets/StoreLogo.scale-100.png new file mode 100644 index 0000000..dcb6727 Binary files /dev/null and b/Tests/VSXaml/Assets/StoreLogo.scale-100.png differ diff --git a/Tests/VSXaml/CMakeLists.txt b/Tests/VSXaml/CMakeLists.txt new file mode 100644 index 0000000..f384c82 --- /dev/null +++ b/Tests/VSXaml/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.2) +project(VSXaml) + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +set(SOURCE_FILES + App.xaml.cpp + MainPage.xaml.cpp + pch.cpp + ) + +set(HEADER_FILES + App.xaml.h + MainPage.xaml.h + pch.h + ) + +set(XAML_FILES + App.xaml + MainPage.xaml + ) + +set(ASSET_FILES + Assets/Logo.scale-100.png + Assets/SmallLogo.scale-100.png + Assets/SplashScreen.scale-100.png + Assets/StoreLogo.scale-100.png + ) + +set(CONTENT_FILES + Package.appxmanifest + ) + +set(RESOURCE_FILES + ${CONTENT_FILES} ${ASSET_FILES} + VSXaml_TemporaryKey.pfx) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets") + +set_property(SOURCE "App.xaml" PROPERTY VS_XAML_TYPE "ApplicationDefinition") + +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +source_group("Resource Files" FILES ${RESOURCE_FILES}) +source_group("Xaml Files" FILES ${XAML_FILES}) + +add_executable(VSXaml WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES} ${XAML_FILES}) +set_property(TARGET VSXaml PROPERTY VS_WINRT_COMPONENT TRUE) diff --git a/Tests/VSXaml/MainPage.xaml b/Tests/VSXaml/MainPage.xaml new file mode 100644 index 0000000..62139ca --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml @@ -0,0 +1,14 @@ +? + + + + + diff --git a/Tests/VSXaml/MainPage.xaml.cpp b/Tests/VSXaml/MainPage.xaml.cpp new file mode 100644 index 0000000..d0a64e8 --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml.cpp @@ -0,0 +1,27 @@ +?// +// MainPage.xaml.cpp +// Implementation of the MainPage class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace VSXaml; + +using namespace Platform; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 + +MainPage::MainPage() +{ + InitializeComponent(); +} diff --git a/Tests/VSXaml/MainPage.xaml.h b/Tests/VSXaml/MainPage.xaml.h new file mode 100644 index 0000000..ccc781b --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml.h @@ -0,0 +1,21 @@ +?// +// MainPage.xaml.h +// Declaration of the MainPage class. +// + +#pragma once + +#include "MainPage.g.h" + +namespace VSXaml +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public ref class MainPage sealed + { + public: + MainPage(); + + }; +} diff --git a/Tests/VSXaml/Package.appxmanifest b/Tests/VSXaml/Package.appxmanifest new file mode 100644 index 0000000..873a64a --- /dev/null +++ b/Tests/VSXaml/Package.appxmanifest @@ -0,0 +1,41 @@ +? + + + + + + VSXaml + Microsoft + Assets\StoreLogo.png + + + + 6.3.0 + 6.3.0 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/VSXaml/VSXaml_TemporaryKey.pfx b/Tests/VSXaml/VSXaml_TemporaryKey.pfx new file mode 100644 index 0000000..1cad999 Binary files /dev/null and b/Tests/VSXaml/VSXaml_TemporaryKey.pfx differ diff --git a/Tests/VSXaml/pch.cpp b/Tests/VSXaml/pch.cpp new file mode 100644 index 0000000..01484ff --- /dev/null +++ b/Tests/VSXaml/pch.cpp @@ -0,0 +1,6 @@ +?// +// pch.cpp +// Include the standard header and generate the precompiled header. +// + +#include "pch.h" diff --git a/Tests/VSXaml/pch.h b/Tests/VSXaml/pch.h new file mode 100644 index 0000000..2c4354d --- /dev/null +++ b/Tests/VSXaml/pch.h @@ -0,0 +1,11 @@ +?// +// pch.h +// Header for standard system include files. +// + +#pragma once + +#include +#include + +#include "App.xaml.h" ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:40:32 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:40:32 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1452-gde05d73 Message-ID: <20150403174032.29EA5ACA76@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via de05d7329aab3e3b54190a65ff95eb531c399915 (commit) via a0364316e12c47a3cd41510260ec8e6007a9d376 (commit) from 3e6403fda35e95867bdc41ccb77b59513a9cbf80 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de05d7329aab3e3b54190a65ff95eb531c399915 commit de05d7329aab3e3b54190a65ff95eb531c399915 Merge: 3e6403f a036431 Author: Brad King AuthorDate: Fri Apr 3 13:40:31 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 13:40:31 2015 -0400 Merge topic 'vs-xaml' into next a0364316 fixup! VS: Add support for XAML source files http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0364316e12c47a3cd41510260ec8e6007a9d376 commit a0364316e12c47a3cd41510260ec8e6007a9d376 Author: Brad King AuthorDate: Fri Apr 3 13:40:15 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 13:40:15 2015 -0400 fixup! VS: Add support for XAML source files diff --git a/Help/release/dev/vs-xaml.rst b/Help/release/dev/vs-xaml.rst index 6fdc659..575899f 100644 --- a/Help/release/dev/vs-xaml.rst +++ b/Help/release/dev/vs-xaml.rst @@ -1,6 +1,6 @@ vs-xaml ------- -* The Visual Studio generators learned to support ``.xaml`` +* The :ref:`Visual Studio Generators` learned to support ``.xaml`` source files and automatically associate them with corresponding ``.h`` and ``.cpp`` sources. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/vs-xaml.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:40:47 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:40:47 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1454-g9157684 Message-ID: <20150403174047.9E0D3AD185@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 91576842db3ec2444b6aaf92a4558c3b8fa15d00 (commit) via 01a9ab0def07ecddbc1bdfa67fec1bd3e6d030ea (commit) from de05d7329aab3e3b54190a65ff95eb531c399915 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91576842db3ec2444b6aaf92a4558c3b8fa15d00 commit 91576842db3ec2444b6aaf92a4558c3b8fa15d00 Merge: de05d73 01a9ab0 Author: Brad King AuthorDate: Fri Apr 3 13:40:46 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 13:40:46 2015 -0400 Merge topic 'vs-xaml' into next 01a9ab0d VS: Add support for XAML source files http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=01a9ab0def07ecddbc1bdfa67fec1bd3e6d030ea commit 01a9ab0def07ecddbc1bdfa67fec1bd3e6d030ea Author: Gilles Khouzam AuthorDate: Tue Mar 31 13:49:39 2015 -0700 Commit: Brad King CommitDate: Fri Apr 3 13:40:35 2015 -0400 VS: Add support for XAML source files XAML files are by default of type Page in the vcxproj and can be overriden by setting the VS_XAML_TYPE property. The .cpp and .h file of the same name are automatically added as depending on the XAML file. New VSXaml test builds a basic XAML WindowsStore 8.1 app with VS2013. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 1dff33e..76dd279 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -298,6 +298,7 @@ Properties on Source Files /prop_sf/VS_SHADER_FLAGS /prop_sf/VS_SHADER_MODEL /prop_sf/VS_SHADER_TYPE + /prop_sf/VS_XAML_TYPE /prop_sf/WRAP_EXCLUDE /prop_sf/XCODE_EXPLICIT_FILE_TYPE /prop_sf/XCODE_LAST_KNOWN_FILE_TYPE diff --git a/Help/prop_sf/VS_XAML_TYPE.rst b/Help/prop_sf/VS_XAML_TYPE.rst new file mode 100644 index 0000000..e92191d --- /dev/null +++ b/Help/prop_sf/VS_XAML_TYPE.rst @@ -0,0 +1,6 @@ +VS_XAML_TYPE +------------ + +Mark a XAML source file as a different type than the default ``Page``. +The most common usage would be to set the default App.xaml file as +ApplicationDefinition. diff --git a/Help/release/dev/vs-xaml.rst b/Help/release/dev/vs-xaml.rst new file mode 100644 index 0000000..575899f --- /dev/null +++ b/Help/release/dev/vs-xaml.rst @@ -0,0 +1,6 @@ +vs-xaml +------- + +* The :ref:`Visual Studio Generators` learned to support ``.xaml`` + source files and automatically associate them with corresponding + ``.h`` and ``.cpp`` sources. diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index e0af47a..41d12d7 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -56,6 +56,7 @@ struct ResxTag {}; struct ModuleDefinitionFileTag {}; struct AppManifestTag{}; struct CertificatesTag{}; +struct XamlTag{}; template struct IsSameTag @@ -98,6 +99,20 @@ struct DoAccept data.ExpectedResxHeaders.insert(hFileName); data.ResxSources.push_back(f); } + static void Do(cmGeneratorTarget::XamlData& data, cmSourceFile* f) + { + // Build and save the name of the corresponding .h and .cpp file + // This relationship will be used later when building the project files. + // Both names would have been auto generated from Visual Studio + // where the user supplied the file name and Visual Studio + // appended the suffix. + std::string xaml = f->GetFullPath(); + std::string hFileName = xaml + ".h"; + std::string cppFileName = xaml + ".cpp"; + data.ExpectedXamlHeaders.insert(hFileName); + data.ExpectedXamlSources.insert(cppFileName); + data.XamlSources.push_back(f); + } static void Do(std::string& data, cmSourceFile* f) { data = f->GetFullPath(); @@ -186,6 +201,10 @@ struct TagVisitor { DoAccept::Result>::Do(this->Data, sf); } + else if (ext == "xaml") + { + DoAccept::Result>::Do(this->Data, sf); + } else if(this->Header.find(sf->GetFullPath().c_str())) { DoAccept::Result>::Do(this->Data, sf); @@ -438,6 +457,36 @@ cmGeneratorTarget } //---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedXamlHeaders(std::set& headers, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + headers = data.ExpectedXamlHeaders; +} + +//---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedXamlSources(std::set& srcs, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + srcs = data.ExpectedXamlSources; +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget +::GetXamlSources(std::vector& srcs, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + srcs = data.XamlSources; +} + +//---------------------------------------------------------------------------- bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, const std::string& config) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index c329cf5..c79aa72 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -58,6 +58,12 @@ public: const std::string& config) const; void GetCertificates(std::vector&, const std::string& config) const; + void GetXamlSources(std::vector&, + const std::string& config) const; + void GetExpectedXamlHeaders(std::set&, + const std::string& config) const; + void GetExpectedXamlSources(std::set&, + const std::string& config) const; void ComputeObjectMapping(); @@ -132,6 +138,13 @@ public: mutable std::set ExpectedResxHeaders; mutable std::vector ResxSources; }; + + struct XamlData { + std::set ExpectedXamlHeaders; + std::set ExpectedXamlSources; + std::vector XamlSources; + }; + private: friend class cmTargetTraceDependencies; struct SourceEntry { std::vector Depends; }; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 19444ed..dad6f93 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -461,6 +461,7 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteAllSources(); this->WriteDotNetReferences(); this->WriteEmbeddedResourceGroup(); + this->WriteXamlFilesGroup(); this->WriteWinRTReferences(); this->WriteProjectReferences(); this->WriteString( @@ -522,8 +523,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() this->WriteString("", 3); std::string hFileName = obj.substr(0, obj.find_last_of(".")) + ".h"; - (*this->BuildFileStream ) << hFileName; - this->WriteString("\n", 3); + (*this->BuildFileStream) << hFileName << "\n"; std::vector const * configs = this->GlobalGenerator->GetConfigurations(); @@ -546,6 +546,38 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() } } +void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup() +{ + std::vector xamlObjs; + this->GeneratorTarget->GetXamlSources(xamlObjs, ""); + if (!xamlObjs.empty()) + { + this->WriteString("\n", 1); + for (std::vector::const_iterator + oi = xamlObjs.begin(); oi != xamlObjs.end(); ++oi) + { + std::string obj = (*oi)->GetFullPath(); + std::string xamlType; + const char * xamlTypeProperty = (*oi)->GetProperty("VS_XAML_TYPE"); + if (xamlTypeProperty) + { + xamlType = xamlTypeProperty; + } + else + { + xamlType = "Page"; + } + + this->WriteSource(xamlType, *oi, ">\n"); + this->WriteString("Designer\n", 3); + this->WriteString("BuildFileStream) << xamlType << ">\n"; + + } + this->WriteString("\n", 1); + } +} + void cmVisualStudio10TargetGenerator::WriteTargetSpecificReferences() { if(this->MSTools) @@ -1192,12 +1224,21 @@ WriteGroupSources(const char* name, void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf) { - if(this->IsResxHeader(sf->GetFullPath())) + std::string const& fileName = sf->GetFullPath(); + if (this->IsResxHeader(fileName)) { this->WriteSource("ClInclude", sf, ">\n"); this->WriteString("CppForm\n", 3); this->WriteString("\n", 2); } + else if (this->IsXamlHeader(fileName)) + { + this->WriteSource("ClInclude", sf, ">\n"); + this->WriteString("", 3); + std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); + (*this->BuildFileStream) << xamlFileName << "\n"; + this->WriteString("\n", 2); + } else { this->WriteSource("ClInclude", sf); @@ -1669,6 +1710,17 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( " ", "\n", lang); } } + if (this->IsXamlSource(source->GetFullPath())) + { + (*this->BuildFileStream) << firstString; + firstString = ""; // only do firstString once + hasFlags = true; + this->WriteString("", 3); + const std::string& fileName = source->GetFullPath(); + std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); + (*this->BuildFileStream) << xamlFileName << "\n"; + } + return hasFlags; } @@ -2749,6 +2801,28 @@ bool cmVisualStudio10TargetGenerator:: return it != expectedResxHeaders.end(); } +bool cmVisualStudio10TargetGenerator:: +IsXamlHeader(const std::string& headerFile) +{ + std::set expectedXamlHeaders; + this->GeneratorTarget->GetExpectedXamlHeaders(expectedXamlHeaders, ""); + + std::set::const_iterator it = + expectedXamlHeaders.find(headerFile); + return it != expectedXamlHeaders.end(); +} + +bool cmVisualStudio10TargetGenerator:: +IsXamlSource(const std::string& sourceFile) +{ + std::set expectedXamlSources; + this->GeneratorTarget->GetExpectedXamlSources(expectedXamlSources, ""); + + std::set::const_iterator it = + expectedXamlSources.find(sourceFile); + return it != expectedXamlSources.end(); +} + void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() { bool isAppContainer = false; diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index a02dfa8..a2776de 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -69,6 +69,7 @@ private: void WriteEmbeddedResourceGroup(); void WriteWinRTReferences(); void WriteWinRTPackageCertificateKeyFile(); + void WriteXamlFilesGroup(); void WritePathAndIncrementalLinkOptions(); void WriteItemDefinitionGroups(); void VerifyNecessaryFiles(); @@ -119,6 +120,8 @@ private: void AddMissingSourceGroups(std::set& groupsUsed, const std::vector& allGroups); bool IsResxHeader(const std::string& headerFile); + bool IsXamlHeader(const std::string& headerFile); + bool IsXamlSource(const std::string& headerFile); cmIDEFlagTable const* GetClFlagTable() const; cmIDEFlagTable const* GetRcFlagTable() const; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5944d08..1df39aa 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1927,6 +1927,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1) add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013 ARM" WindowsStore 8.1) add_test_VSWinStorePhone(vs12-store81-X64 "Visual Studio 12 2013 Win64" WindowsStore 8.1) + + add_test(NAME VSXaml COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSXaml" + "${CMake_BINARY_DIR}/Tests/VSXaml" + --build-generator "Visual Studio 12 2013" + --build-project VSXaml + --build-config $ + --build-options -DCMAKE_SYSTEM_NAME=WindowsStore + -DCMAKE_SYSTEM_VERSION=8.1 + ) endif() if(vs11 AND wp80) add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0) diff --git a/Tests/VSWindowsFormsResx/CMakeLists.txt b/Tests/VSWindowsFormsResx/CMakeLists.txt index 4373810..43c4833 100644 --- a/Tests/VSWindowsFormsResx/CMakeLists.txt +++ b/Tests/VSWindowsFormsResx/CMakeLists.txt @@ -14,7 +14,7 @@ include(CheckCXXSourceCompiles) include(CheckIncludeFile) # Note: The designable form is assumed to have a .h extension as is default in Visual Studio. -# Node: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio +# Note: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio set(TARGET_H WindowsFormsResx/MyForm.h diff --git a/Tests/VSXaml/App.xaml b/Tests/VSXaml/App.xaml new file mode 100644 index 0000000..eecf2c1 --- /dev/null +++ b/Tests/VSXaml/App.xaml @@ -0,0 +1,7 @@ +? + + diff --git a/Tests/VSXaml/App.xaml.cpp b/Tests/VSXaml/App.xaml.cpp new file mode 100644 index 0000000..334dc1f --- /dev/null +++ b/Tests/VSXaml/App.xaml.cpp @@ -0,0 +1,125 @@ +?// +// App.xaml.cpp +// Implementation of the App class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace VSXaml; + +using namespace Platform; +using namespace Windows::ApplicationModel; +using namespace Windows::ApplicationModel::Activation; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Interop; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 + +/// +/// Initializes the singleton application object. This is the first line of authored code +/// executed, and as such is the logical equivalent of main() or WinMain(). +/// +App::App() +{ + InitializeComponent(); + Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending); +} + +/// +/// Invoked when the application is launched normally by the end user. Other entry points +/// will be used such as when the application is launched to open a specific file. +/// +/// Details about the launch request and process. +void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) +{ + +#if _DEBUG + // Show graphics profiling information while debugging. + if (IsDebuggerPresent()) + { + // Display the current frame rate counters + DebugSettings->EnableFrameRateCounter = true; + } +#endif + + auto rootFrame = dynamic_cast(Window::Current->Content); + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == nullptr) + { + // Create a Frame to act as the navigation context and associate it with + // a SuspensionManager key + rootFrame = ref new Frame(); + + // Set the default language + rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0); + + rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed); + + if (e->PreviousExecutionState == ApplicationExecutionState::Terminated) + { + // TODO: Restore the saved session state only when appropriate, scheduling the + // final launch steps after the restore is complete + + } + + if (rootFrame->Content == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); + } + // Place the frame in the current Window + Window::Current->Content = rootFrame; + // Ensure the current window is active + Window::Current->Activate(); + } + else + { + if (rootFrame->Content == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); + } + // Ensure the current window is active + Window::Current->Activate(); + } +} + +/// +/// Invoked when application execution is being suspended. Application state is saved +/// without knowing whether the application will be terminated or resumed with the contents +/// of memory still intact. +/// +/// The source of the suspend request. +/// Details about the suspend request. +void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e) +{ + (void) sender; // Unused parameter + (void) e; // Unused parameter + + //TODO: Save application state and stop any background activity +} + +/// +/// Invoked when Navigation to a certain page fails +/// +/// The Frame which failed navigation +/// Details about the navigation failure +void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e) +{ + throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name); +} \ No newline at end of file diff --git a/Tests/VSXaml/App.xaml.h b/Tests/VSXaml/App.xaml.h new file mode 100644 index 0000000..1f65bda --- /dev/null +++ b/Tests/VSXaml/App.xaml.h @@ -0,0 +1,27 @@ +?// +// App.xaml.h +// Declaration of the App class. +// + +#pragma once + +#include "App.g.h" + +namespace VSXaml +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + ref class App sealed + { + protected: + virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override; + + internal: + App(); + + private: + void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e); + void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e); + }; +} diff --git a/Tests/VSXaml/Assets/Logo.scale-100.png b/Tests/VSXaml/Assets/Logo.scale-100.png new file mode 100644 index 0000000..e26771c Binary files /dev/null and b/Tests/VSXaml/Assets/Logo.scale-100.png differ diff --git a/Tests/VSXaml/Assets/SmallLogo.scale-100.png b/Tests/VSXaml/Assets/SmallLogo.scale-100.png new file mode 100644 index 0000000..1eb0d9d Binary files /dev/null and b/Tests/VSXaml/Assets/SmallLogo.scale-100.png differ diff --git a/Tests/VSXaml/Assets/SplashScreen.scale-100.png b/Tests/VSXaml/Assets/SplashScreen.scale-100.png new file mode 100644 index 0000000..c951e03 Binary files /dev/null and b/Tests/VSXaml/Assets/SplashScreen.scale-100.png differ diff --git a/Tests/VSXaml/Assets/StoreLogo.scale-100.png b/Tests/VSXaml/Assets/StoreLogo.scale-100.png new file mode 100644 index 0000000..dcb6727 Binary files /dev/null and b/Tests/VSXaml/Assets/StoreLogo.scale-100.png differ diff --git a/Tests/VSXaml/CMakeLists.txt b/Tests/VSXaml/CMakeLists.txt new file mode 100644 index 0000000..f384c82 --- /dev/null +++ b/Tests/VSXaml/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.2) +project(VSXaml) + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +set(SOURCE_FILES + App.xaml.cpp + MainPage.xaml.cpp + pch.cpp + ) + +set(HEADER_FILES + App.xaml.h + MainPage.xaml.h + pch.h + ) + +set(XAML_FILES + App.xaml + MainPage.xaml + ) + +set(ASSET_FILES + Assets/Logo.scale-100.png + Assets/SmallLogo.scale-100.png + Assets/SplashScreen.scale-100.png + Assets/StoreLogo.scale-100.png + ) + +set(CONTENT_FILES + Package.appxmanifest + ) + +set(RESOURCE_FILES + ${CONTENT_FILES} ${ASSET_FILES} + VSXaml_TemporaryKey.pfx) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets") + +set_property(SOURCE "App.xaml" PROPERTY VS_XAML_TYPE "ApplicationDefinition") + +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +source_group("Resource Files" FILES ${RESOURCE_FILES}) +source_group("Xaml Files" FILES ${XAML_FILES}) + +add_executable(VSXaml WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES} ${XAML_FILES}) +set_property(TARGET VSXaml PROPERTY VS_WINRT_COMPONENT TRUE) diff --git a/Tests/VSXaml/MainPage.xaml b/Tests/VSXaml/MainPage.xaml new file mode 100644 index 0000000..62139ca --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml @@ -0,0 +1,14 @@ +? + + + + + diff --git a/Tests/VSXaml/MainPage.xaml.cpp b/Tests/VSXaml/MainPage.xaml.cpp new file mode 100644 index 0000000..d0a64e8 --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml.cpp @@ -0,0 +1,27 @@ +?// +// MainPage.xaml.cpp +// Implementation of the MainPage class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace VSXaml; + +using namespace Platform; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 + +MainPage::MainPage() +{ + InitializeComponent(); +} diff --git a/Tests/VSXaml/MainPage.xaml.h b/Tests/VSXaml/MainPage.xaml.h new file mode 100644 index 0000000..ccc781b --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml.h @@ -0,0 +1,21 @@ +?// +// MainPage.xaml.h +// Declaration of the MainPage class. +// + +#pragma once + +#include "MainPage.g.h" + +namespace VSXaml +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public ref class MainPage sealed + { + public: + MainPage(); + + }; +} diff --git a/Tests/VSXaml/Package.appxmanifest b/Tests/VSXaml/Package.appxmanifest new file mode 100644 index 0000000..873a64a --- /dev/null +++ b/Tests/VSXaml/Package.appxmanifest @@ -0,0 +1,41 @@ +? + + + + + + VSXaml + Microsoft + Assets\StoreLogo.png + + + + 6.3.0 + 6.3.0 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/VSXaml/VSXaml_TemporaryKey.pfx b/Tests/VSXaml/VSXaml_TemporaryKey.pfx new file mode 100644 index 0000000..1cad999 Binary files /dev/null and b/Tests/VSXaml/VSXaml_TemporaryKey.pfx differ diff --git a/Tests/VSXaml/pch.cpp b/Tests/VSXaml/pch.cpp new file mode 100644 index 0000000..01484ff --- /dev/null +++ b/Tests/VSXaml/pch.cpp @@ -0,0 +1,6 @@ +?// +// pch.cpp +// Include the standard header and generate the precompiled header. +// + +#include "pch.h" diff --git a/Tests/VSXaml/pch.h b/Tests/VSXaml/pch.h new file mode 100644 index 0000000..2c4354d --- /dev/null +++ b/Tests/VSXaml/pch.h @@ -0,0 +1,11 @@ +?// +// pch.h +// Header for standard system include files. +// + +#pragma once + +#include +#include + +#include "App.xaml.h" ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:57:42 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:57:42 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1456-g0520edf Message-ID: <20150403175742.C1E51ADBC0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0520edf6a7129170c27e1ea94cebdcfaae7a39a4 (commit) via 623fdc5c34dbf45ad40ea12bac8ba437bd53af96 (commit) from 91576842db3ec2444b6aaf92a4558c3b8fa15d00 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0520edf6a7129170c27e1ea94cebdcfaae7a39a4 commit 0520edf6a7129170c27e1ea94cebdcfaae7a39a4 Merge: 9157684 623fdc5 Author: Brad King AuthorDate: Fri Apr 3 13:57:42 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 13:57:42 2015 -0400 Merge topic 'doc-target_link_libraries' into next 623fdc5c fixup! Help: Revise target_link_libraries command documentation http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=623fdc5c34dbf45ad40ea12bac8ba437bd53af96 commit 623fdc5c34dbf45ad40ea12bac8ba437bd53af96 Author: Brad King AuthorDate: Fri Apr 3 13:57:26 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 13:57:26 2015 -0400 fixup! Help: Revise target_link_libraries command documentation diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index e0b1667..393c8b4 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -37,10 +37,10 @@ Each ```` may be: * **A full path to a library file**: The generated link line will normally preserve the full path to the file. However, there are some cases where CMake must ask the linker to search for the library - (e.g. ``-lfoo``), such as when it appears in a system library directory - that the compiler front-end may replace with an alternative. - Either way, the buildsystem will have a dependency to re-link - ```` if the library file changes. + (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``), such as when it + appears in a system library directory that the compiler front-end + may replace with an alternative. Either way, the buildsystem will + have a dependency to re-link ```` if the library file changes. If the library file is in a Mac OSX framework, the ``Headers`` directory of the framework will also be processed as a @@ -48,7 +48,7 @@ Each ```` may be: effect as passing the framework directory as an include directory. * **A plain library name**: The generated link line will ask the linker - to search for the library (e.g. ``-lfoo``). + to search for the library (e.g. ``foo`` becomes ``-lfoo`` or ``foo.lib``). * **A link flag**: Item names starting with ``-``, but not ``-l`` or ``-framework``, are treated as linker flags. Note that such flags will @@ -67,6 +67,11 @@ Each ```` may be: rules by creating and linking to :ref:`IMPORTED library targets `. +Items containing ``::``, such as ``Foo::Bar``, are assumed to be +:ref:`IMPORTED ` or :ref:`ALIAS ` library +target names and will cause an error if no such target exists. +See policy :policy:`CMP0028`. + Arguments to ``target_link_libraries`` may use "generator expressions" with the syntax ``$<...>``. Note however, that generator expressions will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`. ----------------------------------------------------------------------- Summary of changes: Help/command/target_link_libraries.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:57:58 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:57:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1458-g539f340 Message-ID: <20150403175758.D85F8ADBBF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 539f340b4404bbfb331421f20555acf9d1fc27de (commit) via 659896d3ed21bc7da1cf394c17e1a60e4d4ee5f7 (commit) from 0520edf6a7129170c27e1ea94cebdcfaae7a39a4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=539f340b4404bbfb331421f20555acf9d1fc27de commit 539f340b4404bbfb331421f20555acf9d1fc27de Merge: 0520edf 659896d Author: Brad King AuthorDate: Fri Apr 3 13:57:58 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 13:57:58 2015 -0400 Merge topic 'doc-target_link_libraries' into next 659896d3 Help: Revise target_link_libraries command documentation http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=659896d3ed21bc7da1cf394c17e1a60e4d4ee5f7 commit 659896d3ed21bc7da1cf394c17e1a60e4d4ee5f7 Author: Brad King AuthorDate: Thu Apr 2 15:41:06 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 13:57:46 2015 -0400 Help: Revise target_link_libraries command documentation Organize the documentation into subsections to separate the signatures. Refactor the discussion of allowed link items into bullet points and expand into more detail on each. diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index 88a555a..393c8b4 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -1,38 +1,107 @@ target_link_libraries --------------------- -Link a target to given libraries. +.. only:: html + + .. contents:: + +Specify libraries or flags to use when linking a given target and/or +its dependents. :ref:`Usage requirements ` +from linked library targets will be propagated. Usage requirements +of a target's dependencies affect compilation of its own sources. + +Overview +^^^^^^^^ + +This command has several signatures as detailed in subsections below. +All of them have the general form:: + + target_link_libraries( ... ... ...) + +The named ```` must have been created in the current directory by +a command such as :command:`add_executable` or :command:`add_library`. +Repeated calls for the same ```` append items in the order called. +Each ```` may be: + +* **A library target name**: The generated link line will have the + full path to the linkable library file associated with the target. + The buildsystem will have a dependency to re-link ```` if + the library file changes. + + The named target must be created by :command:`add_library` within + the project or as an :ref:`IMPORTED library `. + If it is created within the project an ordering dependency will + automatically be added in the build system to make sure the named + library target is up-to-date before the ```` links. + +* **A full path to a library file**: The generated link line will + normally preserve the full path to the file. However, there are + some cases where CMake must ask the linker to search for the library + (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``), such as when it + appears in a system library directory that the compiler front-end + may replace with an alternative. Either way, the buildsystem will + have a dependency to re-link ```` if the library file changes. + + If the library file is in a Mac OSX framework, the ``Headers`` directory + of the framework will also be processed as a + :ref:`usage requirement `. This has the same + effect as passing the framework directory as an include directory. + +* **A plain library name**: The generated link line will ask the linker + to search for the library (e.g. ``foo`` becomes ``-lfoo`` or ``foo.lib``). + +* **A link flag**: Item names starting with ``-``, but not ``-l`` or + ``-framework``, are treated as linker flags. Note that such flags will + be treated like any other library link item for purposes of transitive + dependencies, so they are generally safe to specify only as private link + items that will not propagate to dependents. + +* A ``debug``, ``optimized``, or ``general`` keyword immediately followed + by another ````. The item following such a keyword will be used + only for the corresponding build configuration. The ``debug`` keyword + corresponds to the ``Debug`` configuration (or to configurations named + in the :prop_gbl:`DEBUG_CONFIGURATIONS` global property if it is set). + The ``optimized`` keyword corresponds to all other configurations. The + ``general`` keyword corresponds to all configurations, and is purely + optional. Higher granularity may be achieved for per-configuration + rules by creating and linking to + :ref:`IMPORTED library targets `. + +Items containing ``::``, such as ``Foo::Bar``, are assumed to be +:ref:`IMPORTED ` or :ref:`ALIAS ` library +target names and will cause an error if no such target exists. +See policy :policy:`CMP0028`. + +Arguments to ``target_link_libraries`` may use "generator expressions" +with the syntax ``$<...>``. Note however, that generator expressions +will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`. +See the :manual:`cmake-generator-expressions(7)` manual for available +expressions. See the :manual:`cmake-buildsystem(7)` manual for more on +defining buildsystem properties. + +Libraries for a Target and/or its Dependents +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +:: + + target_link_libraries( + ... + [ ...]...) + +The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` keywords can be used to +specify both the link dependencies and the link interface in one command. +Libraries and targets following ``PUBLIC`` are linked to, and are made +part of the link interface. Libraries and targets following ``PRIVATE`` +are linked to, but are not made part of the link interface. Libraries +following ``INTERFACE`` are appended to the link interface and are not +used for linking ````. + +Libraries for both a Target and its Dependents +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: - target_link_libraries( [item1 [item2 [...]]] - [[debug|optimized|general] ] ...) - -Specify libraries or flags to use when linking a given target. The -named ```` must have been created in the current directory by a -command such as :command:`add_executable` or :command:`add_library`. The -remaining arguments specify library names or flags. Repeated calls for -the same ```` append items in the order called. - -If a library name matches that of another target in the project a -dependency will automatically be added in the build system to make sure -the library being linked is up-to-date before the target links. Item names -starting with ``-``, but not ``-l`` or ``-framework``, are treated as -linker flags. Note that such flags will be treated like any other library -link item for purposes of transitive dependencies, so they are generally -safe to specify only as private link items that will not propagate to -dependents of ````. - -A ``debug``, ``optimized``, or ``general`` keyword indicates that the -library immediately following it is to be used only for the -corresponding build configuration. The ``debug`` keyword corresponds to -the Debug configuration (or to configurations named in the -:prop_gbl:`DEBUG_CONFIGURATIONS` global property if it is set). The -``optimized`` keyword corresponds to all other configurations. The -``general`` keyword corresponds to all configurations, and is purely -optional (assumed if omitted). Higher granularity may be achieved for -per-configuration rules by creating and linking to -:ref:`IMPORTED library targets `. + target_link_libraries( ...) Library dependencies are transitive by default with this signature. When this target is linked into another target then the libraries @@ -45,37 +114,34 @@ by setting the property directly. When :policy:`CMP0022` is not set to of this command may set the property making any libraries linked exclusively by this signature private. -CMake will also propagate :ref:`usage requirements ` -from linked library targets. Usage requirements of dependencies affect -compilation of sources in the ````. - -If an ```` is a library in a Mac OX framework, the ``Headers`` -directory of the framework will also be processed as a -:ref:`usage requirement `. This has the same -effect as passing the framework directory as an include directory. - --------------------------------------------------------------------------- +Libraries for a Target and/or its Dependents (Legacy) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: target_link_libraries( - ... - [ ... ] ...]) + ... + [ ...]...) -The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` keywords can be used to -specify both the link dependencies and the link interface in one command. -Libraries and targets following ``PUBLIC`` are linked to, and are made -part of the link interface. Libraries and targets following ``PRIVATE`` -are linked to, but are not made part of the link interface. Libraries -following ``INTERFACE`` are appended to the link interface and are not -used for linking ````. +The ``LINK_PUBLIC`` and ``LINK_PRIVATE`` modes can be used to specify both +the link dependencies and the link interface in one command. --------------------------------------------------------------------------- +This signature is for compatibility only. Prefer the ``PUBLIC`` or +``PRIVATE`` keywords instead. + +Libraries and targets following ``LINK_PUBLIC`` are linked to, and are +made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy +:policy:`CMP0022` is not ``NEW``, they are also made part of the +:prop_tgt:`LINK_INTERFACE_LIBRARIES`. Libraries and targets following +``LINK_PRIVATE`` are linked to, but are not made part of the +:prop_tgt:`INTERFACE_LINK_LIBRARIES` (or :prop_tgt:`LINK_INTERFACE_LIBRARIES`). + +Libraries for Dependents Only (Legacy) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: - target_link_libraries( LINK_INTERFACE_LIBRARIES - [[debug|optimized|general] ] ...) + target_link_libraries( LINK_INTERFACE_LIBRARIES ...) The ``LINK_INTERFACE_LIBRARIES`` mode appends the libraries to the :prop_tgt:`INTERFACE_LINK_LIBRARIES` target property instead of using them @@ -99,28 +165,8 @@ is not ``NEW``, they are also appended to the ``general`` (or without any keyword) are treated as if specified for both ``debug`` and ``optimized``. --------------------------------------------------------------------------- - -:: - - target_link_libraries( - - [[debug|optimized|general] ] ... - [ - [[debug|optimized|general] ] ...]) - -The ``LINK_PUBLIC`` and ``LINK_PRIVATE`` modes can be used to specify both -the link dependencies and the link interface in one command. - -This signature is for compatibility only. Prefer the ``PUBLIC`` or -``PRIVATE`` keywords instead. - -Libraries and targets following ``LINK_PUBLIC`` are linked to, and are -made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy -:policy:`CMP0022` is not ``NEW``, they are also made part of the -:prop_tgt:`LINK_INTERFACE_LIBRARIES`. Libraries and targets following -``LINK_PRIVATE`` are linked to, but are not made part of the -:prop_tgt:`INTERFACE_LINK_LIBRARIES` (or :prop_tgt:`LINK_INTERFACE_LIBRARIES`). +Cyclic Dependencies of Static Libraries +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The library dependency graph is normally acyclic (a DAG), but in the case of mutually-dependent ``STATIC`` libraries CMake allows the graph to @@ -139,17 +185,11 @@ For example, the code links ``main`` to ``A B A B``. While one repetition is usually sufficient, pathological object file and symbol arrangements can require -more. One may handle such cases by manually repeating the component in -the last ``target_link_libraries`` call. However, if two archives are -really so interdependent they should probably be combined into a single -archive. - -Arguments to target_link_libraries may use "generator expressions" -with the syntax ``$<...>``. Note however, that generator expressions -will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`. -See the :manual:`cmake-generator-expressions(7)` manual for available -expressions. See the :manual:`cmake-buildsystem(7)` manual for more on -defining buildsystem properties. +more. One may handle such cases by using the +:prop_tgt:`LINK_INTERFACE_MULTIPLICITY` target property or by manually +repeating the component in the last ``target_link_libraries`` call. +However, if two archives are really so interdependent they should probably +be combined into a single archive, perhaps by using :ref:`Object Libraries`. Creating Relocatable Packages ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:59:04 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:59:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-610-g9ed24fb Message-ID: <20150403175904.A3727ADBEF@public.kitware.com> This is an automated email from 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 9ed24fbb5e37c7c4338d2117d66f7262fbc5e074 (commit) via 01a9ab0def07ecddbc1bdfa67fec1bd3e6d030ea (commit) from b6b77bb750f30c452053ad4c28e4c69b1e7950e0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ed24fbb5e37c7c4338d2117d66f7262fbc5e074 commit 9ed24fbb5e37c7c4338d2117d66f7262fbc5e074 Merge: b6b77bb 01a9ab0 Author: Brad King AuthorDate: Fri Apr 3 13:59:03 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 3 13:59:03 2015 -0400 Merge topic 'vs-xaml' 01a9ab0d VS: Add support for XAML source files ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 1 + Help/prop_sf/VS_XAML_TYPE.rst | 6 + Help/release/dev/vs-xaml.rst | 6 + Source/cmGeneratorTarget.cxx | 49 ++++++++ Source/cmGeneratorTarget.h | 13 ++ Source/cmVisualStudio10TargetGenerator.cxx | 80 ++++++++++++- Source/cmVisualStudio10TargetGenerator.h | 3 + Tests/CMakeLists.txt | 11 ++ Tests/VSWindowsFormsResx/CMakeLists.txt | 2 +- Tests/VSXaml/App.xaml | 7 ++ Tests/VSXaml/App.xaml.cpp | 125 ++++++++++++++++++++ Tests/VSXaml/App.xaml.h | 27 +++++ .../VSXaml/Assets/Logo.scale-100.png | Bin 801 -> 801 bytes .../VSXaml/Assets/SmallLogo.scale-100.png | Bin 329 -> 329 bytes .../VSXaml/Assets/SplashScreen.scale-100.png | Bin 2146 -> 2146 bytes .../VSXaml/Assets/StoreLogo.scale-100.png | Bin 429 -> 429 bytes Tests/VSXaml/CMakeLists.txt | 52 ++++++++ Tests/VSXaml/MainPage.xaml | 14 +++ Tests/VSXaml/MainPage.xaml.cpp | 27 +++++ Tests/VSXaml/MainPage.xaml.h | 21 ++++ Tests/VSXaml/Package.appxmanifest | 41 +++++++ .../VSXaml/VSXaml_TemporaryKey.pfx | Bin 2560 -> 2560 bytes Tests/VSXaml/pch.cpp | 6 + Tests/VSXaml/pch.h | 11 ++ 24 files changed, 498 insertions(+), 4 deletions(-) create mode 100644 Help/prop_sf/VS_XAML_TYPE.rst create mode 100644 Help/release/dev/vs-xaml.rst create mode 100644 Tests/VSXaml/App.xaml create mode 100644 Tests/VSXaml/App.xaml.cpp create mode 100644 Tests/VSXaml/App.xaml.h copy Templates/Windows/Logo.png => Tests/VSXaml/Assets/Logo.scale-100.png (100%) copy Templates/Windows/SmallLogo.png => Tests/VSXaml/Assets/SmallLogo.scale-100.png (100%) copy Templates/Windows/SplashScreen.png => Tests/VSXaml/Assets/SplashScreen.scale-100.png (100%) copy Templates/Windows/StoreLogo.png => Tests/VSXaml/Assets/StoreLogo.scale-100.png (100%) create mode 100644 Tests/VSXaml/CMakeLists.txt create mode 100644 Tests/VSXaml/MainPage.xaml create mode 100644 Tests/VSXaml/MainPage.xaml.cpp create mode 100644 Tests/VSXaml/MainPage.xaml.h create mode 100644 Tests/VSXaml/Package.appxmanifest copy Templates/Windows/Windows_TemporaryKey.pfx => Tests/VSXaml/VSXaml_TemporaryKey.pfx (100%) create mode 100644 Tests/VSXaml/pch.cpp create mode 100644 Tests/VSXaml/pch.h hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 3 13:59:50 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 3 Apr 2015 13:59:50 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1460-g3664e7e Message-ID: <20150403175950.28E28ADC19@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3664e7ee98b13a3acca13ee8b163a6d36454ec7b (commit) via 9ed24fbb5e37c7c4338d2117d66f7262fbc5e074 (commit) from 539f340b4404bbfb331421f20555acf9d1fc27de (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3664e7ee98b13a3acca13ee8b163a6d36454ec7b commit 3664e7ee98b13a3acca13ee8b163a6d36454ec7b Merge: 539f340 9ed24fb Author: Brad King AuthorDate: Fri Apr 3 13:59:19 2015 -0400 Commit: Brad King CommitDate: Fri Apr 3 13:59:19 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Sat Apr 4 00:01:06 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 4 Apr 2015 00:01:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-611-gc6624cf Message-ID: <20150404040106.940F6AD8AB@public.kitware.com> This is an automated email from 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 c6624cfdc1fe9c7c53ad9ed06da759df803aef71 (commit) from 9ed24fbb5e37c7c4338d2117d66f7262fbc5e074 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6624cfdc1fe9c7c53ad9ed06da759df803aef71 commit c6624cfdc1fe9c7c53ad9ed06da759df803aef71 Author: Kitware Robot AuthorDate: Sat Apr 4 00:01:05 2015 -0400 Commit: Kitware Robot CommitDate: Sat Apr 4 00:01:05 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8a93101..48f02d1 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150403) +set(CMake_VERSION_PATCH 20150404) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From nilsgladitz at gmail.com Sat Apr 4 06:24:09 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Sat, 4 Apr 2015 06:24:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1462-gc56158b Message-ID: <20150404102409.7A2FAAD63B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c56158b2c4aa16e9cefe30efab1ad467f4e36260 (commit) via 560edb1157a99f9091aab11f04a84f5e8352073e (commit) from 3664e7ee98b13a3acca13ee8b163a6d36454ec7b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c56158b2c4aa16e9cefe30efab1ad467f4e36260 commit c56158b2c4aa16e9cefe30efab1ad467f4e36260 Merge: 3664e7e 560edb1 Author: Nils Gladitz AuthorDate: Sat Apr 4 06:24:08 2015 -0400 Commit: CMake Topic Stage CommitDate: Sat Apr 4 06:24:08 2015 -0400 Merge topic 'gcov-module-coverage-exclude' into next 560edb11 CTestCoverageCollectGCOV: Fix unicode path source file path handling http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=560edb1157a99f9091aab11f04a84f5e8352073e commit 560edb1157a99f9091aab11f04a84f5e8352073e Author: Nils Gladitz AuthorDate: Sat Apr 4 12:23:06 2015 +0200 Commit: Nils Gladitz CommitDate: Sat Apr 4 12:23:06 2015 +0200 CTestCoverageCollectGCOV: Fix unicode path source file path handling diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index db86751..8659a69 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -152,7 +152,7 @@ function(ctest_coverage_collect_gcov) set(gcov_files) foreach(gcov_file ${unfiltered_gcov_files}) - file(STRINGS ${binary_dir}/${gcov_file} first_line LIMIT_COUNT 1) + file(STRINGS ${binary_dir}/${gcov_file} first_line LIMIT_COUNT 1 ENCODING UTF-8) set(is_excluded false) if(first_line MATCHES "^ -: 0:Source:(.*)$") diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake index c7b563f..b0c3a9b 100644 --- a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake +++ b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake @@ -7,7 +7,7 @@ endforeach() get_filename_component(gcda_name ${gcda_file} NAME) string(REPLACE ".gcda" ".gcov" gcov_name "${gcda_name}") -file(STRINGS "${gcda_file}" source_file LIMIT_COUNT 1) +file(STRINGS "${gcda_file}" source_file LIMIT_COUNT 1 ENCODING UTF-8) file(WRITE "${CMAKE_SOURCE_DIR}/${gcov_name}" " -: 0:Source:${source_file}" ----------------------------------------------------------------------- Summary of changes: Modules/CTestCoverageCollectGCOV.cmake | 2 +- Tests/CTestCoverageCollectGCOV/fakegcov.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From nilsgladitz at gmail.com Sat Apr 4 06:25:40 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Sat, 4 Apr 2015 06:25:40 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1464-gdd42365 Message-ID: <20150404102541.2C46BAD8B9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via dd42365d9a196cff86359e2e269b6619ad4acad4 (commit) via 9a544f2d987df940625465129a5f00bea01ad4eb (commit) from c56158b2c4aa16e9cefe30efab1ad467f4e36260 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd42365d9a196cff86359e2e269b6619ad4acad4 commit dd42365d9a196cff86359e2e269b6619ad4acad4 Merge: c56158b 9a544f2 Author: Nils Gladitz AuthorDate: Sat Apr 4 06:25:38 2015 -0400 Commit: CMake Topic Stage CommitDate: Sat Apr 4 06:25:38 2015 -0400 Merge topic 'gcov-module-coverage-exclude' into next 9a544f2d CTestCoverageCollectGCOV: Support CTEST_CUSTOM_COVERAGE_EXCLUDE http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a544f2d987df940625465129a5f00bea01ad4eb commit 9a544f2d987df940625465129a5f00bea01ad4eb Author: Nils Gladitz AuthorDate: Thu Apr 2 17:02:08 2015 +0200 Commit: Nils Gladitz CommitDate: Sat Apr 4 12:25:15 2015 +0200 CTestCoverageCollectGCOV: Support CTEST_CUSTOM_COVERAGE_EXCLUDE diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 4519627..8659a69 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -147,8 +147,37 @@ function(ctest_coverage_collect_gcov) \"Binary\": \"${binary_dir}\" }") # collect the gcov files + set(unfiltered_gcov_files) + file(GLOB_RECURSE unfiltered_gcov_files RELATIVE ${binary_dir} "${coverage_dir}/*.gcov") + set(gcov_files) - file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${coverage_dir}/*.gcov") + foreach(gcov_file ${unfiltered_gcov_files}) + file(STRINGS ${binary_dir}/${gcov_file} first_line LIMIT_COUNT 1 ENCODING UTF-8) + + set(is_excluded false) + if(first_line MATCHES "^ -: 0:Source:(.*)$") + set(source_file ${CMAKE_MATCH_1}) + elseif(NOT GCOV_QUIET) + message(STATUS "Could not determine source file corresponding to: ${gcov_file}") + endif() + + foreach(exclude_entry ${CTEST_CUSTOM_COVERAGE_EXCLUDE}) + if(source_file MATCHES "${exclude_entry}") + set(is_excluded true) + + if(NOT GCOV_QUIET) + message("Excluding coverage for: ${source_file} which matches ${exclude_entry}") + endif() + + break() + endif() + endforeach() + + if(NOT is_excluded) + list(APPEND gcov_files ${gcov_file}) + endif() + endforeach() + # 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 diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5944d08..d9988b2 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2345,12 +2345,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" @ONLY ESCAPE_QUOTES) add_test(CTestCoverageCollectGCOV ${CMAKE_CTEST_COMMAND} + -C \${CTEST_CONFIGURATION_TYPE} -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") + "PASSED with correct output.*Testing/CoverageInfo/main.cpp.gcov") configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake.in" diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/3rdparty/foo.cpp b/Tests/CTestCoverageCollectGCOV/TestProject/3rdparty/foo.cpp new file mode 100644 index 0000000..85e6cd8 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/3rdparty/foo.cpp @@ -0,0 +1 @@ +void foo() {} diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt b/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt new file mode 100644 index 0000000..ce6fac4 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.2) + +project(TestProject CXX) + +include(CTest) + +set(SOURCES + main.cpp + 3rdparty/foo.cpp + extra/extra.cpp +) + +add_executable(myexecutable ${SOURCES}) + +set_property(SOURCE main.cpp APPEND PROPERTY LABELS SourceLabel) +set_property(TARGET myexecutable APPEND PROPERTY LABELS TargetLabel) + +set(MYEXECUTABLE_INFO_FILE "${CMAKE_CURRENT_BINARY_DIR}/myexecutable_info.cmake") + +file(WRITE "${MYEXECUTABLE_INFO_FILE}" " + set(TARGET myexecutable) + set(SOURCE_DIR \"${CMAKE_CURRENT_SOURCE_DIR}\") + set(SOURCES \"${SOURCES}\") +") + +add_custom_command(TARGET myexecutable + POST_BUILD + COMMAND ${CMAKE_COMMAND} + "-DINFO_FILE=${MYEXECUTABLE_INFO_FILE}" + -P "${CMAKE_CURRENT_SOURCE_DIR}/fake_compile_time_gcno.cmake" + VERBATIM +) + +add_test(NAME mytest + COMMAND ${CMAKE_COMMAND} + "-DMYEXECUTABLE=$" + "-DTARGETDIR=${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/myexecutable.dir" + -P "${CMAKE_CURRENT_SOURCE_DIR}/fake_run_time_gcda.cmake" +) + +set_property(TEST mytest APPEND PROPERTY LABELS TestLabel) diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/extra/extra.cpp b/Tests/CTestCoverageCollectGCOV/TestProject/extra/extra.cpp new file mode 100644 index 0000000..c3a2c12 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/extra/extra.cpp @@ -0,0 +1 @@ +void extra() {} diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake b/Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake new file mode 100644 index 0000000..881460b --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake @@ -0,0 +1,7 @@ +include("${INFO_FILE}") + +foreach(source ${SOURCES}) + file(WRITE "CMakeFiles/${TARGET}.dir/${source}.gcno" + "${SOURCE_DIR}/${source}" + ) +endforeach() diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/fake_run_time_gcda.cmake b/Tests/CTestCoverageCollectGCOV/TestProject/fake_run_time_gcda.cmake new file mode 100644 index 0000000..26ce2bd --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/fake_run_time_gcda.cmake @@ -0,0 +1,12 @@ +execute_process(COMMAND ${MYEXECUTABLE} RESULT_VARIABLE RESULT) + +if(NOT RESULT_VARIABLE STREQUAL "0") + message("Test failure") +endif() + +file(GLOB_RECURSE gcno_files "${TARGETDIR}/*.gcno") + +foreach(gcno_file ${gcno_files}) + string(REPLACE ".gcno" ".gcda" gcda_file "${gcno_file}") + configure_file(${gcno_file} ${gcda_file} COPYONLY) +endforeach() diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/main.cpp b/Tests/CTestCoverageCollectGCOV/TestProject/main.cpp new file mode 100644 index 0000000..237c8ce --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/main.cpp @@ -0,0 +1 @@ +int main() {} diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake index e704f14..b0c3a9b 100644 --- a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake +++ b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake @@ -3,6 +3,12 @@ foreach(I RANGE 0 ${CMAKE_ARGC}) 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") + +get_filename_component(gcda_name ${gcda_file} NAME) +string(REPLACE ".gcda" ".gcov" gcov_name "${gcda_name}") + +file(STRINGS "${gcda_file}" source_file LIMIT_COUNT 1 ENCODING UTF-8) + +file(WRITE "${CMAKE_SOURCE_DIR}/${gcov_name}" + " -: 0:Source:${source_file}" +) diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in index 4bdcb10..29f7e7f 100644 --- a/Tests/CTestCoverageCollectGCOV/test.cmake.in +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -1,16 +1,21 @@ 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_PROJECT_NAME "TestProject") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/TestProject") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV/TestProject") set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") + +ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + ctest_start(Experimental) ctest_configure() ctest_build() ctest_test() -file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeFiles/echoargs.dir/echoargs.gcda -"dummy -") +list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE + "/foo/something" + "/3rdparty/" + "/bar/somethingelse" +) include(CTestCoverageCollectGCOV) set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar) @@ -22,15 +27,21 @@ ctest_coverage_collect_gcov( GCOV_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}) + ${CMAKE_COMMAND} -E tar tf ${tar_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +string(REPLACE "\n" ";" out "${out}") +list(SORT out) set(expected_out -"Testing/CoverageInfo/echoargs.gcov -Testing/CoverageInfo/data.json -CMakeFiles/echoargs.dir/Labels.json -") + CMakeFiles/myexecutable.dir/Labels.json + Testing/CoverageInfo/data.json + Testing/CoverageInfo/extra.cpp.gcov + Testing/CoverageInfo/main.cpp.gcov +) if("${out}" STREQUAL "${expected_out}") message("PASSED with correct output: ${out}") ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From nilsgladitz at gmail.com Sat Apr 4 10:02:12 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Sat, 4 Apr 2015 10:02:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1467-g646bd1a Message-ID: <20150404140212.C060BADAD4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 646bd1ab578d9e29cdec80f8f8a16ddb657f0303 (commit) via dc4f64ab982f0bfb987b1e0a7e3afae8e24ed40a (commit) via c6624cfdc1fe9c7c53ad9ed06da759df803aef71 (commit) from dd42365d9a196cff86359e2e269b6619ad4acad4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=646bd1ab578d9e29cdec80f8f8a16ddb657f0303 commit 646bd1ab578d9e29cdec80f8f8a16ddb657f0303 Merge: dd42365 dc4f64a Author: Nils Gladitz AuthorDate: Sat Apr 4 10:02:12 2015 -0400 Commit: CMake Topic Stage CommitDate: Sat Apr 4 10:02:12 2015 -0400 Merge topic 'doc-generator-names-ref' into next dc4f64ab Help: Clarify manual reference for generator names c6624cfd CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc4f64ab982f0bfb987b1e0a7e3afae8e24ed40a commit dc4f64ab982f0bfb987b1e0a7e3afae8e24ed40a Author: Nils Gladitz AuthorDate: Sat Apr 4 16:01:50 2015 +0200 Commit: Nils Gladitz CommitDate: Sat Apr 4 16:01:50 2015 +0200 Help: Clarify manual reference for generator names diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt index 986b541..e4c5873 100644 --- a/Help/manual/OPTIONS_BUILD.txt +++ b/Help/manual/OPTIONS_BUILD.txt @@ -43,7 +43,7 @@ CMake may support multiple native build systems on certain platforms. A generator is responsible for generating a particular build system. Possible generator names are specified in the - Generators section. + :manual:`cmake-generators(7)` manual. ``-T `` Specify toolset name if supported by generator. ----------------------------------------------------------------------- Summary of changes: Help/manual/OPTIONS_BUILD.txt | 2 +- Source/CMakeVersion.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sat Apr 4 12:36:42 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 4 Apr 2015 12:36:42 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1472-ga78a2f8 Message-ID: <20150404163642.67C7AADB8F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a78a2f8997a87806fb04e833c27b684b7c20fb3e (commit) via a469bf7b98bb2fc82de874383b0538e2d32ab2e1 (commit) via 257c16495ae0653d8f3630c8d76e6496bc9edd86 (commit) via fe17092c20c39761a060508fc6b1979b06e84afe (commit) via 199b28ac3ab5cc2dc99b352b8653a03f93baf3e5 (commit) from 646bd1ab578d9e29cdec80f8f8a16ddb657f0303 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a78a2f8997a87806fb04e833c27b684b7c20fb3e commit a78a2f8997a87806fb04e833c27b684b7c20fb3e Merge: 646bd1a a469bf7 Author: Stephen Kelly AuthorDate: Sat Apr 4 12:36:41 2015 -0400 Commit: CMake Topic Stage CommitDate: Sat Apr 4 12:36:41 2015 -0400 Merge topic 'minor-cleanups' into next a469bf7b cmMakefile: Remove one wrong and one insufficiently helpful comment. 257c1649 cmListFile: Remove unused member. fe17092c cmMakefile: Remove bogus comment. 199b28ac Remove duplicate tag name. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a469bf7b98bb2fc82de874383b0538e2d32ab2e1 commit a469bf7b98bb2fc82de874383b0538e2d32ab2e1 Author: Stephen Kelly AuthorDate: Sat Apr 4 15:47:49 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 4 18:31:03 2015 +0200 cmMakefile: Remove one wrong and one insufficiently helpful comment. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index e18a4a7..7c2085a 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -981,9 +981,8 @@ protected: // directories. std::set SystemIncludeDirectories; - std::vector ListFiles; // list of command files loaded - std::vector OutputFiles; // list of command files loaded - + std::vector ListFiles; + std::vector OutputFiles; cmTarget::LinkLibraryVectorType LinkLibraries; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=257c16495ae0653d8f3630c8d76e6496bc9edd86 commit 257c16495ae0653d8f3630c8d76e6496bc9edd86 Author: Stephen Kelly AuthorDate: Sat Apr 4 15:47:24 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 4 18:31:03 2015 +0200 cmListFile: Remove unused member. It is written, but not read since commit v2.4.0~575 (ENH: Since list file cache does not make much sense any more ..., 2006-02-07). diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 3e26349..ddcea9b 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -146,18 +146,12 @@ bool cmListFile::ParseFile(const char* filename, } bool parseError = false; - this->ModifiedTime = cmSystemTools::ModifiedTime(filename); { cmListFileParser parser(this, mf, filename); parseError = !parser.ParseFile(); } - if(parseError) - { - this->ModifiedTime = 0; - } - // do we need a cmake_policy(VERSION call? if(topLevel) { diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 2ca9b8e..544ff1b 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -85,15 +85,10 @@ class cmListFileBacktrace: public std::vector struct cmListFile { - cmListFile() - :ModifiedTime(0) - { - } bool ParseFile(const char* path, bool topLevel, cmMakefile *mf); - long int ModifiedTime; std::vector Functions; }; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe17092c20c39761a060508fc6b1979b06e84afe commit fe17092c20c39761a060508fc6b1979b06e84afe Author: Stephen Kelly AuthorDate: Sat Apr 4 15:30:25 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 4 18:31:03 2015 +0200 cmMakefile: Remove bogus comment. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index ebfe508..e18a4a7 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -776,10 +776,6 @@ public: ///enabled. void EnableLanguage(std::vectorconst& languages, bool optional); - /** - * Set/Get the name of the parent directories CMakeLists file - * given a current CMakeLists file name - */ cmCacheManager *GetCacheManager() const; /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=199b28ac3ab5cc2dc99b352b8653a03f93baf3e5 commit 199b28ac3ab5cc2dc99b352b8653a03f93baf3e5 Author: Stephen Kelly AuthorDate: Wed Mar 18 21:18:44 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Apr 4 18:30:52 2015 +0200 Remove duplicate tag name. diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 673dcb9..2654851 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1554,7 +1554,6 @@ class ArtifactPdbTag; class ArtifactPathTag; class ArtifactDirTag; -class ArtifactNameTag; //---------------------------------------------------------------------------- template ----------------------------------------------------------------------- Summary of changes: Source/cmGeneratorExpressionNode.cxx | 1 - Source/cmListFileCache.cxx | 6 ------ Source/cmListFileCache.h | 5 ----- Source/cmMakefile.h | 9 ++------- 4 files changed, 2 insertions(+), 19 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sat Apr 4 13:16:46 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 4 Apr 2015 13:16:46 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1478-g1382e81 Message-ID: <20150404171646.7383DAD494@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1382e8156cfe09a06a13451f9ae7879b135f3ede (commit) via 6f82b5e81ca9677dc2fde855ba7be8e235baa667 (commit) via 66f5af29f3855c743580821eb73a94f72b709064 (commit) via f7dd3f7cf05c588b7cbdee7c8b95306d6f1cc05d (commit) via 3b2561736df2c1fd8f69fd9341e1f4c47eb1192d (commit) via 8fc3a2fbf61bd2686455656201d3de1ceb571145 (commit) from a78a2f8997a87806fb04e833c27b684b7c20fb3e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1382e8156cfe09a06a13451f9ae7879b135f3ede commit 1382e8156cfe09a06a13451f9ae7879b135f3ede Merge: a78a2f8 6f82b5e Author: Stephen Kelly AuthorDate: Sat Apr 4 13:16:45 2015 -0400 Commit: CMake Topic Stage CommitDate: Sat Apr 4 13:16:45 2015 -0400 Merge topic 'improve-properties-help' into next 6f82b5e8 Help: Link to properties in set_tests_properties. 66f5af29 Help: Link to properties in set_directory_properties docs. f7dd3f7c Help: Add link in set_source_files_properties command docs. 3b256173 Help: Shorten too-long title marker. 8fc3a2fb Help: Add references to cmake-property sections. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f82b5e81ca9677dc2fde855ba7be8e235baa667 commit 6f82b5e81ca9677dc2fde855ba7be8e235baa667 Author: Stephen Kelly AuthorDate: Sat Apr 4 19:10:38 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 4 19:14:56 2015 +0200 Help: Link to properties in set_tests_properties. Remove help for specific properties to their own help pages. diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index afac847..3efb165 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -8,29 +8,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 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: - -WILL_FAIL: If set to true, this will invert the pass/fail flag of the -test. - -PASS_REGULAR_EXPRESSION: If set, the test output will be checked -against the specified regular expressions and at least one of the -regular expressions has to match, otherwise the test will fail. - -:: - - Example: PASS_REGULAR_EXPRESSION "TestPassed;All ok" - -FAIL_REGULAR_EXPRESSION: If set, if the output will match to one of -specified regular expressions, the test will fail. - -:: - - Example: FAIL_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed" - -Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect a list -of regular expressions. - -TIMEOUT: Setting this will limit the test runtime to the number of -seconds specified. +will report an error. +:manual:`Generator expressions ` will be +expanded the same as supported by the test's :command:`add_test` call. See +:ref:`Test Properties` for the list of properties known to CMake. diff --git a/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst b/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst index b02d17d..facf902 100644 --- a/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst +++ b/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst @@ -4,5 +4,12 @@ FAIL_REGULAR_EXPRESSION If the output matches this regular expression the test will fail. If set, if the output matches one of specified regular expressions, -the test will fail.For example: FAIL_REGULAR_EXPRESSION -"[^a-z]Error;ERROR;Failed" +the test will fail. Example: + +.. code-block:: cmake + + set_tests_properties(mytest PROPERTIES + FAIL_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed" + ) + +``FAIL_REGULAR_EXPRESSION`` expects a list of regular expressions. diff --git a/Help/prop_test/PASS_REGULAR_EXPRESSION.rst b/Help/prop_test/PASS_REGULAR_EXPRESSION.rst index bb35f77..0cd6215 100644 --- a/Help/prop_test/PASS_REGULAR_EXPRESSION.rst +++ b/Help/prop_test/PASS_REGULAR_EXPRESSION.rst @@ -5,4 +5,12 @@ The output must match this regular expression for the test to pass. If set, the test output will be checked against the specified regular expressions and at least one of the regular expressions has to match, -otherwise the test will fail. +otherwise the test will fail. Example: + +.. code-block:: cmake + + set_tests_properties(mytest PROPERTIES + PASS_REGULAR_EXPRESSION "TestPassed;All ok" + ) + +``PASS_REGULAR_EXPRESSION`` expects a list of regular expressions. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=66f5af29f3855c743580821eb73a94f72b709064 commit 66f5af29f3855c743580821eb73a94f72b709064 Author: Stephen Kelly AuthorDate: Sat Apr 4 18:58:55 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 4 18:58:55 2015 +0200 Help: Link to properties in set_directory_properties docs. Remove claim that CMake will report an error for unknown properties. diff --git a/Help/command/set_directory_properties.rst b/Help/command/set_directory_properties.rst index 834013a..e485fce 100644 --- a/Help/command/set_directory_properties.rst +++ b/Help/command/set_directory_properties.rst @@ -7,9 +7,6 @@ Set a property of the directory. set_directory_properties(PROPERTIES prop1 value1 prop2 value2) -Set a property for the current directory and subdirectories. If the -property is not found, CMake will report an error. The properties -include: INCLUDE_DIRECTORIES, LINK_DIRECTORIES, -INCLUDE_REGULAR_EXPRESSION, and ADDITIONAL_MAKE_CLEAN_FILES. -ADDITIONAL_MAKE_CLEAN_FILES is a list of files that will be cleaned as -a part of "make clean" stage. +Set a property for the current directory and subdirectories. See +:ref:`Directory Properties` for the list of properties known +to CMake. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f7dd3f7cf05c588b7cbdee7c8b95306d6f1cc05d commit f7dd3f7cf05c588b7cbdee7c8b95306d6f1cc05d Author: Stephen Kelly AuthorDate: Sat Apr 4 18:56:14 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 4 18:56:14 2015 +0200 Help: Add link in set_source_files_properties command docs. Remove claim about unrecognized properties being ignored. Such properties can be retrieved later by the user. diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst index 8ea02a3..b4904e8 100644 --- a/Help/command/set_source_files_properties.rst +++ b/Help/command/set_source_files_properties.rst @@ -10,6 +10,6 @@ Source files can have properties that affect how they are built. [prop2 value2 [...]]) Set properties associated with source files using a key/value paired -list. See properties documentation for those known to CMake. -Unrecognized properties are ignored. Source file properties are -visible only to targets added in the same directory (CMakeLists.txt). +list. See :ref:`Source File Properties` for the list of properties known +to CMake. Source file properties are visible only to targets added +in the same directory (CMakeLists.txt). http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3b2561736df2c1fd8f69fd9341e1f4c47eb1192d commit 3b2561736df2c1fd8f69fd9341e1f4c47eb1192d Author: Stephen Kelly AuthorDate: Sat Apr 4 18:54:28 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 4 18:54:28 2015 +0200 Help: Shorten too-long title marker. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index ac38dde..affa75f 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -345,7 +345,7 @@ Properties on Installed Files Deprecated Properties on Directories -===================================== +==================================== .. toctree:: :maxdepth: 1 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8fc3a2fbf61bd2686455656201d3de1ceb571145 commit 8fc3a2fbf61bd2686455656201d3de1ceb571145 Author: Stephen Kelly AuthorDate: Sat Apr 4 18:54:09 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 4 18:54:09 2015 +0200 Help: Add references to cmake-property sections. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 76dd279..ac38dde 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -7,6 +7,8 @@ cmake-properties(7) .. contents:: +.. _`Global Properties`: + Properties of Global Scope ========================== @@ -41,6 +43,8 @@ Properties of Global Scope /prop_gbl/TARGET_SUPPORTS_SHARED_LIBS /prop_gbl/USE_FOLDERS +.. _`Directory Properties`: + Properties on Directories ========================= @@ -72,6 +76,8 @@ Properties on Directories /prop_dir/VS_GLOBAL_SECTION_POST_section /prop_dir/VS_GLOBAL_SECTION_PRE_section +.. _`Target Properties`: + Properties on Targets ===================== @@ -245,6 +251,8 @@ Properties on Targets /prop_tgt/XCODE_ATTRIBUTE_an-attribute /prop_tgt/XCTEST +.. _`Test Properties`: + Properties on Tests =================== @@ -269,6 +277,8 @@ Properties on Tests /prop_test/WILL_FAIL /prop_test/WORKING_DIRECTORY +.. _`Source File Properties`: + Properties on Source Files ========================== @@ -303,6 +313,8 @@ Properties on Source Files /prop_sf/XCODE_EXPLICIT_FILE_TYPE /prop_sf/XCODE_LAST_KNOWN_FILE_TYPE +.. _`Cache Entry Properties`: + Properties on Cache Entries =========================== @@ -316,6 +328,8 @@ Properties on Cache Entries /prop_cache/TYPE /prop_cache/VALUE +.. _`Installed File Properties`: + Properties on Installed Files ============================= ----------------------------------------------------------------------- Summary of changes: Help/command/set_directory_properties.rst | 9 +++----- Help/command/set_source_files_properties.rst | 6 +++--- Help/command/set_tests_properties.rst | 30 ++++---------------------- Help/manual/cmake-properties.7.rst | 16 +++++++++++++- Help/prop_test/FAIL_REGULAR_EXPRESSION.rst | 11 ++++++++-- Help/prop_test/PASS_REGULAR_EXPRESSION.rst | 10 ++++++++- 6 files changed, 43 insertions(+), 39 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Apr 5 00:01:09 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 5 Apr 2015 00:01:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-612-ga3e2de3 Message-ID: <20150405040110.02609AD6CD@public.kitware.com> This is an automated email from 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 a3e2de3a312aa7db516a9127a96dd1d966a7fa47 (commit) from c6624cfdc1fe9c7c53ad9ed06da759df803aef71 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a3e2de3a312aa7db516a9127a96dd1d966a7fa47 commit a3e2de3a312aa7db516a9127a96dd1d966a7fa47 Author: Kitware Robot AuthorDate: Sun Apr 5 00:01:04 2015 -0400 Commit: Kitware Robot CommitDate: Sun Apr 5 00:01:04 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 48f02d1..7d4ef58 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150404) +set(CMake_VERSION_PATCH 20150405) #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 Apr 5 04:26:53 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 5 Apr 2015 04:26:53 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1487-gbda8224 Message-ID: <20150405082653.5D793AD753@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via bda82241db4eb8d23661d3ce95de0b011d4b40d3 (commit) via c37cf7fa9e0aa7f7c3a2b32457385a1caf37bc3c (commit) via 64556e3dfa4161b33110daba606439f2c7971b15 (commit) via 23bb5d225b772f7e18dab16375c7620c99d62814 (commit) via 510562e3e7b9387bebe14060b147ec3022ee58a3 (commit) via 629e94893668c69fccb6954b0fc807c54e9218dd (commit) via d280bae98f009b56b9c14243981d5aba3e2f8747 (commit) via 364c7ea187d67f702891b201970712806999ad07 (commit) via 47acfe1d1e480bee109efa2de9253cf1a5457a8e (commit) from 1382e8156cfe09a06a13451f9ae7879b135f3ede (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bda82241db4eb8d23661d3ce95de0b011d4b40d3 commit bda82241db4eb8d23661d3ce95de0b011d4b40d3 Merge: 1382e81 c37cf7f Author: Stephen Kelly AuthorDate: Sun Apr 5 04:26:51 2015 -0400 Commit: CMake Topic Stage CommitDate: Sun Apr 5 04:26:51 2015 -0400 Merge topic 'minor-cleanups' into next c37cf7fa cmCacheManager: Remove unused method 64556e3d cmCacheManager: Remove unused overloads. 23bb5d22 cmCacheManager: Remove use of intermediate overload. 510562e3 cmGlobalGenerator: Don't fetch the cache manager in a loop. 629e9489 cmake: Clear member rather than explicit erase. d280bae9 cmake: Be clear that there is no chaining after global properties. 364c7ea1 cmake: Remove unused method. 47acfe1d cmake: Remove unused member. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c37cf7fa9e0aa7f7c3a2b32457385a1caf37bc3c commit c37cf7fa9e0aa7f7c3a2b32457385a1caf37bc3c Author: Stephen Kelly AuthorDate: Sat Apr 4 20:42:28 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 5 10:26:10 2015 +0200 cmCacheManager: Remove unused method diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 002ccd1..fa7eff3 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -896,21 +896,3 @@ bool cmCacheManager::CacheIterator::PropertyExists( { return this->GetProperty(prop)? true:false; } - -//---------------------------------------------------------------------------- -bool cmCacheManager::NeedCacheCompatibility(int major, int minor) -{ - // Compatibility is not needed if the cache version is zero because - // the cache was created or modified by the user. - if(this->CacheMajorVersion == 0) - { - return false; - } - - // Compatibility is needed if the cache version is equal to or lower - // than the given version. - cmIML_INT_uint64_t actual_compat = - CMake_VERSION_ENCODE(this->CacheMajorVersion, this->CacheMinorVersion, 0); - return (actual_compat && - actual_compat <= CMake_VERSION_ENCODE(major, minor, 0)); -} diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 659d44a..f7f8776 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -144,7 +144,6 @@ public: { return this->CacheMajorVersion; } unsigned int GetCacheMinorVersion() const { return this->CacheMinorVersion; } - bool NeedCacheCompatibility(int major, int minor); protected: ///! Add an entry into the cache diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ec1d814..215ee16 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -184,11 +184,6 @@ unsigned int cmMakefile::GetCacheMinorVersion() const return this->GetCacheManager()->GetCacheMinorVersion(); } -bool cmMakefile::NeedCacheCompatibility(int major, int minor) const -{ - return this->GetCacheManager()->NeedCacheCompatibility(major, minor); -} - cmMakefile::~cmMakefile() { cmDeleteAll(this->InstallGenerators); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 7c2085a..920b6b7 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -78,9 +78,6 @@ public: bool VariableInitialized(const std::string& ) const; /* return true if a variable has been used */ bool VariableUsed(const std::string& ) const; - /** Return whether compatibility features needed for a version of - the cache or lower should be enabled. */ - bool NeedCacheCompatibility(int major, int minor) const; /** * Construct an empty makefile. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=64556e3dfa4161b33110daba606439f2c7971b15 commit 64556e3dfa4161b33110daba606439f2c7971b15 Author: Stephen Kelly AuthorDate: Sat Apr 4 20:24:34 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 5 10:26:10 2015 +0200 cmCacheManager: Remove unused overloads. diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 30791ff..002ccd1 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -76,25 +76,12 @@ bool cmCacheManager::IsType(const char* s) return false; } -bool cmCacheManager::LoadCache(cmMakefile* mf) -{ - return this->LoadCache(mf->GetHomeOutputDirectory()); -} - - bool cmCacheManager::LoadCache(const std::string& path) { std::set emptySet; return this->LoadCache(path, true, emptySet, emptySet); } -bool cmCacheManager::LoadCache(const std::string& path, - bool internal) -{ - std::set emptySet; - return this->LoadCache(path, internal, emptySet, emptySet); -} - static bool ParseEntryWithoutType(const std::string& entry, std::string& var, std::string& value) @@ -419,12 +406,6 @@ void cmCacheManager::WritePropertyEntries(std::ostream& os, } } -bool cmCacheManager::SaveCache(cmMakefile* mf) -{ - return this->SaveCache(mf->GetHomeOutputDirectory()); -} - - bool cmCacheManager::SaveCache(const std::string& path) { std::string cacheFile = path; diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index d9a9112..659d44a 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -105,17 +105,12 @@ public: static const char* TypeToString(CacheEntryType); static bool IsType(const char*); - ///! Load a cache for given makefile. Loads from ouput home. - bool LoadCache(cmMakefile*); ///! Load a cache for given makefile. Loads from path/CMakeCache.txt. bool LoadCache(const std::string& path); - bool LoadCache(const std::string& path, bool internal); bool LoadCache(const std::string& path, bool internal, std::set& excludes, std::set& includes); - ///! Save cache for given makefile. Saves to ouput home CMakeCache.txt. - bool SaveCache(cmMakefile*) ; ///! Save cache for given makefile. Saves to ouput path/CMakeCache.txt bool SaveCache(const std::string& path) ; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23bb5d225b772f7e18dab16375c7620c99d62814 commit 23bb5d225b772f7e18dab16375c7620c99d62814 Author: Stephen Kelly AuthorDate: Sat Apr 4 20:24:11 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 5 10:26:10 2015 +0200 cmCacheManager: Remove use of intermediate overload. diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 0c77891..30791ff 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -84,7 +84,8 @@ bool cmCacheManager::LoadCache(cmMakefile* mf) bool cmCacheManager::LoadCache(const std::string& path) { - return this->LoadCache(path,true); + std::set emptySet; + return this->LoadCache(path, true, emptySet, emptySet); } bool cmCacheManager::LoadCache(const std::string& path, http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=510562e3e7b9387bebe14060b147ec3022ee58a3 commit 510562e3e7b9387bebe14060b147ec3022ee58a3 Author: Stephen Kelly AuthorDate: Sat Apr 4 20:36:06 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 5 10:26:10 2015 +0200 cmGlobalGenerator: Don't fetch the cache manager in a loop. It doesn't change from Makefile to Makefile. diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 8123c99..3c0a0e2 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1537,10 +1537,9 @@ void cmGlobalGenerator::CheckLocalGenerators() std::map notFoundMap; // std::set notFoundMap; // after it is all done do a ConfigureFinalPass - cmCacheManager* manager = 0; + cmCacheManager* manager = this->GetCMakeInstance()->GetCacheManager(); for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { - manager = this->LocalGenerators[i]->GetMakefile()->GetCacheManager(); this->LocalGenerators[i]->ConfigureFinalPass(); cmTargets &targets = this->LocalGenerators[i]->GetMakefile()->GetTargets(); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=629e94893668c69fccb6954b0fc807c54e9218dd commit 629e94893668c69fccb6954b0fc807c54e9218dd Author: Stephen Kelly AuthorDate: Sun Apr 5 01:58:15 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 5 10:26:10 2015 +0200 cmake: Clear member rather than explicit erase. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 3381447..5c52a1a 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -212,7 +212,7 @@ void cmake::CleanupCommandsAndMacros() delete j->second; } } - this->Commands.erase(this->Commands.begin(), this->Commands.end()); + this->Commands.clear(); std::vector::iterator it; for ( it = commands.begin(); it != commands.end(); ++ it ) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d280bae98f009b56b9c14243981d5aba3e2f8747 commit d280bae98f009b56b9c14243981d5aba3e2f8747 Author: Stephen Kelly AuthorDate: Sun Apr 5 10:11:30 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 5 10:26:09 2015 +0200 cmake: Be clear that there is no chaining after global properties. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 3dc50ab..3381447 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2273,8 +2273,6 @@ const char *cmake::GetProperty(const std::string& prop) const char *cmake::GetProperty(const std::string& prop, cmProperty::ScopeType scope) { - bool chain = false; - // watch for special properties std::string output = ""; if ( prop == "CACHE_VARIABLES" ) @@ -2332,7 +2330,8 @@ const char *cmake::GetProperty(const std::string& prop, return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1; } #undef STRING_LIST_ELEMENT - return this->Properties.GetPropertyValue(prop, scope, chain); + bool dummy = false; + return this->Properties.GetPropertyValue(prop, scope, dummy); } bool cmake::GetPropertyAsBool(const std::string& prop) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=364c7ea187d67f702891b201970712806999ad07 commit 364c7ea187d67f702891b201970712806999ad07 Author: Stephen Kelly AuthorDate: Sun Apr 5 01:29:45 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 5 10:26:09 2015 +0200 cmake: Remove unused method. diff --git a/Source/cmake.h b/Source/cmake.h index 79ccc33..c22b329 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -287,9 +287,6 @@ class cmake cmProperty::ScopeType scope); bool GetPropertyAsBool(const std::string& prop); - // Get the properties - cmPropertyMap &GetProperties() { return this->Properties; } - ///! Get or create an cmInstalledFile instance and return a pointer to it cmInstalledFile *GetOrCreateInstalledFile( cmMakefile* mf, const std::string& name); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=47acfe1d1e480bee109efa2de9253cf1a5457a8e commit 47acfe1d1e480bee109efa2de9253cf1a5457a8e Author: Stephen Kelly AuthorDate: Sat Apr 4 23:46:14 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 5 10:10:00 2015 +0200 cmake: Remove unused member. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 51df7f2..3dc50ab 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -188,7 +188,6 @@ void cmake::InitializeProperties() { this->Properties.clear(); this->Properties.SetCMakeInstance(this); - this->AccessedProperties.clear(); this->PropertyDefinitions.clear(); // initialize properties diff --git a/Source/cmake.h b/Source/cmake.h index 60ffcd4..79ccc33 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -383,7 +383,6 @@ protected: void InitializeProperties(); int HandleDeleteCacheVariables(const std::string& var); cmPropertyMap Properties; - std::set > AccessedProperties; std::map PropertyDefinitions; ----------------------------------------------------------------------- Summary of changes: Source/cmCacheManager.cxx | 38 +------------------------------------- Source/cmCacheManager.h | 6 ------ Source/cmGlobalGenerator.cxx | 3 +-- Source/cmMakefile.cxx | 5 ----- Source/cmMakefile.h | 3 --- Source/cmake.cxx | 8 +++----- Source/cmake.h | 4 ---- 7 files changed, 5 insertions(+), 62 deletions(-) hooks/post-receive -- CMake From domen.vrankar at gmail.com Sun Apr 5 16:53:13 2015 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Sun, 5 Apr 2015 16:53:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1490-g71f7b67 Message-ID: <20150405205314.056FCAD8CB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 71f7b678666f1e91b56972df9a9871816584af67 (commit) via 0ffd35340e5458882b4b9596a84dd7cdfeaecfbd (commit) via a3e2de3a312aa7db516a9127a96dd1d966a7fa47 (commit) from bda82241db4eb8d23661d3ce95de0b011d4b40d3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=71f7b678666f1e91b56972df9a9871816584af67 commit 71f7b678666f1e91b56972df9a9871816584af67 Merge: bda8224 0ffd353 Author: Domen Vrankar AuthorDate: Sun Apr 5 16:53:13 2015 -0400 Commit: CMake Topic Stage CommitDate: Sun Apr 5 16:53:13 2015 -0400 Merge topic 'cpack-one-component-only' into next 0ffd3534 CPack single component packaging a3e2de3a CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0ffd35340e5458882b4b9596a84dd7cdfeaecfbd commit 0ffd35340e5458882b4b9596a84dd7cdfeaecfbd Author: Domen Vrankar AuthorDate: Sun Apr 5 22:49:19 2015 +0200 Commit: Domen Vrankar CommitDate: Sun Apr 5 22:49:41 2015 +0200 CPack single component packaging RPM, DEB and archive packages were not created in cases when CPACK__COMPONENT_INSTALL was set to ON and a single component existed. Patch also changes CPackRPM test to implicitly test for this case. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 67005ef..995eb0d 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1499,7 +1499,10 @@ bool cmCPackGenerator::SupportsComponentInstallation() const //---------------------------------------------------------------------- bool cmCPackGenerator::WantsComponentInstallation() const { - return (!IsOn("CPACK_MONOLITHIC_INSTALL") & SupportsComponentInstallation()); + return (!IsOn("CPACK_MONOLITHIC_INSTALL") + && SupportsComponentInstallation() + // check that package at least has components + && !(this->ComponentGroups.empty() || this->Components.empty())); } //---------------------------------------------------------------------- diff --git a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake index 3ace6a8..31e729b 100644 --- a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake +++ b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake @@ -1,5 +1,4 @@ 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") ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- Source/CPack/cmCPackGenerator.cxx | 5 ++++- .../CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Apr 6 00:01:05 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 6 Apr 2015 00:01:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-613-g03f7a50 Message-ID: <20150406040105.CF0D9ADB8A@public.kitware.com> This is an automated email from 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 03f7a509ef9a0d3d6a9afb5cfc8ab6773428786e (commit) from a3e2de3a312aa7db516a9127a96dd1d966a7fa47 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03f7a509ef9a0d3d6a9afb5cfc8ab6773428786e commit 03f7a509ef9a0d3d6a9afb5cfc8ab6773428786e Author: Kitware Robot AuthorDate: Mon Apr 6 00:01:04 2015 -0400 Commit: Kitware Robot CommitDate: Mon Apr 6 00:01:04 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7d4ef58..2e9ee68 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150405) +set(CMake_VERSION_PATCH 20150406) #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 Apr 6 08:43:10 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 6 Apr 2015 08:43:10 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1492-gb698a9b Message-ID: <20150406124310.285F3ABC92@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b698a9b255e5012a50a3b9a76342f3ccbb19fffd (commit) via c22f6c1504037347d4052a7b441160a2b5c4ce23 (commit) from 71f7b678666f1e91b56972df9a9871816584af67 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b698a9b255e5012a50a3b9a76342f3ccbb19fffd commit b698a9b255e5012a50a3b9a76342f3ccbb19fffd Merge: 71f7b67 c22f6c1 Author: Stephen Kelly AuthorDate: Mon Apr 6 08:43:09 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 08:43:09 2015 -0400 Merge topic 'minor-cleanups' into next c22f6c15 Remove unused includes. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c22f6c1504037347d4052a7b441160a2b5c4ce23 commit c22f6c1504037347d4052a7b441160a2b5c4ce23 Author: Stephen Kelly AuthorDate: Mon Apr 6 14:41:05 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 14:41:05 2015 +0200 Remove unused includes. diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index fa7eff3..b8dfe04 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -12,7 +12,6 @@ #include "cmCacheManager.h" #include "cmSystemTools.h" -#include "cmCacheManager.h" #include "cmGeneratedFileStream.h" #include "cmMakefile.h" #include "cmake.h" diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 2b999eb..6844fee 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -14,7 +14,6 @@ #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmSourceFile.h" -#include "cmCacheManager.h" #include "cmGeneratorTarget.h" #include "cmCustomCommandGenerator.h" #include "cmake.h" ----------------------------------------------------------------------- Summary of changes: Source/cmCacheManager.cxx | 1 - Source/cmLocalVisualStudio6Generator.cxx | 1 - 2 files changed, 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 08:53:15 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 08:53:15 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1494-g6ec818d Message-ID: <20150406125315.89E7CAD494@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 6ec818dad66ff35f2cfeb44c5527b01cf5d8f8fc (commit) via 5f686b8a6b5258f6c5aafbb33d7db36b38a3f06d (commit) from b698a9b255e5012a50a3b9a76342f3ccbb19fffd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ec818dad66ff35f2cfeb44c5527b01cf5d8f8fc commit 6ec818dad66ff35f2cfeb44c5527b01cf5d8f8fc Merge: b698a9b 5f686b8 Author: Brad King AuthorDate: Mon Apr 6 08:53:14 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 08:53:14 2015 -0400 Merge topic 'test_cpack_symlinks' into next 5f686b8a Tests: Add case for CPack source package with symlinks http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f686b8a6b5258f6c5aafbb33d7db36b38a3f06d commit 5f686b8a6b5258f6c5aafbb33d7db36b38a3f06d Author: Bill Hoffman AuthorDate: Tue Mar 31 15:04:39 2015 -0400 Commit: Brad King CommitDate: Mon Apr 6 08:52:54 2015 -0400 Tests: Add case for CPack source package with symlinks diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 7b9c810..1242332 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -203,6 +203,11 @@ add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) add_RunCMake_test(CTestCommandLine) +# Only run this test on unix platforms that support +# symbolic links +if(UNIX) + add_RunCMake_test(CPackSymlinks) +endif() set(IfacePaths_INCLUDE_DIRECTORIES_ARGS -DTEST_PROP=INCLUDE_DIRECTORIES) add_RunCMake_test(IfacePaths_INCLUDE_DIRECTORIES TEST_DIR IfacePaths) diff --git a/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake b/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake new file mode 100644 index 0000000..439d95e --- /dev/null +++ b/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake @@ -0,0 +1,20 @@ +include(RunCMake) + +function(run_cpack_symlink_test) + set(RunCMake_TEST_NO_CLEAN TRUE) + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/SrcSymlinks-build") + set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/SrcSymlinks") + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}") + run_cmake_command(SrcSymlinksTar + ${CMAKE_COMMAND} -E chdir ${RunCMake_TEST_SOURCE_DIR} + ${CMAKE_COMMAND} -E tar xvf ${RunCMake_SOURCE_DIR}/testcpacksym.tar + ) + run_cmake(SrcSymlinksCMake) + run_cmake_command(SrcSymlinksCPack + ${CMAKE_CPACK_COMMAND} --config CPackSourceConfig.cmake + ) +endfunction() + +run_cpack_symlink_test() diff --git a/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt b/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt new file mode 100644 index 0000000..24ad124 --- /dev/null +++ b/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt @@ -0,0 +1,10 @@ +^x CMakeLists.txt +x cygwin/ +x cygwin/build.sh +x cygwin/setup.patch +x include/ +x include/src.h +x link.h +x real.h +x src/ +x src/src.h$ diff --git a/Tests/RunCMake/CPackSymlinks/testcpacksym.tar b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar new file mode 100644 index 0000000..a44c656 Binary files /dev/null and b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar differ ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 08:58:14 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 08:58:14 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-615-gf762ceb Message-ID: <20150406125814.1830CAD654@public.kitware.com> This is an automated email from 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 f762ceb26eb08ade9ea795cfee46b43850beb9bb (commit) via dc4f64ab982f0bfb987b1e0a7e3afae8e24ed40a (commit) from 03f7a509ef9a0d3d6a9afb5cfc8ab6773428786e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f762ceb26eb08ade9ea795cfee46b43850beb9bb commit f762ceb26eb08ade9ea795cfee46b43850beb9bb Merge: 03f7a50 dc4f64a Author: Brad King AuthorDate: Mon Apr 6 08:58:12 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 08:58:12 2015 -0400 Merge topic 'doc-generator-names-ref' dc4f64ab Help: Clarify manual reference for generator names ----------------------------------------------------------------------- Summary of changes: Help/manual/OPTIONS_BUILD.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 08:58:16 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 08:58:16 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-618-g9ddbacd Message-ID: <20150406125816.5D923AD653@public.kitware.com> This is an automated email from 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 9ddbacdb74c7f3daf824decee9a1d900ddb44744 (commit) via 5f686b8a6b5258f6c5aafbb33d7db36b38a3f06d (commit) via aca1d93bd9b9921ecef83b80bed219a2f5879500 (commit) from f762ceb26eb08ade9ea795cfee46b43850beb9bb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ddbacdb74c7f3daf824decee9a1d900ddb44744 commit 9ddbacdb74c7f3daf824decee9a1d900ddb44744 Merge: f762ceb 5f686b8 Author: Brad King AuthorDate: Mon Apr 6 08:58:14 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 08:58:14 2015 -0400 Merge topic 'test_cpack_symlinks' 5f686b8a Tests: Add case for CPack source package with symlinks aca1d93b cpack: Disable CMake Cygwin legacy warning while packaging ----------------------------------------------------------------------- Summary of changes: Source/CPack/cpack.cxx | 3 +++ Tests/RunCMake/CMakeLists.txt | 5 +++++ Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake | 20 ++++++++++++++++++++ .../CPackSymlinks/SrcSymlinksTar-stdout.txt | 10 ++++++++++ .../RunCMake/CPackSymlinks/testcpacksym.tar | Bin 12292 -> 10240 bytes 5 files changed, 38 insertions(+) create mode 100644 Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt copy Modules/CPack.DS_Store.in => Tests/RunCMake/CPackSymlinks/testcpacksym.tar (52%) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 08:58:18 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 08:58:18 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-620-gb9c1eb4 Message-ID: <20150406125818.7000BAD686@public.kitware.com> This is an automated email from 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 b9c1eb4dcc801ea0a8f3f33aec58c5f9ab04026e (commit) via af924827120f39f1a7a940bc3f6bc487665145d9 (commit) from 9ddbacdb74c7f3daf824decee9a1d900ddb44744 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9c1eb4dcc801ea0a8f3f33aec58c5f9ab04026e commit b9c1eb4dcc801ea0a8f3f33aec58c5f9ab04026e Merge: 9ddbacd af92482 Author: Brad King AuthorDate: Mon Apr 6 08:58:17 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 08:58:17 2015 -0400 Merge topic 'makefile-depscan-BOM' af924827 Makefile: Tolerate a BOM while scanning source dependencies (#15493) ----------------------------------------------------------------------- Summary of changes: Source/cmDependsC.cxx | 21 +++++++++++----- Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 26 ++++++++++++++++++++ .../RunCMake/CommandLine/cmake_depends-check.cmake | 13 ++++++++++ .../RunCMake/CommandLine/cmake_depends-stdout.txt | 1 + Tests/RunCMake/CommandLine/cmake_depends/test.c | 2 ++ Tests/RunCMake/CommandLine/cmake_depends/test.h | 1 + .../CommandLine/cmake_depends/test_UTF-16LE.h | Bin 0 -> 58 bytes 7 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 Tests/RunCMake/CommandLine/cmake_depends-check.cmake create mode 100644 Tests/RunCMake/CommandLine/cmake_depends-stdout.txt create mode 100644 Tests/RunCMake/CommandLine/cmake_depends/test.c create mode 100644 Tests/RunCMake/CommandLine/cmake_depends/test.h create mode 100644 Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 08:58:20 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 08:58:20 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-622-g89ee57f Message-ID: <20150406125820.57C7FAD68E@public.kitware.com> This is an automated email from 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 89ee57f6c79858bf350a5afce2ef588348dacb1c (commit) via 659896d3ed21bc7da1cf394c17e1a60e4d4ee5f7 (commit) from b9c1eb4dcc801ea0a8f3f33aec58c5f9ab04026e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=89ee57f6c79858bf350a5afce2ef588348dacb1c commit 89ee57f6c79858bf350a5afce2ef588348dacb1c Merge: b9c1eb4 659896d Author: Brad King AuthorDate: Mon Apr 6 08:58:19 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 08:58:19 2015 -0400 Merge topic 'doc-target_link_libraries' 659896d3 Help: Revise target_link_libraries command documentation ----------------------------------------------------------------------- Summary of changes: Help/command/target_link_libraries.rst | 208 +++++++++++++++++++------------- 1 file changed, 124 insertions(+), 84 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 08:58:22 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 08:58:22 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-624-gdfbde6f Message-ID: <20150406125822.7ABEDAD68F@public.kitware.com> This is an automated email from 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 dfbde6fa991e60853a9f7ad165c4b8c8416a9ba4 (commit) via 9a544f2d987df940625465129a5f00bea01ad4eb (commit) from 89ee57f6c79858bf350a5afce2ef588348dacb1c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dfbde6fa991e60853a9f7ad165c4b8c8416a9ba4 commit dfbde6fa991e60853a9f7ad165c4b8c8416a9ba4 Merge: 89ee57f 9a544f2 Author: Brad King AuthorDate: Mon Apr 6 08:58:21 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 08:58:21 2015 -0400 Merge topic 'gcov-module-coverage-exclude' 9a544f2d CTestCoverageCollectGCOV: Support CTEST_CUSTOM_COVERAGE_EXCLUDE ----------------------------------------------------------------------- Summary of changes: Modules/CTestCoverageCollectGCOV.cmake | 31 ++++++++++++++- Tests/CMakeLists.txt | 3 +- .../TestProject/3rdparty/foo.cpp | 1 + .../TestProject/CMakeLists.txt | 41 ++++++++++++++++++++ .../TestProject/extra/extra.cpp | 1 + .../TestProject/fake_compile_time_gcno.cmake | 7 ++++ .../TestProject/fake_run_time_gcda.cmake | 12 ++++++ .../TestProject/main.cpp} | 0 Tests/CTestCoverageCollectGCOV/fakegcov.cmake | 12 ++++-- Tests/CTestCoverageCollectGCOV/test.cmake.in | 37 +++++++++++------- 10 files changed, 127 insertions(+), 18 deletions(-) create mode 100644 Tests/CTestCoverageCollectGCOV/TestProject/3rdparty/foo.cpp create mode 100644 Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt create mode 100644 Tests/CTestCoverageCollectGCOV/TestProject/extra/extra.cpp create mode 100644 Tests/CTestCoverageCollectGCOV/TestProject/fake_compile_time_gcno.cmake create mode 100644 Tests/CTestCoverageCollectGCOV/TestProject/fake_run_time_gcda.cmake copy Tests/{MissingInstall/mybin.cpp => CTestCoverageCollectGCOV/TestProject/main.cpp} (100%) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 08:58:24 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 08:58:24 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-630-g156d3f8 Message-ID: <20150406125824.42224AD6A1@public.kitware.com> This is an automated email from 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 156d3f8903057ba92195f442cc1d0dd817731bc8 (commit) via 6f82b5e81ca9677dc2fde855ba7be8e235baa667 (commit) via 66f5af29f3855c743580821eb73a94f72b709064 (commit) via f7dd3f7cf05c588b7cbdee7c8b95306d6f1cc05d (commit) via 3b2561736df2c1fd8f69fd9341e1f4c47eb1192d (commit) via 8fc3a2fbf61bd2686455656201d3de1ceb571145 (commit) from dfbde6fa991e60853a9f7ad165c4b8c8416a9ba4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=156d3f8903057ba92195f442cc1d0dd817731bc8 commit 156d3f8903057ba92195f442cc1d0dd817731bc8 Merge: dfbde6f 6f82b5e Author: Brad King AuthorDate: Mon Apr 6 08:58:23 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 08:58:23 2015 -0400 Merge topic 'improve-properties-help' 6f82b5e8 Help: Link to properties in set_tests_properties. 66f5af29 Help: Link to properties in set_directory_properties docs. f7dd3f7c Help: Add link in set_source_files_properties command docs. 3b256173 Help: Shorten too-long title marker. 8fc3a2fb Help: Add references to cmake-property sections. ----------------------------------------------------------------------- Summary of changes: Help/command/set_directory_properties.rst | 9 +++----- Help/command/set_source_files_properties.rst | 6 +++--- Help/command/set_tests_properties.rst | 30 ++++---------------------- Help/manual/cmake-properties.7.rst | 16 +++++++++++++- Help/prop_test/FAIL_REGULAR_EXPRESSION.rst | 11 ++++++++-- Help/prop_test/PASS_REGULAR_EXPRESSION.rst | 10 ++++++++- 6 files changed, 43 insertions(+), 39 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 08:59:00 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 08:59:00 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1502-g3ab68fe Message-ID: <20150406125900.57D07AD6A1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3ab68fea963d5ef2bbb730a6220dcf7ef4ec8fb0 (commit) via 156d3f8903057ba92195f442cc1d0dd817731bc8 (commit) via dfbde6fa991e60853a9f7ad165c4b8c8416a9ba4 (commit) via 89ee57f6c79858bf350a5afce2ef588348dacb1c (commit) via b9c1eb4dcc801ea0a8f3f33aec58c5f9ab04026e (commit) via 9ddbacdb74c7f3daf824decee9a1d900ddb44744 (commit) via f762ceb26eb08ade9ea795cfee46b43850beb9bb (commit) via 03f7a509ef9a0d3d6a9afb5cfc8ab6773428786e (commit) from 6ec818dad66ff35f2cfeb44c5527b01cf5d8f8fc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ab68fea963d5ef2bbb730a6220dcf7ef4ec8fb0 commit 3ab68fea963d5ef2bbb730a6220dcf7ef4ec8fb0 Merge: 6ec818d 156d3f8 Author: Brad King AuthorDate: Mon Apr 6 08:58:49 2015 -0400 Commit: Brad King CommitDate: Mon Apr 6 08:58:49 2015 -0400 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 Apr 6 09:02:12 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 09:02:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1504-g71a8946 Message-ID: <20150406130212.7EFEBAD7B0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 71a89464921583f66548ca91bddb132d2f55e024 (commit) via d224039011f85a1061289b2869c9ff19161fc0a7 (commit) from 3ab68fea963d5ef2bbb730a6220dcf7ef4ec8fb0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=71a89464921583f66548ca91bddb132d2f55e024 commit 71a89464921583f66548ca91bddb132d2f55e024 Merge: 3ab68fe d224039 Author: Brad King AuthorDate: Mon Apr 6 09:02:11 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 09:02:11 2015 -0400 Merge topic 'gcov-module-coverage-exclude' into next d2240390 Help: Add notes for topic 'gcov-module-coverage-exclude' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d224039011f85a1061289b2869c9ff19161fc0a7 commit d224039011f85a1061289b2869c9ff19161fc0a7 Author: Brad King AuthorDate: Mon Apr 6 09:00:49 2015 -0400 Commit: Brad King CommitDate: Mon Apr 6 09:00:49 2015 -0400 Help: Add notes for topic 'gcov-module-coverage-exclude' diff --git a/Help/release/dev/gcov-module-coverage-exclude.rst b/Help/release/dev/gcov-module-coverage-exclude.rst new file mode 100644 index 0000000..ee4ebae --- /dev/null +++ b/Help/release/dev/gcov-module-coverage-exclude.rst @@ -0,0 +1,6 @@ +gcov-module-coverage-exclude +---------------------------- + +* The :module:`CTestCoverageCollectGCOV` module learned to support + the same ``CTEST_CUSTOM_COVERAGE_EXCLUDE`` option as the + :command:`ctest_coverage` command. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/gcov-module-coverage-exclude.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Help/release/dev/gcov-module-coverage-exclude.rst hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 09:11:35 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 09:11:35 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-632-g0e6b00e Message-ID: <20150406131135.B334CAB545@public.kitware.com> This is an automated email from 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 0e6b00ee494f341be104fa2a00543fc4acd43c6f (commit) via 0ffd35340e5458882b4b9596a84dd7cdfeaecfbd (commit) from 156d3f8903057ba92195f442cc1d0dd817731bc8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e6b00ee494f341be104fa2a00543fc4acd43c6f commit 0e6b00ee494f341be104fa2a00543fc4acd43c6f Merge: 156d3f8 0ffd353 Author: Brad King AuthorDate: Mon Apr 6 09:11:34 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 09:11:34 2015 -0400 Merge topic 'cpack-one-component-only' 0ffd3534 CPack single component packaging ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 5 ++++- .../CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 09:12:07 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 09:12:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1506-gd0e8149 Message-ID: <20150406131207.42095AB901@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d0e8149a661cd8580b3dbc7879b142c38d12592b (commit) via 0e6b00ee494f341be104fa2a00543fc4acd43c6f (commit) from 71a89464921583f66548ca91bddb132d2f55e024 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d0e8149a661cd8580b3dbc7879b142c38d12592b commit d0e8149a661cd8580b3dbc7879b142c38d12592b Merge: 71a8946 0e6b00e Author: Brad King AuthorDate: Mon Apr 6 09:11:47 2015 -0400 Commit: Brad King CommitDate: Mon Apr 6 09:11:47 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 09:19:36 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 09:19:36 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-645-g9b7213d Message-ID: <20150406131936.1ED61AD7BA@public.kitware.com> This is an automated email from 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 9b7213dc47d2477cb4ceb5032a9078412b5474bd (commit) via c37cf7fa9e0aa7f7c3a2b32457385a1caf37bc3c (commit) via 64556e3dfa4161b33110daba606439f2c7971b15 (commit) via 23bb5d225b772f7e18dab16375c7620c99d62814 (commit) via 510562e3e7b9387bebe14060b147ec3022ee58a3 (commit) via 629e94893668c69fccb6954b0fc807c54e9218dd (commit) via d280bae98f009b56b9c14243981d5aba3e2f8747 (commit) via 364c7ea187d67f702891b201970712806999ad07 (commit) via 47acfe1d1e480bee109efa2de9253cf1a5457a8e (commit) via a469bf7b98bb2fc82de874383b0538e2d32ab2e1 (commit) via 257c16495ae0653d8f3630c8d76e6496bc9edd86 (commit) via fe17092c20c39761a060508fc6b1979b06e84afe (commit) via 199b28ac3ab5cc2dc99b352b8653a03f93baf3e5 (commit) from 0e6b00ee494f341be104fa2a00543fc4acd43c6f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b7213dc47d2477cb4ceb5032a9078412b5474bd commit 9b7213dc47d2477cb4ceb5032a9078412b5474bd Merge: 0e6b00e c37cf7f Author: Brad King AuthorDate: Mon Apr 6 09:19:34 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 09:19:34 2015 -0400 Merge topic 'minor-cleanups' c37cf7fa cmCacheManager: Remove unused method 64556e3d cmCacheManager: Remove unused overloads. 23bb5d22 cmCacheManager: Remove use of intermediate overload. 510562e3 cmGlobalGenerator: Don't fetch the cache manager in a loop. 629e9489 cmake: Clear member rather than explicit erase. d280bae9 cmake: Be clear that there is no chaining after global properties. 364c7ea1 cmake: Remove unused method. 47acfe1d cmake: Remove unused member. a469bf7b cmMakefile: Remove one wrong and one insufficiently helpful comment. 257c1649 cmListFile: Remove unused member. fe17092c cmMakefile: Remove bogus comment. 199b28ac Remove duplicate tag name. ----------------------------------------------------------------------- Summary of changes: Source/cmCacheManager.cxx | 38 +--------------------------------- Source/cmCacheManager.h | 6 ------ Source/cmGeneratorExpressionNode.cxx | 1 - Source/cmGlobalGenerator.cxx | 3 +-- Source/cmListFileCache.cxx | 6 ------ Source/cmListFileCache.h | 5 ----- Source/cmMakefile.cxx | 5 ----- Source/cmMakefile.h | 12 ++--------- Source/cmake.cxx | 8 +++---- Source/cmake.h | 4 ---- 10 files changed, 7 insertions(+), 81 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 09:19:53 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 09:19:53 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1508-g7ab2d0f Message-ID: <20150406131953.47717AD93B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7ab2d0f90ecb24878ebeef37bbe845d0b88a066c (commit) via 9b7213dc47d2477cb4ceb5032a9078412b5474bd (commit) from d0e8149a661cd8580b3dbc7879b142c38d12592b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ab2d0f90ecb24878ebeef37bbe845d0b88a066c commit 7ab2d0f90ecb24878ebeef37bbe845d0b88a066c Merge: d0e8149 9b7213d Author: Brad King AuthorDate: Mon Apr 6 09:19:44 2015 -0400 Commit: Brad King CommitDate: Mon Apr 6 09:19:44 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 6 10:12:40 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 6 Apr 2015 10:12:40 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1511-g4bf326d Message-ID: <20150406141240.9CA60AB92F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4bf326d69cf167d8deb892339d96dc44eddb416f (commit) via ecb1d5b47a75a88653fe508abec1a664cc81595f (commit) via 827309af76fe3f51a2d589148ef98cf91f510c2b (commit) from 7ab2d0f90ecb24878ebeef37bbe845d0b88a066c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bf326d69cf167d8deb892339d96dc44eddb416f commit 4bf326d69cf167d8deb892339d96dc44eddb416f Merge: 7ab2d0f ecb1d5b Author: Brad King AuthorDate: Mon Apr 6 10:12:39 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 10:12:39 2015 -0400 Merge topic 'vs-compiler-feature-2013-update' into next ecb1d5b4 Features: VS 2013 Update 3 supports initializer lists (#15494) 827309af Tests: Fix CompileFeatures cxx_generalized_initializers example http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecb1d5b47a75a88653fe508abec1a664cc81595f commit ecb1d5b47a75a88653fe508abec1a664cc81595f Author: Brad King AuthorDate: Mon Apr 6 09:59:51 2015 -0400 Commit: Brad King CommitDate: Mon Apr 6 10:06:26 2015 -0400 Features: VS 2013 Update 3 supports initializer lists (#15494) VS 2013 originally claimed to support initializer lists but a bug was found in which it generated bad code silently. For this reason we previously considered support to not be present. However, Update 3 adds a hard error on cases that previously generated bad code, so it is now safe to use initializer lists with VS 2013 Update 3 or greater. At worst a compiler error will be issued in the cases that do not work, but that is no different from any other compiler-specific workaround a project code may need. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake index c770211..fcedf3c 100644 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -16,12 +16,6 @@ set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") # 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}") @@ -44,6 +38,16 @@ set(_cmake_feature_test_cxx_reference_qualified_functions "${MSVC_2015}") # lists this as 'partial' in 2013 set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2015}") +set(MSVC_2013_v30723 "_MSC_FULL_VER >= 180030723") +# 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. +# The blog post also says that VS 2013 Update 3 generates an error in cases +# that previously produced bad code. +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013_v30723}") + 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. @@ -101,6 +105,7 @@ set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") # Unset all the variables that we don't need exposed. # _cmake_oldestSupported is required by WriteCompilerDetectionHeader set(MSVC_2015) +set(MSVC_2013_v30723) set(MSVC_2013) set(MSVC_2012) set(MSVC_2010) diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp index 13544f3..ad05f12 100644 --- a/Tests/CompileFeatures/cxx_generalized_initializers.cpp +++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp @@ -1,5 +1,5 @@ -#if defined(_MSC_VER) && _MSC_VER == 1800 -# error "VS 2013 does not safely support this" +#if defined(_MSC_VER) && _MSC_VER == 1800 && _MSC_FULL_VER < 180030723 +# error "VS 2013 safely supports this only with Update 3 or greater" #endif // Dummy implementation. Test only the compiler feature. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=827309af76fe3f51a2d589148ef98cf91f510c2b commit 827309af76fe3f51a2d589148ef98cf91f510c2b Author: Brad King AuthorDate: Mon Apr 6 09:54:52 2015 -0400 Commit: Brad King CommitDate: Mon Apr 6 10:05:37 2015 -0400 Tests: Fix CompileFeatures cxx_generalized_initializers example The only reason this failed to compile on VS 2013 was because the compiler uses different initializer_list constructor argument types than our dummy implementation. The standard does not specify the non-default constructor argument types for initializer_list. Use a template to match any two-arg constructor a compiler might select (e.g. begin/end or begin/len). Use #error to preserve the error on VS 2013. diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp index 7bf356b..13544f3 100644 --- a/Tests/CompileFeatures/cxx_generalized_initializers.cpp +++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp @@ -1,3 +1,6 @@ +#if defined(_MSC_VER) && _MSC_VER == 1800 +# error "VS 2013 does not safely support this" +#endif // Dummy implementation. Test only the compiler feature. namespace std { @@ -7,8 +10,9 @@ namespace std { { const _E* __begin_; size_t __size_; - - initializer_list(const int*, long unsigned int) {} + public: + template + initializer_list(T1, T2) {} }; } ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 17 +++++++++++------ .../CompileFeatures/cxx_generalized_initializers.cpp | 8 ++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Mon Apr 6 11:56:52 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 6 Apr 2015 11:56:52 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1526-g9f0e946 Message-ID: <20150406155652.9B1BAAD5CF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9f0e9467f3cf7d2f72388512e477e7ddcaebd2ca (commit) via ec181a24bac55d270e8a17eb16a807bdd65c2c4b (commit) via b02569d78f292adf31efcb8f8f023d07462db1a8 (commit) via e6eb16933aa26a8bda70caa1ff41498a0d62281b (commit) via 9754cb6f804df5150a1f1fffed0e8eb3c0612e1c (commit) via a94cddabb4f6be6d47ee9be31ec76fe483e85415 (commit) via eb5090065e06b96f115d2f80872a97e098800d57 (commit) via 59c9744d8cba44dc3b49f2cb1fb760dce008fc44 (commit) via 3a909de726d66b4e2b0b06a7baefd366d040ce54 (commit) via 8951b57dd03b3550a6f698aefe9e65435f933323 (commit) via 2c4ff47867f0073865c16cc8e397fe5118b15f33 (commit) via db25277da05b1f2c058635b76cf3f9d612784427 (commit) via 6f3e57e98ce324d7afb7681647159029fb145634 (commit) via 4cf211dcbaf1efaa082d281d1ff4d3755a108389 (commit) via 883042c34e6270551907b5d43f300ad3193b83a8 (commit) from 4bf326d69cf167d8deb892339d96dc44eddb416f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9f0e9467f3cf7d2f72388512e477e7ddcaebd2ca commit 9f0e9467f3cf7d2f72388512e477e7ddcaebd2ca Merge: 4bf326d ec181a2 Author: Stephen Kelly AuthorDate: Mon Apr 6 11:56:49 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 11:56:49 2015 -0400 Merge topic 'introduce-cmConfiguration' into next ec181a24 cmConfiguration: Move CacheEntryType enum from cmCacheManager. b02569d7 cmMakefile: Remove unused CacheManager accessor. e6eb1693 Port to cmConfiguration. 9754cb6f Introduce cmConfiguration class. a94cddab cmCacheManager: Port consumers to non-iterator API. eb509006 Port QtDialog to non-iterator cache API. 59c9744d Port CursesDialog to non-iterator cache API. 3a909de7 cmMakefile: Port away from CacheEntry.Initialized. 8951b57d cmCacheManager: Add non-iterator-based API. 2c4ff478 cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue. db25277d Add API for cache loading, deleting and saving to the cmake class. 6f3e57e9 cmMakefile: Remove cache version accessors. 4cf211dc cmMakefile: Simplify GetDefinitions implementation. 883042c3 Remove unused includes. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ec181a24bac55d270e8a17eb16a807bdd65c2c4b commit ec181a24bac55d270e8a17eb16a807bdd65c2c4b Author: Stephen Kelly AuthorDate: Mon Apr 6 13:40:24 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:57:39 2015 +0200 cmConfiguration: Move CacheEntryType enum from cmCacheManager. diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx index fd15b99..d6329c5 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.cxx +++ b/Source/CursesDialog/cmCursesBoolWidget.cxx @@ -16,7 +16,7 @@ cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::BOOL; + this->Type = cmConfiguration::BOOL; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index f2b5895..e388409 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -55,7 +55,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( assert(value); switch (cm->GetConfiguration()->GetCacheEntryType(key)) { - case cmCacheManager::BOOL: + case cmConfiguration::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); if (cmSystemTools::IsOn(value)) { @@ -66,15 +66,15 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( static_cast(this->Entry)->SetValueAsBool(false); } break; - case cmCacheManager::PATH: + case cmConfiguration::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); static_cast(this->Entry)->SetString(value); break; - case cmCacheManager::FILEPATH: + case cmConfiguration::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); static_cast(this->Entry)->SetString(value); break; - case cmCacheManager::STRING: + case cmConfiguration::STRING: { const char* stringsProp = cm->GetConfiguration() ->GetCacheEntryProperty(key, "STRINGS"); @@ -99,7 +99,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } break; } - case cmCacheManager::UNINITIALIZED: + case cmConfiguration::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", key.c_str()); break; diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index dc4ee4af..f280897 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -12,7 +12,6 @@ #ifndef cmCursesCacheEntryComposite_h #define cmCursesCacheEntryComposite_h -#include "../cmCacheManager.h" #include "cmCursesLabelWidget.h" class cmCursesCacheEntryComposite diff --git a/Source/CursesDialog/cmCursesDummyWidget.cxx b/Source/CursesDialog/cmCursesDummyWidget.cxx index 60086a5..0c5c09d 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.cxx +++ b/Source/CursesDialog/cmCursesDummyWidget.cxx @@ -15,7 +15,7 @@ cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::INTERNAL; + this->Type = cmConfiguration::INTERNAL; } diff --git a/Source/CursesDialog/cmCursesFilePathWidget.cxx b/Source/CursesDialog/cmCursesFilePathWidget.cxx index 01db014..fb04b44 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.cxx +++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx @@ -15,6 +15,6 @@ cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, int left, int top) : cmCursesPathWidget(width, height, left, top) { - this->Type = cmCacheManager::FILEPATH; + this->Type = cmConfiguration::FILEPATH; } diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 6df8e6d..f97ea36 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmVersion.h" #include "../cmake.h" @@ -118,11 +117,11 @@ void cmCursesMainForm::InitializeUI() for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() + cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); - if (t != cmCacheManager::INTERNAL && - t != cmCacheManager::STATIC && - t != cmCacheManager::UNINITIALIZED) + if (t != cmConfiguration::INTERNAL && + t != cmConfiguration::STATIC && + t != cmConfiguration::UNINITIALIZED) { ++count; } @@ -148,11 +147,11 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() + cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); - if (t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED ) + if (t == cmConfiguration::INTERNAL || + t == cmConfiguration::STATIC || + t == cmConfiguration::UNINITIALIZED ) { continue; } @@ -172,11 +171,11 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() + cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); - if (t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED ) + if (t == cmConfiguration::INTERNAL || + t == cmConfiguration::STATIC || + t == cmConfiguration::UNINITIALIZED ) { continue; } @@ -294,9 +293,9 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) cmCursesWidget* cw = reinterpret_cast (field_userptr(currentField)); // If in edit mode, get out of it - if ( cw->GetType() == cmCacheManager::STRING || - cw->GetType() == cmCacheManager::PATH || - cw->GetType() == cmCacheManager::FILEPATH ) + if ( cw->GetType() == cmConfiguration::STRING || + cw->GetType() == cmConfiguration::PATH || + cw->GetType() == cmConfiguration::FILEPATH ) { cmCursesStringWidget* sw = static_cast(cw); sw->SetInEdit(false); @@ -823,7 +822,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - cmCacheManager::CacheEntryType t = + cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(cacheKey); this->FixValue(t, oldValue, fixedOldValue); @@ -841,15 +840,15 @@ void cmCursesMainForm::FillCacheManagerFromUI() } } -void cmCursesMainForm::FixValue(cmCacheManager::CacheEntryType type, +void cmCursesMainForm::FixValue(cmConfiguration::CacheEntryType type, const std::string& in, std::string& out) const { out = in.substr(0,in.find_last_not_of(" ")+1); - if(type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH) + if(type == cmConfiguration::PATH || type == cmConfiguration::FILEPATH) { cmSystemTools::ConvertToUnixSlashes(out); } - if(type == cmCacheManager::BOOL) + if(type == cmConfiguration::BOOL) { if(cmSystemTools::IsOff(out.c_str())) { diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 6455252..d410a26 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -113,7 +113,7 @@ protected: // cache. void FillCacheManagerFromUI(); // Fix formatting of values to a consistent form. - void FixValue(cmCacheManager::CacheEntryType type, + void FixValue(cmConfiguration::CacheEntryType type, const std::string& in, std::string& out) const; // Re-post the existing fields. Used to toggle between // normal and advanced modes. Render() should be called diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx index 2f4b59e..83b8b79 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.cxx +++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx @@ -21,7 +21,7 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::BOOL; // this is a bit of a hack + this->Type = cmConfiguration::BOOL; // this is a bit of a hack // there is no option type, and string type causes ccmake to cast // the widget into a string widget at some point. BOOL is safe for // now. diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx index 89e2238..c1d1c7c 100644 --- a/Source/CursesDialog/cmCursesPathWidget.cxx +++ b/Source/CursesDialog/cmCursesPathWidget.cxx @@ -18,7 +18,7 @@ cmCursesPathWidget::cmCursesPathWidget(int width, int height, int left, int top) : cmCursesStringWidget(width, height, left, top) { - this->Type = cmCacheManager::PATH; + this->Type = cmConfiguration::PATH; this->Cycle = false; this->CurrentIndex = 0; } @@ -59,7 +59,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w) } std::vector dirs; - cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmCacheManager::PATH?-1:0)); + cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmConfiguration::PATH?-1:0)); if ( this->CurrentIndex < dirs.size() ) { cstr = dirs[this->CurrentIndex]; diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index d25022d..ce7df27 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -22,7 +22,7 @@ cmCursesStringWidget::cmCursesStringWidget(int width, int height, cmCursesWidget(width, height, left, top) { this->InEdit = false; - this->Type = cmCacheManager::STRING; + this->Type = cmConfiguration::STRING; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h index 7d82864..67b6876 100644 --- a/Source/CursesDialog/cmCursesWidget.h +++ b/Source/CursesDialog/cmCursesWidget.h @@ -12,7 +12,7 @@ #ifndef cmCursesWidget_h #define cmCursesWidget_h -#include "../cmCacheManager.h" +#include "../cmConfiguration.h" #include "cmCursesStandardIncludes.h" class cmCursesMainForm; @@ -46,7 +46,7 @@ public: /** * Get the type of the widget (STRING, PATH etc...) */ - cmCacheManager::CacheEntryType GetType() + cmConfiguration::CacheEntryType GetType() { return this->Type; } /** @@ -77,7 +77,7 @@ protected: cmCursesWidget(const cmCursesWidget& from); void operator=(const cmCursesWidget&); - cmCacheManager::CacheEntryType Type; + cmConfiguration::CacheEntryType Type; std::string Value; FIELD* Field; // The page in the main form this widget is in diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 4c9eb01..97e68e8 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -200,9 +200,9 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = config->GetCacheEntryType(*it); - if(t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC) + cmConfiguration::CacheEntryType t = config->GetCacheEntryType(*it); + if(t == cmConfiguration::INTERNAL || + t == cmConfiguration::STATIC) { continue; } @@ -249,28 +249,28 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toBool() ? "ON" : "OFF", s.Help.toLocal8Bit().data(), - cmCacheManager::BOOL); + cmConfiguration::BOOL); } else if(s.Type == QCMakeProperty::STRING) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::STRING); + cmConfiguration::STRING); } else if(s.Type == QCMakeProperty::PATH) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::PATH); + cmConfiguration::PATH); } else if(s.Type == QCMakeProperty::FILEPATH) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); } } @@ -286,10 +286,10 @@ QCMakePropertyList QCMake::properties() const for (std::vector::const_iterator i = cacheKeys.begin(); i != cacheKeys.end(); ++i) { - cmCacheManager::CacheEntryType t = config->GetCacheEntryType(*i); - if(t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED) + cmConfiguration::CacheEntryType t = config->GetCacheEntryType(*i); + if(t == cmConfiguration::INTERNAL || + t == cmConfiguration::STATIC || + t == cmConfiguration::UNINITIALIZED) { continue; } @@ -302,20 +302,20 @@ QCMakePropertyList QCMake::properties() const config->GetCacheEntryProperty(*i, "HELPSTRING")); prop.Value = QString::fromLocal8Bit(cachedValue); prop.Advanced = config->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); - if(t == cmCacheManager::BOOL) + if(t == cmConfiguration::BOOL) { prop.Type = QCMakeProperty::BOOL; prop.Value = cmSystemTools::IsOn(cachedValue); } - else if(t == cmCacheManager::PATH) + else if(t == cmConfiguration::PATH) { prop.Type = QCMakeProperty::PATH; } - else if(t == cmCacheManager::FILEPATH) + else if(t == cmConfiguration::FILEPATH) { prop.Type = QCMakeProperty::FILEPATH; } - else if(t == cmCacheManager::STRING) + else if(t == cmConfiguration::STRING) { prop.Type = QCMakeProperty::STRING; const char* stringsProperty = diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 5d32437..c83c41f 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -147,6 +147,6 @@ bool cmBuildCommand makecommand.c_str(), "Command used to build entire project " "from the command line.", - cmCacheManager::STRING); + cmConfiguration::STRING); return true; } diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 171ed0f..257d62e 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -39,7 +39,7 @@ bool cmBuildNameCommand this->Makefile->AddCacheDefinition(args[0], cv.c_str(), "Name of build.", - cmCacheManager::STRING); + cmConfiguration::STRING); } return true; } @@ -74,7 +74,7 @@ bool cmBuildNameCommand this->Makefile->AddCacheDefinition(args[0], buildname.c_str(), "Name of build.", - cmCacheManager::STRING); + cmConfiguration::STRING); return true; } diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 987a7b1..d27d4f5 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -87,27 +87,27 @@ void CCONV cmAddCacheDefinition(void *arg, const char* name, { case CM_CACHE_BOOL: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::BOOL); + cmConfiguration::BOOL); break; case CM_CACHE_PATH: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::PATH); + cmConfiguration::PATH); break; case CM_CACHE_FILEPATH: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); break; case CM_CACHE_STRING: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::STRING); + cmConfiguration::STRING); break; case CM_CACHE_INTERNAL: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); break; case CM_CACHE_STATIC: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::STATIC); + cmConfiguration::STATIC); break; } } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 1db057b..364f767 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2279,7 +2279,7 @@ bool cmCTest::AddVariableDefinition(const std::string &arg) { std::string name; std::string value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmConfiguration::CacheEntryType type = cmConfiguration::UNINITIALIZED; if (cmake::ParseCacheEntry(arg, name, value, type)) { diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 5387d0c..a469f41 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -22,17 +22,6 @@ #include #include -const char* cmCacheManagerTypes[] = -{ "BOOL", - "PATH", - "FILEPATH", - "STRING", - "INTERNAL", - "STATIC", - "UNINITIALIZED", - 0 -}; - cmCacheManager::cmCacheManager(cmake* cm) { this->CacheMajorVersion = 0; @@ -40,41 +29,6 @@ cmCacheManager::cmCacheManager(cmake* cm) this->CMakeInstance = cm; } -const char* cmCacheManager::TypeToString(cmCacheManager::CacheEntryType type) -{ - if ( type > 6 ) - { - return cmCacheManagerTypes[6]; - } - return cmCacheManagerTypes[type]; -} - -cmCacheManager::CacheEntryType cmCacheManager::StringToType(const char* s) -{ - int i = 0; - while(cmCacheManagerTypes[i]) - { - if(strcmp(s, cmCacheManagerTypes[i]) == 0) - { - return static_cast(i); - } - ++i; - } - return STRING; -} - -bool cmCacheManager::IsType(const char* s) -{ - for(int i=0; cmCacheManagerTypes[i]; ++i) - { - if(strcmp(s, cmCacheManagerTypes[i]) == 0) - { - return true; - } - } - return false; -} - bool cmCacheManager::LoadCache(const std::string& path) { std::set emptySet; @@ -122,7 +76,7 @@ static bool ParseEntryWithoutType(const std::string& entry, bool cmCacheManager::ParseEntry(const std::string& entry, std::string& var, std::string& value, - CacheEntryType& type) + cmConfiguration::CacheEntryType& type) { // input line is: key:type=value static cmsys::RegularExpression reg( @@ -134,14 +88,14 @@ bool cmCacheManager::ParseEntry(const std::string& entry, if(regQuoted.find(entry)) { var = regQuoted.match(1); - type = cmCacheManager::StringToType(regQuoted.match(2).c_str()); + type = cmConfiguration::StringToCacheEntryType(regQuoted.match(2).c_str()); value = regQuoted.match(3); flag = true; } else if (reg.find(entry)) { var = reg.match(1); - type = cmCacheManager::StringToType(reg.match(2).c_str()); + type = cmConfiguration::StringToCacheEntryType(reg.match(2).c_str()); value = reg.match(3); flag = true; } @@ -250,7 +204,7 @@ bool cmCacheManager::LoadCache(const std::string& path, // If the entry is not internal to the cache being loaded // or if it is in the list of internal entries to be // imported, load it. - if ( internal || (e.Type != INTERNAL) || + if ( internal || (e.Type != cmConfiguration::INTERNAL) || (includes.find(entryKey) != includes.end()) ) { // If we are loading the cache from another project, @@ -258,7 +212,7 @@ bool cmCacheManager::LoadCache(const std::string& path, // not visible in the gui if (!internal) { - e.Type = INTERNAL; + e.Type = cmConfiguration::INTERNAL; helpString = "DO NOT EDIT, "; helpString += entryKey; helpString += " loaded from external file. " @@ -306,10 +260,10 @@ bool cmCacheManager::LoadCache(const std::string& path, // Set as version 0.0 this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", "0", "Minor version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmConfiguration::INTERNAL); this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", "0", "Major version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmConfiguration::INTERNAL); } // check to make sure the cache directory has not @@ -351,7 +305,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, CacheEntry& e) { // All property entries are internal. - if(e.Type != cmCacheManager::INTERNAL) + if(e.Type != cmConfiguration::INTERNAL) { return false; } @@ -370,7 +324,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, // Create an entry and store the property. CacheEntry& ne = this->Cache[key]; ne.Properties.SetCMakeInstance(this->CMakeInstance); - ne.Type = cmCacheManager::UNINITIALIZED; + ne.Type = cmConfiguration::UNINITIALIZED; ne.SetProperty(*p, e.Value.c_str()); } else @@ -427,15 +381,15 @@ bool cmCacheManager::SaveCache(const std::string& path) sprintf(temp, "%d", cmVersion::GetMinorVersion()); this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp, "Minor version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmConfiguration::INTERNAL); sprintf(temp, "%d", cmVersion::GetMajorVersion()); this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", temp, "Major version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmConfiguration::INTERNAL); sprintf(temp, "%d", cmVersion::GetPatchVersion()); this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION", temp, "Patch version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmConfiguration::INTERNAL); // Let us store the current working directory so that if somebody // Copies it, he will not be surprised @@ -450,7 +404,7 @@ bool cmCacheManager::SaveCache(const std::string& path) cmSystemTools::ConvertToUnixSlashes(currentcwd); this->AddCacheEntry("CMAKE_CACHEFILE_DIR", currentcwd.c_str(), "This is the directory where this CMakeCache.txt" - " was created", cmCacheManager::INTERNAL); + " was created", cmConfiguration::INTERNAL); fout << "# This is the CMakeCache file.\n" << "# For build in directory: " << currentcwd << "\n"; @@ -484,7 +438,7 @@ bool cmCacheManager::SaveCache(const std::string& path) this->Cache.begin(); i != this->Cache.end(); ++i) { const CacheEntry& ce = (*i).second; - CacheEntryType t = ce.Type; + cmConfiguration::CacheEntryType t = ce.Type; if(!ce.Initialized) { /* @@ -493,7 +447,7 @@ bool cmCacheManager::SaveCache(const std::string& path) "\" is uninitialized"); */ } - else if(t != INTERNAL) + else if(t != cmConfiguration::INTERNAL) { // Format is key:type=value if(const char* help = ce.GetProperty("HELPSTRING")) @@ -505,7 +459,7 @@ bool cmCacheManager::SaveCache(const std::string& path) cmCacheManager::OutputHelpString(fout, "Missing description"); } this->OutputKey(fout, i->first); - fout << ":" << cmCacheManagerTypes[t] << "="; + fout << ":" << cmConfiguration::CacheEntryTypeToString(t) << "="; this->OutputValue(fout, ce.Value); fout << "\n\n"; } @@ -525,9 +479,9 @@ bool cmCacheManager::SaveCache(const std::string& path) continue; } - CacheEntryType t = i.GetType(); + cmConfiguration::CacheEntryType t = i.GetType(); this->WritePropertyEntries(fout, i); - if(t == cmCacheManager::INTERNAL) + if(t == cmConfiguration::INTERNAL) { // Format is key:type=value if(const char* help = i.GetProperty("HELPSTRING")) @@ -535,7 +489,7 @@ bool cmCacheManager::SaveCache(const std::string& path) this->OutputHelpString(fout, help); } this->OutputKey(fout, i.GetName()); - fout << ":" << cmCacheManagerTypes[t] << "="; + fout << ":" << cmConfiguration::CacheEntryTypeToString(t) << "="; this->OutputValue(fout, i.GetValue()); fout << "\n"; } @@ -677,7 +631,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const for(std::map::const_iterator i = this->Cache.begin(); i != this->Cache.end(); ++i) { - if((*i).second.Type != INTERNAL) + if((*i).second.Type != cmConfiguration::INTERNAL) { out << (*i).first << " = " << (*i).second.Value << std::endl; @@ -693,7 +647,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const void cmCacheManager::AddCacheEntry(const std::string& key, const char* value, const char* helpString, - CacheEntryType type) + cmConfiguration::CacheEntryType type) { CacheEntry& e = this->Cache[key]; e.Properties.SetCMakeInstance(this->CMakeInstance); @@ -708,7 +662,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key, } e.Type = type; // make sure we only use unix style paths - if(type == FILEPATH || type == PATH) + if(type == cmConfiguration::FILEPATH || type == cmConfiguration::PATH) { if(e.Value.find(';') != e.Value.npos) { @@ -789,7 +743,7 @@ cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const { if(prop == "TYPE") { - return cmCacheManagerTypes[this->Type]; + return cmConfiguration::CacheEntryTypeToString(this->Type); } else if(prop == "VALUE") { @@ -806,7 +760,7 @@ void cmCacheManager::CacheEntry::SetProperty(const std::string& prop, { if(prop == "TYPE") { - this->Type = cmCacheManager::StringToType(value? value : "STRING"); + this->Type = cmConfiguration::StringToCacheEntryType(value? value : "STRING"); } else if(prop == "VALUE") { @@ -825,7 +779,7 @@ void cmCacheManager::CacheEntry::AppendProperty(const std::string& prop, { if(prop == "TYPE") { - this->Type = cmCacheManager::StringToType(value? value : "STRING"); + this->Type = cmConfiguration::StringToCacheEntryType(value? value : "STRING"); } else if(prop == "VALUE") { diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 36848c4..927651f 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -14,6 +14,8 @@ #include "cmStandardIncludes.h" #include "cmPropertyMap.h" +#include "cmConfiguration.h" + class cmMakefile; class cmMarkAsAdvancedCommand; class cmake; @@ -30,21 +32,22 @@ public: cmCacheManager(cmake* cm); class CacheIterator; friend class cmCacheManager::CacheIterator; - enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, - UNINITIALIZED }; private: struct CacheEntry { std::string Value; - CacheEntryType Type; + cmConfiguration::CacheEntryType Type; cmPropertyMap Properties; const char* GetProperty(const std::string&) const; void SetProperty(const std::string& property, const char* value); void AppendProperty(const std::string& property, const char* value, bool asString=false); bool Initialized; - CacheEntry() : Value(""), Type(UNINITIALIZED), Initialized(false) + CacheEntry() + : Value(""), + Type(cmConfiguration::UNINITIALIZED), + Initialized(false) {} }; @@ -68,8 +71,10 @@ public: std::string GetValue() const { return this->GetEntry().Value; } bool GetValueAsBool() const; void SetValue(const char*); - CacheEntryType GetType() const { return this->GetEntry().Type; } - void SetType(CacheEntryType ty) { this->GetEntry().Type = ty; } + cmConfiguration::CacheEntryType GetType() const + { return this->GetEntry().Type; } + void SetType(cmConfiguration::CacheEntryType ty) + { this->GetEntry().Type = ty; } bool Initialized() { return this->GetEntry().Initialized; } cmCacheManager &Container; std::map::iterator Position; @@ -94,17 +99,6 @@ public: return CacheIterator(*this); } - /** - * Types for the cache entries. These are useful as - * hints for a cache editor program. Path should bring - * up a file chooser, BOOL a check box, and STRING a - * text entry box, FILEPATH is a full path to a file which - * can be different than just a path input - */ - static CacheEntryType StringToType(const char*); - static const char* TypeToString(CacheEntryType); - static bool IsType(const char*); - ///! Load a cache for given makefile. Loads from path/CMakeCache.txt. bool LoadCache(const std::string& path); bool LoadCache(const std::string& path, bool internal, @@ -134,7 +128,7 @@ public: static bool ParseEntry(const std::string& entry, std::string& var, std::string& value, - CacheEntryType& type); + cmConfiguration::CacheEntryType& type); ///! Get a value from the cache given a key const char* GetInitializedCacheValue(const std::string& key) const; @@ -155,7 +149,7 @@ public: return this->GetCacheIterator(key.c_str()).GetProperty(propName); } - CacheEntryType GetCacheEntryType(std::string const& key) + cmConfiguration::CacheEntryType GetCacheEntryType(std::string const& key) { return this->GetCacheIterator(key.c_str()).GetType(); } @@ -223,7 +217,8 @@ public: protected: ///! Add an entry into the cache void AddCacheEntry(const std::string& key, const char* value, - const char* helpString, CacheEntryType type); + const char* helpString, + cmConfiguration::CacheEntryType type); ///! Get a cache entry object for a key CacheEntry *GetCacheEntry(const std::string& key); diff --git a/Source/cmConfiguration.cxx b/Source/cmConfiguration.cxx index 7e89c09..209cdd9 100644 --- a/Source/cmConfiguration.cxx +++ b/Source/cmConfiguration.cxx @@ -2,26 +2,59 @@ #include "cmConfiguration.h" #include "cmake.h" +#include "cmCacheManager.h" cmConfiguration::cmConfiguration(cmake* cm) : CMakeInstance(cm) { } -cmCacheManager::CacheEntryType -cmConfiguration::StringToCacheEntryType(const char* s) + +const char* cmCacheEntryTypes[] = +{ "BOOL", + "PATH", + "FILEPATH", + "STRING", + "INTERNAL", + "STATIC", + "UNINITIALIZED", + 0 +}; + +const char* +cmConfiguration::CacheEntryTypeToString(cmConfiguration::CacheEntryType type) { - return cmCacheManager::StringToType(s); + if ( type > 6 ) + { + return cmCacheEntryTypes[6]; + } + return cmCacheEntryTypes[type]; } -const char* -cmConfiguration::CacheEntryTypeToString(cmCacheManager::CacheEntryType t) +cmConfiguration::CacheEntryType +cmConfiguration::StringToCacheEntryType(const char* s) { - return cmCacheManager::TypeToString(t); + int i = 0; + while(cmCacheEntryTypes[i]) + { + if(strcmp(s, cmCacheEntryTypes[i]) == 0) + { + return static_cast(i); + } + ++i; + } + return STRING; } bool cmConfiguration::IsCacheEntryType(std::string const& key) { - return cmCacheManager::IsType(key.c_str()); + for(int i=0; cmCacheEntryTypes[i]; ++i) + { + if(strcmp(key.c_str(), cmCacheEntryTypes[i]) == 0) + { + return true; + } + } + return false; } std::vector cmConfiguration::GetCacheEntryKeys() const @@ -54,7 +87,7 @@ cmConfiguration::GetInitializedCacheValue(std::string const& key) const return this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue(key); } -cmCacheManager::CacheEntryType +cmConfiguration::CacheEntryType cmConfiguration::GetCacheEntryType(std::string const& key) const { cmCacheManager::CacheIterator it = @@ -107,7 +140,7 @@ bool cmConfiguration::GetCacheEntryPropertyAsBool(std::string const& key, void cmConfiguration::AddCacheEntry(const std::string& key, const char* value, const char* helpString, - cmCacheManager::CacheEntryType type) + cmConfiguration::CacheEntryType type) { this->CMakeInstance->GetCacheManager()->AddCacheEntry(key, value, helpString, type); diff --git a/Source/cmConfiguration.h b/Source/cmConfiguration.h index d8f5916..72149fb 100644 --- a/Source/cmConfiguration.h +++ b/Source/cmConfiguration.h @@ -2,7 +2,7 @@ #ifndef cmConfiguration_h #define cmConfiguration_h -#include "cmCacheManager.h" +#include "cmStandardIncludes.h" class cmake; @@ -11,21 +11,21 @@ class cmConfiguration public: cmConfiguration(cmake* cm); - static cmCacheManager::CacheEntryType StringToCacheEntryType(const char*); - static const char* CacheEntryTypeToString(cmCacheManager::CacheEntryType); + enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, + UNINITIALIZED }; + static CacheEntryType StringToCacheEntryType(const char*); + static const char* CacheEntryTypeToString(CacheEntryType); static bool IsCacheEntryType(std::string const& key); std::vector GetCacheEntryKeys() const; const char* GetCacheEntryValue(std::string const& key) const; const char* GetInitializedCacheValue(std::string const& key) const; - cmCacheManager::CacheEntryType - GetCacheEntryType(std::string const& key) const; + CacheEntryType GetCacheEntryType(std::string const& key) const; void SetCacheEntryValue(std::string const& key, std::string const& value); void SetCacheValue(std::string const& key, std::string const& value); void AddCacheEntry(const std::string& key, const char* value, - const char* helpString, - cmCacheManager::CacheEntryType type); + const char* helpString, CacheEntryType type); void RemoveCacheEntry(std::string const& key); void SetCacheEntryProperty(std::string const& key, diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 59efa52..7217ce6 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmCoreTryCompile.h" #include "cmake.h" -#include "cmCacheManager.h" #include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmAlgorithms.h" @@ -527,7 +526,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) this->Makefile->AddCacheDefinition(argv[0], (res == 0 ? "TRUE" : "FALSE"), "Result of TRY_COMPILE", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); if (!outputVariable.empty()) { diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 7e53be2..63de734 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -222,7 +222,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, // in the cache valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), - cacheEntryName.c_str(), cmCacheManager::STRING, + cacheEntryName.c_str(), cmConfiguration::STRING, true); mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } @@ -243,7 +243,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, { valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), - cacheEntryName.c_str(), cmCacheManager::STRING, + cacheEntryName.c_str(), cmConfiguration::STRING, true); mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index f13ac1e..7cc0cd2 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -378,7 +378,7 @@ bool cmFindBase::CheckForVariableInCache() // original value. Tell the subclass implementations to do // this. if(cached && config->GetCacheEntryType(this->VariableName) - == cmCacheManager::UNINITIALIZED) + == cmConfiguration::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; } diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index c499f61..649d00b 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindLibraryCommand.h" -#include "cmCacheManager.h" #include #include @@ -39,7 +38,7 @@ bool cmFindLibraryCommand { this->Makefile->AddCacheDefinition(this->VariableName, "", this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); } return true; } @@ -72,14 +71,14 @@ bool cmFindLibraryCommand this->Makefile->AddCacheDefinition(this->VariableName, library.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); return true; } std::string notfound = this->VariableName + "-NOTFOUND"; this->Makefile->AddCacheDefinition(this->VariableName, notfound.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); return true; } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 4d7fd60..6336ee4 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -947,7 +947,7 @@ bool cmFindPackageCommand::FindConfig() // We force the value since we do not get here if it was already set. this->Makefile->AddCacheDefinition(this->Variable, init.c_str(), help.c_str(), - cmCacheManager::PATH, true); + cmConfiguration::PATH, true); return found; } diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 49fbf45..4317076 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindPathCommand.h" -#include "cmCacheManager.h" #include @@ -41,7 +40,7 @@ bool cmFindPathCommand this->VariableName, "", this->VariableDocumentation.c_str(), (this->IncludeFileInPath ? - cmCacheManager::FILEPATH :cmCacheManager::PATH) + cmConfiguration::FILEPATH :cmConfiguration::PATH) ); } return true; @@ -54,7 +53,7 @@ bool cmFindPathCommand (this->VariableName, result.c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? - cmCacheManager::FILEPATH :cmCacheManager::PATH); + cmConfiguration::FILEPATH :cmConfiguration::PATH); return true; } this->Makefile->AddCacheDefinition @@ -62,7 +61,7 @@ bool cmFindPathCommand (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? - cmCacheManager::FILEPATH :cmCacheManager::PATH); + cmConfiguration::FILEPATH :cmConfiguration::PATH); return true; } diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 4ee419c..75fe29b 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindProgramCommand.h" -#include "cmCacheManager.h" #include #if defined(__APPLE__) @@ -37,7 +36,7 @@ bool cmFindProgramCommand { this->Makefile->AddCacheDefinition(this->VariableName, "", this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); } return true; } @@ -49,14 +48,14 @@ bool cmFindProgramCommand this->Makefile->AddCacheDefinition(this->VariableName, result.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); return true; } this->Makefile->AddCacheDefinition(this->VariableName, (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); return true; } diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 9aceb39..979e756 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -117,13 +117,13 @@ bool cmGetFilenameComponentCommand { this->Makefile->AddCacheDefinition (storeArgs, programArgs.c_str(), - "", args[2] == "PATH" ? cmCacheManager::FILEPATH - : cmCacheManager::STRING); + "", args[2] == "PATH" ? cmConfiguration::FILEPATH + : cmConfiguration::STRING); } this->Makefile->AddCacheDefinition (args[0], result.c_str(), "", - args[2] == "PATH" ? cmCacheManager::FILEPATH - : cmCacheManager::STRING); + args[2] == "PATH" ? cmConfiguration::FILEPATH + : cmConfiguration::STRING); } else { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 1a0b20c..a9c73a7 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -311,7 +311,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) makeProgram += saveFile; mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", makeProgram.c_str(), "make program", - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); } } @@ -1116,7 +1116,7 @@ void cmGlobalGenerator::Configure() sprintf(num,"%d",static_cast(this->LocalGenerators.size())); this->GetCMakeInstance()->AddCacheEntry ("CMAKE_NUMBER_OF_LOCAL_GENERATORS", num, - "number of local generators", cmCacheManager::INTERNAL); + "number of local generators", cmConfiguration::INTERNAL); // check for link libraries and include directories containing "NOTFOUND" // and for infinite loops @@ -1894,7 +1894,7 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen, gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM"); this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make, "make program", - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); // copy the enabled languages this->LanguageEnabled = gen->LanguageEnabled; this->LanguagesReady = gen->LanguagesReady; diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 7648813..d36a6fc 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -97,7 +97,7 @@ std::string cmGlobalUnixMakefileGenerator3::GetEditCacheCommand() const { cm->AddCacheEntry ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(), - "Path to cache edit program executable.", cmCacheManager::INTERNAL); + "Path to cache edit program executable.", cmConfiguration::INTERNAL); } } const char* edit_cmd = cm->GetCacheDefinition("CMAKE_EDIT_COMMAND"); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 0e0e63a..2108715 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -89,7 +89,7 @@ void cmGlobalVisualStudio7Generator "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmConfiguration::STRING); } // Create list of configurations requested by user's cache, if any. @@ -109,7 +109,7 @@ void cmGlobalVisualStudio7Generator mf->AddCacheDefinition ("CMAKE_MSVCIDE_RUN_PATH", extraPath, "Saved environment variable CMAKE_MSVCIDE_RUN_PATH", - cmCacheManager::STATIC); + cmConfiguration::STATIC); } } @@ -335,7 +335,7 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmConfiguration::STRING); } void cmGlobalVisualStudio7Generator::Generate() @@ -970,7 +970,7 @@ void cmGlobalVisualStudio7Generator::CreateGUID(const std::string& name) ret = cmSystemTools::UpperCase(ret); this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), ret.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } std::vector *cmGlobalVisualStudio7Generator::GetConfigurations() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0561a05..33349d2 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -285,7 +285,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vectorconst& "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmConfiguration::STRING); } } mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); @@ -2754,7 +2754,7 @@ std::string cmGlobalXCodeGenerator::GetOrCreateId(const std::string& name, } this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), - id.c_str(), "Stored Xcode object GUID", cmCacheManager::INTERNAL); + id.c_str(), "Stored Xcode object GUID", cmConfiguration::INTERNAL); return id; } diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index d40d8fe..a8b8c2e 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -73,7 +73,7 @@ bool cmIncludeExternalMSProjectCommand std::string guidVariable = utility_name + "_GUID_CMAKE"; this->Makefile->GetCMakeInstance()->AddCacheEntry( guidVariable.c_str(), customGuid.c_str(), - "Stored GUID", cmCacheManager::INTERNAL); + "Stored GUID", cmConfiguration::INTERNAL); } // Create a target instance for this utility. diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index e2ae901..256eb31 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -172,7 +172,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) // Check one line of the cache file. std::string var; std::string value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmConfiguration::CacheEntryType type = cmConfiguration::UNINITIALIZED; if(cmake::ParseCacheEntry(line, var, value, type)) { // Found a real entry. See if this one was requested. diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index aa70ab9..22abb79 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -118,7 +118,7 @@ void cmLocalVisualStudio10Generator AddCacheEntry(guidStoreName.c_str(), parser.GUID.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index c4abeb2..2bbaab1 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -16,7 +16,6 @@ #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmSourceFile.h" -#include "cmCacheManager.h" #include "cmGeneratorTarget.h" #include "cmCustomCommandGenerator.h" #include "cmake.h" @@ -2331,7 +2330,7 @@ void cmLocalVisualStudio7Generator::ReadAndStoreExternalGUID( AddCacheEntry(guidStoreName.c_str(), parser.GUID.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6d57cc5..941aaf1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -18,7 +18,6 @@ #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmCommands.h" -#include "cmCacheManager.h" #include "cmConfiguration.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" @@ -1806,7 +1805,7 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value) void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmCacheManager::CacheEntryType type, + cmConfiguration::CacheEntryType type, bool force) { bool haveVal = value ? true : false; @@ -1815,7 +1814,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, this->GetConfiguration()->GetInitializedCacheValue(name); if(existingValue && (this->GetConfiguration()->GetCacheEntryType(name) - == cmCacheManager::UNINITIALIZED)) + == cmConfiguration::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in @@ -1824,7 +1823,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, val = existingValue; haveVal = true; } - if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) + if ( type == cmConfiguration::PATH || type == cmConfiguration::FILEPATH ) { std::vector::size_type cc; std::vector files; @@ -3617,7 +3616,7 @@ int cmMakefile::TryCompile(const std::string& srcdir, // Add this before the user-provided CMake arguments in case // one of the arguments is -DCMAKE_BUILD_TYPE=... cm.AddCacheEntry("CMAKE_BUILD_TYPE", config, - "Build configuration", cmCacheManager::STRING); + "Build configuration", cmConfiguration::STRING); } } // if cmake args were provided then pass them in @@ -3656,12 +3655,12 @@ int cmMakefile::TryCompile(const std::string& srcdir, if(this->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "TRUE", "", cmCacheManager::INTERNAL); + "TRUE", "", cmConfiguration::INTERNAL); } else { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "FALSE", "", cmCacheManager::INTERNAL); + "FALSE", "", cmConfiguration::INTERNAL); } if (cm.Configure() != 0) { @@ -4914,7 +4913,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, "For backwards compatibility, what version of CMake " "commands and " "syntax should this version of CMake try to support.", - cmCacheManager::STRING); + cmConfiguration::STRING); } } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index aa48e8a..5ba7d19 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -22,6 +22,7 @@ #include "cmGeneratorTarget.h" #include "cmExpandedCommandArgument.h" #include "cmake.h" +#include "cmConfiguration.h" #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmSourceGroup.h" @@ -305,7 +306,7 @@ public: ///! Add a definition to this makefile and the global cmake cache. void AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmCacheManager::CacheEntryType type, + cmConfiguration::CacheEntryType type, bool force = false); /** diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index e89cf99..5ed1ea1 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -39,7 +39,7 @@ bool cmMarkAsAdvancedCommand cmConfiguration* config = this->Makefile->GetConfiguration(); if (!config->GetCacheEntryValue(variable)) { - config->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); + config->AddCacheEntry(variable, 0, 0, cmConfiguration::UNINITIALIZED); overwrite = true; } if (!config->GetCacheEntryValue(variable)) diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 64b3d39..c3d254f 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -46,7 +46,7 @@ bool cmOptionCommand const char* existingValue = config->GetCacheEntryValue(args[0]); if(existingValue) { - if (config->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) + if (config->GetCacheEntryType(args[0]) != cmConfiguration::UNINITIALIZED) { config->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; @@ -59,6 +59,6 @@ bool cmOptionCommand } bool init = cmSystemTools::IsOn(initialValue.c_str()); this->Makefile->AddCacheDefinition(args[0], init? "ON":"OFF", - args[1].c_str(), cmCacheManager::BOOL); + args[1].c_str(), cmConfiguration::BOOL); return true; } diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 61c0133..c26173e 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -30,11 +30,11 @@ bool cmProjectCommand this->Makefile->AddCacheDefinition (bindir, this->Makefile->GetCurrentOutputDirectory(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmConfiguration::STATIC); this->Makefile->AddCacheDefinition (srcdir, this->Makefile->GetCurrentDirectory(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmConfiguration::STATIC); bindir = "PROJECT_BINARY_DIR"; srcdir = "PROJECT_SOURCE_DIR"; @@ -59,7 +59,7 @@ bool cmProjectCommand this->Makefile->AddCacheDefinition ("CMAKE_PROJECT_NAME", args[0].c_str(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmConfiguration::STATIC); } bool haveVersion = false; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index ead2080..d74944e 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -79,8 +79,8 @@ bool cmSetCommand bool cache = false; // optional bool force = false; // optional bool parentScope = false; - cmCacheManager::CacheEntryType type - = cmCacheManager::STRING; // required if cache + cmConfiguration::CacheEntryType type + = cmConfiguration::STRING; // required if cache const char* docstring = 0; // required if cache unsigned int ignoreLastArgs = 0; @@ -131,7 +131,7 @@ bool cmSetCommand if(cache) { std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0); - type = cmCacheManager::StringToType(args[cacheStart+1].c_str()); + type = cmConfiguration::StringToCacheEntryType(args[cacheStart+1].c_str()); docstring = args[cacheStart+2].c_str(); } @@ -139,13 +139,13 @@ bool cmSetCommand cmConfiguration* config = this->Makefile->GetConfiguration(); const char* existingValue = config->GetCacheEntryValue(variable); if(existingValue && - (config->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) + (config->GetCacheEntryType(variable) != cmConfiguration::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal // then leave now without setting any definitions in the cache // or the makefile - if(cache && type != cmCacheManager::INTERNAL && !force) + if(cache && type != cmConfiguration::INTERNAL && !force) { return true; } diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index b6f8590..87fb475 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -14,7 +14,6 @@ #include "cmSetTestsPropertiesCommand.h" #include "cmSetSourceFilesPropertiesCommand.h" -#include "cmCacheManager.h" //---------------------------------------------------------------------------- cmSetPropertyCommand::cmSetPropertyCommand() @@ -426,7 +425,7 @@ bool cmSetPropertyCommand::HandleCacheMode() } else if(this->PropertyName == "TYPE") { - if(!cmCacheManager::IsType(this->PropertyValue.c_str())) + if(!cmConfiguration::IsCacheEntryType(this->PropertyValue.c_str())) { std::ostringstream e; e << "given invalid CACHE entry TYPE \"" << this->PropertyValue << "\""; diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 927888b..836f342 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -88,7 +88,7 @@ bool cmSiteNameCommand AddCacheDefinition(args[0], siteName.c_str(), "Name of the computer/site where compile is being run", - cmCacheManager::STRING); + cmConfiguration::STRING); return true; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b3d1155..ad461f0 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1181,7 +1181,7 @@ void cmTarget::ClearDependencyInformation( cmMakefile& mf, if (this->RecordDependencies) { mf.AddCacheDefinition(depname, "", - "Dependencies for target", cmCacheManager::STATIC); + "Dependencies for target", cmConfiguration::STATIC); } else { @@ -1369,7 +1369,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, dependencies += ";"; mf.AddCacheDefinition( targetEntry, dependencies.c_str(), "Dependencies for the target", - cmCacheManager::STATIC ); + cmConfiguration::STATIC ); } } diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 60f48ae..3cd8291 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmTryRunCommand.h" -#include "cmCacheManager.h" #include "cmTryCompileCommand.h" #include @@ -217,7 +216,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, } this->Makefile->AddCacheDefinition(this->RunResultVariable, retChar, "Result of TRY_RUN", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } /* This is only used when cross compiling. Instead of running the @@ -262,7 +261,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->Makefile->AddCacheDefinition(this->RunResultVariable, "PLEASE_FILL_OUT-FAILED_TO_RUN", comment.c_str(), - cmCacheManager::STRING); + cmConfiguration::STRING); cmConfiguration* config = this->Makefile->GetConfiguration(); const char* existingValue @@ -290,7 +289,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->Makefile->AddCacheDefinition(internalRunOutputName, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), - cmCacheManager::STRING); + cmConfiguration::STRING); cmConfiguration* config = this->Makefile->GetConfiguration(); const char* existing = config->GetCacheEntryValue(internalRunOutputName); diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 2799a9b..b68afbc 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmUtilitySourceCommand.h" +#include "cmCacheManager.h" + // cmUtilitySourceCommand bool cmUtilitySourceCommand ::InitialPass(std::vector const& args, cmExecutionStatus &) @@ -118,14 +120,14 @@ bool cmUtilitySourceCommand this->Makefile->AddCacheDefinition(cacheEntry, utilityExecutable.c_str(), "Path to an internal program.", - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); // add a value into the cache that maps from the // full path to the name of the project cmSystemTools::ConvertToUnixSlashes(utilityExecutable); this->Makefile->AddCacheDefinition(utilityExecutable, utilityName.c_str(), "Executable to project name.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); return true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 186b2de..328e273 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -338,7 +338,7 @@ bool cmake::SetCacheArgs(const std::vector& args) } } std::string var, value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmConfiguration::CacheEntryType type = cmConfiguration::UNINITIALIZED; if(cmCacheManager::ParseEntry(entry, var, value, type)) { // The value is transformed if it is a filepath for example, so @@ -412,9 +412,9 @@ bool cmake::SetCacheArgs(const std::vector& args) for (std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = + cmConfiguration::CacheEntryType t = this->Configuration->GetCacheEntryType(*it); - if(t != cmCacheManager::STATIC) + if(t != cmConfiguration::STATIC) { if (regex.find(it->c_str())) { @@ -979,14 +979,14 @@ int cmake::AddCMakePaths() // Save the value in the cache this->CacheManager->AddCacheEntry ("CMAKE_COMMAND", cmSystemTools::GetCMakeCommand().c_str(), - "Path to CMake executable.", cmCacheManager::INTERNAL); + "Path to CMake executable.", cmConfiguration::INTERNAL); #ifdef CMAKE_BUILD_WITH_CMAKE this->CacheManager->AddCacheEntry ("CMAKE_CTEST_COMMAND", cmSystemTools::GetCTestCommand().c_str(), - "Path to ctest program executable.", cmCacheManager::INTERNAL); + "Path to ctest program executable.", cmConfiguration::INTERNAL); this->CacheManager->AddCacheEntry ("CMAKE_CPACK_COMMAND", cmSystemTools::GetCPackCommand().c_str(), - "Path to cpack program executable.", cmCacheManager::INTERNAL); + "Path to cpack program executable.", cmConfiguration::INTERNAL); #endif if(!cmSystemTools::FileExists( (cmSystemTools::GetCMakeRoot()+"/Modules/CMake.cmake").c_str())) @@ -1000,7 +1000,7 @@ int cmake::AddCMakePaths() } this->CacheManager->AddCacheEntry ("CMAKE_ROOT", cmSystemTools::GetCMakeRoot().c_str(), - "Path to CMake installation.", cmCacheManager::INTERNAL); + "Path to CMake installation.", cmConfiguration::INTERNAL); return 1; } @@ -1242,7 +1242,7 @@ struct SaveCacheEntry std::string key; std::string value; std::string help; - cmCacheManager::CacheEntryType type; + cmConfiguration::CacheEntryType type; }; int cmake::HandleDeleteCacheVariables(const std::string& var) @@ -1315,7 +1315,7 @@ int cmake::Configure() AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE", "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } else { @@ -1323,7 +1323,7 @@ int cmake::Configure() AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE", "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } } int ret = this->ActualConfigure(); @@ -1359,7 +1359,7 @@ int cmake::ActualConfigure() this->GetHomeDirectory(), "Start directory with the top level CMakeLists.txt file for this " "project", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } // no generator specified on the command line @@ -1468,11 +1468,11 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName().c_str(), "Name of generator.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); this->CacheManager->AddCacheEntry("CMAKE_EXTRA_GENERATOR", this->GlobalGenerator->GetExtraGeneratorName().c_str(), "Name of external makefile project generator.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } if(const char* platformName = @@ -1500,7 +1500,7 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_PLATFORM", this->GeneratorPlatform.c_str(), "Name of generator platform.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } if(const char* tsName = @@ -1528,7 +1528,7 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_TOOLSET", this->GeneratorToolset.c_str(), "Name of generator toolset.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } // reset any system configuration information, except for when we are @@ -1566,7 +1566,7 @@ int cmake::ActualConfigure() this->Configuration->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", - cmCacheManager::PATH); + cmConfiguration::PATH); } if(!this->Configuration ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) @@ -1574,7 +1574,7 @@ int cmake::ActualConfigure() this->Configuration->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", "Single output directory for building all executables.", - cmCacheManager::PATH); + cmConfiguration::PATH); } } if(!this->Configuration @@ -1583,7 +1583,7 @@ int cmake::ActualConfigure() this->Configuration->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", - cmCacheManager::BOOL); + cmConfiguration::BOOL); if (!this->Configuration->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", "ADVANCED")) { @@ -1808,7 +1808,7 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, { this->CacheManager->AddCacheEntry(key, value, helpString, - cmCacheManager::CacheEntryType(type)); + cmConfiguration::CacheEntryType(type)); } const char* cmake::GetCacheDefinition(const std::string& name) const @@ -1880,7 +1880,7 @@ void cmake::AddDefaultGenerators() bool cmake::ParseCacheEntry(const std::string& entry, std::string& var, std::string& value, - cmCacheManager::CacheEntryType& type) + cmConfiguration::CacheEntryType& type) { return cmCacheManager::ParseEntry(entry, var, value, type); } diff --git a/Source/cmake.h b/Source/cmake.h index 5b10288..1debfeb 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -19,6 +19,7 @@ #include "cmPropertyMap.h" #include "cmInstalledFile.h" #include "cmCacheManager.h" +#include "cmConfiguration.h" class cmGlobalGeneratorFactory; class cmGlobalGenerator; @@ -178,7 +179,7 @@ class cmake static bool ParseCacheEntry(const std::string& entry, std::string& var, std::string& value, - cmCacheManager::CacheEntryType& type); + cmConfiguration::CacheEntryType& type); int LoadCache(); bool LoadCache(const std::string& path); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 7960b47..9ab49ee 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -19,7 +19,6 @@ #include "cmake.h" #include "cmcmd.h" #include "cmConfiguration.h" -#include "cmCacheManager.h" #include "cmListFileCache.h" #include "cmSourceFile.h" #include "cmGlobalGenerator.h" @@ -335,10 +334,10 @@ int do_cmake(int ac, char const* const* av) for (std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) { - cmCacheManager::CacheEntryType t = + cmConfiguration::CacheEntryType t = cm.GetConfiguration()->GetCacheEntryType(*it); - if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && - t != cmCacheManager::UNINITIALIZED ) + if ( t != cmConfiguration::INTERNAL && t != cmConfiguration::STATIC && + t != cmConfiguration::UNINITIALIZED ) { const char* advancedProp = cm.GetConfiguration()->GetCacheEntryProperty(*it, "ADVANCED"); @@ -351,7 +350,7 @@ int do_cmake(int ac, char const* const* av) "HELPSTRING") << std::endl; } std::cout << *it << ":" << - cmCacheManager::TypeToString(t) + cmConfiguration::CacheEntryTypeToString(t) << "=" << cm.GetConfiguration()->GetCacheEntryValue(*it) << std::endl; if ( list_help ) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b02569d78f292adf31efcb8f8f023d07462db1a8 commit b02569d78f292adf31efcb8f8f023d07462db1a8 Author: Stephen Kelly AuthorDate: Mon Apr 6 13:34:03 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:57:38 2015 +0200 cmMakefile: Remove unused CacheManager accessor. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0d847fa..6d57cc5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3735,11 +3735,6 @@ void cmMakefile::GetListOfMacros(std::string& macros) const macros = cmJoin(this->MacrosList, ";"); } -cmCacheManager *cmMakefile::GetCacheManager() const -{ - return this->GetCMakeInstance()->GetCacheManager(); -} - cmConfiguration *cmMakefile::GetConfiguration() const { return this->GetCMakeInstance()->GetConfiguration(); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 8c896e4..aa48e8a 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -12,7 +12,6 @@ #ifndef cmMakefile_h #define cmMakefile_h -#include "cmCacheManager.h" #include "cmExecutionStatus.h" #include "cmListFileCache.h" #include "cmPolicies.h" @@ -765,7 +764,6 @@ public: ///enabled. void EnableLanguage(std::vectorconst& languages, bool optional); - cmCacheManager *GetCacheManager() const; cmConfiguration *GetConfiguration() const; /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6eb16933aa26a8bda70caa1ff41498a0d62281b commit e6eb16933aa26a8bda70caa1ff41498a0d62281b Author: Stephen Kelly AuthorDate: Mon Apr 6 10:52:45 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:57:38 2015 +0200 Port to cmConfiguration. diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 3d92a2d..e013f81 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmake.h" #include "../cmDocumentation.h" diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 4f028c4..f2b5895 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -19,6 +19,7 @@ #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" #include "../cmake.h" +#include "../cmConfiguration.h" #include @@ -50,9 +51,9 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); + const char* value = cm->GetConfiguration()->GetCacheEntryValue(key); assert(value); - switch (cm->GetCacheManager()->GetCacheEntryType(key)) + switch (cm->GetConfiguration()->GetCacheEntryType(key)) { case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); @@ -75,7 +76,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( break; case cmCacheManager::STRING: { - const char* stringsProp = cm->GetCacheManager() + const char* stringsProp = cm->GetConfiguration() ->GetCacheEntryProperty(key, "STRINGS"); if(stringsProp) { diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 057f8f3..67e4aab 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmake.h" #include "../cmVersion.h" diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 833d540..6df8e6d 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -23,6 +23,7 @@ #include "cmCursesCacheEntryComposite.h" #include "cmCursesLongMessageForm.h" #include "cmAlgorithms.h" +#include "cmConfiguration.h" inline int ctrl(int z) @@ -107,17 +108,17 @@ void cmCursesMainForm::InitializeUI() // which contain labels, entries and new entry markers std::vector* newEntries = new std::vector; - newEntries->reserve(this->CMakeInstance->GetCacheManager()->GetSize()); + std::vector cacheKeys = + this->CMakeInstance->GetConfiguration()->GetCacheEntryKeys(); + newEntries->reserve(cacheKeys.size()); // Count non-internal and non-static entries int count=0; - std::vector cacheKeys = - this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys(); for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); if (t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && @@ -147,7 +148,7 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); if (t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || @@ -171,7 +172,7 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); if (t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || @@ -225,10 +226,10 @@ void cmCursesMainForm::RePost() for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -257,10 +258,10 @@ void cmCursesMainForm::RePost() for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -329,10 +330,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -352,10 +353,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -516,10 +517,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the help string of the current entry // and add it to the help string const char* existingValue = - this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField); + this->CMakeInstance->GetConfiguration()->GetCacheEntryValue(curField); if (existingValue) { - const char* hs = this->CMakeInstance->GetCacheManager() + const char* hs = this->CMakeInstance->GetConfiguration() ->GetCacheEntryProperty(curField, "HELPSTRING"); if ( hs ) { @@ -814,7 +815,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() for(size_t i=0; i < size; i++) { std::string cacheKey = (*this->Entries)[i]->Key; - const char* existingValue = this->CMakeInstance->GetCacheManager() + const char* existingValue = this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue(cacheKey); if (existingValue) { @@ -823,7 +824,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() std::string fixedOldValue; std::string fixedNewValue; cmCacheManager::CacheEntryType t = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(cacheKey); this->FixValue(t, oldValue, fixedOldValue); this->FixValue(t, newValue, fixedNewValue); @@ -831,9 +832,9 @@ void cmCursesMainForm::FillCacheManagerFromUI() if(!(fixedOldValue == fixedNewValue)) { // The user has changed the value. Mark it as modified. - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true); - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->SetCacheEntryValue(cacheKey, fixedNewValue); } } @@ -1046,11 +1047,11 @@ void cmCursesMainForm::HandleInput() const char* helpString = 0; const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue(curField); if (existingValue) { - helpString = this->CMakeInstance->GetCacheManager() + helpString = this->CMakeInstance->GetConfiguration() ->GetCacheEntryProperty(curField, "HELPSTRING"); } if (helpString) @@ -1161,7 +1162,7 @@ void cmCursesMainForm::HandleInput() field_userptr(this->Fields[findex-2])); if ( lbl ) { - this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(lbl->GetValue()); + this->CMakeInstance->GetConfiguration()->RemoveCacheEntry(lbl->GetValue()); std::string nextVal; if (nextCur) diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 08d53ce..4c9eb01 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -16,7 +16,7 @@ #include #include "cmake.h" -#include "cmCacheManager.h" +#include "cmConfiguration.h" #include "cmSystemTools.h" #include "cmExternalMakefileProjectGenerator.h" @@ -94,7 +94,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) { this->BinaryDirectory = QDir::fromNativeSeparators(dir); emit this->binaryDirChanged(this->BinaryDirectory); - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); + cmConfiguration *config = this->CMakeInstance->GetConfiguration(); this->setGenerator(QString()); if(!this->CMakeInstance->LoadCache( this->BinaryDirectory.toLocal8Bit().data())) @@ -110,15 +110,15 @@ void QCMake::setBinaryDirectory(const QString& _dir) QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); - const char* homeDir = cachem->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + const char* homeDir = config->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (homeDir) { setSourceDirectory(QString::fromLocal8Bit(homeDir)); } - const char* gen = cachem->GetCacheEntryValue("CMAKE_GENERATOR"); + const char* gen = config->GetCacheEntryValue("CMAKE_GENERATOR"); if (gen) { - const char* extraGen = cachem + const char* extraGen = config ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: CreateFullGeneratorName(gen, extraGen? extraGen : ""); @@ -195,12 +195,12 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) QStringList toremove; // set the value of properties - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - std::vector cacheKeys = cachem->GetCacheEntryKeys(); + cmConfiguration *config = this->CMakeInstance->GetConfiguration(); + std::vector cacheKeys = config->GetCacheEntryKeys(); for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*it); + cmCacheManager::CacheEntryType t = config->GetCacheEntryType(*it); if(t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC) { @@ -219,11 +219,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - cachem->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); + config->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); } else { - cachem->SetCacheEntryValue(*it, + config->SetCacheEntryValue(*it, prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); @@ -236,7 +236,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) { this->CMakeInstance->UnwatchUnusedCli(s.toLocal8Bit().data()); - cachem->RemoveCacheEntry(s.toLocal8Bit().data()); + config->RemoveCacheEntry(s.toLocal8Bit().data()); } // add some new properites @@ -281,12 +281,12 @@ QCMakePropertyList QCMake::properties() const { QCMakePropertyList ret; - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - std::vector cacheKeys = cachem->GetCacheEntryKeys(); + cmConfiguration *config = this->CMakeInstance->GetConfiguration(); + std::vector cacheKeys = config->GetCacheEntryKeys(); for (std::vector::const_iterator i = cacheKeys.begin(); i != cacheKeys.end(); ++i) { - cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*i); + cmCacheManager::CacheEntryType t = config->GetCacheEntryType(*i); if(t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || t == cmCacheManager::UNINITIALIZED) @@ -294,14 +294,14 @@ QCMakePropertyList QCMake::properties() const continue; } - const char* cachedValue = cachem->GetCacheEntryValue(*i); + const char* cachedValue = config->GetCacheEntryValue(*i); QCMakeProperty prop; prop.Key = QString::fromLocal8Bit(i->c_str()); prop.Help = QString::fromLocal8Bit( - cachem->GetCacheEntryProperty(*i, "HELPSTRING")); + config->GetCacheEntryProperty(*i, "HELPSTRING")); prop.Value = QString::fromLocal8Bit(cachedValue); - prop.Advanced = cachem->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); + prop.Advanced = config->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); if(t == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; @@ -319,7 +319,7 @@ QCMakePropertyList QCMake::properties() const { prop.Type = QCMakeProperty::STRING; const char* stringsProperty = - cachem->GetCacheEntryProperty(*i, "STRINGS"); + config->GetCacheEntryProperty(*i, "STRINGS"); if (stringsProperty) { prop.Strings = QString::fromLocal8Bit(stringsProperty).split(";"); diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 99bf5f5..0e4dd4b 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -13,6 +13,7 @@ #include "cmSystemTools.h" #include "cmMakefile.h" +#include "cmConfiguration.h" #include "cmCommandArgumentLexer.h" @@ -90,7 +91,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } if ( strcmp(key, "CACHE") == 0 ) { - if(const char* c = this->Makefile->GetCacheManager() + if(const char* c = this->Makefile->GetConfiguration() ->GetInitializedCacheValue(var)) { if(this->EscapeQuotes) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 0d32e4b..7e53be2 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -16,6 +16,7 @@ #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" +#include "cmConfiguration.h" #include "cmTarget.h" #include "cmSourceFile.h" @@ -205,7 +206,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_"; cacheEntryName += envVar; - const char* cacheValue = mf->GetCacheManager()->GetInitializedCacheValue( + const char* cacheValue = mf->GetConfiguration()->GetInitializedCacheValue( cacheEntryName); // now we have both, decide which one to use diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index cc08052..f13ac1e 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -12,6 +12,7 @@ #include "cmFindBase.h" #include "cmAlgorithms.h" +#include "cmConfiguration.h" cmFindBase::cmFindBase() { @@ -366,8 +367,8 @@ bool cmFindBase::CheckForVariableInCache() if(const char* cacheValue = this->Makefile->GetDefinition(this->VariableName)) { - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName); + cmConfiguration* config = this->Makefile->GetConfiguration(); + const char* cacheEntry = config->GetCacheEntryValue(this->VariableName); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); bool cached = cacheEntry ? true : false; if(found) @@ -376,7 +377,7 @@ bool cmFindBase::CheckForVariableInCache() // type we should add the type and docstring but keep the // original value. Tell the subclass implementations to do // this. - if(cached && manager->GetCacheEntryType(this->VariableName) + if(cached && config->GetCacheEntryType(this->VariableName) == cmCacheManager::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; @@ -385,7 +386,7 @@ bool cmFindBase::CheckForVariableInCache() } else if(cached) { - const char* hs = manager->GetCacheEntryProperty(this->VariableName, + const char* hs = config->GetCacheEntryProperty(this->VariableName, "HELPSTRING"); this->VariableDocumentation = hs?hs:"(none)"; } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 0e6e0c2..1fe53ac 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -12,6 +12,7 @@ #include "cmGetPropertyCommand.h" #include "cmake.h" +#include "cmConfiguration.h" #include "cmTest.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" @@ -391,9 +392,9 @@ bool cmGetPropertyCommand::HandleCacheMode() } const char* value = 0; - if(this->Makefile->GetCacheManager()->GetCacheEntryValue(this->Name)) + if(this->Makefile->GetConfiguration()->GetCacheEntryValue(this->Name)) { - value = this->Makefile->GetCacheManager() + value = this->Makefile->GetConfiguration() ->GetCacheEntryProperty(this->Name, this->PropertyName); } this->StoreResult(value); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 35394b8..1a0b20c 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -20,6 +20,7 @@ #include "cmLocalGenerator.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmake.h" +#include "cmConfiguration.h" #include "cmMakefile.h" #include "cmQtAutoGenerators.h" #include "cmSourceFile.h" @@ -179,7 +180,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, return; } const char* cname = this->GetCMakeInstance()-> - GetCacheManager()->GetInitializedCacheValue(langComp); + GetConfiguration()->GetInitializedCacheValue(langComp); std::string changeVars; if(cname && !optional) { @@ -1537,7 +1538,7 @@ void cmGlobalGenerator::CheckLocalGenerators() std::map notFoundMap; // std::set notFoundMap; // after it is all done do a ConfigureFinalPass - cmCacheManager* manager = this->GetCMakeInstance()->GetCacheManager(); + cmConfiguration* config = this->GetCMakeInstance()->GetConfiguration(); for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { this->LocalGenerators[i]->ConfigureFinalPass(); @@ -1559,7 +1560,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(lib->first.c_str())) { std::string varName = lib->first.substr(0, lib->first.size()-9); - if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + if(config->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1590,7 +1591,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(incDir->c_str())) { std::string varName = incDir->substr(0, incDir->size()-9); - if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + if(config->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1637,7 +1638,7 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir, // and there is a good chance that the try compile stuff will // take the bulk of the time, so try and guess some progress // by getting closer and closer to 100 without actually getting there. - if (!this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue + if (!this->CMakeInstance->GetConfiguration()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS")) { // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set @@ -1835,7 +1836,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) // update progress // estimate how many lg there will be const char *numGenC = - this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue + this->CMakeInstance->GetConfiguration()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"); if (!numGenC) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b1450a8..0d847fa 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1812,9 +1812,9 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; const char* existingValue = - this->GetCacheManager()->GetInitializedCacheValue(name); + this->GetConfiguration()->GetInitializedCacheValue(name); if(existingValue - && (this->GetCacheManager()->GetCacheEntryType(name) + && (this->GetConfiguration()->GetCacheEntryType(name) == cmCacheManager::UNINITIALIZED)) { // if this is not a force, then use the value from the cache @@ -1843,14 +1843,14 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, nvalue += files[cc]; } - this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = this->GetCacheManager()->GetInitializedCacheValue(name); + this->GetConfiguration()->AddCacheEntry(name, nvalue.c_str(), doc, type); + val = this->GetConfiguration()->GetInitializedCacheValue(name); haveVal = true; } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, - doc, type); + this->GetConfiguration()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -1977,7 +1977,7 @@ void cmMakefile::RemoveDefinition(const std::string& name) void cmMakefile::RemoveCacheDefinition(const std::string& name) { - this->GetCacheManager()->RemoveCacheEntry(name); + this->GetConfiguration()->RemoveCacheEntry(name); } void cmMakefile::SetProjectName(const char* p) @@ -2434,7 +2434,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const this->Internal->VarUsageStack.top().insert(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetConfiguration()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE if(cmVariableWatch* vv = this->GetVariableWatch()) @@ -2459,7 +2459,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const const char* def = this->Internal->VarStack.top().Get(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetConfiguration()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); @@ -2501,7 +2501,7 @@ std::vector cmMakefile res.insert(res.end(), definitions.begin(), definitions.end()); } std::vector cacheKeys = - this->GetCacheManager()->GetCacheEntryKeys(); + this->GetConfiguration()->GetCacheEntryKeys(); res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); std::sort(res.begin(), res.end()); @@ -2802,6 +2802,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( openstack.push(t_lookup()); cmake::MessageType mtype = cmake::LOG; + cmConfiguration* config = this->GetCMakeInstance()->GetConfiguration(); + do { char inc = *in; @@ -2835,8 +2837,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( value = cmSystemTools::GetEnv(lookup.c_str()); break; case CACHE: - value = this->GetCacheManager() - ->GetInitializedCacheValue(lookup); + value = config->GetCacheEntryValue(lookup); break; } // Get the string we're meant to append to. @@ -4908,7 +4909,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, if(id == cmPolicies::CMP0001 && (status == cmPolicies::WARN || status == cmPolicies::OLD)) { - if(!(this->GetCacheManager() + if(!(this->GetConfiguration() ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) { // Set it to 2.4 because that is the last version where the diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index cc094b1..e89cf99 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -36,20 +36,20 @@ bool cmMarkAsAdvancedCommand for(; i < args.size(); ++i) { std::string variable = args[i]; - cmCacheManager* manager = this->Makefile->GetCacheManager(); - if (!manager->GetCacheEntryValue(variable)) + cmConfiguration* config = this->Makefile->GetConfiguration(); + if (!config->GetCacheEntryValue(variable)) { - manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); + config->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); overwrite = true; } - if (!manager->GetCacheEntryValue(variable)) + if (!config->GetCacheEntryValue(variable)) { cmSystemTools::Error("This should never happen..."); return false; } - if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) + if (!config->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) { - manager->SetCacheEntryProperty(variable, "ADVANCED", value); + config->SetCacheEntryProperty(variable, "ADVANCED", value); } } return true; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index baf5b1e..64b3d39 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,13 +42,13 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(args[0]); + cmConfiguration* config = this->Makefile->GetConfiguration(); + const char* existingValue = config->GetCacheEntryValue(args[0]); if(existingValue) { - if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) + if (config->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) { - manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); + config->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; } initialValue = existingValue; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index e17474b..ead2080 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -136,10 +136,10 @@ bool cmSetCommand } // see if this is already in the cache - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(variable); + cmConfiguration* config = this->Makefile->GetConfiguration(); + const char* existingValue = config->GetCacheEntryValue(variable); if(existingValue && - (manager->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) + (config->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 77f9fb9..b6f8590 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -453,7 +453,7 @@ bool cmSetPropertyCommand::HandleCacheMode() cmMakefile* mf = this->GetMakefile(); cmake* cm = mf->GetCMakeInstance(); const char* existingValue - = cm->GetCacheManager()->GetCacheEntryValue(*ni); + = cm->GetConfiguration()->GetCacheEntryValue(*ni); if(existingValue) { if(!this->HandleCacheEntry(*ni)) @@ -479,20 +479,19 @@ bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey) // Set or append the property. const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmConfiguration* config = this->Makefile->GetConfiguration(); if (this->Remove) { - manager->RemoveCacheEntryProperty(cacheKey, name); - return true; + config->RemoveCacheEntryProperty(cacheKey, name); } if(this->AppendMode) { - manager->AppendCacheEntryProperty(cacheKey, name, value, - this->AppendAsString); + config->AppendCacheEntryProperty(cacheKey, name, value, + this->AppendAsString); } else { - manager->SetCacheEntryProperty(cacheKey, name, value); + config->SetCacheEntryProperty(cacheKey, name, value); } return true; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 911ade8..60f48ae 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -264,12 +264,12 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment.c_str(), cmCacheManager::STRING); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmConfiguration* config = this->Makefile->GetConfiguration(); const char* existingValue - = manager->GetCacheEntryValue(this->RunResultVariable); + = config->GetCacheEntryValue(this->RunResultVariable); if (existingValue) { - manager->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); + config->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); } error = true; @@ -291,13 +291,13 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmCacheManager::STRING); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmConfiguration* config = this->Makefile->GetConfiguration(); const char* existing = - manager->GetCacheEntryValue(internalRunOutputName); + config->GetCacheEntryValue(internalRunOutputName); if (existing) { - manager->SetCacheEntryProperty(internalRunOutputName, - "ADVANCED", "1"); + config->SetCacheEntryProperty(internalRunOutputName, + "ADVANCED", "1"); } error = true; diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index dd2a682..bc6bc01 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -10,7 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmVariableRequiresCommand.h" -#include "cmCacheManager.h" +#include "cmConfiguration.h" // cmLibraryCommand bool cmVariableRequiresCommand @@ -34,6 +34,7 @@ bool cmVariableRequiresCommand bool requirementsMet = true; std::string notSet; bool hasAdvanced = false; + cmConfiguration* config = this->Makefile->GetConfiguration(); for(unsigned int i = 2; i < args.size(); ++i) { if(!this->Makefile->IsOn(args[i])) @@ -41,9 +42,8 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - cmCacheManager* manager = this->Makefile->GetCacheManager(); - if(manager->GetCacheEntryValue(args[i]) && - manager->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) + if(config->GetCacheEntryValue(args[i]) && + config->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) { hasAdvanced = true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 79fb2a5..186b2de 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -348,7 +348,7 @@ bool cmake::SetCacheArgs(const std::vector& args) std::string cachedValue; if(this->WarnUnusedCli) { - if(const char *v = this->CacheManager + if(const char *v = this->Configuration ->GetInitializedCacheValue(var)) { haveValue = true; @@ -356,13 +356,13 @@ bool cmake::SetCacheArgs(const std::vector& args) } } - this->CacheManager->AddCacheEntry(var, value.c_str(), + this->Configuration->AddCacheEntry(var, value.c_str(), "No help, variable specified on the command line.", type); if(this->WarnUnusedCli) { if (!haveValue || - cachedValue != this->CacheManager + cachedValue != this->Configuration ->GetInitializedCacheValue(var)) { this->WatchUnusedCli(var); @@ -408,12 +408,12 @@ bool cmake::SetCacheArgs(const std::vector& args) //go through all cache entries and collect the vars which will be removed std::vector entriesToDelete; std::vector cacheKeys = - this->CacheManager->GetCacheEntryKeys(); + this->Configuration->GetCacheEntryKeys(); for (std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { cmCacheManager::CacheEntryType t = - this->CacheManager->GetCacheEntryType(*it); + this->Configuration->GetCacheEntryType(*it); if(t != cmCacheManager::STATIC) { if (regex.find(it->c_str())) @@ -429,7 +429,7 @@ bool cmake::SetCacheArgs(const std::vector& args) currentEntry != entriesToDelete.end(); ++currentEntry) { - this->CacheManager->RemoveCacheEntry(*currentEntry); + this->Configuration->RemoveCacheEntry(*currentEntry); } } else if(arg.find("-C",0) == 0) @@ -925,7 +925,7 @@ void cmake::SetDirectoriesFromFile(const char* arg) if(this->LoadCache(cachePath)) { const char* existingValue = - this->CacheManager->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + this->Configuration->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (existingValue) { this->SetHomeOutputDirectory(cachePath); @@ -1255,7 +1255,6 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) { return 0; } - cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator(); std::vector saved; std::ostringstream warning; warning @@ -1271,10 +1270,13 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) i++; save.value = *i; warning << *i << "\n"; - if(ci.Find(save.key)) + const char* existingValue = + this->CacheManager->GetCacheEntryValue(save.key); + if(existingValue) { - save.type = ci.GetType(); - if(const char* help = ci.GetProperty("HELPSTRING")) + save.type = this->CacheManager->GetCacheEntryType(save.key); + if(const char* help = + this->CacheManager->GetCacheEntryProperty(save.key, "HELPSTRING")) { save.help = help; } @@ -1556,49 +1558,51 @@ int cmake::ActualConfigure() // project requires compatibility with CMake 2.4. We detect this // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY // variable created when CMP0001 is not set to NEW. - if(this->GetCacheManager() + if(this->Configuration ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { - if(!this->CacheManager->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) + if(!this->Configuration->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) { - this->CacheManager->AddCacheEntry + this->Configuration->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", cmCacheManager::PATH); } - if(!this->CacheManager + if(!this->Configuration ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) { - this->CacheManager->AddCacheEntry + this->Configuration->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", "Single output directory for building all executables.", cmCacheManager::PATH); } } - if(!this->CacheManager + if(!this->Configuration ->GetInitializedCacheValue("CMAKE_USE_RELATIVE_PATHS")) { - this->CacheManager->AddCacheEntry + this->Configuration->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", cmCacheManager::BOOL); - if (!this->CacheManager->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED")) + if (!this->Configuration->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED")) { - this->CacheManager->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED", "1"); + this->Configuration->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED", "1"); } } - if(cmSystemTools::GetFatalErrorOccured() && - (!this->CacheManager->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM") || - cmSystemTools::IsOff(this->CacheManager-> - GetInitializedCacheValue("CMAKE_MAKE_PROGRAM")))) + if(cmSystemTools::GetFatalErrorOccured()) { - // We must have a bad generator selection. Wipe the cache entry so the - // user can select another. - this->CacheManager->RemoveCacheEntry("CMAKE_GENERATOR"); - this->CacheManager->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR"); + const char* makeProgram = + this->Configuration->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM"); + if (!makeProgram || cmSystemTools::IsOff(makeProgram)) + { + // We must have a bad generator selection. Wipe the cache entry so the + // user can select another. + this->Configuration->RemoveCacheEntry("CMAKE_GENERATOR"); + this->Configuration->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR"); + } } cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); @@ -2204,7 +2208,7 @@ void cmake::TruncateOutputLog(const char* fname) { return; } - if ( !this->CacheManager->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR") ) + if (!this->Configuration->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")) { cmSystemTools::RemoveFile(fullPath); return; @@ -2322,7 +2326,7 @@ const char *cmake::GetProperty(const std::string& prop, if ( prop == "CACHE_VARIABLES" ) { std::vector cacheKeys = - this->CacheManager->GetCacheEntryKeys(); + this->Configuration->GetCacheEntryKeys(); this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); } else if ( prop == "COMMANDS" ) @@ -2475,7 +2479,7 @@ int cmake::GetSystemInformation(std::vector& args) // we have to find the module directory, so we can copy the files this->AddCMakePaths(); std::string modulesPath = - this->CacheManager->GetInitializedCacheValue("CMAKE_ROOT"); + this->Configuration->GetInitializedCacheValue("CMAKE_ROOT"); modulesPath += "/Modules"; std::string inFile = modulesPath; inFile += "/SystemInformation.cmake"; @@ -2685,7 +2689,7 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, if(t == cmake::AUTHOR_WARNING) { // Allow suppression of these warnings. - const char* suppress = this->CacheManager->GetCacheEntryValue( + const char* suppress = this->Configuration->GetCacheEntryValue( "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); if(suppress && cmSystemTools::IsOn(suppress)) { @@ -2806,7 +2810,7 @@ int cmake::Build(const std::string& dir, return 1; } const char* cachedGenerator = - this->CacheManager->GetCacheEntryValue("CMAKE_GENERATOR"); + this->Configuration->GetCacheEntryValue("CMAKE_GENERATOR"); if(!cachedGenerator) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; @@ -2823,7 +2827,7 @@ int cmake::Build(const std::string& dir, std::string output; std::string projName; const char* cachedProjectName = - this->CacheManager->GetCacheEntryValue("CMAKE_PROJECT_NAME"); + this->Configuration->GetCacheEntryValue("CMAKE_PROJECT_NAME"); if(!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; @@ -2832,7 +2836,7 @@ int cmake::Build(const std::string& dir, projName = cachedProjectName; bool verbose = false; const char* cachedVerbose = - this->CacheManager->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); + this->Configuration->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); if(cachedVerbose) { verbose = cmSystemTools::IsOn(cachedVerbose); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 3b518be..7960b47 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -18,6 +18,7 @@ #include "cmake.h" #include "cmcmd.h" +#include "cmConfiguration.h" #include "cmCacheManager.h" #include "cmListFileCache.h" #include "cmSourceFile.h" @@ -330,28 +331,28 @@ int do_cmake(int ac, char const* const* av) { std::cout << "-- Cache values" << std::endl; std::vector keys = - cm.GetCacheManager()->GetCacheEntryKeys(); + cm.GetConfiguration()->GetCacheEntryKeys(); for (std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) { cmCacheManager::CacheEntryType t = - cm.GetCacheManager()->GetCacheEntryType(*it); + cm.GetConfiguration()->GetCacheEntryType(*it); if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && t != cmCacheManager::UNINITIALIZED ) { const char* advancedProp = - cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED"); + cm.GetConfiguration()->GetCacheEntryProperty(*it, "ADVANCED"); if ( list_all_cached || !advancedProp) { if ( list_help ) { std::cout << "// " - << cm.GetCacheManager()->GetCacheEntryProperty(*it, + << cm.GetConfiguration()->GetCacheEntryProperty(*it, "HELPSTRING") << std::endl; } std::cout << *it << ":" << cmCacheManager::TypeToString(t) - << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it) + << "=" << cm.GetConfiguration()->GetCacheEntryValue(*it) << std::endl; if ( list_help ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9754cb6f804df5150a1f1fffed0e8eb3c0612e1c commit 9754cb6f804df5150a1f1fffed0e8eb3c0612e1c Author: Stephen Kelly AuthorDate: Sat Apr 4 21:20:12 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:57:33 2015 +0200 Introduce cmConfiguration class. At this point, it is an interface to the cache. It will be extended to be a universal interface for access to and manipulation of configuration-time data (defintions, properties on targets, directories, source files etc). This will allow porting all command implementations away from the cmMakefile and cmTarget classes, and result in something more-purely related to configuration-time processing of cmake commands. That should serve at least the following goals: * Split the CMake implementation more definitively into three stages: Configuration, computation and generation, and be able to implement each optimally for memory access patterns etc. * Make better IDE integration possible by making more configuration data available. * Make it possiblte to use a smaller library than CMakeLib.a in cpack and ctest, resulting in smaller executables. * Make it possible to run the configure step multiple times in the same CMake run (#14539). Manage its lifetime in the cmake class, and add a convenience accessor to cmMakefile. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 04f6a81..8354fd9 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -171,6 +171,8 @@ set(SRCS cmComputeLinkInformation.h cmComputeTargetDepends.h cmComputeTargetDepends.cxx + cmConfiguration.cxx + cmConfiguration.h cmCPackPropertiesGenerator.h cmCPackPropertiesGenerator.cxx cmCryptoHash.cxx diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 2d3f6e5..36848c4 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -249,6 +249,7 @@ private: // Only cmake and cmMakefile should be able to add cache values // the commands should never use the cmCacheManager directly friend class cmMakefile; // allow access to add cache values + friend class cmConfiguration; // allow access to add cache values friend class cmake; // allow access to add cache values friend class cmMarkAsAdvancedCommand; // allow access to add cache values }; diff --git a/Source/cmConfiguration.cxx b/Source/cmConfiguration.cxx new file mode 100644 index 0000000..7e89c09 --- /dev/null +++ b/Source/cmConfiguration.cxx @@ -0,0 +1,137 @@ + +#include "cmConfiguration.h" + +#include "cmake.h" + +cmConfiguration::cmConfiguration(cmake* cm) + : CMakeInstance(cm) +{ +} +cmCacheManager::CacheEntryType +cmConfiguration::StringToCacheEntryType(const char* s) +{ + return cmCacheManager::StringToType(s); +} + +const char* +cmConfiguration::CacheEntryTypeToString(cmCacheManager::CacheEntryType t) +{ + return cmCacheManager::TypeToString(t); +} + +bool cmConfiguration::IsCacheEntryType(std::string const& key) +{ + return cmCacheManager::IsType(key.c_str()); +} + +std::vector cmConfiguration::GetCacheEntryKeys() const +{ + std::vector definitions; + definitions.reserve(this->CMakeInstance->GetCacheManager()->GetSize()); + cmCacheManager::CacheIterator cit = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + definitions.push_back(cit.GetName()); + } + return definitions; +} + +const char* cmConfiguration::GetCacheEntryValue(std::string const& key) const +{ + cmCacheManager::CacheEntry* e = this->CMakeInstance->GetCacheManager() + ->GetCacheEntry(key); + if (!e) + { + return 0; + } + return e->Value.c_str(); +} + +const char* +cmConfiguration::GetInitializedCacheValue(std::string const& key) const +{ + return this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue(key); +} + +cmCacheManager::CacheEntryType +cmConfiguration::GetCacheEntryType(std::string const& key) const +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + return it.GetType(); +} + +void cmConfiguration::SetCacheEntryValue(std::string const& key, + std::string const& value) +{ + this->CMakeInstance->GetCacheManager()->SetCacheEntryValue(key, value); +} + +void cmConfiguration::SetCacheEntryProperty(std::string const& key, + std::string const& propertyName, + std::string const& value) +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + it.SetProperty(propertyName, value.c_str()); +} + +void cmConfiguration::SetCacheEntryBoolProperty(std::string const& key, + std::string const& propertyName, + bool value) +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + it.SetProperty(propertyName, value); +} + +const char* cmConfiguration::GetCacheEntryProperty(std::string const& key, + std::string const& propertyName) +{ + cmCacheManager::CacheIterator it = this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()); + if (!it.PropertyExists(propertyName)) + { + return 0; + } + return it.GetProperty(propertyName); +} + +bool cmConfiguration::GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propertyName) +{ + return this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).GetPropertyAsBool(propertyName); +} + +void cmConfiguration::AddCacheEntry(const std::string& key, const char* value, + const char* helpString, + cmCacheManager::CacheEntryType type) +{ + this->CMakeInstance->GetCacheManager()->AddCacheEntry(key, value, + helpString, type); +} + +void cmConfiguration::RemoveCacheEntry(std::string const& key) +{ + this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(key); +} + +void cmConfiguration::AppendCacheEntryProperty(const std::string& key, + const std::string& property, + const std::string& value, + bool asString) +{ + this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).AppendProperty(property, + value.c_str(), + asString); +} + +void cmConfiguration::RemoveCacheEntryProperty(std::string const& key, + std::string const& propertyName) +{ + this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).SetProperty(propertyName, (void*)0); +} diff --git a/Source/cmConfiguration.h b/Source/cmConfiguration.h new file mode 100644 index 0000000..d8f5916 --- /dev/null +++ b/Source/cmConfiguration.h @@ -0,0 +1,52 @@ + +#ifndef cmConfiguration_h +#define cmConfiguration_h + +#include "cmCacheManager.h" + +class cmake; + +class cmConfiguration +{ +public: + cmConfiguration(cmake* cm); + + static cmCacheManager::CacheEntryType StringToCacheEntryType(const char*); + static const char* CacheEntryTypeToString(cmCacheManager::CacheEntryType); + static bool IsCacheEntryType(std::string const& key); + + std::vector GetCacheEntryKeys() const; + const char* GetCacheEntryValue(std::string const& key) const; + const char* GetInitializedCacheValue(std::string const& key) const; + cmCacheManager::CacheEntryType + GetCacheEntryType(std::string const& key) const; + void SetCacheEntryValue(std::string const& key, std::string const& value); + void SetCacheValue(std::string const& key, std::string const& value); + + void AddCacheEntry(const std::string& key, const char* value, + const char* helpString, + cmCacheManager::CacheEntryType type); + void RemoveCacheEntry(std::string const& key); + + void SetCacheEntryProperty(std::string const& key, + std::string const& propertyName, + std::string const& value); + void SetCacheEntryBoolProperty(std::string const& key, + std::string const& propertyName, + bool value); + const char* GetCacheEntryProperty(std::string const& key, + std::string const& propertyName); + bool GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propertyName); + void AppendCacheEntryProperty(std::string const& key, + const std::string& property, + const std::string& value, + bool asString = false); + void RemoveCacheEntryProperty(std::string const& key, + std::string const& propertyName); + +private: + cmake* CMakeInstance; +}; + +#endif diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 34b4621..b1450a8 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -19,6 +19,7 @@ #include "cmLocalGenerator.h" #include "cmCommands.h" #include "cmCacheManager.h" +#include "cmConfiguration.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" #include "cmCommandArgumentParserHelper.h" @@ -3738,6 +3739,11 @@ cmCacheManager *cmMakefile::GetCacheManager() const return this->GetCMakeInstance()->GetCacheManager(); } +cmConfiguration *cmMakefile::GetConfiguration() const +{ + return this->GetCMakeInstance()->GetConfiguration(); +} + void cmMakefile::DisplayStatus(const char* message, float s) const { cmake* cm = this->GetLocalGenerator()->GetGlobalGenerator() diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5209891..8c896e4 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -766,6 +766,7 @@ public: void EnableLanguage(std::vectorconst& languages, bool optional); cmCacheManager *GetCacheManager() const; + cmConfiguration *GetConfiguration() const; /** * Get the variable watch. This is used to determine when certain variables diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 64b332c..79fb2a5 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -21,6 +21,7 @@ #include "cmTest.h" #include "cmDocumentationFormatter.h" #include "cmAlgorithms.h" +#include "cmConfiguration.h" #if defined(CMAKE_BUILD_WITH_CMAKE) # include "cmGraphVizWriter.h" @@ -133,6 +134,8 @@ cmake::cmake() this->FileComparison = new cmFileTimeComparison; this->Policies = new cmPolicies(); + this->Configuration = new cmConfiguration(this); + this->InitializeProperties(); #ifdef __APPLE__ @@ -171,6 +174,7 @@ cmake::~cmake() { delete this->CacheManager; delete this->Policies; + delete this->Configuration; if (this->GlobalGenerator) { delete this->GlobalGenerator; diff --git a/Source/cmake.h b/Source/cmake.h index 3acf4a8..5b10288 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -32,6 +32,7 @@ class cmDocumentationSection; class cmPolicies; class cmTarget; class cmGeneratedFileStream; +class cmConfiguration; /** \brief Represents a cmake invocation. * @@ -387,6 +388,9 @@ class cmake void UnwatchUnusedCli(const std::string& var); void WatchUnusedCli(const std::string& var); + + cmConfiguration* GetConfiguration() const { return this->Configuration; } + protected: void RunCheckForUnusedVariables(); void InitializeProperties(); @@ -475,6 +479,8 @@ private: std::vector DebugConfigs; InstalledFilesMap InstalledFiles; + cmConfiguration* Configuration; + void UpdateConversionPathTable(); }; diff --git a/bootstrap b/bootstrap index 4239802..b8e9885 100755 --- a/bootstrap +++ b/bootstrap @@ -302,6 +302,7 @@ CMAKE_CXX_SOURCES="\ cmCommandsForBootstrap \ cmTarget \ cmTest \ + cmConfiguration \ cmCustomCommand \ cmCustomCommandGenerator \ cmCacheManager \ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a94cddabb4f6be6d47ee9be31ec76fe483e85415 commit a94cddabb4f6be6d47ee9be31ec76fe483e85415 Author: Stephen Kelly AuthorDate: Sun Apr 5 10:48:04 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:52:27 2015 +0200 cmCacheManager: Port consumers to non-iterator API. This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names. diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index f63df61..cc08052 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -366,18 +366,18 @@ bool cmFindBase::CheckForVariableInCache() if(const char* cacheValue = this->Makefile->GetDefinition(this->VariableName)) { - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()-> - GetCacheIterator(this->VariableName.c_str()); + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); - bool cached = !it.IsAtEnd(); + bool cached = cacheEntry ? true : false; if(found) { // If the user specifies the entry on the command line without a // type we should add the type and docstring but keep the // original value. Tell the subclass implementations to do // this. - if(cached && it.GetType() == cmCacheManager::UNINITIALIZED) + if(cached && manager->GetCacheEntryType(this->VariableName) + == cmCacheManager::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; } @@ -385,7 +385,8 @@ bool cmFindBase::CheckForVariableInCache() } else if(cached) { - const char* hs = it.GetProperty("HELPSTRING"); + const char* hs = manager->GetCacheEntryProperty(this->VariableName, + "HELPSTRING"); this->VariableDocumentation = hs?hs:"(none)"; } } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index f0b2686..0e6e0c2 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -391,11 +391,10 @@ bool cmGetPropertyCommand::HandleCacheMode() } const char* value = 0; - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(this->Name.c_str()); - if(!it.IsAtEnd()) + if(this->Makefile->GetCacheManager()->GetCacheEntryValue(this->Name)) { - value = it.GetProperty(this->PropertyName); + value = this->Makefile->GetCacheManager() + ->GetCacheEntryProperty(this->Name, this->PropertyName); } this->StoreResult(value); return true; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f23caa6..35394b8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1559,9 +1559,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(lib->first.c_str())) { std::string varName = lib->first.substr(0, lib->first.size()-9); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(varName.c_str()); - if(it.GetPropertyAsBool("ADVANCED")) + if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1592,9 +1590,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(incDir->c_str())) { std::string varName = incDir->substr(0, incDir->size()-9); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(varName.c_str()); - if(it.GetPropertyAsBool("ADVANCED")) + if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7c1b9c4..34b4621 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1848,8 +1848,8 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, doc, - type); + this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -2499,12 +2499,10 @@ std::vector cmMakefile this->Internal->VarStack.top().ClosureKeys(); res.insert(res.end(), definitions.begin(), definitions.end()); } - cmCacheManager::CacheIterator cit = - this->GetCacheManager()->GetCacheIterator(); - for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) - { - res.push_back(cit.GetName()); - } + std::vector cacheKeys = + this->GetCacheManager()->GetCacheEntryKeys(); + res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); + std::sort(res.begin(), res.end()); return res; } diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index f6a2c26..cc094b1 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -37,24 +37,19 @@ bool cmMarkAsAdvancedCommand { std::string variable = args[i]; cmCacheManager* manager = this->Makefile->GetCacheManager(); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(variable.c_str()); - if ( it.IsAtEnd() ) + if (!manager->GetCacheEntryValue(variable)) { - this->Makefile->GetCacheManager() - ->AddCacheEntry(variable, 0, 0, - cmCacheManager::UNINITIALIZED); + manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); overwrite = true; } - it.Find(variable); - if ( it.IsAtEnd() ) + if (!manager->GetCacheEntryValue(variable)) { cmSystemTools::Error("This should never happen..."); return false; } - if ( !it.PropertyExists("ADVANCED") || overwrite ) + if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) { - it.SetProperty("ADVANCED", value); + manager->SetCacheEntryProperty(variable, "ADVANCED", value); } } return true; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 60728ea..baf5b1e 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,16 +42,16 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(args[0].c_str()); - if(!it.IsAtEnd()) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue = manager->GetCacheEntryValue(args[0]); + if(existingValue) { - if ( it.GetType() != cmCacheManager::UNINITIALIZED ) + if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) { - it.SetProperty("HELPSTRING", args[1].c_str()); + manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; } - initialValue = it.GetValue(); + initialValue = existingValue; } if(args.size() == 3) { diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 204d95b..e17474b 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -136,9 +136,10 @@ bool cmSetCommand } // see if this is already in the cache - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(variable); - if(!it.IsAtEnd() && (it.GetType() != cmCacheManager::UNINITIALIZED)) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue = manager->GetCacheEntryValue(variable); + if(existingValue && + (manager->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 1150bc7..77f9fb9 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -452,11 +452,11 @@ bool cmSetPropertyCommand::HandleCacheMode() // Get the source file. cmMakefile* mf = this->GetMakefile(); cmake* cm = mf->GetCMakeInstance(); - cmCacheManager::CacheIterator it = - cm->GetCacheManager()->GetCacheIterator(ni->c_str()); - if(!it.IsAtEnd()) + const char* existingValue + = cm->GetCacheManager()->GetCacheEntryValue(*ni); + if(existingValue) { - if(!this->HandleCacheEntry(it)) + if(!this->HandleCacheEntry(*ni)) { return false; } @@ -474,22 +474,25 @@ bool cmSetPropertyCommand::HandleCacheMode() } //---------------------------------------------------------------------------- -bool cmSetPropertyCommand::HandleCacheEntry(cmCacheManager::CacheIterator& it) +bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey) { // Set or append the property. const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); + cmCacheManager* manager = this->Makefile->GetCacheManager(); if (this->Remove) { - value = 0; + manager->RemoveCacheEntryProperty(cacheKey, name); + return true; } if(this->AppendMode) { - it.AppendProperty(name, value, this->AppendAsString); + manager->AppendCacheEntryProperty(cacheKey, name, value, + this->AppendAsString); } else { - it.SetProperty(name, value); + manager->SetCacheEntryProperty(cacheKey, name, value); } return true; diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h index b06cb68..3285e60 100644 --- a/Source/cmSetPropertyCommand.h +++ b/Source/cmSetPropertyCommand.h @@ -61,7 +61,7 @@ private: bool HandleTestMode(); bool HandleTest(cmTest* test); bool HandleCacheMode(); - bool HandleCacheEntry(cmCacheManager::CacheIterator&); + bool HandleCacheEntry(std::string const&); bool HandleInstallMode(); bool HandleInstall(cmInstalledFile* file); }; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index b5280cf..911ade8 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -264,11 +264,12 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment.c_str(), cmCacheManager::STRING); - cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()-> - GetCacheIterator(this->RunResultVariable.c_str()); - if ( !it.IsAtEnd() ) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue + = manager->GetCacheEntryValue(this->RunResultVariable); + if (existingValue) { - it.SetProperty("ADVANCED", "1"); + manager->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); } error = true; @@ -290,11 +291,13 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmCacheManager::STRING); - cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()-> - GetCacheIterator(internalRunOutputName.c_str()); - if ( !it.IsAtEnd() ) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existing = + manager->GetCacheEntryValue(internalRunOutputName); + if (existing) { - it.SetProperty("ADVANCED", "1"); + manager->SetCacheEntryProperty(internalRunOutputName, + "ADVANCED", "1"); } error = true; diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index 80c1286..dd2a682 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -41,9 +41,9 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(args[i].c_str()); - if(!it.IsAtEnd() && it.GetPropertyAsBool("ADVANCED")) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + if(manager->GetCacheEntryValue(args[i]) && + manager->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) { hasAdvanced = true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 210c0ef..64b332c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -403,17 +403,18 @@ bool cmake::SetCacheArgs(const std::vector& args) cmsys::Glob::PatternToRegex(entryPattern, true, true).c_str()); //go through all cache entries and collect the vars which will be removed std::vector entriesToDelete; - cmCacheManager::CacheIterator it = - this->CacheManager->GetCacheIterator(); - for ( it.Begin(); !it.IsAtEnd(); it.Next() ) + std::vector cacheKeys = + this->CacheManager->GetCacheEntryKeys(); + for (std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = it.GetType(); + cmCacheManager::CacheEntryType t = + this->CacheManager->GetCacheEntryType(*it); if(t != cmCacheManager::STATIC) { - std::string entryName = it.GetName(); - if (regex.find(entryName.c_str())) + if (regex.find(it->c_str())) { - entriesToDelete.push_back(entryName); + entriesToDelete.push_back(*it); } } } @@ -917,16 +918,18 @@ void cmake::SetDirectoriesFromFile(const char* arg) // If there is a CMakeCache.txt file, use its settings. if(!cachePath.empty()) { - cmCacheManager* cachem = this->GetCacheManager(); - cmCacheManager::CacheIterator it = cachem->NewIterator(); - if(this->LoadCache(cachePath) && - it.Find("CMAKE_HOME_DIRECTORY")) + if(this->LoadCache(cachePath)) { - this->SetHomeOutputDirectory(cachePath); - this->SetStartOutputDirectory(cachePath); - this->SetHomeDirectory(it.GetValue()); - this->SetStartDirectory(it.GetValue()); - return; + const char* existingValue = + this->CacheManager->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + if (existingValue) + { + this->SetHomeOutputDirectory(cachePath); + this->SetStartOutputDirectory(cachePath); + this->SetHomeDirectory(existingValue); + this->SetStartDirectory(existingValue); + return; + } } } @@ -1575,11 +1578,11 @@ int cmake::ActualConfigure() ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", cmCacheManager::BOOL); - cmCacheManager::CacheIterator it = - this->CacheManager->GetCacheIterator("CMAKE_USE_RELATIVE_PATHS"); - if ( !it.PropertyExists("ADVANCED") ) + if (!this->CacheManager->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED")) { - it.SetProperty("ADVANCED", "1"); + this->CacheManager->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED", "1"); } } @@ -2314,17 +2317,9 @@ const char *cmake::GetProperty(const std::string& prop, std::string output = ""; if ( prop == "CACHE_VARIABLES" ) { - cmCacheManager::CacheIterator cit = - this->GetCacheManager()->GetCacheIterator(); - for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) - { - if (!output.empty()) - { - output += ";"; - } - output += cit.GetName(); - } - this->SetProperty("CACHE_VARIABLES", output.c_str()); + std::vector cacheKeys = + this->CacheManager->GetCacheEntryKeys(); + this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); } else if ( prop == "COMMANDS" ) { @@ -2686,9 +2681,9 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, if(t == cmake::AUTHOR_WARNING) { // Allow suppression of these warnings. - cmCacheManager::CacheIterator it = this->CacheManager - ->GetCacheIterator("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); - if(!it.IsAtEnd() && it.GetValueAsBool()) + const char* suppress = this->CacheManager->GetCacheEntryValue( + "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); + if(suppress && cmSystemTools::IsOn(suppress)) { return; } @@ -2801,37 +2796,42 @@ int cmake::Build(const std::string& dir, } std::string cachePath = dir; cmSystemTools::ConvertToUnixSlashes(cachePath); - cmCacheManager::CacheIterator it = this->GetCacheManager()->NewIterator(); if(!this->LoadCache(cachePath)) { std::cerr << "Error: could not load cache\n"; return 1; } - if(!it.Find("CMAKE_GENERATOR")) + const char* cachedGenerator = + this->CacheManager->GetCacheEntryValue("CMAKE_GENERATOR"); + if(!cachedGenerator) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; return 1; } cmsys::auto_ptr gen( - this->CreateGlobalGenerator(it.GetValue())); + this->CreateGlobalGenerator(cachedGenerator)); if(!gen.get()) { std::cerr << "Error: could create CMAKE_GENERATOR \"" - << it.GetValue() << "\"\n"; + << cachedGenerator << "\"\n"; return 1; } std::string output; std::string projName; - if(!it.Find("CMAKE_PROJECT_NAME")) + const char* cachedProjectName = + this->CacheManager->GetCacheEntryValue("CMAKE_PROJECT_NAME"); + if(!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; return 1; } - projName = it.GetValue(); + projName = cachedProjectName; bool verbose = false; - if(it.Find("CMAKE_VERBOSE_MAKEFILE")) + const char* cachedVerbose = + this->CacheManager->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); + if(cachedVerbose) { - verbose = it.GetValueAsBool(); + verbose = cmSystemTools::IsOn(cachedVerbose); } return gen->Build("", dir, projName, target, diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index ac73ad0..3b518be 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -328,25 +328,31 @@ int do_cmake(int ac, char const* const* av) int res = cm.Run(args, view_only); if ( list_cached || list_all_cached ) { - cmCacheManager::CacheIterator it = - cm.GetCacheManager()->GetCacheIterator(); std::cout << "-- Cache values" << std::endl; - for ( it.Begin(); !it.IsAtEnd(); it.Next() ) + std::vector keys = + cm.GetCacheManager()->GetCacheEntryKeys(); + for (std::vector::const_iterator it = keys.begin(); + it != keys.end(); ++it) { - cmCacheManager::CacheEntryType t = it.GetType(); + cmCacheManager::CacheEntryType t = + cm.GetCacheManager()->GetCacheEntryType(*it); if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && t != cmCacheManager::UNINITIALIZED ) { - bool advanced = it.PropertyExists("ADVANCED"); - if ( list_all_cached || !advanced) + const char* advancedProp = + cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED"); + if ( list_all_cached || !advancedProp) { if ( list_help ) { - std::cout << "// " << it.GetProperty("HELPSTRING") << std::endl; + std::cout << "// " + << cm.GetCacheManager()->GetCacheEntryProperty(*it, + "HELPSTRING") << std::endl; } - std::cout << it.GetName() << ":" << - cmCacheManager::TypeToString(it.GetType()) - << "=" << it.GetValue() << std::endl; + std::cout << *it << ":" << + cmCacheManager::TypeToString(t) + << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it) + << std::endl; if ( list_help ) { std::cout << std::endl; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb5090065e06b96f115d2f80872a97e098800d57 commit eb5090065e06b96f115d2f80872a97e098800d57 Author: Stephen Kelly AuthorDate: Mon Apr 6 12:14:40 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:52:26 2015 +0200 Port QtDialog to non-iterator cache API. diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 009d06e..08d53ce 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -110,17 +110,18 @@ void QCMake::setBinaryDirectory(const QString& _dir) QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); - cmCacheManager::CacheIterator itm = cachem->NewIterator(); - if ( itm.Find("CMAKE_HOME_DIRECTORY")) + const char* homeDir = cachem->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + if (homeDir) { - setSourceDirectory(QString::fromLocal8Bit(itm.GetValue().c_str())); + setSourceDirectory(QString::fromLocal8Bit(homeDir)); } - if ( itm.Find("CMAKE_GENERATOR")) + const char* gen = cachem->GetCacheEntryValue("CMAKE_GENERATOR"); + if (gen) { const char* extraGen = cachem ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: - CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : ""); + CreateFullGeneratorName(gen, extraGen? extraGen : ""); this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); } } @@ -195,33 +196,35 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) // set the value of properties cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - for(cmCacheManager::CacheIterator i = cachem->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = cachem->GetCacheEntryKeys(); + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - - if(i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC) + cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*it); + if(t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC) { continue; } QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); + prop.Key = QString::fromLocal8Bit(it->c_str()); int idx = props.indexOf(prop); if(idx == -1) { - toremove.append(QString::fromLocal8Bit(i.GetName().c_str())); + toremove.append(QString::fromLocal8Bit(it->c_str())); } else { prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - i.SetValue(prop.Value.toBool() ? "ON" : "OFF"); + cachem->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); } else { - i.SetValue(prop.Value.toString().toLocal8Bit().data()); + cachem->SetCacheEntryValue(*it, + prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); } @@ -279,42 +282,47 @@ QCMakePropertyList QCMake::properties() const QCMakePropertyList ret; cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - for(cmCacheManager::CacheIterator i = cachem->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = cachem->GetCacheEntryKeys(); + for (std::vector::const_iterator i = cacheKeys.begin(); + i != cacheKeys.end(); ++i) { - - if(i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED) + cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*i); + if(t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED) { continue; } - QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); - prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING")); - prop.Value = QString::fromLocal8Bit(i.GetValue().c_str()); - prop.Advanced = i.GetPropertyAsBool("ADVANCED"); + const char* cachedValue = cachem->GetCacheEntryValue(*i); - if(i.GetType() == cmCacheManager::BOOL) + QCMakeProperty prop; + prop.Key = QString::fromLocal8Bit(i->c_str()); + prop.Help = QString::fromLocal8Bit( + cachem->GetCacheEntryProperty(*i, "HELPSTRING")); + prop.Value = QString::fromLocal8Bit(cachedValue); + prop.Advanced = cachem->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); + if(t == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; - prop.Value = cmSystemTools::IsOn(i.GetValue().c_str()); + prop.Value = cmSystemTools::IsOn(cachedValue); } - else if(i.GetType() == cmCacheManager::PATH) + else if(t == cmCacheManager::PATH) { prop.Type = QCMakeProperty::PATH; } - else if(i.GetType() == cmCacheManager::FILEPATH) + else if(t == cmCacheManager::FILEPATH) { prop.Type = QCMakeProperty::FILEPATH; } - else if(i.GetType() == cmCacheManager::STRING) + else if(t == cmCacheManager::STRING) { prop.Type = QCMakeProperty::STRING; - if (i.PropertyExists("STRINGS")) + const char* stringsProperty = + cachem->GetCacheEntryProperty(*i, "STRINGS"); + if (stringsProperty) { - prop.Strings = QString::fromLocal8Bit(i.GetProperty("STRINGS")).split(";"); + prop.Strings = QString::fromLocal8Bit(stringsProperty).split(";"); } } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59c9744d8cba44dc3b49f2cb1fb760dce008fc44 commit 59c9744d8cba44dc3b49f2cb1fb760dce008fc44 Author: Stephen Kelly AuthorDate: Mon Apr 6 12:01:35 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:52:26 2015 +0200 Port CursesDialog to non-iterator cache API. diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 682f95f..4f028c4 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -18,6 +18,9 @@ #include "cmCursesFilePathWidget.h" #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" +#include "../cmake.h" + +#include cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( const std::string& key, @@ -32,7 +35,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( - const std::string& key, const cmCacheManager::CacheIterator& it, bool isNew, + const std::string& key, cmake *cm, bool isNew, int labelwidth, int entrywidth) : Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth) { @@ -47,11 +50,13 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - switch ( it.GetType() ) + const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); + assert(value); + switch (cm->GetCacheManager()->GetCacheEntryType(key)) { - case cmCacheManager::BOOL: + case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); - if (cmSystemTools::IsOn(it.GetValue().c_str())) + if (cmSystemTools::IsOn(value)) { static_cast(this->Entry)->SetValueAsBool(true); } @@ -62,40 +67,40 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( break; case cmCacheManager::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); break; case cmCacheManager::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); break; case cmCacheManager::STRING: - if(it.PropertyExists("STRINGS")) + { + const char* stringsProp = cm->GetCacheManager() + ->GetCacheEntryProperty(key, "STRINGS"); + if(stringsProp) { cmCursesOptionsWidget* ow = new cmCursesOptionsWidget(this->EntryWidth, 1, 1, 1); this->Entry = ow; std::vector options; - cmSystemTools::ExpandListArgument( - std::string(it.GetProperty("STRINGS")), options); + cmSystemTools::ExpandListArgument(stringsProp, options); for(std::vector::iterator si = options.begin(); si != options.end(); ++si) { ow->AddOption(*si); } - ow->SetOption(it.GetValue()); + ow->SetOption(value); } else { this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); } break; + } case cmCacheManager::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", - it.GetName().c_str()); + key.c_str()); break; default: // TODO : put warning message here diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index 7cdf13b..dc4ee4af 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -21,7 +21,7 @@ public: cmCursesCacheEntryComposite(const std::string& key, int labelwidth, int entrywidth); cmCursesCacheEntryComposite(const std::string& key, - const cmCacheManager::CacheIterator& it, + cmake *cm, bool isNew, int labelwidth, int entrywidth); ~cmCursesCacheEntryComposite(); const char* GetValue(); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 1217bda..833d540 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -111,13 +111,17 @@ void cmCursesMainForm::InitializeUI() // Count non-internal and non-static entries int count=0; - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = + this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys(); + + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - if ( i.GetType() != cmCacheManager::INTERNAL && - i.GetType() != cmCacheManager::STATIC && - i.GetType() != cmCacheManager::UNINITIALIZED) + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t != cmCacheManager::INTERNAL && + t != cmCacheManager::STATIC && + t != cmCacheManager::UNINITIALIZED) { ++count; } @@ -139,45 +143,49 @@ void cmCursesMainForm::InitializeUI() // Create the composites. // First add entries which are new - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - std::string key = i.GetName(); - if ( i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED ) + std::string key = *it; + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED ) { continue; } if (!this->LookForCacheEntry(key)) { - newEntries->push_back(new cmCursesCacheEntryComposite(key, i, - true, 30, - entrywidth)); + newEntries->push_back(new cmCursesCacheEntryComposite(key, + this->CMakeInstance, + true, 30, + entrywidth)); this->OkToGenerate = false; } } // then add entries which are old - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - std::string key = i.GetName(); - if ( i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED ) + std::string key = *it; + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED ) { continue; } if (this->LookForCacheEntry(key)) { - newEntries->push_back(new cmCursesCacheEntryComposite(key, i, - false, 30, - entrywidth)); + newEntries->push_back(new cmCursesCacheEntryComposite(key, + this->CMakeInstance, + false, 30, + entrywidth)); } } } @@ -216,10 +224,13 @@ void cmCursesMainForm::RePost() std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -245,10 +256,13 @@ void cmCursesMainForm::RePost() std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -314,10 +328,13 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -334,10 +351,13 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -495,11 +515,12 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the help string of the current entry // and add it to the help string - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField); - if (!it.IsAtEnd()) + const char* existingValue = + this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField); + if (existingValue) { - const char* hs = it.GetProperty("HELPSTRING"); + const char* hs = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryProperty(curField, "HELPSTRING"); if ( hs ) { strncpy(help, hs, 127); @@ -792,23 +813,28 @@ void cmCursesMainForm::FillCacheManagerFromUI() size_t size = this->Entries->size(); for(size_t i=0; i < size; i++) { - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator( - (*this->Entries)[i]->Key.c_str()); - if (!it.IsAtEnd()) + std::string cacheKey = (*this->Entries)[i]->Key; + const char* existingValue = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue(cacheKey); + if (existingValue) { - std::string oldValue = it.GetValue(); + std::string oldValue = existingValue; std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - this->FixValue(it.GetType(), oldValue, fixedOldValue); - this->FixValue(it.GetType(), newValue, fixedNewValue); + cmCacheManager::CacheEntryType t = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(cacheKey); + this->FixValue(t, oldValue, fixedOldValue); + this->FixValue(t, newValue, fixedNewValue); if(!(fixedOldValue == fixedNewValue)) { // The user has changed the value. Mark it as modified. - it.SetProperty("MODIFIED", true); - it.SetValue(fixedNewValue.c_str()); + this->CMakeInstance->GetCacheManager() + ->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true); + this->CMakeInstance->GetCacheManager() + ->SetCacheEntryValue(cacheKey, fixedNewValue); } } } @@ -1017,12 +1043,15 @@ void cmCursesMainForm::HandleInput() cmCursesWidget* lbl = reinterpret_cast(field_userptr( this->Fields[findex-2])); const char* curField = lbl->GetValue(); - const char* helpString=0; - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField); - if (!it.IsAtEnd()) + const char* helpString = 0; + + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue(curField); + if (existingValue) { - helpString = it.GetProperty("HELPSTRING"); + helpString = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryProperty(curField, "HELPSTRING"); } if (helpString) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a909de726d66b4e2b0b06a7baefd366d040ce54 commit 3a909de726d66b4e2b0b06a7baefd366d040ce54 Author: Stephen Kelly AuthorDate: Mon Apr 6 10:46:25 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:52:26 2015 +0200 cmMakefile: Port away from CacheEntry.Initialized. The API has no other external users. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b6eff3d..7c1b9c4 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1810,16 +1810,17 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, { bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; - cmCacheManager::CacheIterator it = - this->GetCacheManager()->GetCacheIterator(name.c_str()); - if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED) && - it.Initialized()) + const char* existingValue = + this->GetCacheManager()->GetInitializedCacheValue(name); + if(existingValue + && (this->GetCacheManager()->GetCacheEntryType(name) + == cmCacheManager::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in if(!force) { - val = it.GetValue(); + val = existingValue; haveVal = true; } if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) @@ -1842,7 +1843,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, } this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = it.GetValue(); + val = this->GetCacheManager()->GetInitializedCacheValue(name); haveVal = true; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8951b57dd03b3550a6f698aefe9e65435f933323 commit 8951b57dd03b3550a6f698aefe9e65435f933323 Author: Stephen Kelly AuthorDate: Sun Apr 5 19:50:05 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:52:26 2015 +0200 cmCacheManager: Add non-iterator-based API. The iterator pattern is an unusual one for CMake, and it hinders refactoring all configuration-time data manipulation into a single class. diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 31d302a..2d3f6e5 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -139,6 +139,81 @@ public: ///! Get a value from the cache given a key const char* GetInitializedCacheValue(const std::string& key) const; + const char* GetCacheEntryValue(const std::string& key) + { + cmCacheManager::CacheIterator it = this->GetCacheIterator(key.c_str()); + if (it.IsAtEnd()) + { + return 0; + } + return it.GetValue().c_str(); + } + + const char* GetCacheEntryProperty(std::string const& key, + std::string const& propName) + { + return this->GetCacheIterator(key.c_str()).GetProperty(propName); + } + + CacheEntryType GetCacheEntryType(std::string const& key) + { + return this->GetCacheIterator(key.c_str()).GetType(); + } + + bool GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propName) + { + return this->GetCacheIterator(key.c_str()).GetPropertyAsBool(propName); + } + + void SetCacheEntryProperty(std::string const& key, + std::string const& propName, + std::string const& value) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, value.c_str()); + } + + void SetCacheEntryBoolProperty(std::string const& key, + std::string const& propName, + bool value) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, value); + } + + void SetCacheEntryValue(std::string const& key, + std::string const& value) + { + this->GetCacheIterator(key.c_str()).SetValue(value.c_str()); + } + + void RemoveCacheEntryProperty(std::string const& key, + std::string const& propName) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, (void*)0); + } + + void AppendCacheEntryProperty(std::string const& key, + std::string const& propName, + std::string const& value, + bool asString = false) + { + this->GetCacheIterator(key.c_str()).AppendProperty(propName, + value.c_str(), + asString); + } + + std::vector GetCacheEntryKeys() + { + std::vector definitions; + definitions.reserve(this->GetSize()); + cmCacheManager::CacheIterator cit = this->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + definitions.push_back(cit.GetName()); + } + return definitions; + } + /** Get the version of CMake that wrote the cache. */ unsigned int GetCacheMajorVersion() const { return this->CacheMajorVersion; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c4ff47867f0073865c16cc8e397fe5118b15f33 commit 2c4ff47867f0073865c16cc8e397fe5118b15f33 Author: Stephen Kelly AuthorDate: Sun Apr 5 10:28:34 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:52:25 2015 +0200 cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue. Being initialized is a requirement for this method to return something, and is what differentiates it from using GetIterator with it.GetValue. diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 3df48d1..009d06e 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -117,7 +117,8 @@ void QCMake::setBinaryDirectory(const QString& _dir) } if ( itm.Find("CMAKE_GENERATOR")) { - const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR"); + const char* extraGen = cachem + ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : ""); this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index b8dfe04..5387d0c 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -283,14 +283,16 @@ bool cmCacheManager::LoadCache(const std::string& path, } this->CacheMajorVersion = 0; this->CacheMinorVersion = 0; - if(const char* cmajor = this->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION")) + if(const char* cmajor = + this->GetInitializedCacheValue("CMAKE_CACHE_MAJOR_VERSION")) { unsigned int v=0; if(sscanf(cmajor, "%u", &v) == 1) { this->CacheMajorVersion = v; } - if(const char* cminor = this->GetCacheValue("CMAKE_CACHE_MINOR_VERSION")) + if(const char* cminor = + this->GetInitializedCacheValue("CMAKE_CACHE_MINOR_VERSION")) { if(sscanf(cminor, "%u", &v) == 1) { @@ -312,10 +314,11 @@ bool cmCacheManager::LoadCache(const std::string& path, } // check to make sure the cache directory has not // been moved - if ( internal && this->GetCacheValue("CMAKE_CACHEFILE_DIR") ) + const char* oldDir = this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR"); + if (internal && oldDir) { std::string currentcwd = path; - std::string oldcwd = this->GetCacheValue("CMAKE_CACHEFILE_DIR"); + std::string oldcwd = oldDir; cmSystemTools::ConvertToUnixSlashes(currentcwd); currentcwd += "/CMakeCache.txt"; oldcwd += "/CMakeCache.txt"; @@ -324,7 +327,7 @@ bool cmCacheManager::LoadCache(const std::string& path, std::string message = std::string("The current CMakeCache.txt directory ") + currentcwd + std::string(" is different than the directory ") + - std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) + + std::string(this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")) + std::string(" where CMakeCache.txt was created. This may result " "in binaries being created in the wrong place. If you " "are not sure, reedit the CMakeCache.txt"); @@ -654,7 +657,8 @@ cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator( return CacheIterator(*this, key); } -const char* cmCacheManager::GetCacheValue(const std::string& key) const +const char* +cmCacheManager::GetInitializedCacheValue(const std::string& key) const { CacheEntryMap::const_iterator i = this->Cache.find(key); if(i != this->Cache.end() && diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index f7f8776..31d302a 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -137,7 +137,7 @@ public: CacheEntryType& type); ///! Get a value from the cache given a key - const char* GetCacheValue(const std::string& key) const; + const char* GetInitializedCacheValue(const std::string& key) const; /** Get the version of CMake that wrote the cache. */ unsigned int GetCacheMajorVersion() const diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 747b7e4..99bf5f5 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -90,7 +90,8 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } if ( strcmp(key, "CACHE") == 0 ) { - if(const char* c = this->Makefile->GetCacheManager()->GetCacheValue(var)) + if(const char* c = this->Makefile->GetCacheManager() + ->GetInitializedCacheValue(var)) { if(this->EscapeQuotes) { diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 810ec57..0d32e4b 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -205,7 +205,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_"; cacheEntryName += envVar; - const char* cacheValue = mf->GetCacheManager()->GetCacheValue( + const char* cacheValue = mf->GetCacheManager()->GetInitializedCacheValue( cacheEntryName); // now we have both, decide which one to use diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 3c0a0e2..f23caa6 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -179,7 +179,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, return; } const char* cname = this->GetCMakeInstance()-> - GetCacheManager()->GetCacheValue(langComp); + GetCacheManager()->GetInitializedCacheValue(langComp); std::string changeVars; if(cname && !optional) { @@ -1641,7 +1641,7 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir, // and there is a good chance that the try compile stuff will // take the bulk of the time, so try and guess some progress // by getting closer and closer to 100 without actually getting there. - if (!this->CMakeInstance->GetCacheManager()->GetCacheValue + if (!this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS")) { // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set @@ -1839,7 +1839,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) // update progress // estimate how many lg there will be const char *numGenC = - this->CMakeInstance->GetCacheManager()->GetCacheValue + this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"); if (!numGenC) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ad4ad7c..b6eff3d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2432,7 +2432,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const this->Internal->VarUsageStack.top().insert(name); if(!def) { - def = this->GetCacheManager()->GetCacheValue(name); + def = this->GetCacheManager()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE if(cmVariableWatch* vv = this->GetVariableWatch()) @@ -2457,7 +2457,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const const char* def = this->Internal->VarStack.top().Get(name); if(!def) { - def = this->GetCacheManager()->GetCacheValue(name); + def = this->GetCacheManager()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); @@ -2835,7 +2835,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( value = cmSystemTools::GetEnv(lookup.c_str()); break; case CACHE: - value = this->GetCacheManager()->GetCacheValue(lookup); + value = this->GetCacheManager() + ->GetInitializedCacheValue(lookup); break; } // Get the string we're meant to append to. @@ -4903,7 +4904,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, (status == cmPolicies::WARN || status == cmPolicies::OLD)) { if(!(this->GetCacheManager() - ->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) + ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) { // Set it to 2.4 because that is the last version where the // variable had meaning. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e781417..210c0ef 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -344,7 +344,8 @@ bool cmake::SetCacheArgs(const std::vector& args) std::string cachedValue; if(this->WarnUnusedCli) { - if(const char *v = this->CacheManager->GetCacheValue(var)) + if(const char *v = this->CacheManager + ->GetInitializedCacheValue(var)) { haveValue = true; cachedValue = v; @@ -357,7 +358,8 @@ bool cmake::SetCacheArgs(const std::vector& args) if(this->WarnUnusedCli) { if (!haveValue || - cachedValue != this->CacheManager->GetCacheValue(var)) + cachedValue != this->CacheManager + ->GetInitializedCacheValue(var)) { this->WatchUnusedCli(var); } @@ -1203,10 +1205,10 @@ int cmake::DoPreConfigureChecks() } // do a sanity check on some values - if(this->CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY")) + if(this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY")) { std::string cacheStart = - this->CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY"); + this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"); cacheStart += "/CMakeLists.txt"; std::string currentStart = this->GetHomeDirectory(); currentStart += "/CMakeLists.txt"; @@ -1355,9 +1357,9 @@ int cmake::ActualConfigure() if(!this->GlobalGenerator) { const char* genName = - this->CacheManager->GetCacheValue("CMAKE_GENERATOR"); + this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR"); const char* extraGenName = - this->CacheManager->GetCacheValue("CMAKE_EXTRA_GENERATOR"); + this->CacheManager->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); if(genName) { std::string fullName = cmExternalMakefileProjectGenerator:: @@ -1435,7 +1437,8 @@ int cmake::ActualConfigure() } } - const char* genName = this->CacheManager->GetCacheValue("CMAKE_GENERATOR"); + const char* genName = this->CacheManager + ->GetInitializedCacheValue("CMAKE_GENERATOR"); if(genName) { if(!this->GlobalGenerator->MatchesGeneratorName(genName)) @@ -1451,7 +1454,7 @@ int cmake::ActualConfigure() return -2; } } - if(!this->CacheManager->GetCacheValue("CMAKE_GENERATOR")) + if(!this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR")) { this->CacheManager->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName().c_str(), @@ -1464,7 +1467,7 @@ int cmake::ActualConfigure() } if(const char* platformName = - this->CacheManager->GetCacheValue("CMAKE_GENERATOR_PLATFORM")) + this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM")) { if(this->GeneratorPlatform.empty()) { @@ -1492,7 +1495,7 @@ int cmake::ActualConfigure() } if(const char* tsName = - this->CacheManager->GetCacheValue("CMAKE_GENERATOR_TOOLSET")) + this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET")) { if(this->GeneratorToolset.empty()) { @@ -1546,16 +1549,18 @@ int cmake::ActualConfigure() // project requires compatibility with CMake 2.4. We detect this // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY // variable created when CMP0001 is not set to NEW. - if(this->GetCacheManager()->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) + if(this->GetCacheManager() + ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { - if(!this->CacheManager->GetCacheValue("LIBRARY_OUTPUT_PATH")) + if(!this->CacheManager->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) { this->CacheManager->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", cmCacheManager::PATH); } - if(!this->CacheManager->GetCacheValue("EXECUTABLE_OUTPUT_PATH")) + if(!this->CacheManager + ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) { this->CacheManager->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", @@ -1563,7 +1568,8 @@ int cmake::ActualConfigure() cmCacheManager::PATH); } } - if(!this->CacheManager->GetCacheValue("CMAKE_USE_RELATIVE_PATHS")) + if(!this->CacheManager + ->GetInitializedCacheValue("CMAKE_USE_RELATIVE_PATHS")) { this->CacheManager->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", @@ -1578,9 +1584,9 @@ int cmake::ActualConfigure() } if(cmSystemTools::GetFatalErrorOccured() && - (!this->CacheManager->GetCacheValue("CMAKE_MAKE_PROGRAM") || + (!this->CacheManager->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM") || cmSystemTools::IsOff(this->CacheManager-> - GetCacheValue("CMAKE_MAKE_PROGRAM")))) + GetInitializedCacheValue("CMAKE_MAKE_PROGRAM")))) { // We must have a bad generator selection. Wipe the cache entry so the // user can select another. @@ -1796,7 +1802,7 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, const char* cmake::GetCacheDefinition(const std::string& name) const { - return this->CacheManager->GetCacheValue(name); + return this->CacheManager->GetInitializedCacheValue(name); } void cmake::AddDefaultCommands() @@ -1956,7 +1962,8 @@ void cmake::UpdateConversionPathTable() { // Update the path conversion table with any specified file: const char* tablepath = - this->CacheManager->GetCacheValue("CMAKE_PATH_TRANSLATION_FILE"); + this->CacheManager + ->GetInitializedCacheValue("CMAKE_PATH_TRANSLATION_FILE"); if(tablepath) { @@ -2190,7 +2197,7 @@ void cmake::TruncateOutputLog(const char* fname) { return; } - if ( !this->CacheManager->GetCacheValue("CMAKE_CACHEFILE_DIR") ) + if ( !this->CacheManager->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR") ) { cmSystemTools::RemoveFile(fullPath); return; @@ -2469,7 +2476,7 @@ int cmake::GetSystemInformation(std::vector& args) // we have to find the module directory, so we can copy the files this->AddCMakePaths(); std::string modulesPath = - this->CacheManager->GetCacheValue("CMAKE_ROOT"); + this->CacheManager->GetInitializedCacheValue("CMAKE_ROOT"); modulesPath += "/Modules"; std::string inFile = modulesPath; inFile += "/SystemInformation.cmake"; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db25277da05b1f2c058635b76cf3f9d612784427 commit db25277da05b1f2c058635b76cf3f9d612784427 Author: Stephen Kelly AuthorDate: Sun Apr 5 00:07:04 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:52:25 2015 +0200 Add API for cache loading, deleting and saving to the cmake class. Migrate existing users of the CacheManager API to use the new API. The CacheManager will be going away soon. diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 0827037..586070b 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -18,7 +18,6 @@ #include "cmGlobalGenerator.h" #include #include "cmCTestTestHandler.h" -#include "cmCacheManager.h" //---------------------------------------------------------------------- cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler() @@ -255,7 +254,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) cm.SetGeneratorToolset(this->BuildGeneratorToolset); // Load the cache to make CMAKE_MAKE_PROGRAM available. - cm.GetCacheManager()->LoadCache(this->BinaryDir); + cm.LoadCache(this->BinaryDir); } else { diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index d60062e..1217bda 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -639,7 +639,7 @@ int cmCursesMainForm::Configure(int noconfigure) // always save the current gui values to disk this->FillCacheManagerFromUI(); - this->CMakeInstance->GetCacheManager()->SaveCache( + this->CMakeInstance->SaveCache( this->CMakeInstance->GetHomeOutputDirectory()); this->LoadCache(0); diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 996aa75..3df48d1 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -96,7 +96,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) emit this->binaryDirChanged(this->BinaryDirectory); cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); this->setGenerator(QString()); - if(!this->CMakeInstance->GetCacheManager()->LoadCache( + if(!this->CMakeInstance->LoadCache( this->BinaryDirectory.toLocal8Bit().data())) { QDir testDir(this->BinaryDirectory); @@ -270,7 +270,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) } } - cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); } QCMakePropertyList QCMake::properties() const @@ -397,9 +397,9 @@ QStringList QCMake::availableGenerators() const void QCMake::deleteCache() { // delete cache - this->CMakeInstance->GetCacheManager()->DeleteCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->DeleteCache(this->BinaryDirectory.toLocal8Bit().data()); // reload to make our cache empty - this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit no generator and no properties this->setGenerator(QString()); QCMakePropertyList props = this->properties(); @@ -412,7 +412,7 @@ void QCMake::reloadCache() QCMakePropertyList props; emit this->propertiesChanged(props); // reload - this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit new cache properties props = this->properties(); emit this->propertiesChanged(props); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index df61fe6..1db057b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2281,7 +2281,7 @@ bool cmCTest::AddVariableDefinition(const std::string &arg) std::string value; cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; - if (cmCacheManager::ParseEntry(arg, name, value, type)) + if (cmake::ParseCacheEntry(arg, name, value, type)) { this->Definitions[name] = value; return true; diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index d64b0d7..810ec57 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -223,7 +223,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), cacheEntryName.c_str(), cmCacheManager::STRING, true); - mf->GetCacheManager()->SaveCache(mf->GetHomeOutputDirectory()); + mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } else if (envVarValue==0 && cacheValue!=0) { @@ -244,7 +244,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), cacheEntryName.c_str(), cmCacheManager::STRING, true); - mf->GetCacheManager()->SaveCache(mf->GetHomeOutputDirectory()); + mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 5e584a4..0561a05 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3703,7 +3703,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root, // Since this call may have created new cache entries, save the cache: // - root->GetMakefile()->GetCacheManager()->SaveCache( + root->GetMakefile()->GetCMakeInstance()->SaveCache( root->GetMakefile()->GetHomeOutputDirectory()); } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 93aec32..e2ae901 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -81,8 +81,8 @@ bool cmLoadCacheCommand { break; } - this->Makefile->GetCacheManager()->LoadCache(args[i], false, - excludes, includes); + this->Makefile->GetCMakeInstance()->LoadCache(args[i], false, + excludes, includes); } @@ -173,7 +173,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) std::string var; std::string value; cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; - if(cmCacheManager::ParseEntry(line, var, value, type)) + if(cmake::ParseCacheEntry(line, var, value, type)) { // Found a real entry. See if this one was requested. if(this->VariablesToRead.find(var) != this->VariablesToRead.end()) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5c52a1a..e781417 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -917,7 +917,7 @@ void cmake::SetDirectoriesFromFile(const char* arg) { cmCacheManager* cachem = this->GetCacheManager(); cmCacheManager::CacheIterator it = cachem->NewIterator(); - if(cachem->LoadCache(cachePath) && + if(this->LoadCache(cachePath) && it.Find("CMAKE_HOME_DIRECTORY")) { this->SetHomeOutputDirectory(cachePath); @@ -1860,10 +1860,18 @@ void cmake::AddDefaultGenerators() #endif } +bool cmake::ParseCacheEntry(const std::string& entry, + std::string& var, + std::string& value, + cmCacheManager::CacheEntryType& type) +{ + return cmCacheManager::ParseEntry(entry, var, value, type); +} + int cmake::LoadCache() { // could we not read the cache - if (!this->CacheManager->LoadCache(this->GetHomeOutputDirectory())) + if (!this->LoadCache(this->GetHomeOutputDirectory())) { // if it does exist, but isn't readable then warn the user std::string cacheFile = this->GetHomeOutputDirectory(); @@ -1886,6 +1894,28 @@ int cmake::LoadCache() return 0; } +bool cmake::LoadCache(const std::string& path) +{ + return this->CacheManager->LoadCache(path); +} + +bool cmake::LoadCache(const std::string& path, bool internal, + std::set& excludes, + std::set& includes) +{ + return this->CacheManager->LoadCache(path, internal, excludes, includes); +} + +bool cmake::SaveCache(const std::string& path) +{ + return this->CacheManager->SaveCache(path); +} + +bool cmake::DeleteCache(const std::string& path) +{ + return this->CacheManager->DeleteCache(path); +} + void cmake::SetProgressCallback(ProgressCallbackType f, void *cd) { this->ProgressCallback = f; @@ -2764,9 +2794,8 @@ int cmake::Build(const std::string& dir, } std::string cachePath = dir; cmSystemTools::ConvertToUnixSlashes(cachePath); - cmCacheManager* cachem = this->GetCacheManager(); - cmCacheManager::CacheIterator it = cachem->NewIterator(); - if(!cachem->LoadCache(cachePath)) + cmCacheManager::CacheIterator it = this->GetCacheManager()->NewIterator(); + if(!this->LoadCache(cachePath)) { std::cerr << "Error: could not load cache\n"; return 1; diff --git a/Source/cmake.h b/Source/cmake.h index c22b329..3acf4a8 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -18,11 +18,11 @@ #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" #include "cmInstalledFile.h" +#include "cmCacheManager.h" class cmGlobalGeneratorFactory; class cmGlobalGenerator; class cmLocalGenerator; -class cmCacheManager; class cmMakefile; class cmCommand; class cmVariableWatch; @@ -173,7 +173,19 @@ class cmake int Configure(); int ActualConfigure(); + ///! Break up a line like VAR:type="value" into var, type and value + static bool ParseCacheEntry(const std::string& entry, + std::string& var, + std::string& value, + cmCacheManager::CacheEntryType& type); + int LoadCache(); + bool LoadCache(const std::string& path); + bool LoadCache(const std::string& path, bool internal, + std::set& excludes, + std::set& includes); + bool SaveCache(const std::string& path); + bool DeleteCache(const std::string& path); void PreLoadCMakeFiles(); ///! Create a GlobalGenerator http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f3e57e98ce324d7afb7681647159029fb145634 commit 6f3e57e98ce324d7afb7681647159029fb145634 Author: Stephen Kelly AuthorDate: Mon Apr 6 13:32:00 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:52:25 2015 +0200 cmMakefile: Remove cache version accessors. They are only used by legacy code. Inline them there to simplify cmMakefile. diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 691d80d..987a7b1 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -51,12 +51,14 @@ void CCONV cmSetError(void *info, const char *err) unsigned int CCONV cmGetCacheMajorVersion(void *arg) { cmMakefile *mf = static_cast(arg); - return mf->GetCacheMajorVersion(); + cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager(); + return manager->GetCacheMajorVersion(); } unsigned int CCONV cmGetCacheMinorVersion(void *arg) { cmMakefile *mf = static_cast(arg); - return mf->GetCacheMinorVersion(); + cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager(); + return manager->GetCacheMinorVersion(); } unsigned int CCONV cmGetMajorVersion(void *) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7f44da2..ad4ad7c 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -174,16 +174,6 @@ void cmMakefile::Initialize() this->CheckCMP0000 = false; } -unsigned int cmMakefile::GetCacheMajorVersion() const -{ - return this->GetCacheManager()->GetCacheMajorVersion(); -} - -unsigned int cmMakefile::GetCacheMinorVersion() const -{ - return this->GetCacheManager()->GetCacheMinorVersion(); -} - cmMakefile::~cmMakefile() { cmDeleteAll(this->InstallGenerators); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 920b6b7..5209891 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -62,14 +62,6 @@ class cmMakefile class Internals; cmsys::auto_ptr Internal; public: - /** - * Return the major and minor version of the cmake that - * was used to write the currently loaded cache, note - * this method will not work before the cache is loaded. - */ - unsigned int GetCacheMajorVersion() const; - unsigned int GetCacheMinorVersion() const; - /* Check for unused variables in this scope */ void CheckForUnusedVariables() const; /* Mark a variable as used */ diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index ee1ff29..2799a9b 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -52,11 +52,13 @@ bool cmUtilitySourceCommand } else { + cmCacheManager *manager = + this->Makefile->GetCMakeInstance()->GetCacheManager(); haveCacheValue = (cacheValue && (strstr(cacheValue, "(IntDir)") == 0 || (intDir && strcmp(intDir, "$(IntDir)") == 0)) && - (this->Makefile->GetCacheMajorVersion() != 0 && - this->Makefile->GetCacheMinorVersion() != 0 )); + (manager->GetCacheMajorVersion() != 0 && + manager->GetCacheMinorVersion() != 0 )); } if(haveCacheValue) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4cf211dcbaf1efaa082d281d1ff4d3755a108389 commit 4cf211dcbaf1efaa082d281d1ff4d3755a108389 Author: Stephen Kelly AuthorDate: Mon Apr 6 12:30:21 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:52:25 2015 +0200 cmMakefile: Simplify GetDefinitions implementation. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 215ee16..7f44da2 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2501,20 +2501,20 @@ const char* cmMakefile::GetSafeDefinition(const std::string& def) const std::vector cmMakefile ::GetDefinitions(int cacheonly /* = 0 */) const { - std::set definitions; + std::vector res; if ( !cacheonly ) { - definitions = this->Internal->VarStack.top().ClosureKeys(); + std::set definitions = + this->Internal->VarStack.top().ClosureKeys(); + res.insert(res.end(), definitions.begin(), definitions.end()); } cmCacheManager::CacheIterator cit = this->GetCacheManager()->GetCacheIterator(); for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) { - definitions.insert(cit.GetName()); + res.push_back(cit.GetName()); } - - std::vector res; - res.insert(res.end(), definitions.begin(), definitions.end()); + std::sort(res.begin(), res.end()); return res; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=883042c34e6270551907b5d43f300ad3193b83a8 commit 883042c34e6270551907b5d43f300ad3193b83a8 Author: Stephen Kelly AuthorDate: Mon Apr 6 14:41:05 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 16:52:24 2015 +0200 Remove unused includes. diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index fa7eff3..b8dfe04 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -12,7 +12,6 @@ #include "cmCacheManager.h" #include "cmSystemTools.h" -#include "cmCacheManager.h" #include "cmGeneratedFileStream.h" #include "cmMakefile.h" #include "cmake.h" diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 2b999eb..6844fee 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -14,7 +14,6 @@ #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmSourceFile.h" -#include "cmCacheManager.h" #include "cmGeneratorTarget.h" #include "cmCustomCommandGenerator.h" #include "cmake.h" ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 2 + Source/CTest/cmCTestBuildAndTestHandler.cxx | 3 +- Source/CursesDialog/ccmake.cxx | 1 - Source/CursesDialog/cmCursesBoolWidget.cxx | 2 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 44 ++-- Source/CursesDialog/cmCursesCacheEntryComposite.h | 3 +- Source/CursesDialog/cmCursesDummyWidget.cxx | 2 +- Source/CursesDialog/cmCursesFilePathWidget.cxx | 2 +- Source/CursesDialog/cmCursesLongMessageForm.cxx | 1 - Source/CursesDialog/cmCursesMainForm.cxx | 169 ++++++++------ Source/CursesDialog/cmCursesMainForm.h | 2 +- Source/CursesDialog/cmCursesOptionsWidget.cxx | 2 +- Source/CursesDialog/cmCursesPathWidget.cxx | 4 +- Source/CursesDialog/cmCursesStringWidget.cxx | 2 +- Source/CursesDialog/cmCursesWidget.h | 6 +- Source/QtDialog/QCMake.cxx | 103 +++++---- Source/cmBuildCommand.cxx | 2 +- Source/cmBuildNameCommand.cxx | 4 +- Source/cmCPluginAPI.cxx | 18 +- Source/cmCTest.cxx | 4 +- Source/cmCacheManager.cxx | 112 +++------ Source/cmCacheManager.h | 111 +++++++-- Source/cmCommandArgumentParserHelper.cxx | 4 +- Source/cmConfiguration.cxx | 170 ++++++++++++++ Source/cmConfiguration.h | 52 +++++ Source/cmCoreTryCompile.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 11 +- Source/cmFindBase.cxx | 14 +- Source/cmFindLibraryCommand.cxx | 7 +- Source/cmFindPackageCommand.cxx | 2 +- Source/cmFindPathCommand.cxx | 7 +- Source/cmFindProgramCommand.cxx | 7 +- Source/cmGetFilenameComponentCommand.cxx | 8 +- Source/cmGetPropertyCommand.cxx | 8 +- Source/cmGlobalGenerator.cxx | 23 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 8 +- Source/cmGlobalXCodeGenerator.cxx | 6 +- Source/cmIncludeExternalMSProjectCommand.cxx | 2 +- Source/cmLoadCacheCommand.cxx | 8 +- Source/cmLocalVisualStudio10Generator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 3 +- Source/cmMakefile.cxx | 79 +++---- Source/cmMakefile.h | 14 +- Source/cmMarkAsAdvancedCommand.cxx | 17 +- Source/cmOptionCommand.cxx | 14 +- Source/cmProjectCommand.cxx | 6 +- Source/cmSetCommand.cxx | 15 +- Source/cmSetPropertyCommand.cxx | 21 +- Source/cmSetPropertyCommand.h | 2 +- Source/cmSiteNameCommand.cxx | 2 +- Source/cmTarget.cxx | 4 +- Source/cmTryRunCommand.cxx | 26 ++- Source/cmUtilitySourceCommand.cxx | 12 +- Source/cmVariableRequiresCommand.cxx | 8 +- Source/cmake.cxx | 240 ++++++++++++-------- Source/cmake.h | 21 +- Source/cmakemain.cxx | 32 +-- bootstrap | 1 + 59 files changed, 904 insertions(+), 556 deletions(-) create mode 100644 Source/cmConfiguration.cxx create mode 100644 Source/cmConfiguration.h hooks/post-receive -- CMake From steveire at gmail.com Mon Apr 6 12:00:21 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 6 Apr 2015 12:00:21 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1540-gaa9c5b8 Message-ID: <20150406160021.B76BBAD4E3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via aa9c5b862759f694dff2afb3e45cfe74e8c6d034 (commit) via b7d13b7457295d40417fe18b72b733be510c75bc (commit) via ca6841ad0f2a55988e2eca91c2599a9ea6ae8f18 (commit) via d882f4abc3636aeb9d6119b51c1fb205d4fd1d7c (commit) via 7e0606cd92f1796fcfa2737887a66d45f7bd515f (commit) via 9410e24a4ad3a21b2c27d057798f723e88d14d45 (commit) via 7b7ae3b1a1d1c664eeef48392759883aa4040657 (commit) via 228c629c18d6b5e820376ac87babca0771205b6f (commit) via 2e50f5e7d9269ee1e2e3587a7a4b806df48510d3 (commit) via e62243674e7ce9a162b47567ef5893fae44ed153 (commit) via 9ada4c04335fc070f3f670df72bd9943eabec464 (commit) via 1fe7f24c2b62734d501427750586d8063149ea58 (commit) via 08c642c6ae47fd075fe1060fc0e28d8a24cc3c00 (commit) via cec8f97e5717fac279d310f3f0b9e849a0e59706 (commit) from 9f0e9467f3cf7d2f72388512e477e7ddcaebd2ca (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa9c5b862759f694dff2afb3e45cfe74e8c6d034 commit aa9c5b862759f694dff2afb3e45cfe74e8c6d034 Merge: 9f0e946 b7d13b7 Author: Stephen Kelly AuthorDate: Mon Apr 6 12:00:18 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 6 12:00:18 2015 -0400 Merge topic 'introduce-cmConfiguration' into next b7d13b74 cmConfiguration: Move CacheEntryType enum from cmCacheManager. ca6841ad cmMakefile: Remove unused CacheManager accessor. d882f4ab Port to cmConfiguration. 7e0606cd Introduce cmConfiguration class. 9410e24a cmCacheManager: Port consumers to non-iterator API. 7b7ae3b1 Port QtDialog to non-iterator cache API. 228c629c Port CursesDialog to non-iterator cache API. 2e50f5e7 cmMakefile: Port away from CacheEntry.Initialized. e6224367 cmCacheManager: Add non-iterator-based API. 9ada4c04 cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue. 1fe7f24c Add API for cache loading, deleting and saving to the cmake class. 08c642c6 cmMakefile: Remove cache version accessors. cec8f97e cmMakefile: Simplify GetDefinitions implementation. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b7d13b7457295d40417fe18b72b733be510c75bc commit b7d13b7457295d40417fe18b72b733be510c75bc Author: Stephen Kelly AuthorDate: Mon Apr 6 13:40:24 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:56 2015 +0200 cmConfiguration: Move CacheEntryType enum from cmCacheManager. diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx index fd15b99..d6329c5 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.cxx +++ b/Source/CursesDialog/cmCursesBoolWidget.cxx @@ -16,7 +16,7 @@ cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::BOOL; + this->Type = cmConfiguration::BOOL; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index f2b5895..e388409 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -55,7 +55,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( assert(value); switch (cm->GetConfiguration()->GetCacheEntryType(key)) { - case cmCacheManager::BOOL: + case cmConfiguration::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); if (cmSystemTools::IsOn(value)) { @@ -66,15 +66,15 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( static_cast(this->Entry)->SetValueAsBool(false); } break; - case cmCacheManager::PATH: + case cmConfiguration::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); static_cast(this->Entry)->SetString(value); break; - case cmCacheManager::FILEPATH: + case cmConfiguration::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); static_cast(this->Entry)->SetString(value); break; - case cmCacheManager::STRING: + case cmConfiguration::STRING: { const char* stringsProp = cm->GetConfiguration() ->GetCacheEntryProperty(key, "STRINGS"); @@ -99,7 +99,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } break; } - case cmCacheManager::UNINITIALIZED: + case cmConfiguration::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", key.c_str()); break; diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index dc4ee4af..f280897 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -12,7 +12,6 @@ #ifndef cmCursesCacheEntryComposite_h #define cmCursesCacheEntryComposite_h -#include "../cmCacheManager.h" #include "cmCursesLabelWidget.h" class cmCursesCacheEntryComposite diff --git a/Source/CursesDialog/cmCursesDummyWidget.cxx b/Source/CursesDialog/cmCursesDummyWidget.cxx index 60086a5..0c5c09d 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.cxx +++ b/Source/CursesDialog/cmCursesDummyWidget.cxx @@ -15,7 +15,7 @@ cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::INTERNAL; + this->Type = cmConfiguration::INTERNAL; } diff --git a/Source/CursesDialog/cmCursesFilePathWidget.cxx b/Source/CursesDialog/cmCursesFilePathWidget.cxx index 01db014..fb04b44 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.cxx +++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx @@ -15,6 +15,6 @@ cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, int left, int top) : cmCursesPathWidget(width, height, left, top) { - this->Type = cmCacheManager::FILEPATH; + this->Type = cmConfiguration::FILEPATH; } diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 6df8e6d..f97ea36 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmVersion.h" #include "../cmake.h" @@ -118,11 +117,11 @@ void cmCursesMainForm::InitializeUI() for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() + cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); - if (t != cmCacheManager::INTERNAL && - t != cmCacheManager::STATIC && - t != cmCacheManager::UNINITIALIZED) + if (t != cmConfiguration::INTERNAL && + t != cmConfiguration::STATIC && + t != cmConfiguration::UNINITIALIZED) { ++count; } @@ -148,11 +147,11 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() + cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); - if (t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED ) + if (t == cmConfiguration::INTERNAL || + t == cmConfiguration::STATIC || + t == cmConfiguration::UNINITIALIZED ) { continue; } @@ -172,11 +171,11 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() + cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); - if (t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED ) + if (t == cmConfiguration::INTERNAL || + t == cmConfiguration::STATIC || + t == cmConfiguration::UNINITIALIZED ) { continue; } @@ -294,9 +293,9 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) cmCursesWidget* cw = reinterpret_cast (field_userptr(currentField)); // If in edit mode, get out of it - if ( cw->GetType() == cmCacheManager::STRING || - cw->GetType() == cmCacheManager::PATH || - cw->GetType() == cmCacheManager::FILEPATH ) + if ( cw->GetType() == cmConfiguration::STRING || + cw->GetType() == cmConfiguration::PATH || + cw->GetType() == cmConfiguration::FILEPATH ) { cmCursesStringWidget* sw = static_cast(cw); sw->SetInEdit(false); @@ -823,7 +822,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - cmCacheManager::CacheEntryType t = + cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(cacheKey); this->FixValue(t, oldValue, fixedOldValue); @@ -841,15 +840,15 @@ void cmCursesMainForm::FillCacheManagerFromUI() } } -void cmCursesMainForm::FixValue(cmCacheManager::CacheEntryType type, +void cmCursesMainForm::FixValue(cmConfiguration::CacheEntryType type, const std::string& in, std::string& out) const { out = in.substr(0,in.find_last_not_of(" ")+1); - if(type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH) + if(type == cmConfiguration::PATH || type == cmConfiguration::FILEPATH) { cmSystemTools::ConvertToUnixSlashes(out); } - if(type == cmCacheManager::BOOL) + if(type == cmConfiguration::BOOL) { if(cmSystemTools::IsOff(out.c_str())) { diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 6455252..d410a26 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -113,7 +113,7 @@ protected: // cache. void FillCacheManagerFromUI(); // Fix formatting of values to a consistent form. - void FixValue(cmCacheManager::CacheEntryType type, + void FixValue(cmConfiguration::CacheEntryType type, const std::string& in, std::string& out) const; // Re-post the existing fields. Used to toggle between // normal and advanced modes. Render() should be called diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx index 2f4b59e..83b8b79 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.cxx +++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx @@ -21,7 +21,7 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::BOOL; // this is a bit of a hack + this->Type = cmConfiguration::BOOL; // this is a bit of a hack // there is no option type, and string type causes ccmake to cast // the widget into a string widget at some point. BOOL is safe for // now. diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx index 89e2238..c1d1c7c 100644 --- a/Source/CursesDialog/cmCursesPathWidget.cxx +++ b/Source/CursesDialog/cmCursesPathWidget.cxx @@ -18,7 +18,7 @@ cmCursesPathWidget::cmCursesPathWidget(int width, int height, int left, int top) : cmCursesStringWidget(width, height, left, top) { - this->Type = cmCacheManager::PATH; + this->Type = cmConfiguration::PATH; this->Cycle = false; this->CurrentIndex = 0; } @@ -59,7 +59,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w) } std::vector dirs; - cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmCacheManager::PATH?-1:0)); + cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmConfiguration::PATH?-1:0)); if ( this->CurrentIndex < dirs.size() ) { cstr = dirs[this->CurrentIndex]; diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index d25022d..ce7df27 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -22,7 +22,7 @@ cmCursesStringWidget::cmCursesStringWidget(int width, int height, cmCursesWidget(width, height, left, top) { this->InEdit = false; - this->Type = cmCacheManager::STRING; + this->Type = cmConfiguration::STRING; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h index 7d82864..67b6876 100644 --- a/Source/CursesDialog/cmCursesWidget.h +++ b/Source/CursesDialog/cmCursesWidget.h @@ -12,7 +12,7 @@ #ifndef cmCursesWidget_h #define cmCursesWidget_h -#include "../cmCacheManager.h" +#include "../cmConfiguration.h" #include "cmCursesStandardIncludes.h" class cmCursesMainForm; @@ -46,7 +46,7 @@ public: /** * Get the type of the widget (STRING, PATH etc...) */ - cmCacheManager::CacheEntryType GetType() + cmConfiguration::CacheEntryType GetType() { return this->Type; } /** @@ -77,7 +77,7 @@ protected: cmCursesWidget(const cmCursesWidget& from); void operator=(const cmCursesWidget&); - cmCacheManager::CacheEntryType Type; + cmConfiguration::CacheEntryType Type; std::string Value; FIELD* Field; // The page in the main form this widget is in diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 4c9eb01..97e68e8 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -200,9 +200,9 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = config->GetCacheEntryType(*it); - if(t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC) + cmConfiguration::CacheEntryType t = config->GetCacheEntryType(*it); + if(t == cmConfiguration::INTERNAL || + t == cmConfiguration::STATIC) { continue; } @@ -249,28 +249,28 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toBool() ? "ON" : "OFF", s.Help.toLocal8Bit().data(), - cmCacheManager::BOOL); + cmConfiguration::BOOL); } else if(s.Type == QCMakeProperty::STRING) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::STRING); + cmConfiguration::STRING); } else if(s.Type == QCMakeProperty::PATH) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::PATH); + cmConfiguration::PATH); } else if(s.Type == QCMakeProperty::FILEPATH) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); } } @@ -286,10 +286,10 @@ QCMakePropertyList QCMake::properties() const for (std::vector::const_iterator i = cacheKeys.begin(); i != cacheKeys.end(); ++i) { - cmCacheManager::CacheEntryType t = config->GetCacheEntryType(*i); - if(t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED) + cmConfiguration::CacheEntryType t = config->GetCacheEntryType(*i); + if(t == cmConfiguration::INTERNAL || + t == cmConfiguration::STATIC || + t == cmConfiguration::UNINITIALIZED) { continue; } @@ -302,20 +302,20 @@ QCMakePropertyList QCMake::properties() const config->GetCacheEntryProperty(*i, "HELPSTRING")); prop.Value = QString::fromLocal8Bit(cachedValue); prop.Advanced = config->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); - if(t == cmCacheManager::BOOL) + if(t == cmConfiguration::BOOL) { prop.Type = QCMakeProperty::BOOL; prop.Value = cmSystemTools::IsOn(cachedValue); } - else if(t == cmCacheManager::PATH) + else if(t == cmConfiguration::PATH) { prop.Type = QCMakeProperty::PATH; } - else if(t == cmCacheManager::FILEPATH) + else if(t == cmConfiguration::FILEPATH) { prop.Type = QCMakeProperty::FILEPATH; } - else if(t == cmCacheManager::STRING) + else if(t == cmConfiguration::STRING) { prop.Type = QCMakeProperty::STRING; const char* stringsProperty = diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 5d32437..c83c41f 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -147,6 +147,6 @@ bool cmBuildCommand makecommand.c_str(), "Command used to build entire project " "from the command line.", - cmCacheManager::STRING); + cmConfiguration::STRING); return true; } diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 171ed0f..257d62e 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -39,7 +39,7 @@ bool cmBuildNameCommand this->Makefile->AddCacheDefinition(args[0], cv.c_str(), "Name of build.", - cmCacheManager::STRING); + cmConfiguration::STRING); } return true; } @@ -74,7 +74,7 @@ bool cmBuildNameCommand this->Makefile->AddCacheDefinition(args[0], buildname.c_str(), "Name of build.", - cmCacheManager::STRING); + cmConfiguration::STRING); return true; } diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 987a7b1..d27d4f5 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -87,27 +87,27 @@ void CCONV cmAddCacheDefinition(void *arg, const char* name, { case CM_CACHE_BOOL: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::BOOL); + cmConfiguration::BOOL); break; case CM_CACHE_PATH: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::PATH); + cmConfiguration::PATH); break; case CM_CACHE_FILEPATH: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); break; case CM_CACHE_STRING: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::STRING); + cmConfiguration::STRING); break; case CM_CACHE_INTERNAL: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); break; case CM_CACHE_STATIC: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::STATIC); + cmConfiguration::STATIC); break; } } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 1db057b..364f767 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2279,7 +2279,7 @@ bool cmCTest::AddVariableDefinition(const std::string &arg) { std::string name; std::string value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmConfiguration::CacheEntryType type = cmConfiguration::UNINITIALIZED; if (cmake::ParseCacheEntry(arg, name, value, type)) { diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index f8f2dbd..4734562 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -23,17 +23,6 @@ #include #include -const char* cmCacheManagerTypes[] = -{ "BOOL", - "PATH", - "FILEPATH", - "STRING", - "INTERNAL", - "STATIC", - "UNINITIALIZED", - 0 -}; - cmCacheManager::cmCacheManager(cmake* cm) { this->CacheMajorVersion = 0; @@ -41,41 +30,6 @@ cmCacheManager::cmCacheManager(cmake* cm) this->CMakeInstance = cm; } -const char* cmCacheManager::TypeToString(cmCacheManager::CacheEntryType type) -{ - if ( type > 6 ) - { - return cmCacheManagerTypes[6]; - } - return cmCacheManagerTypes[type]; -} - -cmCacheManager::CacheEntryType cmCacheManager::StringToType(const char* s) -{ - int i = 0; - while(cmCacheManagerTypes[i]) - { - if(strcmp(s, cmCacheManagerTypes[i]) == 0) - { - return static_cast(i); - } - ++i; - } - return STRING; -} - -bool cmCacheManager::IsType(const char* s) -{ - for(int i=0; cmCacheManagerTypes[i]; ++i) - { - if(strcmp(s, cmCacheManagerTypes[i]) == 0) - { - return true; - } - } - return false; -} - bool cmCacheManager::LoadCache(const std::string& path) { std::set emptySet; @@ -123,7 +77,7 @@ static bool ParseEntryWithoutType(const std::string& entry, bool cmCacheManager::ParseEntry(const std::string& entry, std::string& var, std::string& value, - CacheEntryType& type) + cmConfiguration::CacheEntryType& type) { // input line is: key:type=value static cmsys::RegularExpression reg( @@ -135,14 +89,14 @@ bool cmCacheManager::ParseEntry(const std::string& entry, if(regQuoted.find(entry)) { var = regQuoted.match(1); - type = cmCacheManager::StringToType(regQuoted.match(2).c_str()); + type = cmConfiguration::StringToCacheEntryType(regQuoted.match(2).c_str()); value = regQuoted.match(3); flag = true; } else if (reg.find(entry)) { var = reg.match(1); - type = cmCacheManager::StringToType(reg.match(2).c_str()); + type = cmConfiguration::StringToCacheEntryType(reg.match(2).c_str()); value = reg.match(3); flag = true; } @@ -251,7 +205,7 @@ bool cmCacheManager::LoadCache(const std::string& path, // If the entry is not internal to the cache being loaded // or if it is in the list of internal entries to be // imported, load it. - if ( internal || (e.Type != INTERNAL) || + if ( internal || (e.Type != cmConfiguration::INTERNAL) || (includes.find(entryKey) != includes.end()) ) { // If we are loading the cache from another project, @@ -259,7 +213,7 @@ bool cmCacheManager::LoadCache(const std::string& path, // not visible in the gui if (!internal) { - e.Type = INTERNAL; + e.Type = cmConfiguration::INTERNAL; helpString = "DO NOT EDIT, "; helpString += entryKey; helpString += " loaded from external file. " @@ -307,10 +261,10 @@ bool cmCacheManager::LoadCache(const std::string& path, // Set as version 0.0 this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", "0", "Minor version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmConfiguration::INTERNAL); this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", "0", "Major version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmConfiguration::INTERNAL); } // check to make sure the cache directory has not @@ -352,7 +306,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, CacheEntry& e) { // All property entries are internal. - if(e.Type != cmCacheManager::INTERNAL) + if(e.Type != cmConfiguration::INTERNAL) { return false; } @@ -371,7 +325,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, // Create an entry and store the property. CacheEntry& ne = this->Cache[key]; ne.Properties.SetCMakeInstance(this->CMakeInstance); - ne.Type = cmCacheManager::UNINITIALIZED; + ne.Type = cmConfiguration::UNINITIALIZED; ne.SetProperty(*p, e.Value.c_str()); } else @@ -428,15 +382,15 @@ bool cmCacheManager::SaveCache(const std::string& path) sprintf(temp, "%d", cmVersion::GetMinorVersion()); this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp, "Minor version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmConfiguration::INTERNAL); sprintf(temp, "%d", cmVersion::GetMajorVersion()); this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", temp, "Major version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmConfiguration::INTERNAL); sprintf(temp, "%d", cmVersion::GetPatchVersion()); this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION", temp, "Patch version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmConfiguration::INTERNAL); // Let us store the current working directory so that if somebody // Copies it, he will not be surprised @@ -451,7 +405,7 @@ bool cmCacheManager::SaveCache(const std::string& path) cmSystemTools::ConvertToUnixSlashes(currentcwd); this->AddCacheEntry("CMAKE_CACHEFILE_DIR", currentcwd.c_str(), "This is the directory where this CMakeCache.txt" - " was created", cmCacheManager::INTERNAL); + " was created", cmConfiguration::INTERNAL); fout << "# This is the CMakeCache file.\n" << "# For build in directory: " << currentcwd << "\n"; @@ -485,7 +439,7 @@ bool cmCacheManager::SaveCache(const std::string& path) this->Cache.begin(); i != this->Cache.end(); ++i) { const CacheEntry& ce = (*i).second; - CacheEntryType t = ce.Type; + cmConfiguration::CacheEntryType t = ce.Type; if(!ce.Initialized) { /* @@ -494,7 +448,7 @@ bool cmCacheManager::SaveCache(const std::string& path) "\" is uninitialized"); */ } - else if(t != INTERNAL) + else if(t != cmConfiguration::INTERNAL) { // Format is key:type=value if(const char* help = ce.GetProperty("HELPSTRING")) @@ -506,7 +460,7 @@ bool cmCacheManager::SaveCache(const std::string& path) cmCacheManager::OutputHelpString(fout, "Missing description"); } this->OutputKey(fout, i->first); - fout << ":" << cmCacheManagerTypes[t] << "="; + fout << ":" << cmConfiguration::CacheEntryTypeToString(t) << "="; this->OutputValue(fout, ce.Value); fout << "\n\n"; } @@ -526,9 +480,9 @@ bool cmCacheManager::SaveCache(const std::string& path) continue; } - CacheEntryType t = i.GetType(); + cmConfiguration::CacheEntryType t = i.GetType(); this->WritePropertyEntries(fout, i); - if(t == cmCacheManager::INTERNAL) + if(t == cmConfiguration::INTERNAL) { // Format is key:type=value if(const char* help = i.GetProperty("HELPSTRING")) @@ -536,7 +490,7 @@ bool cmCacheManager::SaveCache(const std::string& path) this->OutputHelpString(fout, help); } this->OutputKey(fout, i.GetName()); - fout << ":" << cmCacheManagerTypes[t] << "="; + fout << ":" << cmConfiguration::CacheEntryTypeToString(t) << "="; this->OutputValue(fout, i.GetValue()); fout << "\n"; } @@ -678,7 +632,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const for(std::map::const_iterator i = this->Cache.begin(); i != this->Cache.end(); ++i) { - if((*i).second.Type != INTERNAL) + if((*i).second.Type != cmConfiguration::INTERNAL) { out << (*i).first << " = " << (*i).second.Value << std::endl; @@ -694,7 +648,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const void cmCacheManager::AddCacheEntry(const std::string& key, const char* value, const char* helpString, - CacheEntryType type) + cmConfiguration::CacheEntryType type) { CacheEntry& e = this->Cache[key]; e.Properties.SetCMakeInstance(this->CMakeInstance); @@ -709,7 +663,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key, } e.Type = type; // make sure we only use unix style paths - if(type == FILEPATH || type == PATH) + if(type == cmConfiguration::FILEPATH || type == cmConfiguration::PATH) { if(e.Value.find(';') != e.Value.npos) { @@ -790,7 +744,7 @@ cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const { if(prop == "TYPE") { - return cmCacheManagerTypes[this->Type]; + return cmConfiguration::CacheEntryTypeToString(this->Type); } else if(prop == "VALUE") { @@ -807,7 +761,7 @@ void cmCacheManager::CacheEntry::SetProperty(const std::string& prop, { if(prop == "TYPE") { - this->Type = cmCacheManager::StringToType(value? value : "STRING"); + this->Type = cmConfiguration::StringToCacheEntryType(value? value : "STRING"); } else if(prop == "VALUE") { @@ -826,7 +780,7 @@ void cmCacheManager::CacheEntry::AppendProperty(const std::string& prop, { if(prop == "TYPE") { - this->Type = cmCacheManager::StringToType(value? value : "STRING"); + this->Type = cmConfiguration::StringToCacheEntryType(value? value : "STRING"); } else if(prop == "VALUE") { diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 36848c4..927651f 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -14,6 +14,8 @@ #include "cmStandardIncludes.h" #include "cmPropertyMap.h" +#include "cmConfiguration.h" + class cmMakefile; class cmMarkAsAdvancedCommand; class cmake; @@ -30,21 +32,22 @@ public: cmCacheManager(cmake* cm); class CacheIterator; friend class cmCacheManager::CacheIterator; - enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, - UNINITIALIZED }; private: struct CacheEntry { std::string Value; - CacheEntryType Type; + cmConfiguration::CacheEntryType Type; cmPropertyMap Properties; const char* GetProperty(const std::string&) const; void SetProperty(const std::string& property, const char* value); void AppendProperty(const std::string& property, const char* value, bool asString=false); bool Initialized; - CacheEntry() : Value(""), Type(UNINITIALIZED), Initialized(false) + CacheEntry() + : Value(""), + Type(cmConfiguration::UNINITIALIZED), + Initialized(false) {} }; @@ -68,8 +71,10 @@ public: std::string GetValue() const { return this->GetEntry().Value; } bool GetValueAsBool() const; void SetValue(const char*); - CacheEntryType GetType() const { return this->GetEntry().Type; } - void SetType(CacheEntryType ty) { this->GetEntry().Type = ty; } + cmConfiguration::CacheEntryType GetType() const + { return this->GetEntry().Type; } + void SetType(cmConfiguration::CacheEntryType ty) + { this->GetEntry().Type = ty; } bool Initialized() { return this->GetEntry().Initialized; } cmCacheManager &Container; std::map::iterator Position; @@ -94,17 +99,6 @@ public: return CacheIterator(*this); } - /** - * Types for the cache entries. These are useful as - * hints for a cache editor program. Path should bring - * up a file chooser, BOOL a check box, and STRING a - * text entry box, FILEPATH is a full path to a file which - * can be different than just a path input - */ - static CacheEntryType StringToType(const char*); - static const char* TypeToString(CacheEntryType); - static bool IsType(const char*); - ///! Load a cache for given makefile. Loads from path/CMakeCache.txt. bool LoadCache(const std::string& path); bool LoadCache(const std::string& path, bool internal, @@ -134,7 +128,7 @@ public: static bool ParseEntry(const std::string& entry, std::string& var, std::string& value, - CacheEntryType& type); + cmConfiguration::CacheEntryType& type); ///! Get a value from the cache given a key const char* GetInitializedCacheValue(const std::string& key) const; @@ -155,7 +149,7 @@ public: return this->GetCacheIterator(key.c_str()).GetProperty(propName); } - CacheEntryType GetCacheEntryType(std::string const& key) + cmConfiguration::CacheEntryType GetCacheEntryType(std::string const& key) { return this->GetCacheIterator(key.c_str()).GetType(); } @@ -223,7 +217,8 @@ public: protected: ///! Add an entry into the cache void AddCacheEntry(const std::string& key, const char* value, - const char* helpString, CacheEntryType type); + const char* helpString, + cmConfiguration::CacheEntryType type); ///! Get a cache entry object for a key CacheEntry *GetCacheEntry(const std::string& key); diff --git a/Source/cmConfiguration.cxx b/Source/cmConfiguration.cxx index 7e89c09..209cdd9 100644 --- a/Source/cmConfiguration.cxx +++ b/Source/cmConfiguration.cxx @@ -2,26 +2,59 @@ #include "cmConfiguration.h" #include "cmake.h" +#include "cmCacheManager.h" cmConfiguration::cmConfiguration(cmake* cm) : CMakeInstance(cm) { } -cmCacheManager::CacheEntryType -cmConfiguration::StringToCacheEntryType(const char* s) + +const char* cmCacheEntryTypes[] = +{ "BOOL", + "PATH", + "FILEPATH", + "STRING", + "INTERNAL", + "STATIC", + "UNINITIALIZED", + 0 +}; + +const char* +cmConfiguration::CacheEntryTypeToString(cmConfiguration::CacheEntryType type) { - return cmCacheManager::StringToType(s); + if ( type > 6 ) + { + return cmCacheEntryTypes[6]; + } + return cmCacheEntryTypes[type]; } -const char* -cmConfiguration::CacheEntryTypeToString(cmCacheManager::CacheEntryType t) +cmConfiguration::CacheEntryType +cmConfiguration::StringToCacheEntryType(const char* s) { - return cmCacheManager::TypeToString(t); + int i = 0; + while(cmCacheEntryTypes[i]) + { + if(strcmp(s, cmCacheEntryTypes[i]) == 0) + { + return static_cast(i); + } + ++i; + } + return STRING; } bool cmConfiguration::IsCacheEntryType(std::string const& key) { - return cmCacheManager::IsType(key.c_str()); + for(int i=0; cmCacheEntryTypes[i]; ++i) + { + if(strcmp(key.c_str(), cmCacheEntryTypes[i]) == 0) + { + return true; + } + } + return false; } std::vector cmConfiguration::GetCacheEntryKeys() const @@ -54,7 +87,7 @@ cmConfiguration::GetInitializedCacheValue(std::string const& key) const return this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue(key); } -cmCacheManager::CacheEntryType +cmConfiguration::CacheEntryType cmConfiguration::GetCacheEntryType(std::string const& key) const { cmCacheManager::CacheIterator it = @@ -107,7 +140,7 @@ bool cmConfiguration::GetCacheEntryPropertyAsBool(std::string const& key, void cmConfiguration::AddCacheEntry(const std::string& key, const char* value, const char* helpString, - cmCacheManager::CacheEntryType type) + cmConfiguration::CacheEntryType type) { this->CMakeInstance->GetCacheManager()->AddCacheEntry(key, value, helpString, type); diff --git a/Source/cmConfiguration.h b/Source/cmConfiguration.h index d8f5916..72149fb 100644 --- a/Source/cmConfiguration.h +++ b/Source/cmConfiguration.h @@ -2,7 +2,7 @@ #ifndef cmConfiguration_h #define cmConfiguration_h -#include "cmCacheManager.h" +#include "cmStandardIncludes.h" class cmake; @@ -11,21 +11,21 @@ class cmConfiguration public: cmConfiguration(cmake* cm); - static cmCacheManager::CacheEntryType StringToCacheEntryType(const char*); - static const char* CacheEntryTypeToString(cmCacheManager::CacheEntryType); + enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, + UNINITIALIZED }; + static CacheEntryType StringToCacheEntryType(const char*); + static const char* CacheEntryTypeToString(CacheEntryType); static bool IsCacheEntryType(std::string const& key); std::vector GetCacheEntryKeys() const; const char* GetCacheEntryValue(std::string const& key) const; const char* GetInitializedCacheValue(std::string const& key) const; - cmCacheManager::CacheEntryType - GetCacheEntryType(std::string const& key) const; + CacheEntryType GetCacheEntryType(std::string const& key) const; void SetCacheEntryValue(std::string const& key, std::string const& value); void SetCacheValue(std::string const& key, std::string const& value); void AddCacheEntry(const std::string& key, const char* value, - const char* helpString, - cmCacheManager::CacheEntryType type); + const char* helpString, CacheEntryType type); void RemoveCacheEntry(std::string const& key); void SetCacheEntryProperty(std::string const& key, diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 59efa52..7217ce6 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmCoreTryCompile.h" #include "cmake.h" -#include "cmCacheManager.h" #include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmAlgorithms.h" @@ -527,7 +526,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) this->Makefile->AddCacheDefinition(argv[0], (res == 0 ? "TRUE" : "FALSE"), "Result of TRY_COMPILE", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); if (!outputVariable.empty()) { diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 7e53be2..63de734 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -222,7 +222,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, // in the cache valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), - cacheEntryName.c_str(), cmCacheManager::STRING, + cacheEntryName.c_str(), cmConfiguration::STRING, true); mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } @@ -243,7 +243,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, { valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), - cacheEntryName.c_str(), cmCacheManager::STRING, + cacheEntryName.c_str(), cmConfiguration::STRING, true); mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index f13ac1e..7cc0cd2 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -378,7 +378,7 @@ bool cmFindBase::CheckForVariableInCache() // original value. Tell the subclass implementations to do // this. if(cached && config->GetCacheEntryType(this->VariableName) - == cmCacheManager::UNINITIALIZED) + == cmConfiguration::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; } diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index c499f61..649d00b 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindLibraryCommand.h" -#include "cmCacheManager.h" #include #include @@ -39,7 +38,7 @@ bool cmFindLibraryCommand { this->Makefile->AddCacheDefinition(this->VariableName, "", this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); } return true; } @@ -72,14 +71,14 @@ bool cmFindLibraryCommand this->Makefile->AddCacheDefinition(this->VariableName, library.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); return true; } std::string notfound = this->VariableName + "-NOTFOUND"; this->Makefile->AddCacheDefinition(this->VariableName, notfound.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); return true; } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 4d7fd60..6336ee4 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -947,7 +947,7 @@ bool cmFindPackageCommand::FindConfig() // We force the value since we do not get here if it was already set. this->Makefile->AddCacheDefinition(this->Variable, init.c_str(), help.c_str(), - cmCacheManager::PATH, true); + cmConfiguration::PATH, true); return found; } diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 49fbf45..4317076 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindPathCommand.h" -#include "cmCacheManager.h" #include @@ -41,7 +40,7 @@ bool cmFindPathCommand this->VariableName, "", this->VariableDocumentation.c_str(), (this->IncludeFileInPath ? - cmCacheManager::FILEPATH :cmCacheManager::PATH) + cmConfiguration::FILEPATH :cmConfiguration::PATH) ); } return true; @@ -54,7 +53,7 @@ bool cmFindPathCommand (this->VariableName, result.c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? - cmCacheManager::FILEPATH :cmCacheManager::PATH); + cmConfiguration::FILEPATH :cmConfiguration::PATH); return true; } this->Makefile->AddCacheDefinition @@ -62,7 +61,7 @@ bool cmFindPathCommand (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? - cmCacheManager::FILEPATH :cmCacheManager::PATH); + cmConfiguration::FILEPATH :cmConfiguration::PATH); return true; } diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 4ee419c..75fe29b 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindProgramCommand.h" -#include "cmCacheManager.h" #include #if defined(__APPLE__) @@ -37,7 +36,7 @@ bool cmFindProgramCommand { this->Makefile->AddCacheDefinition(this->VariableName, "", this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); } return true; } @@ -49,14 +48,14 @@ bool cmFindProgramCommand this->Makefile->AddCacheDefinition(this->VariableName, result.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); return true; } this->Makefile->AddCacheDefinition(this->VariableName, (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); return true; } diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 9aceb39..979e756 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -117,13 +117,13 @@ bool cmGetFilenameComponentCommand { this->Makefile->AddCacheDefinition (storeArgs, programArgs.c_str(), - "", args[2] == "PATH" ? cmCacheManager::FILEPATH - : cmCacheManager::STRING); + "", args[2] == "PATH" ? cmConfiguration::FILEPATH + : cmConfiguration::STRING); } this->Makefile->AddCacheDefinition (args[0], result.c_str(), "", - args[2] == "PATH" ? cmCacheManager::FILEPATH - : cmCacheManager::STRING); + args[2] == "PATH" ? cmConfiguration::FILEPATH + : cmConfiguration::STRING); } else { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 1a0b20c..a9c73a7 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -311,7 +311,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) makeProgram += saveFile; mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", makeProgram.c_str(), "make program", - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); } } @@ -1116,7 +1116,7 @@ void cmGlobalGenerator::Configure() sprintf(num,"%d",static_cast(this->LocalGenerators.size())); this->GetCMakeInstance()->AddCacheEntry ("CMAKE_NUMBER_OF_LOCAL_GENERATORS", num, - "number of local generators", cmCacheManager::INTERNAL); + "number of local generators", cmConfiguration::INTERNAL); // check for link libraries and include directories containing "NOTFOUND" // and for infinite loops @@ -1894,7 +1894,7 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen, gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM"); this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make, "make program", - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); // copy the enabled languages this->LanguageEnabled = gen->LanguageEnabled; this->LanguagesReady = gen->LanguagesReady; diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 7648813..d36a6fc 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -97,7 +97,7 @@ std::string cmGlobalUnixMakefileGenerator3::GetEditCacheCommand() const { cm->AddCacheEntry ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(), - "Path to cache edit program executable.", cmCacheManager::INTERNAL); + "Path to cache edit program executable.", cmConfiguration::INTERNAL); } } const char* edit_cmd = cm->GetCacheDefinition("CMAKE_EDIT_COMMAND"); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 0e0e63a..2108715 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -89,7 +89,7 @@ void cmGlobalVisualStudio7Generator "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmConfiguration::STRING); } // Create list of configurations requested by user's cache, if any. @@ -109,7 +109,7 @@ void cmGlobalVisualStudio7Generator mf->AddCacheDefinition ("CMAKE_MSVCIDE_RUN_PATH", extraPath, "Saved environment variable CMAKE_MSVCIDE_RUN_PATH", - cmCacheManager::STATIC); + cmConfiguration::STATIC); } } @@ -335,7 +335,7 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmConfiguration::STRING); } void cmGlobalVisualStudio7Generator::Generate() @@ -970,7 +970,7 @@ void cmGlobalVisualStudio7Generator::CreateGUID(const std::string& name) ret = cmSystemTools::UpperCase(ret); this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), ret.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } std::vector *cmGlobalVisualStudio7Generator::GetConfigurations() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0561a05..33349d2 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -285,7 +285,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vectorconst& "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmConfiguration::STRING); } } mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); @@ -2754,7 +2754,7 @@ std::string cmGlobalXCodeGenerator::GetOrCreateId(const std::string& name, } this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), - id.c_str(), "Stored Xcode object GUID", cmCacheManager::INTERNAL); + id.c_str(), "Stored Xcode object GUID", cmConfiguration::INTERNAL); return id; } diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index d40d8fe..a8b8c2e 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -73,7 +73,7 @@ bool cmIncludeExternalMSProjectCommand std::string guidVariable = utility_name + "_GUID_CMAKE"; this->Makefile->GetCMakeInstance()->AddCacheEntry( guidVariable.c_str(), customGuid.c_str(), - "Stored GUID", cmCacheManager::INTERNAL); + "Stored GUID", cmConfiguration::INTERNAL); } // Create a target instance for this utility. diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index e2ae901..256eb31 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -172,7 +172,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) // Check one line of the cache file. std::string var; std::string value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmConfiguration::CacheEntryType type = cmConfiguration::UNINITIALIZED; if(cmake::ParseCacheEntry(line, var, value, type)) { // Found a real entry. See if this one was requested. diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index aa70ab9..22abb79 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -118,7 +118,7 @@ void cmLocalVisualStudio10Generator AddCacheEntry(guidStoreName.c_str(), parser.GUID.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index c4abeb2..2bbaab1 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -16,7 +16,6 @@ #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmSourceFile.h" -#include "cmCacheManager.h" #include "cmGeneratorTarget.h" #include "cmCustomCommandGenerator.h" #include "cmake.h" @@ -2331,7 +2330,7 @@ void cmLocalVisualStudio7Generator::ReadAndStoreExternalGUID( AddCacheEntry(guidStoreName.c_str(), parser.GUID.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6d57cc5..941aaf1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -18,7 +18,6 @@ #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmCommands.h" -#include "cmCacheManager.h" #include "cmConfiguration.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" @@ -1806,7 +1805,7 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value) void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmCacheManager::CacheEntryType type, + cmConfiguration::CacheEntryType type, bool force) { bool haveVal = value ? true : false; @@ -1815,7 +1814,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, this->GetConfiguration()->GetInitializedCacheValue(name); if(existingValue && (this->GetConfiguration()->GetCacheEntryType(name) - == cmCacheManager::UNINITIALIZED)) + == cmConfiguration::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in @@ -1824,7 +1823,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, val = existingValue; haveVal = true; } - if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) + if ( type == cmConfiguration::PATH || type == cmConfiguration::FILEPATH ) { std::vector::size_type cc; std::vector files; @@ -3617,7 +3616,7 @@ int cmMakefile::TryCompile(const std::string& srcdir, // Add this before the user-provided CMake arguments in case // one of the arguments is -DCMAKE_BUILD_TYPE=... cm.AddCacheEntry("CMAKE_BUILD_TYPE", config, - "Build configuration", cmCacheManager::STRING); + "Build configuration", cmConfiguration::STRING); } } // if cmake args were provided then pass them in @@ -3656,12 +3655,12 @@ int cmMakefile::TryCompile(const std::string& srcdir, if(this->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "TRUE", "", cmCacheManager::INTERNAL); + "TRUE", "", cmConfiguration::INTERNAL); } else { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "FALSE", "", cmCacheManager::INTERNAL); + "FALSE", "", cmConfiguration::INTERNAL); } if (cm.Configure() != 0) { @@ -4914,7 +4913,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, "For backwards compatibility, what version of CMake " "commands and " "syntax should this version of CMake try to support.", - cmCacheManager::STRING); + cmConfiguration::STRING); } } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index aa48e8a..5ba7d19 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -22,6 +22,7 @@ #include "cmGeneratorTarget.h" #include "cmExpandedCommandArgument.h" #include "cmake.h" +#include "cmConfiguration.h" #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmSourceGroup.h" @@ -305,7 +306,7 @@ public: ///! Add a definition to this makefile and the global cmake cache. void AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmCacheManager::CacheEntryType type, + cmConfiguration::CacheEntryType type, bool force = false); /** diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index e89cf99..5ed1ea1 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -39,7 +39,7 @@ bool cmMarkAsAdvancedCommand cmConfiguration* config = this->Makefile->GetConfiguration(); if (!config->GetCacheEntryValue(variable)) { - config->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); + config->AddCacheEntry(variable, 0, 0, cmConfiguration::UNINITIALIZED); overwrite = true; } if (!config->GetCacheEntryValue(variable)) diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 64b3d39..c3d254f 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -46,7 +46,7 @@ bool cmOptionCommand const char* existingValue = config->GetCacheEntryValue(args[0]); if(existingValue) { - if (config->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) + if (config->GetCacheEntryType(args[0]) != cmConfiguration::UNINITIALIZED) { config->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; @@ -59,6 +59,6 @@ bool cmOptionCommand } bool init = cmSystemTools::IsOn(initialValue.c_str()); this->Makefile->AddCacheDefinition(args[0], init? "ON":"OFF", - args[1].c_str(), cmCacheManager::BOOL); + args[1].c_str(), cmConfiguration::BOOL); return true; } diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 61c0133..c26173e 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -30,11 +30,11 @@ bool cmProjectCommand this->Makefile->AddCacheDefinition (bindir, this->Makefile->GetCurrentOutputDirectory(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmConfiguration::STATIC); this->Makefile->AddCacheDefinition (srcdir, this->Makefile->GetCurrentDirectory(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmConfiguration::STATIC); bindir = "PROJECT_BINARY_DIR"; srcdir = "PROJECT_SOURCE_DIR"; @@ -59,7 +59,7 @@ bool cmProjectCommand this->Makefile->AddCacheDefinition ("CMAKE_PROJECT_NAME", args[0].c_str(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmConfiguration::STATIC); } bool haveVersion = false; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index ead2080..d74944e 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -79,8 +79,8 @@ bool cmSetCommand bool cache = false; // optional bool force = false; // optional bool parentScope = false; - cmCacheManager::CacheEntryType type - = cmCacheManager::STRING; // required if cache + cmConfiguration::CacheEntryType type + = cmConfiguration::STRING; // required if cache const char* docstring = 0; // required if cache unsigned int ignoreLastArgs = 0; @@ -131,7 +131,7 @@ bool cmSetCommand if(cache) { std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0); - type = cmCacheManager::StringToType(args[cacheStart+1].c_str()); + type = cmConfiguration::StringToCacheEntryType(args[cacheStart+1].c_str()); docstring = args[cacheStart+2].c_str(); } @@ -139,13 +139,13 @@ bool cmSetCommand cmConfiguration* config = this->Makefile->GetConfiguration(); const char* existingValue = config->GetCacheEntryValue(variable); if(existingValue && - (config->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) + (config->GetCacheEntryType(variable) != cmConfiguration::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal // then leave now without setting any definitions in the cache // or the makefile - if(cache && type != cmCacheManager::INTERNAL && !force) + if(cache && type != cmConfiguration::INTERNAL && !force) { return true; } diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index b6f8590..87fb475 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -14,7 +14,6 @@ #include "cmSetTestsPropertiesCommand.h" #include "cmSetSourceFilesPropertiesCommand.h" -#include "cmCacheManager.h" //---------------------------------------------------------------------------- cmSetPropertyCommand::cmSetPropertyCommand() @@ -426,7 +425,7 @@ bool cmSetPropertyCommand::HandleCacheMode() } else if(this->PropertyName == "TYPE") { - if(!cmCacheManager::IsType(this->PropertyValue.c_str())) + if(!cmConfiguration::IsCacheEntryType(this->PropertyValue.c_str())) { std::ostringstream e; e << "given invalid CACHE entry TYPE \"" << this->PropertyValue << "\""; diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 927888b..836f342 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -88,7 +88,7 @@ bool cmSiteNameCommand AddCacheDefinition(args[0], siteName.c_str(), "Name of the computer/site where compile is being run", - cmCacheManager::STRING); + cmConfiguration::STRING); return true; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b3d1155..ad461f0 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1181,7 +1181,7 @@ void cmTarget::ClearDependencyInformation( cmMakefile& mf, if (this->RecordDependencies) { mf.AddCacheDefinition(depname, "", - "Dependencies for target", cmCacheManager::STATIC); + "Dependencies for target", cmConfiguration::STATIC); } else { @@ -1369,7 +1369,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, dependencies += ";"; mf.AddCacheDefinition( targetEntry, dependencies.c_str(), "Dependencies for the target", - cmCacheManager::STATIC ); + cmConfiguration::STATIC ); } } diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 60f48ae..3cd8291 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmTryRunCommand.h" -#include "cmCacheManager.h" #include "cmTryCompileCommand.h" #include @@ -217,7 +216,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, } this->Makefile->AddCacheDefinition(this->RunResultVariable, retChar, "Result of TRY_RUN", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } /* This is only used when cross compiling. Instead of running the @@ -262,7 +261,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->Makefile->AddCacheDefinition(this->RunResultVariable, "PLEASE_FILL_OUT-FAILED_TO_RUN", comment.c_str(), - cmCacheManager::STRING); + cmConfiguration::STRING); cmConfiguration* config = this->Makefile->GetConfiguration(); const char* existingValue @@ -290,7 +289,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->Makefile->AddCacheDefinition(internalRunOutputName, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), - cmCacheManager::STRING); + cmConfiguration::STRING); cmConfiguration* config = this->Makefile->GetConfiguration(); const char* existing = config->GetCacheEntryValue(internalRunOutputName); diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 2799a9b..b68afbc 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmUtilitySourceCommand.h" +#include "cmCacheManager.h" + // cmUtilitySourceCommand bool cmUtilitySourceCommand ::InitialPass(std::vector const& args, cmExecutionStatus &) @@ -118,14 +120,14 @@ bool cmUtilitySourceCommand this->Makefile->AddCacheDefinition(cacheEntry, utilityExecutable.c_str(), "Path to an internal program.", - cmCacheManager::FILEPATH); + cmConfiguration::FILEPATH); // add a value into the cache that maps from the // full path to the name of the project cmSystemTools::ConvertToUnixSlashes(utilityExecutable); this->Makefile->AddCacheDefinition(utilityExecutable, utilityName.c_str(), "Executable to project name.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); return true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 186b2de..328e273 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -338,7 +338,7 @@ bool cmake::SetCacheArgs(const std::vector& args) } } std::string var, value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmConfiguration::CacheEntryType type = cmConfiguration::UNINITIALIZED; if(cmCacheManager::ParseEntry(entry, var, value, type)) { // The value is transformed if it is a filepath for example, so @@ -412,9 +412,9 @@ bool cmake::SetCacheArgs(const std::vector& args) for (std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = + cmConfiguration::CacheEntryType t = this->Configuration->GetCacheEntryType(*it); - if(t != cmCacheManager::STATIC) + if(t != cmConfiguration::STATIC) { if (regex.find(it->c_str())) { @@ -979,14 +979,14 @@ int cmake::AddCMakePaths() // Save the value in the cache this->CacheManager->AddCacheEntry ("CMAKE_COMMAND", cmSystemTools::GetCMakeCommand().c_str(), - "Path to CMake executable.", cmCacheManager::INTERNAL); + "Path to CMake executable.", cmConfiguration::INTERNAL); #ifdef CMAKE_BUILD_WITH_CMAKE this->CacheManager->AddCacheEntry ("CMAKE_CTEST_COMMAND", cmSystemTools::GetCTestCommand().c_str(), - "Path to ctest program executable.", cmCacheManager::INTERNAL); + "Path to ctest program executable.", cmConfiguration::INTERNAL); this->CacheManager->AddCacheEntry ("CMAKE_CPACK_COMMAND", cmSystemTools::GetCPackCommand().c_str(), - "Path to cpack program executable.", cmCacheManager::INTERNAL); + "Path to cpack program executable.", cmConfiguration::INTERNAL); #endif if(!cmSystemTools::FileExists( (cmSystemTools::GetCMakeRoot()+"/Modules/CMake.cmake").c_str())) @@ -1000,7 +1000,7 @@ int cmake::AddCMakePaths() } this->CacheManager->AddCacheEntry ("CMAKE_ROOT", cmSystemTools::GetCMakeRoot().c_str(), - "Path to CMake installation.", cmCacheManager::INTERNAL); + "Path to CMake installation.", cmConfiguration::INTERNAL); return 1; } @@ -1242,7 +1242,7 @@ struct SaveCacheEntry std::string key; std::string value; std::string help; - cmCacheManager::CacheEntryType type; + cmConfiguration::CacheEntryType type; }; int cmake::HandleDeleteCacheVariables(const std::string& var) @@ -1315,7 +1315,7 @@ int cmake::Configure() AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE", "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } else { @@ -1323,7 +1323,7 @@ int cmake::Configure() AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE", "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } } int ret = this->ActualConfigure(); @@ -1359,7 +1359,7 @@ int cmake::ActualConfigure() this->GetHomeDirectory(), "Start directory with the top level CMakeLists.txt file for this " "project", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } // no generator specified on the command line @@ -1468,11 +1468,11 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName().c_str(), "Name of generator.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); this->CacheManager->AddCacheEntry("CMAKE_EXTRA_GENERATOR", this->GlobalGenerator->GetExtraGeneratorName().c_str(), "Name of external makefile project generator.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } if(const char* platformName = @@ -1500,7 +1500,7 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_PLATFORM", this->GeneratorPlatform.c_str(), "Name of generator platform.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } if(const char* tsName = @@ -1528,7 +1528,7 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_TOOLSET", this->GeneratorToolset.c_str(), "Name of generator toolset.", - cmCacheManager::INTERNAL); + cmConfiguration::INTERNAL); } // reset any system configuration information, except for when we are @@ -1566,7 +1566,7 @@ int cmake::ActualConfigure() this->Configuration->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", - cmCacheManager::PATH); + cmConfiguration::PATH); } if(!this->Configuration ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) @@ -1574,7 +1574,7 @@ int cmake::ActualConfigure() this->Configuration->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", "Single output directory for building all executables.", - cmCacheManager::PATH); + cmConfiguration::PATH); } } if(!this->Configuration @@ -1583,7 +1583,7 @@ int cmake::ActualConfigure() this->Configuration->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", - cmCacheManager::BOOL); + cmConfiguration::BOOL); if (!this->Configuration->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", "ADVANCED")) { @@ -1808,7 +1808,7 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, { this->CacheManager->AddCacheEntry(key, value, helpString, - cmCacheManager::CacheEntryType(type)); + cmConfiguration::CacheEntryType(type)); } const char* cmake::GetCacheDefinition(const std::string& name) const @@ -1880,7 +1880,7 @@ void cmake::AddDefaultGenerators() bool cmake::ParseCacheEntry(const std::string& entry, std::string& var, std::string& value, - cmCacheManager::CacheEntryType& type) + cmConfiguration::CacheEntryType& type) { return cmCacheManager::ParseEntry(entry, var, value, type); } diff --git a/Source/cmake.h b/Source/cmake.h index 5b10288..1debfeb 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -19,6 +19,7 @@ #include "cmPropertyMap.h" #include "cmInstalledFile.h" #include "cmCacheManager.h" +#include "cmConfiguration.h" class cmGlobalGeneratorFactory; class cmGlobalGenerator; @@ -178,7 +179,7 @@ class cmake static bool ParseCacheEntry(const std::string& entry, std::string& var, std::string& value, - cmCacheManager::CacheEntryType& type); + cmConfiguration::CacheEntryType& type); int LoadCache(); bool LoadCache(const std::string& path); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 7960b47..9ab49ee 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -19,7 +19,6 @@ #include "cmake.h" #include "cmcmd.h" #include "cmConfiguration.h" -#include "cmCacheManager.h" #include "cmListFileCache.h" #include "cmSourceFile.h" #include "cmGlobalGenerator.h" @@ -335,10 +334,10 @@ int do_cmake(int ac, char const* const* av) for (std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) { - cmCacheManager::CacheEntryType t = + cmConfiguration::CacheEntryType t = cm.GetConfiguration()->GetCacheEntryType(*it); - if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && - t != cmCacheManager::UNINITIALIZED ) + if ( t != cmConfiguration::INTERNAL && t != cmConfiguration::STATIC && + t != cmConfiguration::UNINITIALIZED ) { const char* advancedProp = cm.GetConfiguration()->GetCacheEntryProperty(*it, "ADVANCED"); @@ -351,7 +350,7 @@ int do_cmake(int ac, char const* const* av) "HELPSTRING") << std::endl; } std::cout << *it << ":" << - cmCacheManager::TypeToString(t) + cmConfiguration::CacheEntryTypeToString(t) << "=" << cm.GetConfiguration()->GetCacheEntryValue(*it) << std::endl; if ( list_help ) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca6841ad0f2a55988e2eca91c2599a9ea6ae8f18 commit ca6841ad0f2a55988e2eca91c2599a9ea6ae8f18 Author: Stephen Kelly AuthorDate: Mon Apr 6 13:34:03 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:56 2015 +0200 cmMakefile: Remove unused CacheManager accessor. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0d847fa..6d57cc5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3735,11 +3735,6 @@ void cmMakefile::GetListOfMacros(std::string& macros) const macros = cmJoin(this->MacrosList, ";"); } -cmCacheManager *cmMakefile::GetCacheManager() const -{ - return this->GetCMakeInstance()->GetCacheManager(); -} - cmConfiguration *cmMakefile::GetConfiguration() const { return this->GetCMakeInstance()->GetConfiguration(); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 8c896e4..aa48e8a 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -12,7 +12,6 @@ #ifndef cmMakefile_h #define cmMakefile_h -#include "cmCacheManager.h" #include "cmExecutionStatus.h" #include "cmListFileCache.h" #include "cmPolicies.h" @@ -765,7 +764,6 @@ public: ///enabled. void EnableLanguage(std::vectorconst& languages, bool optional); - cmCacheManager *GetCacheManager() const; cmConfiguration *GetConfiguration() const; /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d882f4abc3636aeb9d6119b51c1fb205d4fd1d7c commit d882f4abc3636aeb9d6119b51c1fb205d4fd1d7c Author: Stephen Kelly AuthorDate: Mon Apr 6 10:52:45 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:56 2015 +0200 Port to cmConfiguration. diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 3d92a2d..e013f81 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmake.h" #include "../cmDocumentation.h" diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 4f028c4..f2b5895 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -19,6 +19,7 @@ #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" #include "../cmake.h" +#include "../cmConfiguration.h" #include @@ -50,9 +51,9 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); + const char* value = cm->GetConfiguration()->GetCacheEntryValue(key); assert(value); - switch (cm->GetCacheManager()->GetCacheEntryType(key)) + switch (cm->GetConfiguration()->GetCacheEntryType(key)) { case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); @@ -75,7 +76,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( break; case cmCacheManager::STRING: { - const char* stringsProp = cm->GetCacheManager() + const char* stringsProp = cm->GetConfiguration() ->GetCacheEntryProperty(key, "STRINGS"); if(stringsProp) { diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 057f8f3..67e4aab 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmake.h" #include "../cmVersion.h" diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 833d540..6df8e6d 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -23,6 +23,7 @@ #include "cmCursesCacheEntryComposite.h" #include "cmCursesLongMessageForm.h" #include "cmAlgorithms.h" +#include "cmConfiguration.h" inline int ctrl(int z) @@ -107,17 +108,17 @@ void cmCursesMainForm::InitializeUI() // which contain labels, entries and new entry markers std::vector* newEntries = new std::vector; - newEntries->reserve(this->CMakeInstance->GetCacheManager()->GetSize()); + std::vector cacheKeys = + this->CMakeInstance->GetConfiguration()->GetCacheEntryKeys(); + newEntries->reserve(cacheKeys.size()); // Count non-internal and non-static entries int count=0; - std::vector cacheKeys = - this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys(); for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); if (t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && @@ -147,7 +148,7 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); if (t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || @@ -171,7 +172,7 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(*it); if (t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || @@ -225,10 +226,10 @@ void cmCursesMainForm::RePost() for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -257,10 +258,10 @@ void cmCursesMainForm::RePost() for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -329,10 +330,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -352,10 +353,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -516,10 +517,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the help string of the current entry // and add it to the help string const char* existingValue = - this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField); + this->CMakeInstance->GetConfiguration()->GetCacheEntryValue(curField); if (existingValue) { - const char* hs = this->CMakeInstance->GetCacheManager() + const char* hs = this->CMakeInstance->GetConfiguration() ->GetCacheEntryProperty(curField, "HELPSTRING"); if ( hs ) { @@ -814,7 +815,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() for(size_t i=0; i < size; i++) { std::string cacheKey = (*this->Entries)[i]->Key; - const char* existingValue = this->CMakeInstance->GetCacheManager() + const char* existingValue = this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue(cacheKey); if (existingValue) { @@ -823,7 +824,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() std::string fixedOldValue; std::string fixedNewValue; cmCacheManager::CacheEntryType t = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryType(cacheKey); this->FixValue(t, oldValue, fixedOldValue); this->FixValue(t, newValue, fixedNewValue); @@ -831,9 +832,9 @@ void cmCursesMainForm::FillCacheManagerFromUI() if(!(fixedOldValue == fixedNewValue)) { // The user has changed the value. Mark it as modified. - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true); - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->SetCacheEntryValue(cacheKey, fixedNewValue); } } @@ -1046,11 +1047,11 @@ void cmCursesMainForm::HandleInput() const char* helpString = 0; const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetConfiguration() ->GetCacheEntryValue(curField); if (existingValue) { - helpString = this->CMakeInstance->GetCacheManager() + helpString = this->CMakeInstance->GetConfiguration() ->GetCacheEntryProperty(curField, "HELPSTRING"); } if (helpString) @@ -1161,7 +1162,7 @@ void cmCursesMainForm::HandleInput() field_userptr(this->Fields[findex-2])); if ( lbl ) { - this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(lbl->GetValue()); + this->CMakeInstance->GetConfiguration()->RemoveCacheEntry(lbl->GetValue()); std::string nextVal; if (nextCur) diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 08d53ce..4c9eb01 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -16,7 +16,7 @@ #include #include "cmake.h" -#include "cmCacheManager.h" +#include "cmConfiguration.h" #include "cmSystemTools.h" #include "cmExternalMakefileProjectGenerator.h" @@ -94,7 +94,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) { this->BinaryDirectory = QDir::fromNativeSeparators(dir); emit this->binaryDirChanged(this->BinaryDirectory); - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); + cmConfiguration *config = this->CMakeInstance->GetConfiguration(); this->setGenerator(QString()); if(!this->CMakeInstance->LoadCache( this->BinaryDirectory.toLocal8Bit().data())) @@ -110,15 +110,15 @@ void QCMake::setBinaryDirectory(const QString& _dir) QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); - const char* homeDir = cachem->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + const char* homeDir = config->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (homeDir) { setSourceDirectory(QString::fromLocal8Bit(homeDir)); } - const char* gen = cachem->GetCacheEntryValue("CMAKE_GENERATOR"); + const char* gen = config->GetCacheEntryValue("CMAKE_GENERATOR"); if (gen) { - const char* extraGen = cachem + const char* extraGen = config ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: CreateFullGeneratorName(gen, extraGen? extraGen : ""); @@ -195,12 +195,12 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) QStringList toremove; // set the value of properties - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - std::vector cacheKeys = cachem->GetCacheEntryKeys(); + cmConfiguration *config = this->CMakeInstance->GetConfiguration(); + std::vector cacheKeys = config->GetCacheEntryKeys(); for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*it); + cmCacheManager::CacheEntryType t = config->GetCacheEntryType(*it); if(t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC) { @@ -219,11 +219,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - cachem->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); + config->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); } else { - cachem->SetCacheEntryValue(*it, + config->SetCacheEntryValue(*it, prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); @@ -236,7 +236,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) { this->CMakeInstance->UnwatchUnusedCli(s.toLocal8Bit().data()); - cachem->RemoveCacheEntry(s.toLocal8Bit().data()); + config->RemoveCacheEntry(s.toLocal8Bit().data()); } // add some new properites @@ -281,12 +281,12 @@ QCMakePropertyList QCMake::properties() const { QCMakePropertyList ret; - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - std::vector cacheKeys = cachem->GetCacheEntryKeys(); + cmConfiguration *config = this->CMakeInstance->GetConfiguration(); + std::vector cacheKeys = config->GetCacheEntryKeys(); for (std::vector::const_iterator i = cacheKeys.begin(); i != cacheKeys.end(); ++i) { - cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*i); + cmCacheManager::CacheEntryType t = config->GetCacheEntryType(*i); if(t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || t == cmCacheManager::UNINITIALIZED) @@ -294,14 +294,14 @@ QCMakePropertyList QCMake::properties() const continue; } - const char* cachedValue = cachem->GetCacheEntryValue(*i); + const char* cachedValue = config->GetCacheEntryValue(*i); QCMakeProperty prop; prop.Key = QString::fromLocal8Bit(i->c_str()); prop.Help = QString::fromLocal8Bit( - cachem->GetCacheEntryProperty(*i, "HELPSTRING")); + config->GetCacheEntryProperty(*i, "HELPSTRING")); prop.Value = QString::fromLocal8Bit(cachedValue); - prop.Advanced = cachem->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); + prop.Advanced = config->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); if(t == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; @@ -319,7 +319,7 @@ QCMakePropertyList QCMake::properties() const { prop.Type = QCMakeProperty::STRING; const char* stringsProperty = - cachem->GetCacheEntryProperty(*i, "STRINGS"); + config->GetCacheEntryProperty(*i, "STRINGS"); if (stringsProperty) { prop.Strings = QString::fromLocal8Bit(stringsProperty).split(";"); diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 99bf5f5..0e4dd4b 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -13,6 +13,7 @@ #include "cmSystemTools.h" #include "cmMakefile.h" +#include "cmConfiguration.h" #include "cmCommandArgumentLexer.h" @@ -90,7 +91,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } if ( strcmp(key, "CACHE") == 0 ) { - if(const char* c = this->Makefile->GetCacheManager() + if(const char* c = this->Makefile->GetConfiguration() ->GetInitializedCacheValue(var)) { if(this->EscapeQuotes) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 0d32e4b..7e53be2 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -16,6 +16,7 @@ #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" +#include "cmConfiguration.h" #include "cmTarget.h" #include "cmSourceFile.h" @@ -205,7 +206,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_"; cacheEntryName += envVar; - const char* cacheValue = mf->GetCacheManager()->GetInitializedCacheValue( + const char* cacheValue = mf->GetConfiguration()->GetInitializedCacheValue( cacheEntryName); // now we have both, decide which one to use diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index cc08052..f13ac1e 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -12,6 +12,7 @@ #include "cmFindBase.h" #include "cmAlgorithms.h" +#include "cmConfiguration.h" cmFindBase::cmFindBase() { @@ -366,8 +367,8 @@ bool cmFindBase::CheckForVariableInCache() if(const char* cacheValue = this->Makefile->GetDefinition(this->VariableName)) { - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName); + cmConfiguration* config = this->Makefile->GetConfiguration(); + const char* cacheEntry = config->GetCacheEntryValue(this->VariableName); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); bool cached = cacheEntry ? true : false; if(found) @@ -376,7 +377,7 @@ bool cmFindBase::CheckForVariableInCache() // type we should add the type and docstring but keep the // original value. Tell the subclass implementations to do // this. - if(cached && manager->GetCacheEntryType(this->VariableName) + if(cached && config->GetCacheEntryType(this->VariableName) == cmCacheManager::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; @@ -385,7 +386,7 @@ bool cmFindBase::CheckForVariableInCache() } else if(cached) { - const char* hs = manager->GetCacheEntryProperty(this->VariableName, + const char* hs = config->GetCacheEntryProperty(this->VariableName, "HELPSTRING"); this->VariableDocumentation = hs?hs:"(none)"; } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 0e6e0c2..1fe53ac 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -12,6 +12,7 @@ #include "cmGetPropertyCommand.h" #include "cmake.h" +#include "cmConfiguration.h" #include "cmTest.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" @@ -391,9 +392,9 @@ bool cmGetPropertyCommand::HandleCacheMode() } const char* value = 0; - if(this->Makefile->GetCacheManager()->GetCacheEntryValue(this->Name)) + if(this->Makefile->GetConfiguration()->GetCacheEntryValue(this->Name)) { - value = this->Makefile->GetCacheManager() + value = this->Makefile->GetConfiguration() ->GetCacheEntryProperty(this->Name, this->PropertyName); } this->StoreResult(value); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 35394b8..1a0b20c 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -20,6 +20,7 @@ #include "cmLocalGenerator.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmake.h" +#include "cmConfiguration.h" #include "cmMakefile.h" #include "cmQtAutoGenerators.h" #include "cmSourceFile.h" @@ -179,7 +180,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, return; } const char* cname = this->GetCMakeInstance()-> - GetCacheManager()->GetInitializedCacheValue(langComp); + GetConfiguration()->GetInitializedCacheValue(langComp); std::string changeVars; if(cname && !optional) { @@ -1537,7 +1538,7 @@ void cmGlobalGenerator::CheckLocalGenerators() std::map notFoundMap; // std::set notFoundMap; // after it is all done do a ConfigureFinalPass - cmCacheManager* manager = this->GetCMakeInstance()->GetCacheManager(); + cmConfiguration* config = this->GetCMakeInstance()->GetConfiguration(); for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { this->LocalGenerators[i]->ConfigureFinalPass(); @@ -1559,7 +1560,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(lib->first.c_str())) { std::string varName = lib->first.substr(0, lib->first.size()-9); - if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + if(config->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1590,7 +1591,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(incDir->c_str())) { std::string varName = incDir->substr(0, incDir->size()-9); - if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + if(config->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1637,7 +1638,7 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir, // and there is a good chance that the try compile stuff will // take the bulk of the time, so try and guess some progress // by getting closer and closer to 100 without actually getting there. - if (!this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue + if (!this->CMakeInstance->GetConfiguration()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS")) { // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set @@ -1835,7 +1836,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) // update progress // estimate how many lg there will be const char *numGenC = - this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue + this->CMakeInstance->GetConfiguration()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"); if (!numGenC) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b1450a8..0d847fa 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1812,9 +1812,9 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; const char* existingValue = - this->GetCacheManager()->GetInitializedCacheValue(name); + this->GetConfiguration()->GetInitializedCacheValue(name); if(existingValue - && (this->GetCacheManager()->GetCacheEntryType(name) + && (this->GetConfiguration()->GetCacheEntryType(name) == cmCacheManager::UNINITIALIZED)) { // if this is not a force, then use the value from the cache @@ -1843,14 +1843,14 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, nvalue += files[cc]; } - this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = this->GetCacheManager()->GetInitializedCacheValue(name); + this->GetConfiguration()->AddCacheEntry(name, nvalue.c_str(), doc, type); + val = this->GetConfiguration()->GetInitializedCacheValue(name); haveVal = true; } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, - doc, type); + this->GetConfiguration()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -1977,7 +1977,7 @@ void cmMakefile::RemoveDefinition(const std::string& name) void cmMakefile::RemoveCacheDefinition(const std::string& name) { - this->GetCacheManager()->RemoveCacheEntry(name); + this->GetConfiguration()->RemoveCacheEntry(name); } void cmMakefile::SetProjectName(const char* p) @@ -2434,7 +2434,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const this->Internal->VarUsageStack.top().insert(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetConfiguration()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE if(cmVariableWatch* vv = this->GetVariableWatch()) @@ -2459,7 +2459,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const const char* def = this->Internal->VarStack.top().Get(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetConfiguration()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); @@ -2501,7 +2501,7 @@ std::vector cmMakefile res.insert(res.end(), definitions.begin(), definitions.end()); } std::vector cacheKeys = - this->GetCacheManager()->GetCacheEntryKeys(); + this->GetConfiguration()->GetCacheEntryKeys(); res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); std::sort(res.begin(), res.end()); @@ -2802,6 +2802,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( openstack.push(t_lookup()); cmake::MessageType mtype = cmake::LOG; + cmConfiguration* config = this->GetCMakeInstance()->GetConfiguration(); + do { char inc = *in; @@ -2835,8 +2837,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( value = cmSystemTools::GetEnv(lookup.c_str()); break; case CACHE: - value = this->GetCacheManager() - ->GetInitializedCacheValue(lookup); + value = config->GetCacheEntryValue(lookup); break; } // Get the string we're meant to append to. @@ -4908,7 +4909,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, if(id == cmPolicies::CMP0001 && (status == cmPolicies::WARN || status == cmPolicies::OLD)) { - if(!(this->GetCacheManager() + if(!(this->GetConfiguration() ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) { // Set it to 2.4 because that is the last version where the diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index cc094b1..e89cf99 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -36,20 +36,20 @@ bool cmMarkAsAdvancedCommand for(; i < args.size(); ++i) { std::string variable = args[i]; - cmCacheManager* manager = this->Makefile->GetCacheManager(); - if (!manager->GetCacheEntryValue(variable)) + cmConfiguration* config = this->Makefile->GetConfiguration(); + if (!config->GetCacheEntryValue(variable)) { - manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); + config->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); overwrite = true; } - if (!manager->GetCacheEntryValue(variable)) + if (!config->GetCacheEntryValue(variable)) { cmSystemTools::Error("This should never happen..."); return false; } - if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) + if (!config->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) { - manager->SetCacheEntryProperty(variable, "ADVANCED", value); + config->SetCacheEntryProperty(variable, "ADVANCED", value); } } return true; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index baf5b1e..64b3d39 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,13 +42,13 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(args[0]); + cmConfiguration* config = this->Makefile->GetConfiguration(); + const char* existingValue = config->GetCacheEntryValue(args[0]); if(existingValue) { - if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) + if (config->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) { - manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); + config->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; } initialValue = existingValue; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index e17474b..ead2080 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -136,10 +136,10 @@ bool cmSetCommand } // see if this is already in the cache - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(variable); + cmConfiguration* config = this->Makefile->GetConfiguration(); + const char* existingValue = config->GetCacheEntryValue(variable); if(existingValue && - (manager->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) + (config->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 77f9fb9..b6f8590 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -453,7 +453,7 @@ bool cmSetPropertyCommand::HandleCacheMode() cmMakefile* mf = this->GetMakefile(); cmake* cm = mf->GetCMakeInstance(); const char* existingValue - = cm->GetCacheManager()->GetCacheEntryValue(*ni); + = cm->GetConfiguration()->GetCacheEntryValue(*ni); if(existingValue) { if(!this->HandleCacheEntry(*ni)) @@ -479,20 +479,19 @@ bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey) // Set or append the property. const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmConfiguration* config = this->Makefile->GetConfiguration(); if (this->Remove) { - manager->RemoveCacheEntryProperty(cacheKey, name); - return true; + config->RemoveCacheEntryProperty(cacheKey, name); } if(this->AppendMode) { - manager->AppendCacheEntryProperty(cacheKey, name, value, - this->AppendAsString); + config->AppendCacheEntryProperty(cacheKey, name, value, + this->AppendAsString); } else { - manager->SetCacheEntryProperty(cacheKey, name, value); + config->SetCacheEntryProperty(cacheKey, name, value); } return true; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 911ade8..60f48ae 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -264,12 +264,12 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment.c_str(), cmCacheManager::STRING); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmConfiguration* config = this->Makefile->GetConfiguration(); const char* existingValue - = manager->GetCacheEntryValue(this->RunResultVariable); + = config->GetCacheEntryValue(this->RunResultVariable); if (existingValue) { - manager->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); + config->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); } error = true; @@ -291,13 +291,13 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmCacheManager::STRING); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmConfiguration* config = this->Makefile->GetConfiguration(); const char* existing = - manager->GetCacheEntryValue(internalRunOutputName); + config->GetCacheEntryValue(internalRunOutputName); if (existing) { - manager->SetCacheEntryProperty(internalRunOutputName, - "ADVANCED", "1"); + config->SetCacheEntryProperty(internalRunOutputName, + "ADVANCED", "1"); } error = true; diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index dd2a682..bc6bc01 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -10,7 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmVariableRequiresCommand.h" -#include "cmCacheManager.h" +#include "cmConfiguration.h" // cmLibraryCommand bool cmVariableRequiresCommand @@ -34,6 +34,7 @@ bool cmVariableRequiresCommand bool requirementsMet = true; std::string notSet; bool hasAdvanced = false; + cmConfiguration* config = this->Makefile->GetConfiguration(); for(unsigned int i = 2; i < args.size(); ++i) { if(!this->Makefile->IsOn(args[i])) @@ -41,9 +42,8 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - cmCacheManager* manager = this->Makefile->GetCacheManager(); - if(manager->GetCacheEntryValue(args[i]) && - manager->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) + if(config->GetCacheEntryValue(args[i]) && + config->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) { hasAdvanced = true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 79fb2a5..186b2de 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -348,7 +348,7 @@ bool cmake::SetCacheArgs(const std::vector& args) std::string cachedValue; if(this->WarnUnusedCli) { - if(const char *v = this->CacheManager + if(const char *v = this->Configuration ->GetInitializedCacheValue(var)) { haveValue = true; @@ -356,13 +356,13 @@ bool cmake::SetCacheArgs(const std::vector& args) } } - this->CacheManager->AddCacheEntry(var, value.c_str(), + this->Configuration->AddCacheEntry(var, value.c_str(), "No help, variable specified on the command line.", type); if(this->WarnUnusedCli) { if (!haveValue || - cachedValue != this->CacheManager + cachedValue != this->Configuration ->GetInitializedCacheValue(var)) { this->WatchUnusedCli(var); @@ -408,12 +408,12 @@ bool cmake::SetCacheArgs(const std::vector& args) //go through all cache entries and collect the vars which will be removed std::vector entriesToDelete; std::vector cacheKeys = - this->CacheManager->GetCacheEntryKeys(); + this->Configuration->GetCacheEntryKeys(); for (std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { cmCacheManager::CacheEntryType t = - this->CacheManager->GetCacheEntryType(*it); + this->Configuration->GetCacheEntryType(*it); if(t != cmCacheManager::STATIC) { if (regex.find(it->c_str())) @@ -429,7 +429,7 @@ bool cmake::SetCacheArgs(const std::vector& args) currentEntry != entriesToDelete.end(); ++currentEntry) { - this->CacheManager->RemoveCacheEntry(*currentEntry); + this->Configuration->RemoveCacheEntry(*currentEntry); } } else if(arg.find("-C",0) == 0) @@ -925,7 +925,7 @@ void cmake::SetDirectoriesFromFile(const char* arg) if(this->LoadCache(cachePath)) { const char* existingValue = - this->CacheManager->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + this->Configuration->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (existingValue) { this->SetHomeOutputDirectory(cachePath); @@ -1255,7 +1255,6 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) { return 0; } - cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator(); std::vector saved; std::ostringstream warning; warning @@ -1271,10 +1270,13 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) i++; save.value = *i; warning << *i << "\n"; - if(ci.Find(save.key)) + const char* existingValue = + this->CacheManager->GetCacheEntryValue(save.key); + if(existingValue) { - save.type = ci.GetType(); - if(const char* help = ci.GetProperty("HELPSTRING")) + save.type = this->CacheManager->GetCacheEntryType(save.key); + if(const char* help = + this->CacheManager->GetCacheEntryProperty(save.key, "HELPSTRING")) { save.help = help; } @@ -1556,49 +1558,51 @@ int cmake::ActualConfigure() // project requires compatibility with CMake 2.4. We detect this // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY // variable created when CMP0001 is not set to NEW. - if(this->GetCacheManager() + if(this->Configuration ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { - if(!this->CacheManager->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) + if(!this->Configuration->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) { - this->CacheManager->AddCacheEntry + this->Configuration->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", cmCacheManager::PATH); } - if(!this->CacheManager + if(!this->Configuration ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) { - this->CacheManager->AddCacheEntry + this->Configuration->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", "Single output directory for building all executables.", cmCacheManager::PATH); } } - if(!this->CacheManager + if(!this->Configuration ->GetInitializedCacheValue("CMAKE_USE_RELATIVE_PATHS")) { - this->CacheManager->AddCacheEntry + this->Configuration->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", cmCacheManager::BOOL); - if (!this->CacheManager->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED")) + if (!this->Configuration->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED")) { - this->CacheManager->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED", "1"); + this->Configuration->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED", "1"); } } - if(cmSystemTools::GetFatalErrorOccured() && - (!this->CacheManager->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM") || - cmSystemTools::IsOff(this->CacheManager-> - GetInitializedCacheValue("CMAKE_MAKE_PROGRAM")))) + if(cmSystemTools::GetFatalErrorOccured()) { - // We must have a bad generator selection. Wipe the cache entry so the - // user can select another. - this->CacheManager->RemoveCacheEntry("CMAKE_GENERATOR"); - this->CacheManager->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR"); + const char* makeProgram = + this->Configuration->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM"); + if (!makeProgram || cmSystemTools::IsOff(makeProgram)) + { + // We must have a bad generator selection. Wipe the cache entry so the + // user can select another. + this->Configuration->RemoveCacheEntry("CMAKE_GENERATOR"); + this->Configuration->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR"); + } } cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); @@ -2204,7 +2208,7 @@ void cmake::TruncateOutputLog(const char* fname) { return; } - if ( !this->CacheManager->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR") ) + if (!this->Configuration->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")) { cmSystemTools::RemoveFile(fullPath); return; @@ -2322,7 +2326,7 @@ const char *cmake::GetProperty(const std::string& prop, if ( prop == "CACHE_VARIABLES" ) { std::vector cacheKeys = - this->CacheManager->GetCacheEntryKeys(); + this->Configuration->GetCacheEntryKeys(); this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); } else if ( prop == "COMMANDS" ) @@ -2475,7 +2479,7 @@ int cmake::GetSystemInformation(std::vector& args) // we have to find the module directory, so we can copy the files this->AddCMakePaths(); std::string modulesPath = - this->CacheManager->GetInitializedCacheValue("CMAKE_ROOT"); + this->Configuration->GetInitializedCacheValue("CMAKE_ROOT"); modulesPath += "/Modules"; std::string inFile = modulesPath; inFile += "/SystemInformation.cmake"; @@ -2685,7 +2689,7 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, if(t == cmake::AUTHOR_WARNING) { // Allow suppression of these warnings. - const char* suppress = this->CacheManager->GetCacheEntryValue( + const char* suppress = this->Configuration->GetCacheEntryValue( "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); if(suppress && cmSystemTools::IsOn(suppress)) { @@ -2806,7 +2810,7 @@ int cmake::Build(const std::string& dir, return 1; } const char* cachedGenerator = - this->CacheManager->GetCacheEntryValue("CMAKE_GENERATOR"); + this->Configuration->GetCacheEntryValue("CMAKE_GENERATOR"); if(!cachedGenerator) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; @@ -2823,7 +2827,7 @@ int cmake::Build(const std::string& dir, std::string output; std::string projName; const char* cachedProjectName = - this->CacheManager->GetCacheEntryValue("CMAKE_PROJECT_NAME"); + this->Configuration->GetCacheEntryValue("CMAKE_PROJECT_NAME"); if(!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; @@ -2832,7 +2836,7 @@ int cmake::Build(const std::string& dir, projName = cachedProjectName; bool verbose = false; const char* cachedVerbose = - this->CacheManager->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); + this->Configuration->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); if(cachedVerbose) { verbose = cmSystemTools::IsOn(cachedVerbose); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 3b518be..7960b47 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -18,6 +18,7 @@ #include "cmake.h" #include "cmcmd.h" +#include "cmConfiguration.h" #include "cmCacheManager.h" #include "cmListFileCache.h" #include "cmSourceFile.h" @@ -330,28 +331,28 @@ int do_cmake(int ac, char const* const* av) { std::cout << "-- Cache values" << std::endl; std::vector keys = - cm.GetCacheManager()->GetCacheEntryKeys(); + cm.GetConfiguration()->GetCacheEntryKeys(); for (std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) { cmCacheManager::CacheEntryType t = - cm.GetCacheManager()->GetCacheEntryType(*it); + cm.GetConfiguration()->GetCacheEntryType(*it); if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && t != cmCacheManager::UNINITIALIZED ) { const char* advancedProp = - cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED"); + cm.GetConfiguration()->GetCacheEntryProperty(*it, "ADVANCED"); if ( list_all_cached || !advancedProp) { if ( list_help ) { std::cout << "// " - << cm.GetCacheManager()->GetCacheEntryProperty(*it, + << cm.GetConfiguration()->GetCacheEntryProperty(*it, "HELPSTRING") << std::endl; } std::cout << *it << ":" << cmCacheManager::TypeToString(t) - << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it) + << "=" << cm.GetConfiguration()->GetCacheEntryValue(*it) << std::endl; if ( list_help ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e0606cd92f1796fcfa2737887a66d45f7bd515f commit 7e0606cd92f1796fcfa2737887a66d45f7bd515f Author: Stephen Kelly AuthorDate: Sat Apr 4 21:20:12 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:55 2015 +0200 Introduce cmConfiguration class. At this point, it is an interface to the cache. It will be extended to be a universal interface for access to and manipulation of configuration-time data (defintions, properties on targets, directories, source files etc). This will allow porting all command implementations away from the cmMakefile and cmTarget classes, and result in something more-purely related to configuration-time processing of cmake commands. That should serve at least the following goals: * Split the CMake implementation more definitively into three stages: Configuration, computation and generation, and be able to implement each optimally for memory access patterns etc. * Make better IDE integration possible by making more configuration data available. * Make it possiblte to use a smaller library than CMakeLib.a in cpack and ctest, resulting in smaller executables. * Make it possible to run the configure step multiple times in the same CMake run (#14539). Manage its lifetime in the cmake class, and add a convenience accessor to cmMakefile. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 04f6a81..8354fd9 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -171,6 +171,8 @@ set(SRCS cmComputeLinkInformation.h cmComputeTargetDepends.h cmComputeTargetDepends.cxx + cmConfiguration.cxx + cmConfiguration.h cmCPackPropertiesGenerator.h cmCPackPropertiesGenerator.cxx cmCryptoHash.cxx diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 2d3f6e5..36848c4 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -249,6 +249,7 @@ private: // Only cmake and cmMakefile should be able to add cache values // the commands should never use the cmCacheManager directly friend class cmMakefile; // allow access to add cache values + friend class cmConfiguration; // allow access to add cache values friend class cmake; // allow access to add cache values friend class cmMarkAsAdvancedCommand; // allow access to add cache values }; diff --git a/Source/cmConfiguration.cxx b/Source/cmConfiguration.cxx new file mode 100644 index 0000000..7e89c09 --- /dev/null +++ b/Source/cmConfiguration.cxx @@ -0,0 +1,137 @@ + +#include "cmConfiguration.h" + +#include "cmake.h" + +cmConfiguration::cmConfiguration(cmake* cm) + : CMakeInstance(cm) +{ +} +cmCacheManager::CacheEntryType +cmConfiguration::StringToCacheEntryType(const char* s) +{ + return cmCacheManager::StringToType(s); +} + +const char* +cmConfiguration::CacheEntryTypeToString(cmCacheManager::CacheEntryType t) +{ + return cmCacheManager::TypeToString(t); +} + +bool cmConfiguration::IsCacheEntryType(std::string const& key) +{ + return cmCacheManager::IsType(key.c_str()); +} + +std::vector cmConfiguration::GetCacheEntryKeys() const +{ + std::vector definitions; + definitions.reserve(this->CMakeInstance->GetCacheManager()->GetSize()); + cmCacheManager::CacheIterator cit = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + definitions.push_back(cit.GetName()); + } + return definitions; +} + +const char* cmConfiguration::GetCacheEntryValue(std::string const& key) const +{ + cmCacheManager::CacheEntry* e = this->CMakeInstance->GetCacheManager() + ->GetCacheEntry(key); + if (!e) + { + return 0; + } + return e->Value.c_str(); +} + +const char* +cmConfiguration::GetInitializedCacheValue(std::string const& key) const +{ + return this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue(key); +} + +cmCacheManager::CacheEntryType +cmConfiguration::GetCacheEntryType(std::string const& key) const +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + return it.GetType(); +} + +void cmConfiguration::SetCacheEntryValue(std::string const& key, + std::string const& value) +{ + this->CMakeInstance->GetCacheManager()->SetCacheEntryValue(key, value); +} + +void cmConfiguration::SetCacheEntryProperty(std::string const& key, + std::string const& propertyName, + std::string const& value) +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + it.SetProperty(propertyName, value.c_str()); +} + +void cmConfiguration::SetCacheEntryBoolProperty(std::string const& key, + std::string const& propertyName, + bool value) +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + it.SetProperty(propertyName, value); +} + +const char* cmConfiguration::GetCacheEntryProperty(std::string const& key, + std::string const& propertyName) +{ + cmCacheManager::CacheIterator it = this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()); + if (!it.PropertyExists(propertyName)) + { + return 0; + } + return it.GetProperty(propertyName); +} + +bool cmConfiguration::GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propertyName) +{ + return this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).GetPropertyAsBool(propertyName); +} + +void cmConfiguration::AddCacheEntry(const std::string& key, const char* value, + const char* helpString, + cmCacheManager::CacheEntryType type) +{ + this->CMakeInstance->GetCacheManager()->AddCacheEntry(key, value, + helpString, type); +} + +void cmConfiguration::RemoveCacheEntry(std::string const& key) +{ + this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(key); +} + +void cmConfiguration::AppendCacheEntryProperty(const std::string& key, + const std::string& property, + const std::string& value, + bool asString) +{ + this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).AppendProperty(property, + value.c_str(), + asString); +} + +void cmConfiguration::RemoveCacheEntryProperty(std::string const& key, + std::string const& propertyName) +{ + this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).SetProperty(propertyName, (void*)0); +} diff --git a/Source/cmConfiguration.h b/Source/cmConfiguration.h new file mode 100644 index 0000000..d8f5916 --- /dev/null +++ b/Source/cmConfiguration.h @@ -0,0 +1,52 @@ + +#ifndef cmConfiguration_h +#define cmConfiguration_h + +#include "cmCacheManager.h" + +class cmake; + +class cmConfiguration +{ +public: + cmConfiguration(cmake* cm); + + static cmCacheManager::CacheEntryType StringToCacheEntryType(const char*); + static const char* CacheEntryTypeToString(cmCacheManager::CacheEntryType); + static bool IsCacheEntryType(std::string const& key); + + std::vector GetCacheEntryKeys() const; + const char* GetCacheEntryValue(std::string const& key) const; + const char* GetInitializedCacheValue(std::string const& key) const; + cmCacheManager::CacheEntryType + GetCacheEntryType(std::string const& key) const; + void SetCacheEntryValue(std::string const& key, std::string const& value); + void SetCacheValue(std::string const& key, std::string const& value); + + void AddCacheEntry(const std::string& key, const char* value, + const char* helpString, + cmCacheManager::CacheEntryType type); + void RemoveCacheEntry(std::string const& key); + + void SetCacheEntryProperty(std::string const& key, + std::string const& propertyName, + std::string const& value); + void SetCacheEntryBoolProperty(std::string const& key, + std::string const& propertyName, + bool value); + const char* GetCacheEntryProperty(std::string const& key, + std::string const& propertyName); + bool GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propertyName); + void AppendCacheEntryProperty(std::string const& key, + const std::string& property, + const std::string& value, + bool asString = false); + void RemoveCacheEntryProperty(std::string const& key, + std::string const& propertyName); + +private: + cmake* CMakeInstance; +}; + +#endif diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 34b4621..b1450a8 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -19,6 +19,7 @@ #include "cmLocalGenerator.h" #include "cmCommands.h" #include "cmCacheManager.h" +#include "cmConfiguration.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" #include "cmCommandArgumentParserHelper.h" @@ -3738,6 +3739,11 @@ cmCacheManager *cmMakefile::GetCacheManager() const return this->GetCMakeInstance()->GetCacheManager(); } +cmConfiguration *cmMakefile::GetConfiguration() const +{ + return this->GetCMakeInstance()->GetConfiguration(); +} + void cmMakefile::DisplayStatus(const char* message, float s) const { cmake* cm = this->GetLocalGenerator()->GetGlobalGenerator() diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5209891..8c896e4 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -766,6 +766,7 @@ public: void EnableLanguage(std::vectorconst& languages, bool optional); cmCacheManager *GetCacheManager() const; + cmConfiguration *GetConfiguration() const; /** * Get the variable watch. This is used to determine when certain variables diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 64b332c..79fb2a5 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -21,6 +21,7 @@ #include "cmTest.h" #include "cmDocumentationFormatter.h" #include "cmAlgorithms.h" +#include "cmConfiguration.h" #if defined(CMAKE_BUILD_WITH_CMAKE) # include "cmGraphVizWriter.h" @@ -133,6 +134,8 @@ cmake::cmake() this->FileComparison = new cmFileTimeComparison; this->Policies = new cmPolicies(); + this->Configuration = new cmConfiguration(this); + this->InitializeProperties(); #ifdef __APPLE__ @@ -171,6 +174,7 @@ cmake::~cmake() { delete this->CacheManager; delete this->Policies; + delete this->Configuration; if (this->GlobalGenerator) { delete this->GlobalGenerator; diff --git a/Source/cmake.h b/Source/cmake.h index 3acf4a8..5b10288 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -32,6 +32,7 @@ class cmDocumentationSection; class cmPolicies; class cmTarget; class cmGeneratedFileStream; +class cmConfiguration; /** \brief Represents a cmake invocation. * @@ -387,6 +388,9 @@ class cmake void UnwatchUnusedCli(const std::string& var); void WatchUnusedCli(const std::string& var); + + cmConfiguration* GetConfiguration() const { return this->Configuration; } + protected: void RunCheckForUnusedVariables(); void InitializeProperties(); @@ -475,6 +479,8 @@ private: std::vector DebugConfigs; InstalledFilesMap InstalledFiles; + cmConfiguration* Configuration; + void UpdateConversionPathTable(); }; diff --git a/bootstrap b/bootstrap index 4239802..b8e9885 100755 --- a/bootstrap +++ b/bootstrap @@ -302,6 +302,7 @@ CMAKE_CXX_SOURCES="\ cmCommandsForBootstrap \ cmTarget \ cmTest \ + cmConfiguration \ cmCustomCommand \ cmCustomCommandGenerator \ cmCacheManager \ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9410e24a4ad3a21b2c27d057798f723e88d14d45 commit 9410e24a4ad3a21b2c27d057798f723e88d14d45 Author: Stephen Kelly AuthorDate: Sun Apr 5 10:48:04 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:55 2015 +0200 cmCacheManager: Port consumers to non-iterator API. This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names. diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index f63df61..cc08052 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -366,18 +366,18 @@ bool cmFindBase::CheckForVariableInCache() if(const char* cacheValue = this->Makefile->GetDefinition(this->VariableName)) { - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()-> - GetCacheIterator(this->VariableName.c_str()); + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); - bool cached = !it.IsAtEnd(); + bool cached = cacheEntry ? true : false; if(found) { // If the user specifies the entry on the command line without a // type we should add the type and docstring but keep the // original value. Tell the subclass implementations to do // this. - if(cached && it.GetType() == cmCacheManager::UNINITIALIZED) + if(cached && manager->GetCacheEntryType(this->VariableName) + == cmCacheManager::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; } @@ -385,7 +385,8 @@ bool cmFindBase::CheckForVariableInCache() } else if(cached) { - const char* hs = it.GetProperty("HELPSTRING"); + const char* hs = manager->GetCacheEntryProperty(this->VariableName, + "HELPSTRING"); this->VariableDocumentation = hs?hs:"(none)"; } } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index f0b2686..0e6e0c2 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -391,11 +391,10 @@ bool cmGetPropertyCommand::HandleCacheMode() } const char* value = 0; - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(this->Name.c_str()); - if(!it.IsAtEnd()) + if(this->Makefile->GetCacheManager()->GetCacheEntryValue(this->Name)) { - value = it.GetProperty(this->PropertyName); + value = this->Makefile->GetCacheManager() + ->GetCacheEntryProperty(this->Name, this->PropertyName); } this->StoreResult(value); return true; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f23caa6..35394b8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1559,9 +1559,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(lib->first.c_str())) { std::string varName = lib->first.substr(0, lib->first.size()-9); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(varName.c_str()); - if(it.GetPropertyAsBool("ADVANCED")) + if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1592,9 +1590,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(incDir->c_str())) { std::string varName = incDir->substr(0, incDir->size()-9); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(varName.c_str()); - if(it.GetPropertyAsBool("ADVANCED")) + if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7c1b9c4..34b4621 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1848,8 +1848,8 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, doc, - type); + this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -2499,12 +2499,10 @@ std::vector cmMakefile this->Internal->VarStack.top().ClosureKeys(); res.insert(res.end(), definitions.begin(), definitions.end()); } - cmCacheManager::CacheIterator cit = - this->GetCacheManager()->GetCacheIterator(); - for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) - { - res.push_back(cit.GetName()); - } + std::vector cacheKeys = + this->GetCacheManager()->GetCacheEntryKeys(); + res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); + std::sort(res.begin(), res.end()); return res; } diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index f6a2c26..cc094b1 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -37,24 +37,19 @@ bool cmMarkAsAdvancedCommand { std::string variable = args[i]; cmCacheManager* manager = this->Makefile->GetCacheManager(); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(variable.c_str()); - if ( it.IsAtEnd() ) + if (!manager->GetCacheEntryValue(variable)) { - this->Makefile->GetCacheManager() - ->AddCacheEntry(variable, 0, 0, - cmCacheManager::UNINITIALIZED); + manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); overwrite = true; } - it.Find(variable); - if ( it.IsAtEnd() ) + if (!manager->GetCacheEntryValue(variable)) { cmSystemTools::Error("This should never happen..."); return false; } - if ( !it.PropertyExists("ADVANCED") || overwrite ) + if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) { - it.SetProperty("ADVANCED", value); + manager->SetCacheEntryProperty(variable, "ADVANCED", value); } } return true; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 60728ea..baf5b1e 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,16 +42,16 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(args[0].c_str()); - if(!it.IsAtEnd()) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue = manager->GetCacheEntryValue(args[0]); + if(existingValue) { - if ( it.GetType() != cmCacheManager::UNINITIALIZED ) + if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) { - it.SetProperty("HELPSTRING", args[1].c_str()); + manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; } - initialValue = it.GetValue(); + initialValue = existingValue; } if(args.size() == 3) { diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 204d95b..e17474b 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -136,9 +136,10 @@ bool cmSetCommand } // see if this is already in the cache - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(variable); - if(!it.IsAtEnd() && (it.GetType() != cmCacheManager::UNINITIALIZED)) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue = manager->GetCacheEntryValue(variable); + if(existingValue && + (manager->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 1150bc7..77f9fb9 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -452,11 +452,11 @@ bool cmSetPropertyCommand::HandleCacheMode() // Get the source file. cmMakefile* mf = this->GetMakefile(); cmake* cm = mf->GetCMakeInstance(); - cmCacheManager::CacheIterator it = - cm->GetCacheManager()->GetCacheIterator(ni->c_str()); - if(!it.IsAtEnd()) + const char* existingValue + = cm->GetCacheManager()->GetCacheEntryValue(*ni); + if(existingValue) { - if(!this->HandleCacheEntry(it)) + if(!this->HandleCacheEntry(*ni)) { return false; } @@ -474,22 +474,25 @@ bool cmSetPropertyCommand::HandleCacheMode() } //---------------------------------------------------------------------------- -bool cmSetPropertyCommand::HandleCacheEntry(cmCacheManager::CacheIterator& it) +bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey) { // Set or append the property. const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); + cmCacheManager* manager = this->Makefile->GetCacheManager(); if (this->Remove) { - value = 0; + manager->RemoveCacheEntryProperty(cacheKey, name); + return true; } if(this->AppendMode) { - it.AppendProperty(name, value, this->AppendAsString); + manager->AppendCacheEntryProperty(cacheKey, name, value, + this->AppendAsString); } else { - it.SetProperty(name, value); + manager->SetCacheEntryProperty(cacheKey, name, value); } return true; diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h index b06cb68..3285e60 100644 --- a/Source/cmSetPropertyCommand.h +++ b/Source/cmSetPropertyCommand.h @@ -61,7 +61,7 @@ private: bool HandleTestMode(); bool HandleTest(cmTest* test); bool HandleCacheMode(); - bool HandleCacheEntry(cmCacheManager::CacheIterator&); + bool HandleCacheEntry(std::string const&); bool HandleInstallMode(); bool HandleInstall(cmInstalledFile* file); }; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index b5280cf..911ade8 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -264,11 +264,12 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment.c_str(), cmCacheManager::STRING); - cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()-> - GetCacheIterator(this->RunResultVariable.c_str()); - if ( !it.IsAtEnd() ) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue + = manager->GetCacheEntryValue(this->RunResultVariable); + if (existingValue) { - it.SetProperty("ADVANCED", "1"); + manager->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); } error = true; @@ -290,11 +291,13 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmCacheManager::STRING); - cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()-> - GetCacheIterator(internalRunOutputName.c_str()); - if ( !it.IsAtEnd() ) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existing = + manager->GetCacheEntryValue(internalRunOutputName); + if (existing) { - it.SetProperty("ADVANCED", "1"); + manager->SetCacheEntryProperty(internalRunOutputName, + "ADVANCED", "1"); } error = true; diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index 80c1286..dd2a682 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -41,9 +41,9 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(args[i].c_str()); - if(!it.IsAtEnd() && it.GetPropertyAsBool("ADVANCED")) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + if(manager->GetCacheEntryValue(args[i]) && + manager->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) { hasAdvanced = true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 210c0ef..64b332c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -403,17 +403,18 @@ bool cmake::SetCacheArgs(const std::vector& args) cmsys::Glob::PatternToRegex(entryPattern, true, true).c_str()); //go through all cache entries and collect the vars which will be removed std::vector entriesToDelete; - cmCacheManager::CacheIterator it = - this->CacheManager->GetCacheIterator(); - for ( it.Begin(); !it.IsAtEnd(); it.Next() ) + std::vector cacheKeys = + this->CacheManager->GetCacheEntryKeys(); + for (std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = it.GetType(); + cmCacheManager::CacheEntryType t = + this->CacheManager->GetCacheEntryType(*it); if(t != cmCacheManager::STATIC) { - std::string entryName = it.GetName(); - if (regex.find(entryName.c_str())) + if (regex.find(it->c_str())) { - entriesToDelete.push_back(entryName); + entriesToDelete.push_back(*it); } } } @@ -917,16 +918,18 @@ void cmake::SetDirectoriesFromFile(const char* arg) // If there is a CMakeCache.txt file, use its settings. if(!cachePath.empty()) { - cmCacheManager* cachem = this->GetCacheManager(); - cmCacheManager::CacheIterator it = cachem->NewIterator(); - if(this->LoadCache(cachePath) && - it.Find("CMAKE_HOME_DIRECTORY")) + if(this->LoadCache(cachePath)) { - this->SetHomeOutputDirectory(cachePath); - this->SetStartOutputDirectory(cachePath); - this->SetHomeDirectory(it.GetValue()); - this->SetStartDirectory(it.GetValue()); - return; + const char* existingValue = + this->CacheManager->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + if (existingValue) + { + this->SetHomeOutputDirectory(cachePath); + this->SetStartOutputDirectory(cachePath); + this->SetHomeDirectory(existingValue); + this->SetStartDirectory(existingValue); + return; + } } } @@ -1575,11 +1578,11 @@ int cmake::ActualConfigure() ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", cmCacheManager::BOOL); - cmCacheManager::CacheIterator it = - this->CacheManager->GetCacheIterator("CMAKE_USE_RELATIVE_PATHS"); - if ( !it.PropertyExists("ADVANCED") ) + if (!this->CacheManager->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED")) { - it.SetProperty("ADVANCED", "1"); + this->CacheManager->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED", "1"); } } @@ -2314,17 +2317,9 @@ const char *cmake::GetProperty(const std::string& prop, std::string output = ""; if ( prop == "CACHE_VARIABLES" ) { - cmCacheManager::CacheIterator cit = - this->GetCacheManager()->GetCacheIterator(); - for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) - { - if (!output.empty()) - { - output += ";"; - } - output += cit.GetName(); - } - this->SetProperty("CACHE_VARIABLES", output.c_str()); + std::vector cacheKeys = + this->CacheManager->GetCacheEntryKeys(); + this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); } else if ( prop == "COMMANDS" ) { @@ -2686,9 +2681,9 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, if(t == cmake::AUTHOR_WARNING) { // Allow suppression of these warnings. - cmCacheManager::CacheIterator it = this->CacheManager - ->GetCacheIterator("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); - if(!it.IsAtEnd() && it.GetValueAsBool()) + const char* suppress = this->CacheManager->GetCacheEntryValue( + "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); + if(suppress && cmSystemTools::IsOn(suppress)) { return; } @@ -2801,37 +2796,42 @@ int cmake::Build(const std::string& dir, } std::string cachePath = dir; cmSystemTools::ConvertToUnixSlashes(cachePath); - cmCacheManager::CacheIterator it = this->GetCacheManager()->NewIterator(); if(!this->LoadCache(cachePath)) { std::cerr << "Error: could not load cache\n"; return 1; } - if(!it.Find("CMAKE_GENERATOR")) + const char* cachedGenerator = + this->CacheManager->GetCacheEntryValue("CMAKE_GENERATOR"); + if(!cachedGenerator) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; return 1; } cmsys::auto_ptr gen( - this->CreateGlobalGenerator(it.GetValue())); + this->CreateGlobalGenerator(cachedGenerator)); if(!gen.get()) { std::cerr << "Error: could create CMAKE_GENERATOR \"" - << it.GetValue() << "\"\n"; + << cachedGenerator << "\"\n"; return 1; } std::string output; std::string projName; - if(!it.Find("CMAKE_PROJECT_NAME")) + const char* cachedProjectName = + this->CacheManager->GetCacheEntryValue("CMAKE_PROJECT_NAME"); + if(!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; return 1; } - projName = it.GetValue(); + projName = cachedProjectName; bool verbose = false; - if(it.Find("CMAKE_VERBOSE_MAKEFILE")) + const char* cachedVerbose = + this->CacheManager->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); + if(cachedVerbose) { - verbose = it.GetValueAsBool(); + verbose = cmSystemTools::IsOn(cachedVerbose); } return gen->Build("", dir, projName, target, diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index ac73ad0..3b518be 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -328,25 +328,31 @@ int do_cmake(int ac, char const* const* av) int res = cm.Run(args, view_only); if ( list_cached || list_all_cached ) { - cmCacheManager::CacheIterator it = - cm.GetCacheManager()->GetCacheIterator(); std::cout << "-- Cache values" << std::endl; - for ( it.Begin(); !it.IsAtEnd(); it.Next() ) + std::vector keys = + cm.GetCacheManager()->GetCacheEntryKeys(); + for (std::vector::const_iterator it = keys.begin(); + it != keys.end(); ++it) { - cmCacheManager::CacheEntryType t = it.GetType(); + cmCacheManager::CacheEntryType t = + cm.GetCacheManager()->GetCacheEntryType(*it); if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && t != cmCacheManager::UNINITIALIZED ) { - bool advanced = it.PropertyExists("ADVANCED"); - if ( list_all_cached || !advanced) + const char* advancedProp = + cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED"); + if ( list_all_cached || !advancedProp) { if ( list_help ) { - std::cout << "// " << it.GetProperty("HELPSTRING") << std::endl; + std::cout << "// " + << cm.GetCacheManager()->GetCacheEntryProperty(*it, + "HELPSTRING") << std::endl; } - std::cout << it.GetName() << ":" << - cmCacheManager::TypeToString(it.GetType()) - << "=" << it.GetValue() << std::endl; + std::cout << *it << ":" << + cmCacheManager::TypeToString(t) + << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it) + << std::endl; if ( list_help ) { std::cout << std::endl; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b7ae3b1a1d1c664eeef48392759883aa4040657 commit 7b7ae3b1a1d1c664eeef48392759883aa4040657 Author: Stephen Kelly AuthorDate: Mon Apr 6 12:14:40 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:55 2015 +0200 Port QtDialog to non-iterator cache API. diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 009d06e..08d53ce 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -110,17 +110,18 @@ void QCMake::setBinaryDirectory(const QString& _dir) QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); - cmCacheManager::CacheIterator itm = cachem->NewIterator(); - if ( itm.Find("CMAKE_HOME_DIRECTORY")) + const char* homeDir = cachem->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + if (homeDir) { - setSourceDirectory(QString::fromLocal8Bit(itm.GetValue().c_str())); + setSourceDirectory(QString::fromLocal8Bit(homeDir)); } - if ( itm.Find("CMAKE_GENERATOR")) + const char* gen = cachem->GetCacheEntryValue("CMAKE_GENERATOR"); + if (gen) { const char* extraGen = cachem ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: - CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : ""); + CreateFullGeneratorName(gen, extraGen? extraGen : ""); this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); } } @@ -195,33 +196,35 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) // set the value of properties cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - for(cmCacheManager::CacheIterator i = cachem->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = cachem->GetCacheEntryKeys(); + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - - if(i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC) + cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*it); + if(t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC) { continue; } QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); + prop.Key = QString::fromLocal8Bit(it->c_str()); int idx = props.indexOf(prop); if(idx == -1) { - toremove.append(QString::fromLocal8Bit(i.GetName().c_str())); + toremove.append(QString::fromLocal8Bit(it->c_str())); } else { prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - i.SetValue(prop.Value.toBool() ? "ON" : "OFF"); + cachem->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); } else { - i.SetValue(prop.Value.toString().toLocal8Bit().data()); + cachem->SetCacheEntryValue(*it, + prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); } @@ -279,42 +282,47 @@ QCMakePropertyList QCMake::properties() const QCMakePropertyList ret; cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - for(cmCacheManager::CacheIterator i = cachem->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = cachem->GetCacheEntryKeys(); + for (std::vector::const_iterator i = cacheKeys.begin(); + i != cacheKeys.end(); ++i) { - - if(i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED) + cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*i); + if(t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED) { continue; } - QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); - prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING")); - prop.Value = QString::fromLocal8Bit(i.GetValue().c_str()); - prop.Advanced = i.GetPropertyAsBool("ADVANCED"); + const char* cachedValue = cachem->GetCacheEntryValue(*i); - if(i.GetType() == cmCacheManager::BOOL) + QCMakeProperty prop; + prop.Key = QString::fromLocal8Bit(i->c_str()); + prop.Help = QString::fromLocal8Bit( + cachem->GetCacheEntryProperty(*i, "HELPSTRING")); + prop.Value = QString::fromLocal8Bit(cachedValue); + prop.Advanced = cachem->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); + if(t == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; - prop.Value = cmSystemTools::IsOn(i.GetValue().c_str()); + prop.Value = cmSystemTools::IsOn(cachedValue); } - else if(i.GetType() == cmCacheManager::PATH) + else if(t == cmCacheManager::PATH) { prop.Type = QCMakeProperty::PATH; } - else if(i.GetType() == cmCacheManager::FILEPATH) + else if(t == cmCacheManager::FILEPATH) { prop.Type = QCMakeProperty::FILEPATH; } - else if(i.GetType() == cmCacheManager::STRING) + else if(t == cmCacheManager::STRING) { prop.Type = QCMakeProperty::STRING; - if (i.PropertyExists("STRINGS")) + const char* stringsProperty = + cachem->GetCacheEntryProperty(*i, "STRINGS"); + if (stringsProperty) { - prop.Strings = QString::fromLocal8Bit(i.GetProperty("STRINGS")).split(";"); + prop.Strings = QString::fromLocal8Bit(stringsProperty).split(";"); } } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=228c629c18d6b5e820376ac87babca0771205b6f commit 228c629c18d6b5e820376ac87babca0771205b6f Author: Stephen Kelly AuthorDate: Mon Apr 6 12:01:35 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:55 2015 +0200 Port CursesDialog to non-iterator cache API. diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 682f95f..4f028c4 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -18,6 +18,9 @@ #include "cmCursesFilePathWidget.h" #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" +#include "../cmake.h" + +#include cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( const std::string& key, @@ -32,7 +35,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( - const std::string& key, const cmCacheManager::CacheIterator& it, bool isNew, + const std::string& key, cmake *cm, bool isNew, int labelwidth, int entrywidth) : Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth) { @@ -47,11 +50,13 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - switch ( it.GetType() ) + const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); + assert(value); + switch (cm->GetCacheManager()->GetCacheEntryType(key)) { - case cmCacheManager::BOOL: + case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); - if (cmSystemTools::IsOn(it.GetValue().c_str())) + if (cmSystemTools::IsOn(value)) { static_cast(this->Entry)->SetValueAsBool(true); } @@ -62,40 +67,40 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( break; case cmCacheManager::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); break; case cmCacheManager::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); break; case cmCacheManager::STRING: - if(it.PropertyExists("STRINGS")) + { + const char* stringsProp = cm->GetCacheManager() + ->GetCacheEntryProperty(key, "STRINGS"); + if(stringsProp) { cmCursesOptionsWidget* ow = new cmCursesOptionsWidget(this->EntryWidth, 1, 1, 1); this->Entry = ow; std::vector options; - cmSystemTools::ExpandListArgument( - std::string(it.GetProperty("STRINGS")), options); + cmSystemTools::ExpandListArgument(stringsProp, options); for(std::vector::iterator si = options.begin(); si != options.end(); ++si) { ow->AddOption(*si); } - ow->SetOption(it.GetValue()); + ow->SetOption(value); } else { this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); } break; + } case cmCacheManager::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", - it.GetName().c_str()); + key.c_str()); break; default: // TODO : put warning message here diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index 7cdf13b..dc4ee4af 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -21,7 +21,7 @@ public: cmCursesCacheEntryComposite(const std::string& key, int labelwidth, int entrywidth); cmCursesCacheEntryComposite(const std::string& key, - const cmCacheManager::CacheIterator& it, + cmake *cm, bool isNew, int labelwidth, int entrywidth); ~cmCursesCacheEntryComposite(); const char* GetValue(); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 1217bda..833d540 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -111,13 +111,17 @@ void cmCursesMainForm::InitializeUI() // Count non-internal and non-static entries int count=0; - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = + this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys(); + + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - if ( i.GetType() != cmCacheManager::INTERNAL && - i.GetType() != cmCacheManager::STATIC && - i.GetType() != cmCacheManager::UNINITIALIZED) + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t != cmCacheManager::INTERNAL && + t != cmCacheManager::STATIC && + t != cmCacheManager::UNINITIALIZED) { ++count; } @@ -139,45 +143,49 @@ void cmCursesMainForm::InitializeUI() // Create the composites. // First add entries which are new - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - std::string key = i.GetName(); - if ( i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED ) + std::string key = *it; + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED ) { continue; } if (!this->LookForCacheEntry(key)) { - newEntries->push_back(new cmCursesCacheEntryComposite(key, i, - true, 30, - entrywidth)); + newEntries->push_back(new cmCursesCacheEntryComposite(key, + this->CMakeInstance, + true, 30, + entrywidth)); this->OkToGenerate = false; } } // then add entries which are old - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - std::string key = i.GetName(); - if ( i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED ) + std::string key = *it; + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED ) { continue; } if (this->LookForCacheEntry(key)) { - newEntries->push_back(new cmCursesCacheEntryComposite(key, i, - false, 30, - entrywidth)); + newEntries->push_back(new cmCursesCacheEntryComposite(key, + this->CMakeInstance, + false, 30, + entrywidth)); } } } @@ -216,10 +224,13 @@ void cmCursesMainForm::RePost() std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -245,10 +256,13 @@ void cmCursesMainForm::RePost() std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -314,10 +328,13 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -334,10 +351,13 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -495,11 +515,12 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the help string of the current entry // and add it to the help string - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField); - if (!it.IsAtEnd()) + const char* existingValue = + this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField); + if (existingValue) { - const char* hs = it.GetProperty("HELPSTRING"); + const char* hs = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryProperty(curField, "HELPSTRING"); if ( hs ) { strncpy(help, hs, 127); @@ -792,23 +813,28 @@ void cmCursesMainForm::FillCacheManagerFromUI() size_t size = this->Entries->size(); for(size_t i=0; i < size; i++) { - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator( - (*this->Entries)[i]->Key.c_str()); - if (!it.IsAtEnd()) + std::string cacheKey = (*this->Entries)[i]->Key; + const char* existingValue = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue(cacheKey); + if (existingValue) { - std::string oldValue = it.GetValue(); + std::string oldValue = existingValue; std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - this->FixValue(it.GetType(), oldValue, fixedOldValue); - this->FixValue(it.GetType(), newValue, fixedNewValue); + cmCacheManager::CacheEntryType t = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(cacheKey); + this->FixValue(t, oldValue, fixedOldValue); + this->FixValue(t, newValue, fixedNewValue); if(!(fixedOldValue == fixedNewValue)) { // The user has changed the value. Mark it as modified. - it.SetProperty("MODIFIED", true); - it.SetValue(fixedNewValue.c_str()); + this->CMakeInstance->GetCacheManager() + ->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true); + this->CMakeInstance->GetCacheManager() + ->SetCacheEntryValue(cacheKey, fixedNewValue); } } } @@ -1017,12 +1043,15 @@ void cmCursesMainForm::HandleInput() cmCursesWidget* lbl = reinterpret_cast(field_userptr( this->Fields[findex-2])); const char* curField = lbl->GetValue(); - const char* helpString=0; - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField); - if (!it.IsAtEnd()) + const char* helpString = 0; + + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue(curField); + if (existingValue) { - helpString = it.GetProperty("HELPSTRING"); + helpString = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryProperty(curField, "HELPSTRING"); } if (helpString) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e50f5e7d9269ee1e2e3587a7a4b806df48510d3 commit 2e50f5e7d9269ee1e2e3587a7a4b806df48510d3 Author: Stephen Kelly AuthorDate: Mon Apr 6 10:46:25 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:55 2015 +0200 cmMakefile: Port away from CacheEntry.Initialized. The API has no other external users. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b6eff3d..7c1b9c4 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1810,16 +1810,17 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, { bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; - cmCacheManager::CacheIterator it = - this->GetCacheManager()->GetCacheIterator(name.c_str()); - if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED) && - it.Initialized()) + const char* existingValue = + this->GetCacheManager()->GetInitializedCacheValue(name); + if(existingValue + && (this->GetCacheManager()->GetCacheEntryType(name) + == cmCacheManager::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in if(!force) { - val = it.GetValue(); + val = existingValue; haveVal = true; } if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) @@ -1842,7 +1843,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, } this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = it.GetValue(); + val = this->GetCacheManager()->GetInitializedCacheValue(name); haveVal = true; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e62243674e7ce9a162b47567ef5893fae44ed153 commit e62243674e7ce9a162b47567ef5893fae44ed153 Author: Stephen Kelly AuthorDate: Sun Apr 5 19:50:05 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:55 2015 +0200 cmCacheManager: Add non-iterator-based API. The iterator pattern is an unusual one for CMake, and it hinders refactoring all configuration-time data manipulation into a single class. diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 31d302a..2d3f6e5 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -139,6 +139,81 @@ public: ///! Get a value from the cache given a key const char* GetInitializedCacheValue(const std::string& key) const; + const char* GetCacheEntryValue(const std::string& key) + { + cmCacheManager::CacheIterator it = this->GetCacheIterator(key.c_str()); + if (it.IsAtEnd()) + { + return 0; + } + return it.GetValue().c_str(); + } + + const char* GetCacheEntryProperty(std::string const& key, + std::string const& propName) + { + return this->GetCacheIterator(key.c_str()).GetProperty(propName); + } + + CacheEntryType GetCacheEntryType(std::string const& key) + { + return this->GetCacheIterator(key.c_str()).GetType(); + } + + bool GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propName) + { + return this->GetCacheIterator(key.c_str()).GetPropertyAsBool(propName); + } + + void SetCacheEntryProperty(std::string const& key, + std::string const& propName, + std::string const& value) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, value.c_str()); + } + + void SetCacheEntryBoolProperty(std::string const& key, + std::string const& propName, + bool value) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, value); + } + + void SetCacheEntryValue(std::string const& key, + std::string const& value) + { + this->GetCacheIterator(key.c_str()).SetValue(value.c_str()); + } + + void RemoveCacheEntryProperty(std::string const& key, + std::string const& propName) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, (void*)0); + } + + void AppendCacheEntryProperty(std::string const& key, + std::string const& propName, + std::string const& value, + bool asString = false) + { + this->GetCacheIterator(key.c_str()).AppendProperty(propName, + value.c_str(), + asString); + } + + std::vector GetCacheEntryKeys() + { + std::vector definitions; + definitions.reserve(this->GetSize()); + cmCacheManager::CacheIterator cit = this->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + definitions.push_back(cit.GetName()); + } + return definitions; + } + /** Get the version of CMake that wrote the cache. */ unsigned int GetCacheMajorVersion() const { return this->CacheMajorVersion; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ada4c04335fc070f3f670df72bd9943eabec464 commit 9ada4c04335fc070f3f670df72bd9943eabec464 Author: Stephen Kelly AuthorDate: Sun Apr 5 10:28:34 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:55 2015 +0200 cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue. Being initialized is a requirement for this method to return something, and is what differentiates it from using GetIterator with it.GetValue. diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 3df48d1..009d06e 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -117,7 +117,8 @@ void QCMake::setBinaryDirectory(const QString& _dir) } if ( itm.Find("CMAKE_GENERATOR")) { - const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR"); + const char* extraGen = cachem + ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : ""); this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index fa7eff3..f8f2dbd 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -284,14 +284,16 @@ bool cmCacheManager::LoadCache(const std::string& path, } this->CacheMajorVersion = 0; this->CacheMinorVersion = 0; - if(const char* cmajor = this->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION")) + if(const char* cmajor = + this->GetInitializedCacheValue("CMAKE_CACHE_MAJOR_VERSION")) { unsigned int v=0; if(sscanf(cmajor, "%u", &v) == 1) { this->CacheMajorVersion = v; } - if(const char* cminor = this->GetCacheValue("CMAKE_CACHE_MINOR_VERSION")) + if(const char* cminor = + this->GetInitializedCacheValue("CMAKE_CACHE_MINOR_VERSION")) { if(sscanf(cminor, "%u", &v) == 1) { @@ -313,10 +315,11 @@ bool cmCacheManager::LoadCache(const std::string& path, } // check to make sure the cache directory has not // been moved - if ( internal && this->GetCacheValue("CMAKE_CACHEFILE_DIR") ) + const char* oldDir = this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR"); + if (internal && oldDir) { std::string currentcwd = path; - std::string oldcwd = this->GetCacheValue("CMAKE_CACHEFILE_DIR"); + std::string oldcwd = oldDir; cmSystemTools::ConvertToUnixSlashes(currentcwd); currentcwd += "/CMakeCache.txt"; oldcwd += "/CMakeCache.txt"; @@ -325,7 +328,7 @@ bool cmCacheManager::LoadCache(const std::string& path, std::string message = std::string("The current CMakeCache.txt directory ") + currentcwd + std::string(" is different than the directory ") + - std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) + + std::string(this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")) + std::string(" where CMakeCache.txt was created. This may result " "in binaries being created in the wrong place. If you " "are not sure, reedit the CMakeCache.txt"); @@ -655,7 +658,8 @@ cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator( return CacheIterator(*this, key); } -const char* cmCacheManager::GetCacheValue(const std::string& key) const +const char* +cmCacheManager::GetInitializedCacheValue(const std::string& key) const { CacheEntryMap::const_iterator i = this->Cache.find(key); if(i != this->Cache.end() && diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index f7f8776..31d302a 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -137,7 +137,7 @@ public: CacheEntryType& type); ///! Get a value from the cache given a key - const char* GetCacheValue(const std::string& key) const; + const char* GetInitializedCacheValue(const std::string& key) const; /** Get the version of CMake that wrote the cache. */ unsigned int GetCacheMajorVersion() const diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 747b7e4..99bf5f5 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -90,7 +90,8 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } if ( strcmp(key, "CACHE") == 0 ) { - if(const char* c = this->Makefile->GetCacheManager()->GetCacheValue(var)) + if(const char* c = this->Makefile->GetCacheManager() + ->GetInitializedCacheValue(var)) { if(this->EscapeQuotes) { diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 810ec57..0d32e4b 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -205,7 +205,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_"; cacheEntryName += envVar; - const char* cacheValue = mf->GetCacheManager()->GetCacheValue( + const char* cacheValue = mf->GetCacheManager()->GetInitializedCacheValue( cacheEntryName); // now we have both, decide which one to use diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 3c0a0e2..f23caa6 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -179,7 +179,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, return; } const char* cname = this->GetCMakeInstance()-> - GetCacheManager()->GetCacheValue(langComp); + GetCacheManager()->GetInitializedCacheValue(langComp); std::string changeVars; if(cname && !optional) { @@ -1641,7 +1641,7 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir, // and there is a good chance that the try compile stuff will // take the bulk of the time, so try and guess some progress // by getting closer and closer to 100 without actually getting there. - if (!this->CMakeInstance->GetCacheManager()->GetCacheValue + if (!this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS")) { // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set @@ -1839,7 +1839,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) // update progress // estimate how many lg there will be const char *numGenC = - this->CMakeInstance->GetCacheManager()->GetCacheValue + this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"); if (!numGenC) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ad4ad7c..b6eff3d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2432,7 +2432,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const this->Internal->VarUsageStack.top().insert(name); if(!def) { - def = this->GetCacheManager()->GetCacheValue(name); + def = this->GetCacheManager()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE if(cmVariableWatch* vv = this->GetVariableWatch()) @@ -2457,7 +2457,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const const char* def = this->Internal->VarStack.top().Get(name); if(!def) { - def = this->GetCacheManager()->GetCacheValue(name); + def = this->GetCacheManager()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); @@ -2835,7 +2835,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( value = cmSystemTools::GetEnv(lookup.c_str()); break; case CACHE: - value = this->GetCacheManager()->GetCacheValue(lookup); + value = this->GetCacheManager() + ->GetInitializedCacheValue(lookup); break; } // Get the string we're meant to append to. @@ -4903,7 +4904,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, (status == cmPolicies::WARN || status == cmPolicies::OLD)) { if(!(this->GetCacheManager() - ->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) + ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) { // Set it to 2.4 because that is the last version where the // variable had meaning. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e781417..210c0ef 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -344,7 +344,8 @@ bool cmake::SetCacheArgs(const std::vector& args) std::string cachedValue; if(this->WarnUnusedCli) { - if(const char *v = this->CacheManager->GetCacheValue(var)) + if(const char *v = this->CacheManager + ->GetInitializedCacheValue(var)) { haveValue = true; cachedValue = v; @@ -357,7 +358,8 @@ bool cmake::SetCacheArgs(const std::vector& args) if(this->WarnUnusedCli) { if (!haveValue || - cachedValue != this->CacheManager->GetCacheValue(var)) + cachedValue != this->CacheManager + ->GetInitializedCacheValue(var)) { this->WatchUnusedCli(var); } @@ -1203,10 +1205,10 @@ int cmake::DoPreConfigureChecks() } // do a sanity check on some values - if(this->CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY")) + if(this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY")) { std::string cacheStart = - this->CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY"); + this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"); cacheStart += "/CMakeLists.txt"; std::string currentStart = this->GetHomeDirectory(); currentStart += "/CMakeLists.txt"; @@ -1355,9 +1357,9 @@ int cmake::ActualConfigure() if(!this->GlobalGenerator) { const char* genName = - this->CacheManager->GetCacheValue("CMAKE_GENERATOR"); + this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR"); const char* extraGenName = - this->CacheManager->GetCacheValue("CMAKE_EXTRA_GENERATOR"); + this->CacheManager->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); if(genName) { std::string fullName = cmExternalMakefileProjectGenerator:: @@ -1435,7 +1437,8 @@ int cmake::ActualConfigure() } } - const char* genName = this->CacheManager->GetCacheValue("CMAKE_GENERATOR"); + const char* genName = this->CacheManager + ->GetInitializedCacheValue("CMAKE_GENERATOR"); if(genName) { if(!this->GlobalGenerator->MatchesGeneratorName(genName)) @@ -1451,7 +1454,7 @@ int cmake::ActualConfigure() return -2; } } - if(!this->CacheManager->GetCacheValue("CMAKE_GENERATOR")) + if(!this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR")) { this->CacheManager->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName().c_str(), @@ -1464,7 +1467,7 @@ int cmake::ActualConfigure() } if(const char* platformName = - this->CacheManager->GetCacheValue("CMAKE_GENERATOR_PLATFORM")) + this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM")) { if(this->GeneratorPlatform.empty()) { @@ -1492,7 +1495,7 @@ int cmake::ActualConfigure() } if(const char* tsName = - this->CacheManager->GetCacheValue("CMAKE_GENERATOR_TOOLSET")) + this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET")) { if(this->GeneratorToolset.empty()) { @@ -1546,16 +1549,18 @@ int cmake::ActualConfigure() // project requires compatibility with CMake 2.4. We detect this // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY // variable created when CMP0001 is not set to NEW. - if(this->GetCacheManager()->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) + if(this->GetCacheManager() + ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { - if(!this->CacheManager->GetCacheValue("LIBRARY_OUTPUT_PATH")) + if(!this->CacheManager->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) { this->CacheManager->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", cmCacheManager::PATH); } - if(!this->CacheManager->GetCacheValue("EXECUTABLE_OUTPUT_PATH")) + if(!this->CacheManager + ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) { this->CacheManager->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", @@ -1563,7 +1568,8 @@ int cmake::ActualConfigure() cmCacheManager::PATH); } } - if(!this->CacheManager->GetCacheValue("CMAKE_USE_RELATIVE_PATHS")) + if(!this->CacheManager + ->GetInitializedCacheValue("CMAKE_USE_RELATIVE_PATHS")) { this->CacheManager->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", @@ -1578,9 +1584,9 @@ int cmake::ActualConfigure() } if(cmSystemTools::GetFatalErrorOccured() && - (!this->CacheManager->GetCacheValue("CMAKE_MAKE_PROGRAM") || + (!this->CacheManager->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM") || cmSystemTools::IsOff(this->CacheManager-> - GetCacheValue("CMAKE_MAKE_PROGRAM")))) + GetInitializedCacheValue("CMAKE_MAKE_PROGRAM")))) { // We must have a bad generator selection. Wipe the cache entry so the // user can select another. @@ -1796,7 +1802,7 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, const char* cmake::GetCacheDefinition(const std::string& name) const { - return this->CacheManager->GetCacheValue(name); + return this->CacheManager->GetInitializedCacheValue(name); } void cmake::AddDefaultCommands() @@ -1956,7 +1962,8 @@ void cmake::UpdateConversionPathTable() { // Update the path conversion table with any specified file: const char* tablepath = - this->CacheManager->GetCacheValue("CMAKE_PATH_TRANSLATION_FILE"); + this->CacheManager + ->GetInitializedCacheValue("CMAKE_PATH_TRANSLATION_FILE"); if(tablepath) { @@ -2190,7 +2197,7 @@ void cmake::TruncateOutputLog(const char* fname) { return; } - if ( !this->CacheManager->GetCacheValue("CMAKE_CACHEFILE_DIR") ) + if ( !this->CacheManager->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR") ) { cmSystemTools::RemoveFile(fullPath); return; @@ -2469,7 +2476,7 @@ int cmake::GetSystemInformation(std::vector& args) // we have to find the module directory, so we can copy the files this->AddCMakePaths(); std::string modulesPath = - this->CacheManager->GetCacheValue("CMAKE_ROOT"); + this->CacheManager->GetInitializedCacheValue("CMAKE_ROOT"); modulesPath += "/Modules"; std::string inFile = modulesPath; inFile += "/SystemInformation.cmake"; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1fe7f24c2b62734d501427750586d8063149ea58 commit 1fe7f24c2b62734d501427750586d8063149ea58 Author: Stephen Kelly AuthorDate: Sun Apr 5 00:07:04 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:55 2015 +0200 Add API for cache loading, deleting and saving to the cmake class. Migrate existing users of the CacheManager API to use the new API. The CacheManager will be going away soon. diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 0827037..586070b 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -18,7 +18,6 @@ #include "cmGlobalGenerator.h" #include #include "cmCTestTestHandler.h" -#include "cmCacheManager.h" //---------------------------------------------------------------------- cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler() @@ -255,7 +254,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) cm.SetGeneratorToolset(this->BuildGeneratorToolset); // Load the cache to make CMAKE_MAKE_PROGRAM available. - cm.GetCacheManager()->LoadCache(this->BinaryDir); + cm.LoadCache(this->BinaryDir); } else { diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index d60062e..1217bda 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -639,7 +639,7 @@ int cmCursesMainForm::Configure(int noconfigure) // always save the current gui values to disk this->FillCacheManagerFromUI(); - this->CMakeInstance->GetCacheManager()->SaveCache( + this->CMakeInstance->SaveCache( this->CMakeInstance->GetHomeOutputDirectory()); this->LoadCache(0); diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 996aa75..3df48d1 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -96,7 +96,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) emit this->binaryDirChanged(this->BinaryDirectory); cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); this->setGenerator(QString()); - if(!this->CMakeInstance->GetCacheManager()->LoadCache( + if(!this->CMakeInstance->LoadCache( this->BinaryDirectory.toLocal8Bit().data())) { QDir testDir(this->BinaryDirectory); @@ -270,7 +270,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) } } - cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); } QCMakePropertyList QCMake::properties() const @@ -397,9 +397,9 @@ QStringList QCMake::availableGenerators() const void QCMake::deleteCache() { // delete cache - this->CMakeInstance->GetCacheManager()->DeleteCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->DeleteCache(this->BinaryDirectory.toLocal8Bit().data()); // reload to make our cache empty - this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit no generator and no properties this->setGenerator(QString()); QCMakePropertyList props = this->properties(); @@ -412,7 +412,7 @@ void QCMake::reloadCache() QCMakePropertyList props; emit this->propertiesChanged(props); // reload - this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit new cache properties props = this->properties(); emit this->propertiesChanged(props); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index df61fe6..1db057b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2281,7 +2281,7 @@ bool cmCTest::AddVariableDefinition(const std::string &arg) std::string value; cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; - if (cmCacheManager::ParseEntry(arg, name, value, type)) + if (cmake::ParseCacheEntry(arg, name, value, type)) { this->Definitions[name] = value; return true; diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index d64b0d7..810ec57 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -223,7 +223,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), cacheEntryName.c_str(), cmCacheManager::STRING, true); - mf->GetCacheManager()->SaveCache(mf->GetHomeOutputDirectory()); + mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } else if (envVarValue==0 && cacheValue!=0) { @@ -244,7 +244,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), cacheEntryName.c_str(), cmCacheManager::STRING, true); - mf->GetCacheManager()->SaveCache(mf->GetHomeOutputDirectory()); + mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 5e584a4..0561a05 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3703,7 +3703,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root, // Since this call may have created new cache entries, save the cache: // - root->GetMakefile()->GetCacheManager()->SaveCache( + root->GetMakefile()->GetCMakeInstance()->SaveCache( root->GetMakefile()->GetHomeOutputDirectory()); } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 93aec32..e2ae901 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -81,8 +81,8 @@ bool cmLoadCacheCommand { break; } - this->Makefile->GetCacheManager()->LoadCache(args[i], false, - excludes, includes); + this->Makefile->GetCMakeInstance()->LoadCache(args[i], false, + excludes, includes); } @@ -173,7 +173,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) std::string var; std::string value; cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; - if(cmCacheManager::ParseEntry(line, var, value, type)) + if(cmake::ParseCacheEntry(line, var, value, type)) { // Found a real entry. See if this one was requested. if(this->VariablesToRead.find(var) != this->VariablesToRead.end()) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5c52a1a..e781417 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -917,7 +917,7 @@ void cmake::SetDirectoriesFromFile(const char* arg) { cmCacheManager* cachem = this->GetCacheManager(); cmCacheManager::CacheIterator it = cachem->NewIterator(); - if(cachem->LoadCache(cachePath) && + if(this->LoadCache(cachePath) && it.Find("CMAKE_HOME_DIRECTORY")) { this->SetHomeOutputDirectory(cachePath); @@ -1860,10 +1860,18 @@ void cmake::AddDefaultGenerators() #endif } +bool cmake::ParseCacheEntry(const std::string& entry, + std::string& var, + std::string& value, + cmCacheManager::CacheEntryType& type) +{ + return cmCacheManager::ParseEntry(entry, var, value, type); +} + int cmake::LoadCache() { // could we not read the cache - if (!this->CacheManager->LoadCache(this->GetHomeOutputDirectory())) + if (!this->LoadCache(this->GetHomeOutputDirectory())) { // if it does exist, but isn't readable then warn the user std::string cacheFile = this->GetHomeOutputDirectory(); @@ -1886,6 +1894,28 @@ int cmake::LoadCache() return 0; } +bool cmake::LoadCache(const std::string& path) +{ + return this->CacheManager->LoadCache(path); +} + +bool cmake::LoadCache(const std::string& path, bool internal, + std::set& excludes, + std::set& includes) +{ + return this->CacheManager->LoadCache(path, internal, excludes, includes); +} + +bool cmake::SaveCache(const std::string& path) +{ + return this->CacheManager->SaveCache(path); +} + +bool cmake::DeleteCache(const std::string& path) +{ + return this->CacheManager->DeleteCache(path); +} + void cmake::SetProgressCallback(ProgressCallbackType f, void *cd) { this->ProgressCallback = f; @@ -2764,9 +2794,8 @@ int cmake::Build(const std::string& dir, } std::string cachePath = dir; cmSystemTools::ConvertToUnixSlashes(cachePath); - cmCacheManager* cachem = this->GetCacheManager(); - cmCacheManager::CacheIterator it = cachem->NewIterator(); - if(!cachem->LoadCache(cachePath)) + cmCacheManager::CacheIterator it = this->GetCacheManager()->NewIterator(); + if(!this->LoadCache(cachePath)) { std::cerr << "Error: could not load cache\n"; return 1; diff --git a/Source/cmake.h b/Source/cmake.h index c22b329..3acf4a8 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -18,11 +18,11 @@ #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" #include "cmInstalledFile.h" +#include "cmCacheManager.h" class cmGlobalGeneratorFactory; class cmGlobalGenerator; class cmLocalGenerator; -class cmCacheManager; class cmMakefile; class cmCommand; class cmVariableWatch; @@ -173,7 +173,19 @@ class cmake int Configure(); int ActualConfigure(); + ///! Break up a line like VAR:type="value" into var, type and value + static bool ParseCacheEntry(const std::string& entry, + std::string& var, + std::string& value, + cmCacheManager::CacheEntryType& type); + int LoadCache(); + bool LoadCache(const std::string& path); + bool LoadCache(const std::string& path, bool internal, + std::set& excludes, + std::set& includes); + bool SaveCache(const std::string& path); + bool DeleteCache(const std::string& path); void PreLoadCMakeFiles(); ///! Create a GlobalGenerator http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08c642c6ae47fd075fe1060fc0e28d8a24cc3c00 commit 08c642c6ae47fd075fe1060fc0e28d8a24cc3c00 Author: Stephen Kelly AuthorDate: Mon Apr 6 13:32:00 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:54 2015 +0200 cmMakefile: Remove cache version accessors. They are only used by legacy code. Inline them there to simplify cmMakefile. diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 691d80d..987a7b1 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -51,12 +51,14 @@ void CCONV cmSetError(void *info, const char *err) unsigned int CCONV cmGetCacheMajorVersion(void *arg) { cmMakefile *mf = static_cast(arg); - return mf->GetCacheMajorVersion(); + cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager(); + return manager->GetCacheMajorVersion(); } unsigned int CCONV cmGetCacheMinorVersion(void *arg) { cmMakefile *mf = static_cast(arg); - return mf->GetCacheMinorVersion(); + cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager(); + return manager->GetCacheMinorVersion(); } unsigned int CCONV cmGetMajorVersion(void *) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7f44da2..ad4ad7c 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -174,16 +174,6 @@ void cmMakefile::Initialize() this->CheckCMP0000 = false; } -unsigned int cmMakefile::GetCacheMajorVersion() const -{ - return this->GetCacheManager()->GetCacheMajorVersion(); -} - -unsigned int cmMakefile::GetCacheMinorVersion() const -{ - return this->GetCacheManager()->GetCacheMinorVersion(); -} - cmMakefile::~cmMakefile() { cmDeleteAll(this->InstallGenerators); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 920b6b7..5209891 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -62,14 +62,6 @@ class cmMakefile class Internals; cmsys::auto_ptr Internal; public: - /** - * Return the major and minor version of the cmake that - * was used to write the currently loaded cache, note - * this method will not work before the cache is loaded. - */ - unsigned int GetCacheMajorVersion() const; - unsigned int GetCacheMinorVersion() const; - /* Check for unused variables in this scope */ void CheckForUnusedVariables() const; /* Mark a variable as used */ diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index ee1ff29..2799a9b 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -52,11 +52,13 @@ bool cmUtilitySourceCommand } else { + cmCacheManager *manager = + this->Makefile->GetCMakeInstance()->GetCacheManager(); haveCacheValue = (cacheValue && (strstr(cacheValue, "(IntDir)") == 0 || (intDir && strcmp(intDir, "$(IntDir)") == 0)) && - (this->Makefile->GetCacheMajorVersion() != 0 && - this->Makefile->GetCacheMinorVersion() != 0 )); + (manager->GetCacheMajorVersion() != 0 && + manager->GetCacheMinorVersion() != 0 )); } if(haveCacheValue) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cec8f97e5717fac279d310f3f0b9e849a0e59706 commit cec8f97e5717fac279d310f3f0b9e849a0e59706 Author: Stephen Kelly AuthorDate: Mon Apr 6 12:30:21 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 6 17:58:54 2015 +0200 cmMakefile: Simplify GetDefinitions implementation. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 215ee16..7f44da2 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2501,20 +2501,20 @@ const char* cmMakefile::GetSafeDefinition(const std::string& def) const std::vector cmMakefile ::GetDefinitions(int cacheonly /* = 0 */) const { - std::set definitions; + std::vector res; if ( !cacheonly ) { - definitions = this->Internal->VarStack.top().ClosureKeys(); + std::set definitions = + this->Internal->VarStack.top().ClosureKeys(); + res.insert(res.end(), definitions.begin(), definitions.end()); } cmCacheManager::CacheIterator cit = this->GetCacheManager()->GetCacheIterator(); for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) { - definitions.insert(cit.GetName()); + res.push_back(cit.GetName()); } - - std::vector res; - res.insert(res.end(), definitions.begin(), definitions.end()); + std::sort(res.begin(), res.end()); return res; } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Tue Apr 7 00:01:06 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 7 Apr 2015 00:01:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-646-g52d5a9b Message-ID: <20150407040106.87560AD956@public.kitware.com> This is an automated email from 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 52d5a9b60ba9c375c9381c7afa7441d6dadd9742 (commit) from 9b7213dc47d2477cb4ceb5032a9078412b5474bd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52d5a9b60ba9c375c9381c7afa7441d6dadd9742 commit 52d5a9b60ba9c375c9381c7afa7441d6dadd9742 Author: Kitware Robot AuthorDate: Tue Apr 7 00:01:05 2015 -0400 Commit: Kitware Robot CommitDate: Tue Apr 7 00:01:05 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2e9ee68..eed106d 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150406) +set(CMake_VERSION_PATCH 20150407) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From matt.mccormick at kitware.com Tue Apr 7 08:56:35 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 7 Apr 2015 08:56:35 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1544-g8c53953 Message-ID: <20150407125635.B5B51ADEBA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8c5395350cd986450525b06ca9983325d5e19158 (commit) via e89194cfbbad6bd67355764aeb465cbc2ffd7970 (commit) via 95a6495f689e74993311533f877632071e4ab97a (commit) via 0fac937bc25f6b6f0860e714ae9175f62e5fd30d (commit) from aa9c5b862759f694dff2afb3e45cfe74e8c6d034 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c5395350cd986450525b06ca9983325d5e19158 commit 8c5395350cd986450525b06ca9983325d5e19158 Merge: aa9c5b8 e89194c Author: Matt McCormick AuthorDate: Tue Apr 7 08:56:29 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 08:56:29 2015 -0400 Merge topic 'emulator-property' into next e89194cf TestGenerator: Add CROSSCOMPILING_EMULATOR support. 95a6495f try_run: Use CMAKE_CROSSCOMPILING_EMULATOR. 0fac937b Properties: Add CROSSCOMPILING_EMULATOR target property. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e89194cfbbad6bd67355764aeb465cbc2ffd7970 commit e89194cfbbad6bd67355764aeb465cbc2ffd7970 Author: Matt McCormick AuthorDate: Sat Mar 28 22:05:35 2015 -0400 Commit: Matt McCormick CommitDate: Tue Apr 7 00:53:07 2015 -0400 TestGenerator: Add CROSSCOMPILING_EMULATOR support. Prefix test commands with the CROSSCOMPILING_EMULATOR property for target executables. This allows test suites to be run on the host when crosscompiling. diff --git a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst index 2b5fd4d..3ef8e03 100644 --- a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst +++ b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst @@ -1,4 +1,6 @@ CROSSCOMPILING_EMULATOR ----------------------- -Use the given emulator to run executables created when crosscompiling. +Use the given emulator to run executables created when crosscompiling. This +command will be added as a prefix to :command:`add_test` test commands for +built target system executables. diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index f87a535..add80fa 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -82,11 +82,31 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, // be translated. std::string exe = command[0]; cmMakefile* mf = this->Test->GetMakefile(); + cmLocalGenerator* lg = mf->GetLocalGenerator(); cmTarget* target = mf->FindTargetToUse(exe); if(target && target->GetType() == cmTarget::EXECUTABLE) { // Use the target file on disk. exe = target->GetFullPath(config); + + // Prepend with the emulator when cross compiling if required. + const char * emulator = + target->GetProperty("CROSSCOMPILING_EMULATOR"); + if (emulator != 0) + { + std::vector emulatorWithArgs; + cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); + std::string emulatorExe(emulatorWithArgs[0]); + cmSystemTools::ConvertToUnixSlashes(emulatorExe); + os << lg->EscapeForCMake(emulatorExe) << " "; + for(std::vector::const_iterator ei = + emulatorWithArgs.begin()+1; + ei != emulatorWithArgs.end(); + ++ei) + { + os << lg->EscapeForCMake(*ei) << " "; + } + } } else { @@ -96,7 +116,6 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, } // Generate the command line with full escapes. - cmLocalGenerator* lg = mf->GetLocalGenerator(); os << lg->EscapeForCMake(exe); for(std::vector::const_iterator ci = command.begin()+1; ci != command.end(); ++ci) diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake new file mode 100644 index 0000000..1ed8dd9 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake @@ -0,0 +1,12 @@ +set(testfile "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake") +if(EXISTS "${testfile}") + file(READ "${testfile}" testfile_contents) +else() + message(FATAL_ERROR "Could not find expected CTestTestfile.cmake.") +endif() +if(testfile_contents MATCHES "add_test[(]DoesNotUseEmulator [^ ]+pseudo_emulator.+$") + message(SEND_ERROR "Used emulator when it should not be used.") +endif() +if(NOT testfile_contents MATCHES "add_test[(]UsesEmulator [^ ]+pseudo_emulator.+$") + message(SEND_ERROR "Did not use emulator when it should be used.") +endif() diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake new file mode 100644 index 0000000..41850f2 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake @@ -0,0 +1,8 @@ +set(CMAKE_CROSSCOMPILING 1) +enable_testing() +add_test(NAME DoesNotUseEmulator + COMMAND ${CMAKE_COMMAND} -E echo "Hi") + +add_executable(generated_exe simple_src.cxx) +add_test(NAME UsesEmulator + COMMAND generated_exe) diff --git a/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in b/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in new file mode 100644 index 0000000..c95fd8b --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in @@ -0,0 +1 @@ +CMAKE_EMULATOR:STRING=@PSEUDO_EMULATOR@ diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake index 04fb7db..2581cfc 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -5,3 +5,4 @@ set(RunCMake_TEST_OPTIONS run_cmake(CrosscompilingEmulatorProperty) run_cmake(TryRun) +run_cmake(AddTest) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95a6495f689e74993311533f877632071e4ab97a commit 95a6495f689e74993311533f877632071e4ab97a Author: Matt McCormick AuthorDate: Sat Mar 28 14:18:38 2015 -0400 Commit: Matt McCormick CommitDate: Tue Apr 7 00:53:05 2015 -0400 try_run: Use CMAKE_CROSSCOMPILING_EMULATOR. If the CMAKE_CROSSCOMPILING_EMULATOR variable is defined, and CMAKE_CROSSCOMPILING is TRUE, then use CMAKE_CROSSCOMPILING_EMULATOR to run the try_run executables. This prevents the need to populate TryRunResults.cmake when cross compiling. diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst index fa6f1b7..95d2c7f 100644 --- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst +++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -1,5 +1,12 @@ CMAKE_CROSSCOMPILING_EMULATOR ----------------------------- -Default value for the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property of -executables. See that target property for additional information. +This variable is only used when :variable:`CMAKE_CROSSCOMPILING` is on. It +should point to a command on the host system that can run executable built +for the target system. + +The command will be used to run :command:`try_run` generated executables, +which avoids manual population of the TryRunResults.cmake file. + +It is also used as the default value for the +:prop_tgt:`CROSSCOMPILING_EMULATOR` target property of executables. diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index b5280cf..8b68d64 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -149,7 +149,8 @@ bool cmTryRunCommand { // "run" it and capture the output std::string runOutputContents; - if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING")) + if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING") && + !this->Makefile->IsDefinitionSet("CMAKE_CROSSCOMPILING_EMULATOR")) { this->DoNotRunExecutable(runArgs, argv[3], @@ -195,7 +196,28 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, std::string* out) { int retVal = -1; - std::string finalCommand = cmSystemTools::ConvertToRunCommandPath( + + std::string finalCommand; + const std::string emulator = + this->Makefile->GetSafeDefinition("CMAKE_CROSSCOMPILING_EMULATOR"); + if (!emulator.empty()) + { + std::vector emulatorWithArgs; + cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); + finalCommand += cmSystemTools::ConvertToRunCommandPath( + emulatorWithArgs[0].c_str()); + finalCommand += " "; + for (std::vector::const_iterator ei = + emulatorWithArgs.begin()+1; + ei != emulatorWithArgs.end(); ++ei) + { + finalCommand += "\""; + finalCommand += *ei; + finalCommand += "\""; + finalCommand += " "; + } + } + finalCommand += cmSystemTools::ConvertToRunCommandPath( this->OutputFile.c_str()); if (!runArgs.empty()) { diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake index cecc57f..04fb7db 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -4,3 +4,4 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR}") run_cmake(CrosscompilingEmulatorProperty) +run_cmake(TryRun) diff --git a/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt b/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt new file mode 100644 index 0000000..d012974 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt @@ -0,0 +1 @@ +run_result: 42 diff --git a/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake b/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake new file mode 100644 index 0000000..4851cc7 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake @@ -0,0 +1,18 @@ +set(CMAKE_CROSSCOMPILING 1) + +try_run(run_result compile_result + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/simple_src.cxx + RUN_OUTPUT_VARIABLE run_output) + +message(STATUS "run_output: ${run_output}") +message(STATUS "run_result: ${run_result}") + +set(CMAKE_CROSSCOMPILING_EMULATOR ${CMAKE_CROSSCOMPILING_EMULATOR} + --flag + "multi arg") +try_run(run_result compile_result + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/simple_src.cxx + RUN_OUTPUT_VARIABLE run_output) +message(STATUS "Emulator with arguments run_output: ${run_output}") diff --git a/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx index 630adc6..e5e94f2 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx +++ b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx @@ -1,4 +1,4 @@ int main(int, char **) { - return 0; + return 13; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fac937bc25f6b6f0860e714ae9175f62e5fd30d commit 0fac937bc25f6b6f0860e714ae9175f62e5fd30d Author: Matt McCormick AuthorDate: Tue Mar 24 00:02:50 2015 -0400 Commit: Matt McCormick CommitDate: Tue Apr 7 00:45:02 2015 -0400 Properties: Add CROSSCOMPILING_EMULATOR target property. Add CROSSCOMPILING_EMULATOR target property for executables. This is used by subsequent patches to run exectuables created for the target system when crosscompiling. The property is initialized by the CMAKE_CROSSCOMPILING_EMULATOR variable when defined. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 1dff33e..d5e2d60 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -113,6 +113,7 @@ Properties on Targets /prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG /prop_tgt/CONFIG_OUTPUT_NAME /prop_tgt/CONFIG_POSTFIX + /prop_tgt/CROSSCOMPILING_EMULATOR /prop_tgt/CXX_EXTENSIONS /prop_tgt/CXX_STANDARD /prop_tgt/CXX_STANDARD_REQUIRED diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index c342dbe..63f704d 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -25,6 +25,7 @@ Variables that Provide Information /variable/CMAKE_CFG_INTDIR /variable/CMAKE_COMMAND /variable/CMAKE_CROSSCOMPILING + /variable/CMAKE_CROSSCOMPILING_EMULATOR /variable/CMAKE_CTEST_COMMAND /variable/CMAKE_CURRENT_BINARY_DIR /variable/CMAKE_CURRENT_LIST_DIR diff --git a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst new file mode 100644 index 0000000..2b5fd4d --- /dev/null +++ b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst @@ -0,0 +1,4 @@ +CROSSCOMPILING_EMULATOR +----------------------- + +Use the given emulator to run executables created when crosscompiling. diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst new file mode 100644 index 0000000..fa6f1b7 --- /dev/null +++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -0,0 +1,5 @@ +CMAKE_CROSSCOMPILING_EMULATOR +----------------------------- + +Default value for the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property of +executables. See that target property for additional information. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b3d1155..85e5165 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -442,6 +442,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) if(this->TargetTypeValue == cmTarget::EXECUTABLE) { this->SetPropertyDefault("ANDROID_GUI", 0); + this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", 0); } if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY || this->TargetTypeValue == cmTarget::MODULE_LIBRARY) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 7b9c810..4bbb521 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -220,3 +220,7 @@ add_RunCMake_test(COMPILE_LANGUAGE-genex) if(CMake_TEST_FindMatlab) add_RunCMake_test(FindMatlab) endif() + +add_executable(pseudo_emulator pseudo_emulator.c) +add_RunCMake_test(CrosscompilingEmulator + -DPSEUDO_EMULATOR=$) diff --git a/Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt b/Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt new file mode 100644 index 0000000..2d75985 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.1) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake new file mode 100644 index 0000000..22d537c --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake @@ -0,0 +1,28 @@ +# This tests setting the CROSSCOMPILING_EMULATOR target property from the +# CMAKE_CROSSCOMPILING_EMULATOR variable. + +# -DCMAKE_CROSSCOMPILING_EMULATOR=/path/to/pseudo_emulator is passed to this +# test +add_executable(target_with_emulator simple_src.cxx) +get_property(emulator TARGET target_with_emulator + PROPERTY CROSSCOMPILING_EMULATOR) +if(NOT "${emulator}" MATCHES "pseudo_emulator") + message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set") +endif() + +set_property(TARGET target_with_emulator + PROPERTY CROSSCOMPILING_EMULATOR "another_emulator") +get_property(emulator TARGET target_with_emulator + PROPERTY CROSSCOMPILING_EMULATOR) +if(NOT "${emulator}" MATCHES "another_emulator") + message(SEND_ERROR + "set_property/get_property CROSSCOMPILING_EMULATOR is not consistent") +endif() + +unset(CMAKE_CROSSCOMPILING_EMULATOR CACHE) +add_executable(target_without_emulator simple_src.cxx) +get_property(emulator TARGET target_without_emulator + PROPERTY CROSSCOMPILING_EMULATOR) +if(NOT "${emulator}" STREQUAL "") + message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set to null") +endif() diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake new file mode 100644 index 0000000..cecc57f --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -0,0 +1,6 @@ +include(RunCMake) + +set(RunCMake_TEST_OPTIONS + "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR}") + +run_cmake(CrosscompilingEmulatorProperty) diff --git a/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx new file mode 100644 index 0000000..630adc6 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx @@ -0,0 +1,4 @@ +int main(int, char **) +{ + return 0; +} diff --git a/Tests/RunCMake/pseudo_emulator.c b/Tests/RunCMake/pseudo_emulator.c new file mode 100644 index 0000000..33be24c --- /dev/null +++ b/Tests/RunCMake/pseudo_emulator.c @@ -0,0 +1,14 @@ +#include + +int main(int argc, char * argv[] ) +{ + printf("Command:"); + int ii; + for(ii = 1; ii < argc; ++ii ) + { + printf(" \"%s\"", argv[ii]); + } + printf("\n"); + + return 42; +} ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 1 + Help/manual/cmake-variables.7.rst | 1 + Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst | 6 +++++ Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst | 12 +++++++++ Source/cmTarget.cxx | 1 + Source/cmTestGenerator.cxx | 21 ++++++++++++++- Source/cmTryRunCommand.cxx | 26 ++++++++++++++++-- Tests/RunCMake/CMakeLists.txt | 4 +++ .../CrosscompilingEmulator/AddTest-check.cmake | 12 +++++++++ .../RunCMake/CrosscompilingEmulator/AddTest.cmake | 8 ++++++ .../CMakeLists.txt | 2 +- .../CrosscompilingEmulatorProperty.cmake | 28 ++++++++++++++++++++ .../CrosscompilingEmulator/InitialCache.txt.in | 1 + .../CrosscompilingEmulator/RunCMakeTest.cmake | 8 ++++++ .../CrosscompilingEmulator/TryRun-stdout.txt | 1 + Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake | 18 +++++++++++++ .../CrosscompilingEmulator/simple_src.cxx} | 3 +-- Tests/RunCMake/pseudo_emulator.c | 14 ++++++++++ 18 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst create mode 100644 Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake copy Tests/RunCMake/{CMP0059 => CrosscompilingEmulator}/CMakeLists.txt (68%) create mode 100644 Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in create mode 100644 Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt create mode 100644 Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake copy Tests/{InterfaceLibrary/dummy.cpp => RunCMake/CrosscompilingEmulator/simple_src.cxx} (67%) create mode 100644 Tests/RunCMake/pseudo_emulator.c hooks/post-receive -- CMake From gjasny at googlemail.com Tue Apr 7 09:04:07 2015 From: gjasny at googlemail.com (Gregor Jasny) Date: Tue, 7 Apr 2015 09:04:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1546-g86c4242 Message-ID: <20150407130407.E8F22AE08C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 86c4242ae6c4a91905ccf844373de94674bf02f8 (commit) via dfd6f1f2904ca577743adb5f86f1722359723a0b (commit) from 8c5395350cd986450525b06ca9983325d5e19158 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86c4242ae6c4a91905ccf844373de94674bf02f8 commit 86c4242ae6c4a91905ccf844373de94674bf02f8 Merge: 8c53953 dfd6f1f Author: Gregor Jasny AuthorDate: Tue Apr 7 09:04:06 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 09:04:06 2015 -0400 Merge topic 'xcode-quote-path' into next dfd6f1f2 Xcode: Also quote strings containing // (#15487) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dfd6f1f2904ca577743adb5f86f1722359723a0b commit dfd6f1f2904ca577743adb5f86f1722359723a0b Author: Gregor Jasny AuthorDate: Sat Apr 4 22:13:45 2015 +0200 Commit: Gregor Jasny CommitDate: Sat Apr 4 22:13:45 2015 +0200 Xcode: Also quote strings containing // (#15487) Otherwise those will be interpreted as start of a comment Signed-off-by: Gregor Jasny diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 3302a8d..5a90fd9 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -242,6 +242,7 @@ void cmXCodeObject::PrintString(std::ostream& os,std::string String) // considered special by the Xcode project file parser. bool needQuote = (String.empty() || + String.find("//") != String.npos || String.find_first_of(" <>.+-=@$[],") != String.npos); const char* quote = needQuote? "\"" : ""; diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index 03d3cd3..b7de614 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -3,6 +3,7 @@ include(RunCMake) run_cmake(XcodeFileType) run_cmake(XcodeAttributeGenex) run_cmake(XcodeAttributeGenexError) +run_cmake(XcodeObjectNeedsQuote) if (NOT XCODE_VERSION VERSION_LESS 6) run_cmake(XcodePlatformFrameworks) endif() diff --git a/Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote-check.cmake b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote-check.cmake new file mode 100644 index 0000000..be7d96a --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote-check.cmake @@ -0,0 +1,7 @@ +set(expect "path = \"") +file(STRINGS ${RunCMake_TEST_BINARY_DIR}/XcodeObjectNeedsQuote.xcodeproj/project.pbxproj actual + REGEX "path = [^;]*someFileWithoutSpecialChars[^;]*;" LIMIT_COUNT 1) +if(NOT "${actual}" MATCHES "${expect}") + message(SEND_ERROR "The actual project contains the line:\n ${actual}\n" + "which does not match expected regex:\n ${expect}\n") +endif() diff --git a/Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote.cmake b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote.cmake new file mode 100644 index 0000000..ecc56ab --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote.cmake @@ -0,0 +1,3 @@ +enable_language(C) +add_library(some /${CMAKE_CURRENT_SOURCE_DIR}/someFileWithoutSpecialChars) +set_property(SOURCE /${CMAKE_CURRENT_SOURCE_DIR}/someFileWithoutSpecialChars PROPERTY LANGUAGE C) diff --git a/Tests/RunCMake/XcodeProject/someFileWithoutSpecialChars b/Tests/RunCMake/XcodeProject/someFileWithoutSpecialChars new file mode 100644 index 0000000..e69de29 ----------------------------------------------------------------------- Summary of changes: Source/cmXCodeObject.cxx | 1 + Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 1 + Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote-check.cmake | 7 +++++++ Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote.cmake | 3 +++ .../RunCMake/XcodeProject/someFileWithoutSpecialChars | 0 5 files changed, 12 insertions(+) create mode 100644 Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote-check.cmake create mode 100644 Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote.cmake copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/XcodeProject/someFileWithoutSpecialChars (100%) hooks/post-receive -- CMake From nilsgladitz at gmail.com Tue Apr 7 09:45:16 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 7 Apr 2015 09:45:16 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1550-g58bbc94 Message-ID: <20150407134517.1492AACA31@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 58bbc94bfd87cdd3fc15c8b08c568db5ef319f56 (commit) via 79cbd5015f5fb615075b7462b4ccbc9906ce9094 (commit) via c9860d2d41e344f925116a985997f78773013b81 (commit) via 52d5a9b60ba9c375c9381c7afa7441d6dadd9742 (commit) from 86c4242ae6c4a91905ccf844373de94674bf02f8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58bbc94bfd87cdd3fc15c8b08c568db5ef319f56 commit 58bbc94bfd87cdd3fc15c8b08c568db5ef319f56 Merge: 86c4242 79cbd50 Author: Nils Gladitz AuthorDate: Tue Apr 7 09:45:15 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 09:45:15 2015 -0400 Merge topic 'tar-write-format' into next 79cbd501 CTestCoverageCollectGCOV: Write tar files intended for CDash in gnutar format c9860d2d cmake: Teach "-E tar" command a "--format=" option 52d5a9b6 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79cbd5015f5fb615075b7462b4ccbc9906ce9094 commit 79cbd5015f5fb615075b7462b4ccbc9906ce9094 Author: Nils Gladitz AuthorDate: Tue Apr 7 12:41:55 2015 +0200 Commit: Nils Gladitz CommitDate: Tue Apr 7 15:43:28 2015 +0200 CTestCoverageCollectGCOV: Write tar files intended for CDash in gnutar format PHP's PharData can not currently (PHP 5.6.4) extract paxr tar archives with long filenames. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 8659a69..6c74cf3 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -198,6 +198,7 @@ ${label_files} execute_process(COMMAND ${CMAKE_COMMAND} -E tar ${tar_opts} ${GCOV_TARBALL} "--mtime=1970-01-01 0:0:0 UTC" + "--format=gnutar" --files-from=${coverage_dir}/coverage_file_list.txt WORKING_DIRECTORY ${binary_dir}) endfunction() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9860d2d41e344f925116a985997f78773013b81 commit c9860d2d41e344f925116a985997f78773013b81 Author: Nils Gladitz AuthorDate: Tue Apr 7 12:36:52 2015 +0200 Commit: Nils Gladitz CommitDate: Tue Apr 7 15:43:28 2015 +0200 cmake: Teach "-E tar" command a "--format=" option Allows specifying a libarchive defined archive format currently restricted to 7zip, gnutar, pax, paxr and zip. The default is "paxr" (pax restricted). diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index da41bbb..b2f7e9d 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -215,6 +215,10 @@ Available commands are: names start in ``-``. ``--mtime=`` Specify modification time recorded in tarball entries. + ``--format=`` + Specify the format of the archive to be created. + Supported formats are: ``7zip``, ``gnutar``, ``pax``, + ``paxr`` (restricted pax, default), and ``zip``. ``time [...]`` Run command and return elapsed time. diff --git a/Help/release/dev/tar-write-format.rst b/Help/release/dev/tar-write-format.rst new file mode 100644 index 0000000..004df21 --- /dev/null +++ b/Help/release/dev/tar-write-format.rst @@ -0,0 +1,6 @@ +tar-write-format +---------------- + +* The :manual:`cmake(1)` ``-E tar`` command learned a new + ``--format`` option to specify the archive format to + be written. diff --git a/Source/CPack/cmCPack7zGenerator.cxx b/Source/CPack/cmCPack7zGenerator.cxx index ce31ad4..2809e56 100644 --- a/Source/CPack/cmCPack7zGenerator.cxx +++ b/Source/CPack/cmCPack7zGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPack7zGenerator::cmCPack7zGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, - cmArchiveWrite::Type7Zip) + "7zip") { } diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 05b5cd9..58bd947 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -27,10 +27,10 @@ //---------------------------------------------------------------------- cmCPackArchiveGenerator::cmCPackArchiveGenerator(cmArchiveWrite::Compress t, - cmArchiveWrite::Type at) + std::string const& format) { this->Compress = t; - this->Archive = at; + this->ArchiveFormat = format; } //---------------------------------------------------------------------- @@ -108,7 +108,7 @@ if (!GenerateHeader(&gf)) \ << ">." << std::endl); \ return 0; \ } \ -cmArchiveWrite archive(gf,this->Compress, this->Archive); \ +cmArchiveWrite archive(gf,this->Compress, this->ArchiveFormat); \ if (!archive) \ { \ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " \ diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index 6411b1e..16e7632 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -31,7 +31,7 @@ public: /** * Construct generator */ - cmCPackArchiveGenerator(cmArchiveWrite::Compress, cmArchiveWrite::Type); + cmCPackArchiveGenerator(cmArchiveWrite::Compress, std::string const& format); virtual ~cmCPackArchiveGenerator(); // Used to add a header to the archive virtual int GenerateHeader(std::ostream* os); @@ -68,7 +68,7 @@ protected: int PackageComponentsAllInOne(); virtual const char* GetOutputExtension() = 0; cmArchiveWrite::Compress Compress; - cmArchiveWrite::Type Archive; + std::string ArchiveFormat; }; #endif diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx index 509c7f8..3fa2b64 100644 --- a/Source/CPack/cmCPackTGZGenerator.cxx +++ b/Source/CPack/cmCPackTGZGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTGZGenerator::cmCPackTGZGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressGZip, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTXZGenerator.cxx b/Source/CPack/cmCPackTXZGenerator.cxx index ecfc177..6d4ede1 100644 --- a/Source/CPack/cmCPackTXZGenerator.cxx +++ b/Source/CPack/cmCPackTXZGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTXZGenerator::cmCPackTXZGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx index ae73c37..9ff588b 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.cxx +++ b/Source/CPack/cmCPackTarBZip2Generator.cxx @@ -14,7 +14,7 @@ //---------------------------------------------------------------------- cmCPackTarBZip2Generator::cmCPackTarBZip2Generator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressBZip2, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx index df29408..1c8311b 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.cxx +++ b/Source/CPack/cmCPackTarCompressGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTarCompressGenerator::cmCPackTarCompressGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressCompress, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx index e6e4e77..7ef7729 100644 --- a/Source/CPack/cmCPackZIPGenerator.cxx +++ b/Source/CPack/cmCPackZIPGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackZIPGenerator::cmCPackZIPGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, - cmArchiveWrite::TypeZIP) + "zip") { } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index cf2fe82..72818f5 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -79,11 +79,12 @@ struct cmArchiveWrite::Callback }; //---------------------------------------------------------------------------- -cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): - Stream(os), - Archive(archive_write_new()), - Disk(archive_read_disk_new()), - Verbose(false) +cmArchiveWrite::cmArchiveWrite( + std::ostream& os, Compress c, std::string const& format): + Stream(os), + Archive(archive_write_new()), + Disk(archive_read_disk_new()), + Verbose(false) { switch (c) { @@ -141,35 +142,16 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): { this->Error = "archive_read_disk_set_standard_lookup: "; this->Error += cm_archive_error_string(this->Archive); - return;; + return; } #endif - switch (t) + + if(archive_write_set_format_by_name(this->Archive, format.c_str()) + != ARCHIVE_OK) { - case TypeZIP: - if(archive_write_set_format_zip(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_zip: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; - case TypeTAR: - if(archive_write_set_format_pax_restricted(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_pax_restricted: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; - case Type7Zip: - if(archive_write_set_format_7zip(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_7zip: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; + this->Error = "archive_write_set_format_by_name: "; + this->Error += cm_archive_error_string(this->Archive); + return; } // do not pad the last block!! diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 17357b4..794cb28 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -38,16 +38,10 @@ public: CompressXZ }; - /** Archive Type */ - enum Type - { - TypeTAR, - TypeZIP, - Type7Zip - }; - /** Construct with output stream to which to write archive. */ - cmArchiveWrite(std::ostream& os, Compress c = CompressNone, Type = TypeTAR); + cmArchiveWrite(std::ostream& os, Compress c = CompressNone, + std::string const& format = "paxr"); + ~cmArchiveWrite(); /** diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 5264123..95d05a6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1475,7 +1475,8 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, - bool verbose, std::string const& mtime) + bool verbose, std::string const& mtime, + std::string const& format) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1505,8 +1506,10 @@ bool cmSystemTools::CreateTar(const char* outFileName, compress = cmArchiveWrite::CompressNone; break; } + cmArchiveWrite a(fout, compress, - cmArchiveWrite::TypeTAR); + format.empty() ? "paxr" : format); + a.SetMTime(mtime); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index c59ae96..433ef46 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -395,7 +395,8 @@ public: static bool CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, bool verbose, - std::string const& mtime = std::string()); + std::string const& mtime = std::string(), + std::string const& format = 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/cmcmd.cxx b/Source/cmcmd.cxx index 9f2ea46..c561e17 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -703,10 +703,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) // Tar files else if (args[1] == "tar" && args.size() > 3) { + const char* knownFormats[] = + { + "7zip", + "gnutar", + "pax", + "paxr", + "zip" + }; + std::string flags = args[2]; std::string outFile = args[3]; std::vector files; std::string mtime; + std::string format; bool doing_options = true; for (std::string::size_type cc = 4; cc < args.size(); cc ++) { @@ -729,6 +739,19 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) return 1; } } + else if (cmHasLiteralPrefix(arg, "--format=")) + { + format = arg.substr(9); + bool isKnown = std::find(cmArrayBegin(knownFormats), + cmArrayEnd(knownFormats), format) != cmArrayEnd(knownFormats); + + if(!isKnown) + { + cmSystemTools::Error("Unknown -E tar --format= argument: ", + format.c_str()); + return 1; + } + } else { cmSystemTools::Error("Unknown option to -E tar: ", arg.c_str()); @@ -781,7 +804,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, mtime) ) + outFile.c_str(), files, compress, verbose, mtime, format) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt new file mode 100644 index 0000000..fe9e2dc --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt @@ -0,0 +1 @@ +CMake Error: Unknown -E tar --format= argument: bad-format diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index e8b4584..e3942a8 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -10,6 +10,7 @@ run_cmake_command(E_tar-bad-from5 ${CMAKE_COMMAND} -E tar cvf bad.tar --files-f 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(E_tar-bad-format ${CMAKE_COMMAND} -E tar cvf bad.tar "--format=bad-format") run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake.1.rst | 4 ++ Help/release/dev/tar-write-format.rst | 6 +++ Modules/CTestCoverageCollectGCOV.cmake | 1 + Source/CMakeVersion.cmake | 2 +- Source/CPack/cmCPack7zGenerator.cxx | 2 +- Source/CPack/cmCPackArchiveGenerator.cxx | 6 +-- Source/CPack/cmCPackArchiveGenerator.h | 4 +- Source/CPack/cmCPackTGZGenerator.cxx | 2 +- Source/CPack/cmCPackTXZGenerator.cxx | 2 +- Source/CPack/cmCPackTarBZip2Generator.cxx | 2 +- Source/CPack/cmCPackTarCompressGenerator.cxx | 2 +- Source/CPack/cmCPackZIPGenerator.cxx | 2 +- Source/cmArchiveWrite.cxx | 44 ++++++-------------- Source/cmArchiveWrite.h | 12 ++---- Source/cmSystemTools.cxx | 7 +++- Source/cmSystemTools.h | 3 +- Source/cmcmd.cxx | 25 ++++++++++- .../E_tar-bad-format-result.txt} | 0 .../CommandLine/E_tar-bad-format-stderr.txt | 3 +- Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 1 + 20 files changed, 72 insertions(+), 58 deletions(-) create mode 100644 Help/release/dev/tar-write-format.rst copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-format-result.txt} (100%) copy Modules/Platform/Linux-PGI-Fortran.cmake => Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt (50%) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 11:22:48 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 11:22:48 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1552-g3edfc7c Message-ID: <20150407152248.A48A8AD5C0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3edfc7c8774e64a54b2222c8d52db3213eaf3248 (commit) via 53883968ce61d2a291811d91ca44eea51260b963 (commit) from 58bbc94bfd87cdd3fc15c8b08c568db5ef319f56 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3edfc7c8774e64a54b2222c8d52db3213eaf3248 commit 3edfc7c8774e64a54b2222c8d52db3213eaf3248 Merge: 58bbc94 5388396 Author: Brad King AuthorDate: Tue Apr 7 11:22:47 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 11:22:47 2015 -0400 Merge topic 'emulator-property' into next 53883968 Revert topic 'emulator-property' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53883968ce61d2a291811d91ca44eea51260b963 commit 53883968ce61d2a291811d91ca44eea51260b963 Author: Brad King AuthorDate: Tue Apr 7 11:22:20 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 11:22:20 2015 -0400 Revert topic 'emulator-property' It fails several tests and needs to be revised. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index d5e2d60..1dff33e 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -113,7 +113,6 @@ Properties on Targets /prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG /prop_tgt/CONFIG_OUTPUT_NAME /prop_tgt/CONFIG_POSTFIX - /prop_tgt/CROSSCOMPILING_EMULATOR /prop_tgt/CXX_EXTENSIONS /prop_tgt/CXX_STANDARD /prop_tgt/CXX_STANDARD_REQUIRED diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 63f704d..c342dbe 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -25,7 +25,6 @@ Variables that Provide Information /variable/CMAKE_CFG_INTDIR /variable/CMAKE_COMMAND /variable/CMAKE_CROSSCOMPILING - /variable/CMAKE_CROSSCOMPILING_EMULATOR /variable/CMAKE_CTEST_COMMAND /variable/CMAKE_CURRENT_BINARY_DIR /variable/CMAKE_CURRENT_LIST_DIR diff --git a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst deleted file mode 100644 index 3ef8e03..0000000 --- a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst +++ /dev/null @@ -1,6 +0,0 @@ -CROSSCOMPILING_EMULATOR ------------------------ - -Use the given emulator to run executables created when crosscompiling. This -command will be added as a prefix to :command:`add_test` test commands for -built target system executables. diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst deleted file mode 100644 index 95d2c7f..0000000 --- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst +++ /dev/null @@ -1,12 +0,0 @@ -CMAKE_CROSSCOMPILING_EMULATOR ------------------------------ - -This variable is only used when :variable:`CMAKE_CROSSCOMPILING` is on. It -should point to a command on the host system that can run executable built -for the target system. - -The command will be used to run :command:`try_run` generated executables, -which avoids manual population of the TryRunResults.cmake file. - -It is also used as the default value for the -:prop_tgt:`CROSSCOMPILING_EMULATOR` target property of executables. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 85e5165..b3d1155 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -442,7 +442,6 @@ void cmTarget::SetMakefile(cmMakefile* mf) if(this->TargetTypeValue == cmTarget::EXECUTABLE) { this->SetPropertyDefault("ANDROID_GUI", 0); - this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", 0); } if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY || this->TargetTypeValue == cmTarget::MODULE_LIBRARY) diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index add80fa..f87a535 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -82,31 +82,11 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, // be translated. std::string exe = command[0]; cmMakefile* mf = this->Test->GetMakefile(); - cmLocalGenerator* lg = mf->GetLocalGenerator(); cmTarget* target = mf->FindTargetToUse(exe); if(target && target->GetType() == cmTarget::EXECUTABLE) { // Use the target file on disk. exe = target->GetFullPath(config); - - // Prepend with the emulator when cross compiling if required. - const char * emulator = - target->GetProperty("CROSSCOMPILING_EMULATOR"); - if (emulator != 0) - { - std::vector emulatorWithArgs; - cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); - std::string emulatorExe(emulatorWithArgs[0]); - cmSystemTools::ConvertToUnixSlashes(emulatorExe); - os << lg->EscapeForCMake(emulatorExe) << " "; - for(std::vector::const_iterator ei = - emulatorWithArgs.begin()+1; - ei != emulatorWithArgs.end(); - ++ei) - { - os << lg->EscapeForCMake(*ei) << " "; - } - } } else { @@ -116,6 +96,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, } // Generate the command line with full escapes. + cmLocalGenerator* lg = mf->GetLocalGenerator(); os << lg->EscapeForCMake(exe); for(std::vector::const_iterator ci = command.begin()+1; ci != command.end(); ++ci) diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 8b68d64..b5280cf 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -149,8 +149,7 @@ bool cmTryRunCommand { // "run" it and capture the output std::string runOutputContents; - if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING") && - !this->Makefile->IsDefinitionSet("CMAKE_CROSSCOMPILING_EMULATOR")) + if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING")) { this->DoNotRunExecutable(runArgs, argv[3], @@ -196,28 +195,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, std::string* out) { int retVal = -1; - - std::string finalCommand; - const std::string emulator = - this->Makefile->GetSafeDefinition("CMAKE_CROSSCOMPILING_EMULATOR"); - if (!emulator.empty()) - { - std::vector emulatorWithArgs; - cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); - finalCommand += cmSystemTools::ConvertToRunCommandPath( - emulatorWithArgs[0].c_str()); - finalCommand += " "; - for (std::vector::const_iterator ei = - emulatorWithArgs.begin()+1; - ei != emulatorWithArgs.end(); ++ei) - { - finalCommand += "\""; - finalCommand += *ei; - finalCommand += "\""; - finalCommand += " "; - } - } - finalCommand += cmSystemTools::ConvertToRunCommandPath( + std::string finalCommand = cmSystemTools::ConvertToRunCommandPath( this->OutputFile.c_str()); if (!runArgs.empty()) { diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 4bbb521..7b9c810 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -220,7 +220,3 @@ add_RunCMake_test(COMPILE_LANGUAGE-genex) if(CMake_TEST_FindMatlab) add_RunCMake_test(FindMatlab) endif() - -add_executable(pseudo_emulator pseudo_emulator.c) -add_RunCMake_test(CrosscompilingEmulator - -DPSEUDO_EMULATOR=$) diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake deleted file mode 100644 index 1ed8dd9..0000000 --- a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake +++ /dev/null @@ -1,12 +0,0 @@ -set(testfile "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake") -if(EXISTS "${testfile}") - file(READ "${testfile}" testfile_contents) -else() - message(FATAL_ERROR "Could not find expected CTestTestfile.cmake.") -endif() -if(testfile_contents MATCHES "add_test[(]DoesNotUseEmulator [^ ]+pseudo_emulator.+$") - message(SEND_ERROR "Used emulator when it should not be used.") -endif() -if(NOT testfile_contents MATCHES "add_test[(]UsesEmulator [^ ]+pseudo_emulator.+$") - message(SEND_ERROR "Did not use emulator when it should be used.") -endif() diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake deleted file mode 100644 index 41850f2..0000000 --- a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake +++ /dev/null @@ -1,8 +0,0 @@ -set(CMAKE_CROSSCOMPILING 1) -enable_testing() -add_test(NAME DoesNotUseEmulator - COMMAND ${CMAKE_COMMAND} -E echo "Hi") - -add_executable(generated_exe simple_src.cxx) -add_test(NAME UsesEmulator - COMMAND generated_exe) diff --git a/Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt b/Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt deleted file mode 100644 index 2d75985..0000000 --- a/Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(${RunCMake_TEST} CXX) -include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake deleted file mode 100644 index 22d537c..0000000 --- a/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# This tests setting the CROSSCOMPILING_EMULATOR target property from the -# CMAKE_CROSSCOMPILING_EMULATOR variable. - -# -DCMAKE_CROSSCOMPILING_EMULATOR=/path/to/pseudo_emulator is passed to this -# test -add_executable(target_with_emulator simple_src.cxx) -get_property(emulator TARGET target_with_emulator - PROPERTY CROSSCOMPILING_EMULATOR) -if(NOT "${emulator}" MATCHES "pseudo_emulator") - message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set") -endif() - -set_property(TARGET target_with_emulator - PROPERTY CROSSCOMPILING_EMULATOR "another_emulator") -get_property(emulator TARGET target_with_emulator - PROPERTY CROSSCOMPILING_EMULATOR) -if(NOT "${emulator}" MATCHES "another_emulator") - message(SEND_ERROR - "set_property/get_property CROSSCOMPILING_EMULATOR is not consistent") -endif() - -unset(CMAKE_CROSSCOMPILING_EMULATOR CACHE) -add_executable(target_without_emulator simple_src.cxx) -get_property(emulator TARGET target_without_emulator - PROPERTY CROSSCOMPILING_EMULATOR) -if(NOT "${emulator}" STREQUAL "") - message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set to null") -endif() diff --git a/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in b/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in deleted file mode 100644 index c95fd8b..0000000 --- a/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in +++ /dev/null @@ -1 +0,0 @@ -CMAKE_EMULATOR:STRING=@PSEUDO_EMULATOR@ diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake deleted file mode 100644 index 2581cfc..0000000 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ /dev/null @@ -1,8 +0,0 @@ -include(RunCMake) - -set(RunCMake_TEST_OPTIONS - "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR}") - -run_cmake(CrosscompilingEmulatorProperty) -run_cmake(TryRun) -run_cmake(AddTest) diff --git a/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt b/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt deleted file mode 100644 index d012974..0000000 --- a/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -run_result: 42 diff --git a/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake b/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake deleted file mode 100644 index 4851cc7..0000000 --- a/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake +++ /dev/null @@ -1,18 +0,0 @@ -set(CMAKE_CROSSCOMPILING 1) - -try_run(run_result compile_result - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/simple_src.cxx - RUN_OUTPUT_VARIABLE run_output) - -message(STATUS "run_output: ${run_output}") -message(STATUS "run_result: ${run_result}") - -set(CMAKE_CROSSCOMPILING_EMULATOR ${CMAKE_CROSSCOMPILING_EMULATOR} - --flag - "multi arg") -try_run(run_result compile_result - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/simple_src.cxx - RUN_OUTPUT_VARIABLE run_output) -message(STATUS "Emulator with arguments run_output: ${run_output}") diff --git a/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx deleted file mode 100644 index e5e94f2..0000000 --- a/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx +++ /dev/null @@ -1,4 +0,0 @@ -int main(int, char **) -{ - return 13; -} diff --git a/Tests/RunCMake/pseudo_emulator.c b/Tests/RunCMake/pseudo_emulator.c deleted file mode 100644 index 33be24c..0000000 --- a/Tests/RunCMake/pseudo_emulator.c +++ /dev/null @@ -1,14 +0,0 @@ -#include - -int main(int argc, char * argv[] ) -{ - printf("Command:"); - int ii; - for(ii = 1; ii < argc; ++ii ) - { - printf(" \"%s\"", argv[ii]); - } - printf("\n"); - - return 42; -} ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 1 - Help/manual/cmake-variables.7.rst | 1 - Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst | 6 ----- Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst | 12 --------- Source/cmTarget.cxx | 1 - Source/cmTestGenerator.cxx | 21 +-------------- Source/cmTryRunCommand.cxx | 26 ++---------------- Tests/RunCMake/CMakeLists.txt | 4 --- .../CrosscompilingEmulator/AddTest-check.cmake | 12 --------- .../RunCMake/CrosscompilingEmulator/AddTest.cmake | 8 ------ .../RunCMake/CrosscompilingEmulator/CMakeLists.txt | 3 --- .../CrosscompilingEmulatorProperty.cmake | 28 -------------------- .../CrosscompilingEmulator/InitialCache.txt.in | 1 - .../CrosscompilingEmulator/RunCMakeTest.cmake | 8 ------ .../CrosscompilingEmulator/TryRun-stdout.txt | 1 - Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake | 18 ------------- .../RunCMake/CrosscompilingEmulator/simple_src.cxx | 4 --- Tests/RunCMake/pseudo_emulator.c | 14 ---------- 18 files changed, 3 insertions(+), 166 deletions(-) delete mode 100644 Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst delete mode 100644 Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst delete mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake delete mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake delete mode 100644 Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt delete mode 100644 Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake delete mode 100644 Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in delete mode 100644 Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake delete mode 100644 Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt delete mode 100644 Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake delete mode 100644 Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx delete mode 100644 Tests/RunCMake/pseudo_emulator.c hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 11:24:23 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 11:24:23 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1556-g68fc449 Message-ID: <20150407152424.0F879AD68E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 68fc449d9bbf90f05a1a2fa711612ba5ce62d594 (commit) via 446a1866e17ed79403a5ddb8e75c3acd3badc460 (commit) via 318cd37097c724fac13a364fe3beb21055575ae7 (commit) via 1535dcd894eab9eea023d93aec6a0274babc7fd3 (commit) from 3edfc7c8774e64a54b2222c8d52db3213eaf3248 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68fc449d9bbf90f05a1a2fa711612ba5ce62d594 commit 68fc449d9bbf90f05a1a2fa711612ba5ce62d594 Merge: 3edfc7c 446a186 Author: Brad King AuthorDate: Tue Apr 7 11:24:20 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 11:24:20 2015 -0400 Merge topic 'link-implicit-libs-full-path' into next 446a1866 Link libraries by full path even in implicit directories 318cd370 Help: Add link target for Find Modules section of cmake-developer.7 1535dcd8 Tests: Teach RunCMake to optionally merge command output to stdout http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=446a1866e17ed79403a5ddb8e75c3acd3badc460 commit 446a1866e17ed79403a5ddb8e75c3acd3badc460 Author: Brad King AuthorDate: Tue Apr 7 10:43:47 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 11:15:33 2015 -0400 Link libraries by full path even in implicit directories When CMP0003 was first introduced we wanted to link all libraries by full path. However, some projects had problems on platforms where find_library would find /usr/lib/libfoo.so when the project really wanted to link to /usr/lib//libfoo.so and had been working by accident because pre-CMP0003 behavior used -lfoo to link. We first tried to address that in commit v2.6.0~440 (Teach find_library to avoid returning library paths in system directories, 2008-01-23) by returning just "foo" for libraries in implicit link directories. This caused problems for projects expecting find_library to always return a full path. We ended up using the solution in commit v2.6.0~366 (... switch library paths found in implicit link directories to use -l, 2008-01-31). However, the special case for libraries in implicit link directories has also proven problematic and confusing. Introduce policy CMP0060 to switch to linking all libraries by full path even if they are in implicit link directories. Explain in the policy documentation the factors that led to the original approach and now to this approach. diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index 393c8b4..d903d05 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -34,14 +34,20 @@ Each ```` may be: automatically be added in the build system to make sure the named library target is up-to-date before the ```` links. + If an imported library has the :prop_tgt:`IMPORTED_NO_SONAME` + target property set, CMake may ask the linker to search for + the library instead of using the full path + (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``). + * **A full path to a library file**: The generated link line will - normally preserve the full path to the file. However, there are - some cases where CMake must ask the linker to search for the library - (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``), such as when it - appears in a system library directory that the compiler front-end - may replace with an alternative. Either way, the buildsystem will + normally preserve the full path to the file. The buildsystem will have a dependency to re-link ```` if the library file changes. + There are some cases where CMake may ask the linker to search for + the library (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``), such + as when a shared library is detected to have no ``SONAME`` field. + See policy :policy:`CMP0060` for discussion of another case. + If the library file is in a Mac OSX framework, the ``Headers`` directory of the framework will also be processed as a :ref:`usage requirement `. This has the same diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index d2960de..aff696d 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -117,3 +117,4 @@ All Policies /policy/CMP0057 /policy/CMP0058 /policy/CMP0059 + /policy/CMP0060 diff --git a/Help/policy/CMP0060.rst b/Help/policy/CMP0060.rst new file mode 100644 index 0000000..489d68f --- /dev/null +++ b/Help/policy/CMP0060.rst @@ -0,0 +1,62 @@ +CMP0060 +------- + +Link libraries by full path even in implicit directories. + +Policy :policy:`CMP0003` was introduced with the intention of always +linking library files by full path when known. However, on some +platforms (e.g. HP-UX) the compiler front-end adds alternative library +search paths for the current architecture (e.g. ``/usr/lib/`` has +alternatives to libraries in ``/usr/lib`` for the current architecture). +On such platforms the :command:`find_library` may find a library such as +``/usr/lib/libfoo.so`` that does not belong to the current architecture. + +Prior to policy :policy:`CMP0003` projects would still build in such +cases because the incorrect library path would be converted to ``-lfoo`` +on the link line and the linker would find the proper library in the +arch-specific search path provided by the compiler front-end implicitly. +At the time we chose to remain compatible with such projects by always +converting library files found in implicit link directories to ``-lfoo`` +flags to ask the linker to search for them. This approach allowed existing +projects to continue to build while still linking to libraries outside +implicit link directories via full path (such as those in the build tree). + +CMake does allow projects to override this behavior by using an +:ref:`IMPORTED library target ` with its +:prop_tgt:`IMPORTED_LOCATION` property set to the desired full path to +a library file. In fact, many :ref:`Find Modules` are learning to provide +:ref:`Imported Targets` instead of just the traditional ``Foo_LIBRARIES`` +variable listing library files. However, this makes the link line +generated for a library found by a Find Module depend on whether it +is linked through an imported target or not, which is inconsistent. +Furthermore, this behavior has been a source of confusion because the +generated link line for a library file depends on its location. It is +also problematic for projects trying to link statically because flags +like ``-Wl,-Bstatic -lfoo -Wl,-Bdynamic`` may be used to help the linker +select ``libfoo.a`` instead of ``libfoo.so`` but then leak dynamic linking +to following libraries. (See the :prop_tgt:`LINK_SEARCH_END_STATIC` +target property for a solution typically used for that problem.) + +When the special case for libraries in implicit link directories was first +introduced the list of implicit link directories was simply hard-coded +(e.g. ``/lib``, ``/usr/lib``, and a few others). Since that time, CMake +has learned to detect the implicit link directories used by the compiler +front-end. If necessary, the :command:`find_library` command could be +taught to use this information to help find libraries of the proper +architecture. + +For these reasons, CMake 3.3 and above prefer to drop the special case +and link libraries by full path even when they are in implicit link +directories. Policy ``CMP0060`` provides compatibility for existing +projects. + +The OLD behavior for this policy is to ask the linker to search for +libraries whose full paths are known to be in implicit link directories. +The NEW behavior for this policy is to link libraries by full path even +if they are in implicit link directories. + +This policy was introduced in CMake version 3.3. Unlike most policies, +CMake version |release| does *not* warn by default when this policy +is not set and simply uses OLD behavior. See documentation of the +:variable:`CMAKE_POLICY_WARNING_CMP0060 >` +variable to control the warning. diff --git a/Help/release/dev/link-implicit-libs-full-path.rst b/Help/release/dev/link-implicit-libs-full-path.rst new file mode 100644 index 0000000..7ed7245 --- /dev/null +++ b/Help/release/dev/link-implicit-libs-full-path.rst @@ -0,0 +1,6 @@ +link-implicit-libs-full-path +---------------------------- + +* Linking to library files by a full path in an implicit linker search + directory (e.g. ``/usr/lib/libfoo.a``) no longer asks the linker to + search for the library (e.g. ``-lfoo``). See policy :policy:`CMP0060`. diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst index a83c807..092fe3e 100644 --- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst +++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst @@ -11,6 +11,8 @@ warn by default: policy :policy:`CMP0047`. * ``CMAKE_POLICY_WARNING_CMP0056`` controls the warning for policy :policy:`CMP0056`. +* ``CMAKE_POLICY_WARNING_CMP0060`` controls the warning for + policy :policy:`CMP0060`. This variable should not be set by a project in CMake code. Project developers running CMake may set this variable in their cache to diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index b0e0f36..8880667 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -411,6 +411,10 @@ cmComputeLinkInformation std::vector const& dirs = this->Target->GetLinkDirectories(); this->OldLinkDirMask.insert(dirs.begin(), dirs.end()); } + + this->CMP0060Warn = + this->Makefile->PolicyOptionalWarningEnabled( + "CMAKE_POLICY_WARNING_CMP0060"); } //---------------------------------------------------------------------------- @@ -548,6 +552,22 @@ bool cmComputeLinkInformation::Compute() // Add implicit language runtime libraries and directories. this->AddImplicitLinkInfo(); + if (!this->CMP0060WarnItems.empty()) + { + std::ostringstream w; + w << (this->Makefile->GetCMakeInstance()->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0060)) << "\n" + "Some library files are in directories implicitly searched by " + "the linker when invoked for " << this->LinkLanguage << ":\n" + " " << cmJoin(this->CMP0060WarnItems, "\n ") << "\n" + "For compatibility with older versions of CMake, the generated " + "link line will ask the linker to search for these by library " + "name." + ; + this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), + this->Target->GetBacktrace()); + } + return true; } @@ -1190,6 +1210,28 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(std::string const& item) return false; } + // Check the policy for whether we should use the approach below. + switch (this->Target->GetPolicyStatusCMP0060()) + { + case cmPolicies::WARN: + if (this->CMP0060Warn) + { + // Print the warning at most once for this item. + std::string const& wid = "CMP0060-WARNING-GIVEN-" + item; + if (!this->CMakeInstance->GetPropertyAsBool(wid)) + { + this->CMakeInstance->SetProperty(wid, "1"); + this->CMP0060WarnItems.insert(item); + } + } + case cmPolicies::OLD: + break; + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::NEW: + return false; + } + // Many system linkers support multiple architectures by // automatically selecting the implicit linker search path for the // current architecture. If the library appears in an implicit link diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index e5d674a..8847141 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -175,6 +175,10 @@ private: std::vector OldUserFlagItems; bool OldLinkDirMode; + // CMP0060 warnings. + bool CMP0060Warn; + std::set CMP0060WarnItems; + // Runtime path computation. cmOrderDirectories* OrderRuntimeSearchPath; void AddLibraryRuntimeInfo(std::string const& fullPath, diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 0a61bca..e7678cb 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -390,6 +390,11 @@ cmPolicies::cmPolicies() CMP0059, "CMP0059", "Do no treat DEFINITIONS as a built-in directory property.", 3,3,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0060, "CMP0060", + "Link libraries by full path even in implicit directories.", + 3,3,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index ced9d8c..1d108c1 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -118,6 +118,7 @@ public: CMP0058, ///< Ninja requires custom command byproducts to be explicit CMP0059, ///< Do not treat ``DEFINITIONS`` as a built-in directory /// property. + CMP0060, ///< Link libraries by full path even in implicit directories. /** \brief Always the last entry. * diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a4ef977..55bf234 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -34,7 +34,8 @@ F(CMP0041) \ F(CMP0042) \ F(CMP0046) \ - F(CMP0052) + F(CMP0052) \ + F(CMP0060) class cmake; class cmMakefile; diff --git a/Tests/RunCMake/CMP0060/CMP0060-Common.cmake b/Tests/RunCMake/CMP0060/CMP0060-Common.cmake new file mode 100644 index 0000000..46cfbbf --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-Common.cmake @@ -0,0 +1,23 @@ +# Use a predictable library file name on all platforms. +set(CMAKE_STATIC_LIBRARY_PREFIX lib) +set(CMAKE_STATIC_LIBRARY_SUFFIX .a) + +# Convince CMake that it can instruct the linker to search for the +# library of the proper linkage type, but do not really pass flags. +set(CMAKE_EXE_LINK_STATIC_C_FLAGS " ") +set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS " ") + +# Convince CMake that our library is in an implicit linker search directory. +set(dir ${CMAKE_CURRENT_SOURCE_DIR}/lib) +list(APPEND CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${dir}) + +# Make a link line asking for the linker to search for the library +# look like a missing object file so we will get predictable content +# in the error message. +set(CMAKE_LINK_LIBRARY_FLAG LINKFLAG_) +set(CMAKE_LINK_LIBRARY_SUFFIX _LINKSUFFIX${CMAKE_C_OUTPUT_EXTENSION}) + +add_executable(main1 main.c) +target_link_libraries(main1 ${dir}/libCMP0060.a) +add_executable(main2 main.c) +target_link_libraries(main2 ${dir}/libCMP0060.a) diff --git a/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt new file mode 100644 index 0000000..258d73f --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt @@ -0,0 +1 @@ +Tests[\/]RunCMake[\/]CMP0060[\/]lib[\/]libCMP0060.a diff --git a/Tests/RunCMake/CMP0060/CMP0060-NEW.cmake b/Tests/RunCMake/CMP0060/CMP0060-NEW.cmake new file mode 100644 index 0000000..0414e4b --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0060 NEW) +include(CMP0060-Common.cmake) diff --git a/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt new file mode 100644 index 0000000..240764c --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt @@ -0,0 +1 @@ +LINKFLAG_CMP0060_LINKSUFFIX diff --git a/Tests/RunCMake/CMP0060/CMP0060-OLD.cmake b/Tests/RunCMake/CMP0060/CMP0060-OLD.cmake new file mode 100644 index 0000000..a9cffef --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0060 OLD) +include(CMP0060-Common.cmake) diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt new file mode 100644 index 0000000..240764c --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt @@ -0,0 +1 @@ +LINKFLAG_CMP0060_LINKSUFFIX diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake new file mode 100644 index 0000000..6b84565 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake @@ -0,0 +1 @@ +include(CMP0060-Common.cmake) diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt new file mode 100644 index 0000000..240764c --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt @@ -0,0 +1 @@ +LINKFLAG_CMP0060_LINKSUFFIX diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt new file mode 100644 index 0000000..c8d9d9a --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt @@ -0,0 +1,16 @@ +^CMake Warning \(dev\) at CMP0060-Common.cmake:[0-9]+ \(add_executable\): + Policy CMP0060 is not set: Link libraries by full path even in implicit + directories. Run "cmake --help-policy CMP0060" for policy details. Use + the cmake_policy command to set the policy and suppress this warning. + + Some library files are in directories implicitly searched by the linker + when invoked for C: + + .*/Tests/RunCMake/CMP0060/lib/libCMP0060.a + + For compatibility with older versions of CMake, the generated link line + will ask the linker to search for these by library name. +Call Stack \(most recent call first\): + CMP0060-WARN-ON.cmake:[0-9]+ \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake new file mode 100644 index 0000000..a0a7950 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake @@ -0,0 +1,2 @@ +set(CMAKE_POLICY_WARNING_CMP0060 1) +include(CMP0060-Common.cmake) diff --git a/Tests/RunCMake/CMP0060/CMakeLists.txt b/Tests/RunCMake/CMP0060/CMakeLists.txt new file mode 100644 index 0000000..db6b701 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.2) +project(${RunCMake_TEST} C) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0060/RunCMakeTest.cmake b/Tests/RunCMake/CMP0060/RunCMakeTest.cmake new file mode 100644 index 0000000..afb78fc --- /dev/null +++ b/Tests/RunCMake/CMP0060/RunCMakeTest.cmake @@ -0,0 +1,19 @@ +include(RunCMake) + +function(run_cmake_CMP0060 CASE) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0060-${CASE}-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(CMP0060-${CASE}) + set(RunCMake_TEST_OUTPUT_MERGE 1) + run_cmake_command(CMP0060-${CASE}-Build + ${CMAKE_COMMAND} --build . --config Debug + ) +endfunction() + +run_cmake_CMP0060(OLD) +run_cmake_CMP0060(NEW) +run_cmake_CMP0060(WARN-OFF) +run_cmake_CMP0060(WARN-ON) diff --git a/Tests/RunCMake/CMP0060/lib/libCMP0060.a b/Tests/RunCMake/CMP0060/lib/libCMP0060.a new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CMP0060/main.c b/Tests/RunCMake/CMP0060/main.c new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 60a8a82..de8db56 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -65,6 +65,9 @@ add_RunCMake_test(CMP0054) add_RunCMake_test(CMP0055) add_RunCMake_test(CMP0057) add_RunCMake_test(CMP0059) +if (NOT CMAKE_GENERATOR STREQUAL "Watcom WMake") + add_RunCMake_test(CMP0060) +endif() if(CMAKE_GENERATOR STREQUAL "Ninja") add_RunCMake_test(Ninja) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=318cd37097c724fac13a364fe3beb21055575ae7 commit 318cd37097c724fac13a364fe3beb21055575ae7 Author: Brad King AuthorDate: Tue Apr 7 10:06:34 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 10:30:57 2015 -0400 Help: Add link target for Find Modules section of cmake-developer.7 diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 7bffa42..ab74140 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -605,6 +605,7 @@ have a .cmake file in this directory NOT show up in the modules documentation, simply leave out the ``Help/module/.rst`` file and the ``Help/manual/cmake-modules.7.rst`` toctree entry. +.. _`Find Modules`: Find Modules ------------ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1535dcd894eab9eea023d93aec6a0274babc7fd3 commit 1535dcd894eab9eea023d93aec6a0274babc7fd3 Author: Brad King AuthorDate: Tue Apr 7 09:06:51 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 09:08:39 2015 -0400 Tests: Teach RunCMake to optionally merge command output to stdout Some tests may need to read "cmake --build" output passed through from native build tools and do not know if it will be on stdout or stderr. Optionally use the same variable for the execute_process output so that it merges them and we can always match using expected stdout. diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index abac66e..6333703 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -54,12 +54,18 @@ function(run_cmake test) if(RunCMake_MAKE_PROGRAM) list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}") endif() + if(RunCMake_TEST_OUTPUT_MERGE) + set(actual_stderr_var actual_stdout) + set(actual_stderr "") + else() + set(actual_stderr_var actual_stderr) + endif() if(RunCMake_TEST_COMMAND) execute_process( COMMAND ${RunCMake_TEST_COMMAND} WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}" OUTPUT_VARIABLE actual_stdout - ERROR_VARIABLE actual_stderr + ERROR_VARIABLE ${actual_stderr_var} RESULT_VARIABLE actual_result ) else() @@ -73,7 +79,7 @@ function(run_cmake test) ${RunCMake_TEST_OPTIONS} WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}" OUTPUT_VARIABLE actual_stdout - ERROR_VARIABLE actual_stderr + ERROR_VARIABLE ${actual_stderr_var} RESULT_VARIABLE actual_result ) endif() ----------------------------------------------------------------------- Summary of changes: Help/command/target_link_libraries.rst | 16 +++-- Help/manual/cmake-developer.7.rst | 1 + Help/manual/cmake-policies.7.rst | 1 + Help/policy/CMP0060.rst | 62 ++++++++++++++++++++ Help/release/dev/link-implicit-libs-full-path.rst | 6 ++ Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst | 2 + Source/cmComputeLinkInformation.cxx | 42 +++++++++++++ Source/cmComputeLinkInformation.h | 4 ++ Source/cmPolicies.cxx | 5 ++ Source/cmPolicies.h | 1 + Source/cmTarget.h | 3 +- Tests/RunCMake/CMP0060/CMP0060-Common.cmake | 23 ++++++++ .../RunCMake/CMP0060/CMP0060-NEW-Build-result.txt | 1 + .../RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt | 1 + Tests/RunCMake/CMP0060/CMP0060-NEW.cmake | 2 + .../RunCMake/CMP0060/CMP0060-OLD-Build-result.txt | 1 + .../RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt | 1 + Tests/RunCMake/CMP0060/CMP0060-OLD.cmake | 2 + .../CMP0060/CMP0060-WARN-OFF-Build-result.txt | 1 + .../CMP0060/CMP0060-WARN-OFF-Build-stdout.txt | 1 + Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake | 1 + .../CMP0060/CMP0060-WARN-ON-Build-result.txt | 1 + .../CMP0060/CMP0060-WARN-ON-Build-stdout.txt | 1 + Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt | 16 +++++ Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake | 2 + .../{ObjectLibrary => CMP0060}/CMakeLists.txt | 2 +- Tests/RunCMake/CMP0060/RunCMakeTest.cmake | 19 ++++++ .../RunCMake/CMP0060/lib/libCMP0060.a | 0 Tests/RunCMake/{XcodeProject => CMP0060}/main.c | 0 Tests/RunCMake/CMakeLists.txt | 3 + Tests/RunCMake/RunCMake.cmake | 10 +++- 31 files changed, 222 insertions(+), 9 deletions(-) create mode 100644 Help/policy/CMP0060.rst create mode 100644 Help/release/dev/link-implicit-libs-full-path.rst create mode 100644 Tests/RunCMake/CMP0060/CMP0060-Common.cmake create mode 100644 Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-NEW.cmake create mode 100644 Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-OLD.cmake create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake copy Tests/RunCMake/{ObjectLibrary => CMP0060}/CMakeLists.txt (61%) create mode 100644 Tests/RunCMake/CMP0060/RunCMakeTest.cmake copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CMP0060/lib/libCMP0060.a (100%) copy Tests/RunCMake/{XcodeProject => CMP0060}/main.c (100%) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 11:29:34 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 11:29:34 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-648-g470f6cd Message-ID: <20150407152934.DF5BAADBC9@public.kitware.com> This is an automated email from 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 470f6cd8a3cef4e689c6bf3f131fde47192eb0bf (commit) via d224039011f85a1061289b2869c9ff19161fc0a7 (commit) from 52d5a9b60ba9c375c9381c7afa7441d6dadd9742 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=470f6cd8a3cef4e689c6bf3f131fde47192eb0bf commit 470f6cd8a3cef4e689c6bf3f131fde47192eb0bf Merge: 52d5a9b d224039 Author: Brad King AuthorDate: Tue Apr 7 11:29:32 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 11:29:32 2015 -0400 Merge topic 'gcov-module-coverage-exclude' d2240390 Help: Add notes for topic 'gcov-module-coverage-exclude' ----------------------------------------------------------------------- Summary of changes: Help/release/dev/gcov-module-coverage-exclude.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Help/release/dev/gcov-module-coverage-exclude.rst hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 11:29:37 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 11:29:37 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-650-g64a6491 Message-ID: <20150407152939.6B8A1ADBC8@public.kitware.com> This is an automated email from 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 64a6491fb634a77195034fff41d286ce1a337ff6 (commit) via c22f6c1504037347d4052a7b441160a2b5c4ce23 (commit) from 470f6cd8a3cef4e689c6bf3f131fde47192eb0bf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=64a6491fb634a77195034fff41d286ce1a337ff6 commit 64a6491fb634a77195034fff41d286ce1a337ff6 Merge: 470f6cd c22f6c1 Author: Brad King AuthorDate: Tue Apr 7 11:29:35 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 11:29:35 2015 -0400 Merge topic 'minor-cleanups' c22f6c15 Remove unused includes. ----------------------------------------------------------------------- Summary of changes: Source/cmCacheManager.cxx | 1 - Source/cmLocalVisualStudio6Generator.cxx | 1 - 2 files changed, 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 11:29:42 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 11:29:42 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-653-g7ee897b Message-ID: <20150407152942.33AD2ADBD8@public.kitware.com> This is an automated email from 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 7ee897beec045761e796ac7468ed6e43cd58f1fe (commit) via ecb1d5b47a75a88653fe508abec1a664cc81595f (commit) via 827309af76fe3f51a2d589148ef98cf91f510c2b (commit) from 64a6491fb634a77195034fff41d286ce1a337ff6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ee897beec045761e796ac7468ed6e43cd58f1fe commit 7ee897beec045761e796ac7468ed6e43cd58f1fe Merge: 64a6491 ecb1d5b Author: Brad King AuthorDate: Tue Apr 7 11:29:40 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 11:29:40 2015 -0400 Merge topic 'vs-compiler-feature-2013-update' ecb1d5b4 Features: VS 2013 Update 3 supports initializer lists (#15494) 827309af Tests: Fix CompileFeatures cxx_generalized_initializers example ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 17 +++++++++++------ .../CompileFeatures/cxx_generalized_initializers.cpp | 8 ++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 11:30:05 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 11:30:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1560-g91da7ff Message-ID: <20150407153005.9B8E3ADBD7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 91da7ffd5a73bc3af073f52f76e7ce57b494b965 (commit) via 7ee897beec045761e796ac7468ed6e43cd58f1fe (commit) via 64a6491fb634a77195034fff41d286ce1a337ff6 (commit) via 470f6cd8a3cef4e689c6bf3f131fde47192eb0bf (commit) from 68fc449d9bbf90f05a1a2fa711612ba5ce62d594 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91da7ffd5a73bc3af073f52f76e7ce57b494b965 commit 91da7ffd5a73bc3af073f52f76e7ce57b494b965 Merge: 68fc449 7ee897b Author: Brad King AuthorDate: Tue Apr 7 11:29:58 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 11:29:58 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 11:37:16 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 11:37:16 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1562-g0fd9668 Message-ID: <20150407153716.C809FADF3B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0fd9668fc749941a67e3aadd1cf2444f764e5742 (commit) via f3ff2e38a049df35cc565b5dbed524b2a78d0d53 (commit) from 91da7ffd5a73bc3af073f52f76e7ce57b494b965 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fd9668fc749941a67e3aadd1cf2444f764e5742 commit 0fd9668fc749941a67e3aadd1cf2444f764e5742 Merge: 91da7ff f3ff2e3 Author: Brad King AuthorDate: Tue Apr 7 11:37:15 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 11:37:15 2015 -0400 Merge topic 'link-implicit-libs-full-path' into next f3ff2e38 fixup! Link libraries by full path even in implicit directories http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3ff2e38a049df35cc565b5dbed524b2a78d0d53 commit f3ff2e38a049df35cc565b5dbed524b2a78d0d53 Author: Brad King AuthorDate: Tue Apr 7 11:36:47 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 11:36:47 2015 -0400 fixup! Link libraries by full path even in implicit directories diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index f4b744b..1da1623 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -17,6 +17,7 @@ \* CMP0042 \* CMP0046 \* CMP0052 + \* CMP0060 Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From matt.mccormick at kitware.com Tue Apr 7 13:51:02 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 7 Apr 2015 13:51:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1566-g72847dd Message-ID: <20150407175102.8293DADC48@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 72847dde8e43bb6417d802bf4c5dbff62390b574 (commit) via 9688d98c90d1c496891e8e51caa7e741d5901cb7 (commit) via 0d9099a42bde7ba464d0001d6c0b33c3c3d35bec (commit) via 579c4bec6e2352448f78d9333f7382ff34a08e5a (commit) from 0fd9668fc749941a67e3aadd1cf2444f764e5742 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72847dde8e43bb6417d802bf4c5dbff62390b574 commit 72847dde8e43bb6417d802bf4c5dbff62390b574 Merge: 0fd9668 9688d98 Author: Matt McCormick AuthorDate: Tue Apr 7 13:51:00 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 13:51:00 2015 -0400 Merge topic 'emulator-property' into next 9688d98c TestGenerator: Add CROSSCOMPILING_EMULATOR support. 0d9099a4 try_run: Use CMAKE_CROSSCOMPILING_EMULATOR. 579c4bec Properties: Add CROSSCOMPILING_EMULATOR target property. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9688d98c90d1c496891e8e51caa7e741d5901cb7 commit 9688d98c90d1c496891e8e51caa7e741d5901cb7 Author: Matt McCormick AuthorDate: Sat Mar 28 22:05:35 2015 -0400 Commit: Matt McCormick CommitDate: Tue Apr 7 13:33:34 2015 -0400 TestGenerator: Add CROSSCOMPILING_EMULATOR support. Prefix test commands with the CROSSCOMPILING_EMULATOR property for target executables. This allows test suites to be run on the host when crosscompiling. diff --git a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst index 2b5fd4d..3ef8e03 100644 --- a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst +++ b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst @@ -1,4 +1,6 @@ CROSSCOMPILING_EMULATOR ----------------------- -Use the given emulator to run executables created when crosscompiling. +Use the given emulator to run executables created when crosscompiling. This +command will be added as a prefix to :command:`add_test` test commands for +built target system executables. diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index f87a535..add80fa 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -82,11 +82,31 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, // be translated. std::string exe = command[0]; cmMakefile* mf = this->Test->GetMakefile(); + cmLocalGenerator* lg = mf->GetLocalGenerator(); cmTarget* target = mf->FindTargetToUse(exe); if(target && target->GetType() == cmTarget::EXECUTABLE) { // Use the target file on disk. exe = target->GetFullPath(config); + + // Prepend with the emulator when cross compiling if required. + const char * emulator = + target->GetProperty("CROSSCOMPILING_EMULATOR"); + if (emulator != 0) + { + std::vector emulatorWithArgs; + cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); + std::string emulatorExe(emulatorWithArgs[0]); + cmSystemTools::ConvertToUnixSlashes(emulatorExe); + os << lg->EscapeForCMake(emulatorExe) << " "; + for(std::vector::const_iterator ei = + emulatorWithArgs.begin()+1; + ei != emulatorWithArgs.end(); + ++ei) + { + os << lg->EscapeForCMake(*ei) << " "; + } + } } else { @@ -96,7 +116,6 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, } // Generate the command line with full escapes. - cmLocalGenerator* lg = mf->GetLocalGenerator(); os << lg->EscapeForCMake(exe); for(std::vector::const_iterator ci = command.begin()+1; ci != command.end(); ++ci) diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake new file mode 100644 index 0000000..0aae06c --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake @@ -0,0 +1,12 @@ +set(testfile "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake") +if(EXISTS "${testfile}") + file(READ "${testfile}" testfile_contents) +else() + message(FATAL_ERROR "Could not find expected CTestTestfile.cmake.") +endif() +if(testfile_contents MATCHES "add_test[(]DoesNotUseEmulator ^(pseudo_emulator)+$") + message(SEND_ERROR "Used emulator when it should not be used.") +endif() +if(NOT testfile_contents MATCHES "add_test[(]UsesEmulator .+pseudo_emulator.+$") + message(SEND_ERROR "Did not use emulator when it should be used.") +endif() diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake new file mode 100644 index 0000000..41850f2 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake @@ -0,0 +1,8 @@ +set(CMAKE_CROSSCOMPILING 1) +enable_testing() +add_test(NAME DoesNotUseEmulator + COMMAND ${CMAKE_COMMAND} -E echo "Hi") + +add_executable(generated_exe simple_src.cxx) +add_test(NAME UsesEmulator + COMMAND generated_exe) diff --git a/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in b/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in new file mode 100644 index 0000000..c95fd8b --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in @@ -0,0 +1 @@ +CMAKE_EMULATOR:STRING=@PSEUDO_EMULATOR@ diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake index 04fb7db..2581cfc 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -5,3 +5,4 @@ set(RunCMake_TEST_OPTIONS run_cmake(CrosscompilingEmulatorProperty) run_cmake(TryRun) +run_cmake(AddTest) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d9099a42bde7ba464d0001d6c0b33c3c3d35bec commit 0d9099a42bde7ba464d0001d6c0b33c3c3d35bec Author: Matt McCormick AuthorDate: Sat Mar 28 14:18:38 2015 -0400 Commit: Matt McCormick CommitDate: Tue Apr 7 13:33:34 2015 -0400 try_run: Use CMAKE_CROSSCOMPILING_EMULATOR. If the CMAKE_CROSSCOMPILING_EMULATOR variable is defined, and CMAKE_CROSSCOMPILING is TRUE, then use CMAKE_CROSSCOMPILING_EMULATOR to run the try_run executables. This prevents the need to populate TryRunResults.cmake when cross compiling. diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst index fa6f1b7..95d2c7f 100644 --- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst +++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -1,5 +1,12 @@ CMAKE_CROSSCOMPILING_EMULATOR ----------------------------- -Default value for the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property of -executables. See that target property for additional information. +This variable is only used when :variable:`CMAKE_CROSSCOMPILING` is on. It +should point to a command on the host system that can run executable built +for the target system. + +The command will be used to run :command:`try_run` generated executables, +which avoids manual population of the TryRunResults.cmake file. + +It is also used as the default value for the +:prop_tgt:`CROSSCOMPILING_EMULATOR` target property of executables. diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index b5280cf..8b68d64 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -149,7 +149,8 @@ bool cmTryRunCommand { // "run" it and capture the output std::string runOutputContents; - if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING")) + if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING") && + !this->Makefile->IsDefinitionSet("CMAKE_CROSSCOMPILING_EMULATOR")) { this->DoNotRunExecutable(runArgs, argv[3], @@ -195,7 +196,28 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, std::string* out) { int retVal = -1; - std::string finalCommand = cmSystemTools::ConvertToRunCommandPath( + + std::string finalCommand; + const std::string emulator = + this->Makefile->GetSafeDefinition("CMAKE_CROSSCOMPILING_EMULATOR"); + if (!emulator.empty()) + { + std::vector emulatorWithArgs; + cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); + finalCommand += cmSystemTools::ConvertToRunCommandPath( + emulatorWithArgs[0].c_str()); + finalCommand += " "; + for (std::vector::const_iterator ei = + emulatorWithArgs.begin()+1; + ei != emulatorWithArgs.end(); ++ei) + { + finalCommand += "\""; + finalCommand += *ei; + finalCommand += "\""; + finalCommand += " "; + } + } + finalCommand += cmSystemTools::ConvertToRunCommandPath( this->OutputFile.c_str()); if (!runArgs.empty()) { diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake index cecc57f..04fb7db 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -4,3 +4,4 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR}") run_cmake(CrosscompilingEmulatorProperty) +run_cmake(TryRun) diff --git a/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt b/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt new file mode 100644 index 0000000..d012974 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt @@ -0,0 +1 @@ +run_result: 42 diff --git a/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake b/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake new file mode 100644 index 0000000..4851cc7 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake @@ -0,0 +1,18 @@ +set(CMAKE_CROSSCOMPILING 1) + +try_run(run_result compile_result + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/simple_src.cxx + RUN_OUTPUT_VARIABLE run_output) + +message(STATUS "run_output: ${run_output}") +message(STATUS "run_result: ${run_result}") + +set(CMAKE_CROSSCOMPILING_EMULATOR ${CMAKE_CROSSCOMPILING_EMULATOR} + --flag + "multi arg") +try_run(run_result compile_result + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/simple_src.cxx + RUN_OUTPUT_VARIABLE run_output) +message(STATUS "Emulator with arguments run_output: ${run_output}") diff --git a/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx index 630adc6..e5e94f2 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx +++ b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx @@ -1,4 +1,4 @@ int main(int, char **) { - return 0; + return 13; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=579c4bec6e2352448f78d9333f7382ff34a08e5a commit 579c4bec6e2352448f78d9333f7382ff34a08e5a Author: Matt McCormick AuthorDate: Tue Mar 24 00:02:50 2015 -0400 Commit: Matt McCormick CommitDate: Tue Apr 7 13:33:34 2015 -0400 Properties: Add CROSSCOMPILING_EMULATOR target property. Add CROSSCOMPILING_EMULATOR target property for executables. This is used by subsequent patches to run exectuables created for the target system when crosscompiling. The property is initialized by the CMAKE_CROSSCOMPILING_EMULATOR variable when defined. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index affa75f..02d164b 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -119,6 +119,7 @@ Properties on Targets /prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG /prop_tgt/CONFIG_OUTPUT_NAME /prop_tgt/CONFIG_POSTFIX + /prop_tgt/CROSSCOMPILING_EMULATOR /prop_tgt/CXX_EXTENSIONS /prop_tgt/CXX_STANDARD /prop_tgt/CXX_STANDARD_REQUIRED diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index c342dbe..63f704d 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -25,6 +25,7 @@ Variables that Provide Information /variable/CMAKE_CFG_INTDIR /variable/CMAKE_COMMAND /variable/CMAKE_CROSSCOMPILING + /variable/CMAKE_CROSSCOMPILING_EMULATOR /variable/CMAKE_CTEST_COMMAND /variable/CMAKE_CURRENT_BINARY_DIR /variable/CMAKE_CURRENT_LIST_DIR diff --git a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst new file mode 100644 index 0000000..2b5fd4d --- /dev/null +++ b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst @@ -0,0 +1,4 @@ +CROSSCOMPILING_EMULATOR +----------------------- + +Use the given emulator to run executables created when crosscompiling. diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst new file mode 100644 index 0000000..fa6f1b7 --- /dev/null +++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -0,0 +1,5 @@ +CMAKE_CROSSCOMPILING_EMULATOR +----------------------------- + +Default value for the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property of +executables. See that target property for additional information. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b3d1155..85e5165 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -442,6 +442,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) if(this->TargetTypeValue == cmTarget::EXECUTABLE) { this->SetPropertyDefault("ANDROID_GUI", 0); + this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", 0); } if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY || this->TargetTypeValue == cmTarget::MODULE_LIBRARY) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 60a8a82..977721d 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -226,3 +226,7 @@ add_RunCMake_test(COMPILE_LANGUAGE-genex) if(CMake_TEST_FindMatlab) add_RunCMake_test(FindMatlab) endif() + +add_executable(pseudo_emulator pseudo_emulator.c) +add_RunCMake_test(CrosscompilingEmulator + -DPSEUDO_EMULATOR=$) diff --git a/Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt b/Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt new file mode 100644 index 0000000..2d75985 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.1) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake new file mode 100644 index 0000000..22d537c --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake @@ -0,0 +1,28 @@ +# This tests setting the CROSSCOMPILING_EMULATOR target property from the +# CMAKE_CROSSCOMPILING_EMULATOR variable. + +# -DCMAKE_CROSSCOMPILING_EMULATOR=/path/to/pseudo_emulator is passed to this +# test +add_executable(target_with_emulator simple_src.cxx) +get_property(emulator TARGET target_with_emulator + PROPERTY CROSSCOMPILING_EMULATOR) +if(NOT "${emulator}" MATCHES "pseudo_emulator") + message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set") +endif() + +set_property(TARGET target_with_emulator + PROPERTY CROSSCOMPILING_EMULATOR "another_emulator") +get_property(emulator TARGET target_with_emulator + PROPERTY CROSSCOMPILING_EMULATOR) +if(NOT "${emulator}" MATCHES "another_emulator") + message(SEND_ERROR + "set_property/get_property CROSSCOMPILING_EMULATOR is not consistent") +endif() + +unset(CMAKE_CROSSCOMPILING_EMULATOR CACHE) +add_executable(target_without_emulator simple_src.cxx) +get_property(emulator TARGET target_without_emulator + PROPERTY CROSSCOMPILING_EMULATOR) +if(NOT "${emulator}" STREQUAL "") + message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set to null") +endif() diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake new file mode 100644 index 0000000..cecc57f --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -0,0 +1,6 @@ +include(RunCMake) + +set(RunCMake_TEST_OPTIONS + "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR}") + +run_cmake(CrosscompilingEmulatorProperty) diff --git a/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx new file mode 100644 index 0000000..630adc6 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx @@ -0,0 +1,4 @@ +int main(int, char **) +{ + return 0; +} diff --git a/Tests/RunCMake/pseudo_emulator.c b/Tests/RunCMake/pseudo_emulator.c new file mode 100644 index 0000000..9308f75 --- /dev/null +++ b/Tests/RunCMake/pseudo_emulator.c @@ -0,0 +1,15 @@ +#include + +int main(int argc, char * argv[] ) +{ + int ii; + + printf("Command:"); + for(ii = 1; ii < argc; ++ii) + { + printf(" \"%s\"", argv[ii]); + } + printf("\n"); + + return 42; +} ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 1 + Help/manual/cmake-variables.7.rst | 1 + Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst | 6 +++++ Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst | 12 +++++++++ Source/cmTarget.cxx | 1 + Source/cmTestGenerator.cxx | 21 ++++++++++++++- Source/cmTryRunCommand.cxx | 26 ++++++++++++++++-- Tests/RunCMake/CMakeLists.txt | 4 +++ .../CrosscompilingEmulator/AddTest-check.cmake | 12 +++++++++ .../RunCMake/CrosscompilingEmulator/AddTest.cmake | 8 ++++++ .../CMakeLists.txt | 2 +- .../CrosscompilingEmulatorProperty.cmake | 28 ++++++++++++++++++++ .../CrosscompilingEmulator/InitialCache.txt.in | 1 + .../CrosscompilingEmulator/RunCMakeTest.cmake | 8 ++++++ .../CrosscompilingEmulator/TryRun-stdout.txt | 1 + Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake | 18 +++++++++++++ .../CrosscompilingEmulator/simple_src.cxx} | 3 +-- Tests/RunCMake/pseudo_emulator.c | 15 +++++++++++ 18 files changed, 162 insertions(+), 6 deletions(-) create mode 100644 Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst create mode 100644 Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake copy Tests/RunCMake/{CMP0059 => CrosscompilingEmulator}/CMakeLists.txt (68%) create mode 100644 Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in create mode 100644 Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt create mode 100644 Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake copy Tests/{InterfaceLibrary/dummy.cpp => RunCMake/CrosscompilingEmulator/simple_src.cxx} (67%) create mode 100644 Tests/RunCMake/pseudo_emulator.c hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 14:00:57 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 14:00:57 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1568-gc19af05 Message-ID: <20150407180057.A4A15AE009@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c19af05c6a04482dca164a44fbcc326e591b06fd (commit) via 7e311773b5386663457bedd39cf2110da04438f2 (commit) from 72847dde8e43bb6417d802bf4c5dbff62390b574 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c19af05c6a04482dca164a44fbcc326e591b06fd commit c19af05c6a04482dca164a44fbcc326e591b06fd Merge: 72847dd 7e31177 Author: Brad King AuthorDate: Tue Apr 7 14:00:56 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 14:00:56 2015 -0400 Merge topic 'FindMatlab_add_recent_versions' into next 7e311773 FindMatlab: Look for R2014b and R2015a http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e311773b5386663457bedd39cf2110da04438f2 commit 7e311773b5386663457bedd39cf2110da04438f2 Author: Daniele E. Domenichelli AuthorDate: Tue Apr 7 11:42:02 2015 +0200 Commit: Daniele E. Domenichelli CommitDate: Tue Apr 7 11:42:02 2015 +0200 FindMatlab: Look for R2014b and R2015a diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index d08423b..b4beec3 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -228,6 +228,8 @@ if(NOT MATLAB_ADDITIONAL_VERSIONS) endif() set(MATLAB_VERSIONS_MAPPING + "R2015a=8.5" + "R2014b=8.4" "R2014a=8.3" "R2013b=8.2" "R2013a=8.1" ----------------------------------------------------------------------- Summary of changes: Modules/FindMatlab.cmake | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- CMake From robert.maynard at kitware.com Tue Apr 7 14:11:46 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Tue, 7 Apr 2015 14:11:46 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1570-ge1d2a67 Message-ID: <20150407181146.25BF3145D3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e1d2a67b86cfdc54c028128589673aae144e9c17 (commit) via aa287e70d2ecc402565228e05643e0d066b84e5e (commit) from c19af05c6a04482dca164a44fbcc326e591b06fd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e1d2a67b86cfdc54c028128589673aae144e9c17 commit e1d2a67b86cfdc54c028128589673aae144e9c17 Merge: c19af05 aa287e7 Author: Robert Maynard AuthorDate: Tue Apr 7 14:11:45 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 14:11:45 2015 -0400 Merge topic 'document_supported_compiler_feature_compilers' into next aa287e70 Document which compilers support compile-features. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa287e70d2ecc402565228e05643e0d066b84e5e commit aa287e70d2ecc402565228e05643e0d066b84e5e Author: Robert Maynard AuthorDate: Tue Apr 7 14:10:50 2015 -0400 Commit: Robert Maynard CommitDate: Tue Apr 7 14:11:30 2015 -0400 Document which compilers support compile-features. diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 7a6c249..210baa4 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -295,3 +295,15 @@ the feature-appropriate include directory add_executable(consumer_no consumer_no.cpp) target_link_libraries(consumer_no foo) + +Supported Compilers +=============================== + +Currently the supported set of compilers for the +:command:`target_compile_features` command and :prop_tgt:`CXX_STANDARD` target +property is: + +- Apple Clang ("AppleClang") for Xcode versions 4.4 though 6.1. +- GNU compiler versions 4.4 through 5.0 on UNIX and Apple ("GNU"). +- Microsoft Visual Studio ("MSVC") for versions 2010 through 2015. +- Oracle SolarisStudio ("SunPro") version 12.4. ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-compile-features.7.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 14:38:18 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 14:38:18 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1572-gbaadaeb Message-ID: <20150407183818.64994ADF90@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via baadaeb5e3799cdd3cd2bb3c5b35b7d6c9f04047 (commit) via 6077b1be39cf4ffdd449fda2d3ae0a154fe1520f (commit) from e1d2a67b86cfdc54c028128589673aae144e9c17 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=baadaeb5e3799cdd3cd2bb3c5b35b7d6c9f04047 commit baadaeb5e3799cdd3cd2bb3c5b35b7d6c9f04047 Merge: e1d2a67 6077b1b Author: Brad King AuthorDate: Tue Apr 7 14:38:17 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 14:38:17 2015 -0400 Merge topic 'document_supported_compiler_feature_compilers' into next 6077b1be fixup! Document which compilers support compile-features. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6077b1be39cf4ffdd449fda2d3ae0a154fe1520f commit 6077b1be39cf4ffdd449fda2d3ae0a154fe1520f Author: Brad King AuthorDate: Tue Apr 7 14:38:00 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 14:38:00 2015 -0400 fixup! Document which compilers support compile-features. diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 210baa4..fdcec0e 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -297,13 +297,15 @@ the feature-appropriate include directory target_link_libraries(consumer_no foo) Supported Compilers -=============================== - -Currently the supported set of compilers for the -:command:`target_compile_features` command and :prop_tgt:`CXX_STANDARD` target -property is: - -- Apple Clang ("AppleClang") for Xcode versions 4.4 though 6.1. -- GNU compiler versions 4.4 through 5.0 on UNIX and Apple ("GNU"). -- Microsoft Visual Studio ("MSVC") for versions 2010 through 2015. -- Oracle SolarisStudio ("SunPro") version 12.4. +=================== + +CMake is currently aware of the language standards and features +available from the following +:variable:`compiler ids _COMPILER_ID>` +as of the versions specified for each: + +* ``AppleClang``: Apple Clang for Xcode versions 4.4 though 6.2. +* ``Clang``: Clang compiler versions 2.9 through 3.4. +* ``GNU``: GNU compiler versions 4.4 through 5.0. +* ``MSVC``: Microsoft Visual Studio versions 2010 through 2015. +* ``SunPro``: Oracle SolarisStudio version 12.4. ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-compile-features.7.rst | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) hooks/post-receive -- CMake From jamesbigler at gmail.com Tue Apr 7 14:40:30 2015 From: jamesbigler at gmail.com (James Bigler) Date: Tue, 7 Apr 2015 14:40:30 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1575-ge409a89 Message-ID: <20150407184030.63869D7E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e409a8953a09e2a20428a6613115eb124796f808 (commit) via 57661feb69e776c4c54681084237f16db7f32360 (commit) via 7b7366a4a2f245088ff3eeb6f61d15226544a303 (commit) from baadaeb5e3799cdd3cd2bb3c5b35b7d6c9f04047 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e409a8953a09e2a20428a6613115eb124796f808 commit e409a8953a09e2a20428a6613115eb124796f808 Merge: baadaeb 57661fe Author: James Bigler AuthorDate: Tue Apr 7 14:40:29 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 14:40:29 2015 -0400 Merge topic 'FindCUDA.cmake/C++11Flags' into next 57661feb Make the search and replace for std=c++ understand --std and -std. 7b7366a4 Handling of c++11 host flag. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57661feb69e776c4c54681084237f16db7f32360 commit 57661feb69e776c4c54681084237f16db7f32360 Author: James Bigler AuthorDate: Thu Apr 2 17:09:30 2015 -0600 Commit: James Bigler CommitDate: Thu Apr 2 17:09:30 2015 -0600 Make the search and replace for std=c++ understand --std and -std. When searching and replacing arguments, we need to consider equally --std and -std, and either could be present. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index ce67131..54dd398 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1192,11 +1192,11 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) if( _cuda_c11_host_flag_present ) # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at # the main flag instead of the configuration specific flags. - string(REGEX MATCH "--std;c\\+\\+11" _cuda_c11_nvcc_flag_present "${CUDA_NVCC_FLAGS}") + string(REGEX MATCH "-std;c\\+\\+11" _cuda_c11_nvcc_flag_present "${CUDA_NVCC_FLAGS}") if( NOT _cuda_c11_nvcc_flag_present ) list(APPEND nvcc_flags --std c++11) endif() - string(REPLACE "-std=c++11" "" _cuda_host_flags "${_cuda_host_flags}") + string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") endif() # Get the list of definitions from the directory property http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b7366a4a2f245088ff3eeb6f61d15226544a303 commit 7b7366a4a2f245088ff3eeb6f61d15226544a303 Author: James Bigler AuthorDate: Sat Mar 21 23:01:24 2015 -0600 Commit: James Bigler CommitDate: Sat Mar 21 23:01:24 2015 -0600 Handling of c++11 host flag. If the host flags contain a c++11 flag (at least for gcc), then we can't automatically propagate to nvcc it using -Xcompiler. This is because nvcc can't use any C++ only flags. Instead we find this flag and add it to nvcc's flags (it has a special flag for dealing with c++11 code) and remove it from the host flags. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 81e1cad..ce67131 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1184,6 +1184,21 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) set(_cuda_nvcc_flags_config "${_cuda_nvcc_flags_config}\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") endforeach() + # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and + # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses + # the C preprocessor). In order to get this to work correctly, we need to use nvcc's + # specific c++11 flag. + string(REGEX MATCH "-std=c\\+\\+11" _cuda_c11_host_flag_present "${_cuda_host_flags}") + if( _cuda_c11_host_flag_present ) + # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at + # the main flag instead of the configuration specific flags. + string(REGEX MATCH "--std;c\\+\\+11" _cuda_c11_nvcc_flag_present "${CUDA_NVCC_FLAGS}") + if( NOT _cuda_c11_nvcc_flag_present ) + list(APPEND nvcc_flags --std c++11) + endif() + string(REPLACE "-std=c++11" "" _cuda_host_flags "${_cuda_host_flags}") + endif() + # Get the list of definitions from the directory property get_directory_property(CUDA_NVCC_DEFINITIONS COMPILE_DEFINITIONS) if(CUDA_NVCC_DEFINITIONS) ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 14:42:44 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 14:42:44 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1577-g0434851 Message-ID: <20150407184244.792188C77D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 04348516669dc86c025e6f4c7cbae02dc6403c90 (commit) via 8468670a1a8a3526b8b4748aa0b51484532dc6a8 (commit) from e409a8953a09e2a20428a6613115eb124796f808 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=04348516669dc86c025e6f4c7cbae02dc6403c90 commit 04348516669dc86c025e6f4c7cbae02dc6403c90 Merge: e409a89 8468670 Author: Brad King AuthorDate: Tue Apr 7 14:42:43 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 14:42:43 2015 -0400 Merge topic 'document_supported_compiler_feature_compilers' into next 8468670a Help: Document supported compilers in cmake-compile-features.7 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8468670a1a8a3526b8b4748aa0b51484532dc6a8 commit 8468670a1a8a3526b8b4748aa0b51484532dc6a8 Author: Robert Maynard AuthorDate: Tue Apr 7 14:10:50 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 14:38:27 2015 -0400 Help: Document supported compilers in cmake-compile-features.7 Co-Author: Brad King diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 7a6c249..fdcec0e 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -295,3 +295,17 @@ the feature-appropriate include directory add_executable(consumer_no consumer_no.cpp) target_link_libraries(consumer_no foo) + +Supported Compilers +=================== + +CMake is currently aware of the language standards and features +available from the following +:variable:`compiler ids _COMPILER_ID>` +as of the versions specified for each: + +* ``AppleClang``: Apple Clang for Xcode versions 4.4 though 6.2. +* ``Clang``: Clang compiler versions 2.9 through 3.4. +* ``GNU``: GNU compiler versions 4.4 through 5.0. +* ``MSVC``: Microsoft Visual Studio versions 2010 through 2015. +* ``SunPro``: Oracle SolarisStudio version 12.4. ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 15:01:12 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 15:01:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1579-geb3ab3e Message-ID: <20150407190113.0D004AE049@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via eb3ab3e509628018d5e23760ed136ec2e4ad5027 (commit) via 83cebd139febdf093599cc80f7bdce1d752f3038 (commit) from 04348516669dc86c025e6f4c7cbae02dc6403c90 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb3ab3e509628018d5e23760ed136ec2e4ad5027 commit eb3ab3e509628018d5e23760ed136ec2e4ad5027 Merge: 0434851 83cebd1 Author: Brad King AuthorDate: Tue Apr 7 15:01:11 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 15:01:11 2015 -0400 Merge topic 'document_supported_compiler_feature_compilers' into next 83cebd13 fixup! Help: Document supported compilers in cmake-compile-features.7 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=83cebd139febdf093599cc80f7bdce1d752f3038 commit 83cebd139febdf093599cc80f7bdce1d752f3038 Author: Brad King AuthorDate: Tue Apr 7 15:00:04 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 15:00:04 2015 -0400 fixup! Help: Document supported compilers in cmake-compile-features.7 diff --git a/Help/command/target_compile_features.rst b/Help/command/target_compile_features.rst index 29a8b41..b66a4ec 100644 --- a/Help/command/target_compile_features.rst +++ b/Help/command/target_compile_features.rst @@ -29,4 +29,4 @@ Arguments to ``target_compile_features`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-compile-features(7)` manual for -information on compile features. +information on compile features and a list of supported compilers. diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index fdcec0e..46a5afb 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -299,10 +299,10 @@ the feature-appropriate include directory Supported Compilers =================== -CMake is currently aware of the language standards and features -available from the following -:variable:`compiler ids _COMPILER_ID>` -as of the versions specified for each: +CMake is currently aware of the :prop_tgt:`language standards ` +and :prop_gbl:`compile features ` available from +the following :variable:`compiler ids _COMPILER_ID>` as of the +versions specified for each: * ``AppleClang``: Apple Clang for Xcode versions 4.4 though 6.2. * ``Clang``: Clang compiler versions 2.9 through 3.4. diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 477a132..189c3ef 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -88,7 +88,7 @@ Available logical expressions are: increases the required :prop_tgt:`C_STANDARD` or :prop_tgt:`CXX_STANDARD` for the 'head' target, an error is reported. See the :manual:`cmake-compile-features(7)` manual for information on - compile features. + compile features and a list of supported compilers. ``$`` ``1`` when the language used for compilation unit matches ``lang``, otherwise ``0``. This expression used to specify compile options for diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst index 163ae34..3db4f18 100644 --- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst @@ -9,7 +9,7 @@ be listed in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable. The features listed here may be used with the :command:`target_compile_features` command. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. The features known to this version of CMake are: diff --git a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst index 18cd030..a08af00 100644 --- a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst @@ -9,7 +9,7 @@ be listed in the :variable:`CMAKE_C_COMPILE_FEATURES` variable. The features listed here may be used with the :command:`target_compile_features` command. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. The features known to this version of CMake are: diff --git a/Help/prop_tgt/COMPILE_FEATURES.rst b/Help/prop_tgt/COMPILE_FEATURES.rst index 225ffee..195215e 100644 --- a/Help/prop_tgt/COMPILE_FEATURES.rst +++ b/Help/prop_tgt/COMPILE_FEATURES.rst @@ -9,4 +9,4 @@ in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable. Contents of ``COMPILE_FEATURES`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-compile-features(7)` manual -for information on compile features. +for information on compile features and a list of supported compilers. diff --git a/Help/prop_tgt/CXX_EXTENSIONS.rst b/Help/prop_tgt/CXX_EXTENSIONS.rst index 67c5cb0..0f547e29 100644 --- a/Help/prop_tgt/CXX_EXTENSIONS.rst +++ b/Help/prop_tgt/CXX_EXTENSIONS.rst @@ -9,7 +9,7 @@ as ``-std=gnu++11`` instead of ``-std=c++11`` to the compile line. This property is ``ON`` by default. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_CXX_EXTENSIONS` variable if it is set when a target diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst index 65b30ec..edc9ba5 100644 --- a/Help/prop_tgt/CXX_STANDARD.rst +++ b/Help/prop_tgt/CXX_STANDARD.rst @@ -24,7 +24,7 @@ flag will not result in an error or warning, but will instead add the with the :prop_tgt:`CXX_STANDARD_REQUIRED` target property. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_CXX_STANDARD` variable if it is set when a target diff --git a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst index 4e24e5e..697d7f6 100644 --- a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst @@ -11,7 +11,7 @@ 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. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_CXX_STANDARD_REQUIRED` variable if it is set when a diff --git a/Help/prop_tgt/C_EXTENSIONS.rst b/Help/prop_tgt/C_EXTENSIONS.rst index dc48cc6..fce67f4 100644 --- a/Help/prop_tgt/C_EXTENSIONS.rst +++ b/Help/prop_tgt/C_EXTENSIONS.rst @@ -9,7 +9,7 @@ as ``-std=gnu11`` instead of ``-std=c11`` to the compile line. This property is ``ON`` by default. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_C_EXTENSIONS` variable if it is set when a target diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst index 3aa74af..5e36821 100644 --- a/Help/prop_tgt/C_STANDARD.rst +++ b/Help/prop_tgt/C_STANDARD.rst @@ -24,7 +24,7 @@ flag will not result in an error or warning, but will instead add the be controlled with the :prop_tgt:`C_STANDARD_REQUIRED` target property. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_C_STANDARD` variable if it is set when a target diff --git a/Help/prop_tgt/C_STANDARD_REQUIRED.rst b/Help/prop_tgt/C_STANDARD_REQUIRED.rst index 743d568..acfad98 100644 --- a/Help/prop_tgt/C_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/C_STANDARD_REQUIRED.rst @@ -11,7 +11,7 @@ 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. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_C_STANDARD_REQUIRED` variable if it is set when a diff --git a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst index 8dfec5f..31b594f 100644 --- a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst +++ b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst @@ -9,4 +9,4 @@ INTERFACE_COMPILE_FEATURES .. include:: INTERFACE_BUILD_PROPERTY.txt See the :manual:`cmake-compile-features(7)` manual for information on compile -features. +features and a list of supported compilers. diff --git a/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst b/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst index 460c78c..f003227 100644 --- a/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst @@ -8,4 +8,4 @@ list is a subset of the features listed in the :prop_gbl:`CMAKE_CXX_KNOWN_FEATUR global property. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_CXX_EXTENSIONS.rst b/Help/variable/CMAKE_CXX_EXTENSIONS.rst index 6448371..b14d753 100644 --- a/Help/variable/CMAKE_CXX_EXTENSIONS.rst +++ b/Help/variable/CMAKE_CXX_EXTENSIONS.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_CXX_STANDARD.rst b/Help/variable/CMAKE_CXX_STANDARD.rst index 963a42a..2bc4525 100644 --- a/Help/variable/CMAKE_CXX_STANDARD.rst +++ b/Help/variable/CMAKE_CXX_STANDARD.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst index f7750fa..14ffcd1 100644 --- a/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst +++ b/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_C_COMPILE_FEATURES.rst b/Help/variable/CMAKE_C_COMPILE_FEATURES.rst index 1106246..df66eae 100644 --- a/Help/variable/CMAKE_C_COMPILE_FEATURES.rst +++ b/Help/variable/CMAKE_C_COMPILE_FEATURES.rst @@ -8,4 +8,4 @@ list is a subset of the features listed in the :prop_gbl:`CMAKE_C_KNOWN_FEATURES global property. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_C_EXTENSIONS.rst b/Help/variable/CMAKE_C_EXTENSIONS.rst index 5e935fc..25bec12 100644 --- a/Help/variable/CMAKE_C_EXTENSIONS.rst +++ b/Help/variable/CMAKE_C_EXTENSIONS.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_C_STANDARD.rst b/Help/variable/CMAKE_C_STANDARD.rst index 3098ce5..2eb4e43 100644 --- a/Help/variable/CMAKE_C_STANDARD.rst +++ b/Help/variable/CMAKE_C_STANDARD.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst index c24eea4..5e415da 100644 --- a/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst +++ b/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. ----------------------------------------------------------------------- Summary of changes: Help/command/target_compile_features.rst | 2 +- Help/manual/cmake-compile-features.7.rst | 8 ++++---- Help/manual/cmake-generator-expressions.7.rst | 2 +- Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 2 +- Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst | 2 +- Help/prop_tgt/COMPILE_FEATURES.rst | 2 +- Help/prop_tgt/CXX_EXTENSIONS.rst | 2 +- Help/prop_tgt/CXX_STANDARD.rst | 2 +- Help/prop_tgt/CXX_STANDARD_REQUIRED.rst | 2 +- Help/prop_tgt/C_EXTENSIONS.rst | 2 +- Help/prop_tgt/C_STANDARD.rst | 2 +- Help/prop_tgt/C_STANDARD_REQUIRED.rst | 2 +- Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst | 2 +- Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst | 2 +- Help/variable/CMAKE_CXX_EXTENSIONS.rst | 2 +- Help/variable/CMAKE_CXX_STANDARD.rst | 2 +- Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst | 2 +- Help/variable/CMAKE_C_COMPILE_FEATURES.rst | 2 +- Help/variable/CMAKE_C_EXTENSIONS.rst | 2 +- Help/variable/CMAKE_C_STANDARD.rst | 2 +- Help/variable/CMAKE_C_STANDARD_REQUIRED.rst | 2 +- 21 files changed, 24 insertions(+), 24 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 15:02:13 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 15:02:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1581-gb6190f8 Message-ID: <20150407190213.9AE31AE082@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b6190f8d40a3110ef5c151312e688e4140a63cac (commit) via 322cdc48252e17501866a7177e89ca20a3cb583b (commit) from eb3ab3e509628018d5e23760ed136ec2e4ad5027 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b6190f8d40a3110ef5c151312e688e4140a63cac commit b6190f8d40a3110ef5c151312e688e4140a63cac Merge: eb3ab3e 322cdc4 Author: Brad King AuthorDate: Tue Apr 7 15:02:12 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 15:02:12 2015 -0400 Merge topic 'document_supported_compiler_feature_compilers' into next 322cdc48 Help: Document supported compilers in cmake-compile-features.7 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=322cdc48252e17501866a7177e89ca20a3cb583b commit 322cdc48252e17501866a7177e89ca20a3cb583b Author: Robert Maynard AuthorDate: Tue Apr 7 14:10:50 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 15:01:18 2015 -0400 Help: Document supported compilers in cmake-compile-features.7 Extend sentences in other documentation linking to this manual to say that it has a list of supported compilers. Co-Author: Brad King diff --git a/Help/command/target_compile_features.rst b/Help/command/target_compile_features.rst index 29a8b41..b66a4ec 100644 --- a/Help/command/target_compile_features.rst +++ b/Help/command/target_compile_features.rst @@ -29,4 +29,4 @@ Arguments to ``target_compile_features`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-compile-features(7)` manual for -information on compile features. +information on compile features and a list of supported compilers. diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst index 7a6c249..46a5afb 100644 --- a/Help/manual/cmake-compile-features.7.rst +++ b/Help/manual/cmake-compile-features.7.rst @@ -295,3 +295,17 @@ the feature-appropriate include directory add_executable(consumer_no consumer_no.cpp) target_link_libraries(consumer_no foo) + +Supported Compilers +=================== + +CMake is currently aware of the :prop_tgt:`language standards ` +and :prop_gbl:`compile features ` available from +the following :variable:`compiler ids _COMPILER_ID>` as of the +versions specified for each: + +* ``AppleClang``: Apple Clang for Xcode versions 4.4 though 6.2. +* ``Clang``: Clang compiler versions 2.9 through 3.4. +* ``GNU``: GNU compiler versions 4.4 through 5.0. +* ``MSVC``: Microsoft Visual Studio versions 2010 through 2015. +* ``SunPro``: Oracle SolarisStudio version 12.4. diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 477a132..189c3ef 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -88,7 +88,7 @@ Available logical expressions are: increases the required :prop_tgt:`C_STANDARD` or :prop_tgt:`CXX_STANDARD` for the 'head' target, an error is reported. See the :manual:`cmake-compile-features(7)` manual for information on - compile features. + compile features and a list of supported compilers. ``$`` ``1`` when the language used for compilation unit matches ``lang``, otherwise ``0``. This expression used to specify compile options for diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst index 163ae34..3db4f18 100644 --- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst @@ -9,7 +9,7 @@ be listed in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable. The features listed here may be used with the :command:`target_compile_features` command. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. The features known to this version of CMake are: diff --git a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst index 18cd030..a08af00 100644 --- a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst @@ -9,7 +9,7 @@ be listed in the :variable:`CMAKE_C_COMPILE_FEATURES` variable. The features listed here may be used with the :command:`target_compile_features` command. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. The features known to this version of CMake are: diff --git a/Help/prop_tgt/COMPILE_FEATURES.rst b/Help/prop_tgt/COMPILE_FEATURES.rst index 225ffee..195215e 100644 --- a/Help/prop_tgt/COMPILE_FEATURES.rst +++ b/Help/prop_tgt/COMPILE_FEATURES.rst @@ -9,4 +9,4 @@ in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable. Contents of ``COMPILE_FEATURES`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-compile-features(7)` manual -for information on compile features. +for information on compile features and a list of supported compilers. diff --git a/Help/prop_tgt/CXX_EXTENSIONS.rst b/Help/prop_tgt/CXX_EXTENSIONS.rst index 67c5cb0..0f547e29 100644 --- a/Help/prop_tgt/CXX_EXTENSIONS.rst +++ b/Help/prop_tgt/CXX_EXTENSIONS.rst @@ -9,7 +9,7 @@ as ``-std=gnu++11`` instead of ``-std=c++11`` to the compile line. This property is ``ON`` by default. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_CXX_EXTENSIONS` variable if it is set when a target diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst index 65b30ec..edc9ba5 100644 --- a/Help/prop_tgt/CXX_STANDARD.rst +++ b/Help/prop_tgt/CXX_STANDARD.rst @@ -24,7 +24,7 @@ flag will not result in an error or warning, but will instead add the with the :prop_tgt:`CXX_STANDARD_REQUIRED` target property. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_CXX_STANDARD` variable if it is set when a target diff --git a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst index 4e24e5e..697d7f6 100644 --- a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst @@ -11,7 +11,7 @@ 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. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_CXX_STANDARD_REQUIRED` variable if it is set when a diff --git a/Help/prop_tgt/C_EXTENSIONS.rst b/Help/prop_tgt/C_EXTENSIONS.rst index dc48cc6..fce67f4 100644 --- a/Help/prop_tgt/C_EXTENSIONS.rst +++ b/Help/prop_tgt/C_EXTENSIONS.rst @@ -9,7 +9,7 @@ as ``-std=gnu11`` instead of ``-std=c11`` to the compile line. This property is ``ON`` by default. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_C_EXTENSIONS` variable if it is set when a target diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst index 3aa74af..5e36821 100644 --- a/Help/prop_tgt/C_STANDARD.rst +++ b/Help/prop_tgt/C_STANDARD.rst @@ -24,7 +24,7 @@ flag will not result in an error or warning, but will instead add the be controlled with the :prop_tgt:`C_STANDARD_REQUIRED` target property. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_C_STANDARD` variable if it is set when a target diff --git a/Help/prop_tgt/C_STANDARD_REQUIRED.rst b/Help/prop_tgt/C_STANDARD_REQUIRED.rst index 743d568..acfad98 100644 --- a/Help/prop_tgt/C_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/C_STANDARD_REQUIRED.rst @@ -11,7 +11,7 @@ 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. +compile features and a list of supported compilers. This property is initialized by the value of the :variable:`CMAKE_C_STANDARD_REQUIRED` variable if it is set when a diff --git a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst index 8dfec5f..31b594f 100644 --- a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst +++ b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst @@ -9,4 +9,4 @@ INTERFACE_COMPILE_FEATURES .. include:: INTERFACE_BUILD_PROPERTY.txt See the :manual:`cmake-compile-features(7)` manual for information on compile -features. +features and a list of supported compilers. diff --git a/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst b/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst index 460c78c..f003227 100644 --- a/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst @@ -8,4 +8,4 @@ list is a subset of the features listed in the :prop_gbl:`CMAKE_CXX_KNOWN_FEATUR global property. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_CXX_EXTENSIONS.rst b/Help/variable/CMAKE_CXX_EXTENSIONS.rst index 6448371..b14d753 100644 --- a/Help/variable/CMAKE_CXX_EXTENSIONS.rst +++ b/Help/variable/CMAKE_CXX_EXTENSIONS.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_CXX_STANDARD.rst b/Help/variable/CMAKE_CXX_STANDARD.rst index 963a42a..2bc4525 100644 --- a/Help/variable/CMAKE_CXX_STANDARD.rst +++ b/Help/variable/CMAKE_CXX_STANDARD.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst index f7750fa..14ffcd1 100644 --- a/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst +++ b/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_C_COMPILE_FEATURES.rst b/Help/variable/CMAKE_C_COMPILE_FEATURES.rst index 1106246..df66eae 100644 --- a/Help/variable/CMAKE_C_COMPILE_FEATURES.rst +++ b/Help/variable/CMAKE_C_COMPILE_FEATURES.rst @@ -8,4 +8,4 @@ list is a subset of the features listed in the :prop_gbl:`CMAKE_C_KNOWN_FEATURES global property. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_C_EXTENSIONS.rst b/Help/variable/CMAKE_C_EXTENSIONS.rst index 5e935fc..25bec12 100644 --- a/Help/variable/CMAKE_C_EXTENSIONS.rst +++ b/Help/variable/CMAKE_C_EXTENSIONS.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_C_STANDARD.rst b/Help/variable/CMAKE_C_STANDARD.rst index 3098ce5..2eb4e43 100644 --- a/Help/variable/CMAKE_C_STANDARD.rst +++ b/Help/variable/CMAKE_C_STANDARD.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. diff --git a/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst index c24eea4..5e415da 100644 --- a/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst +++ b/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst @@ -8,4 +8,4 @@ property on all targets. See that target property for additional information. See the :manual:`cmake-compile-features(7)` manual for information on -compile features. +compile features and a list of supported compilers. ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 16:04:07 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 16:04:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-663-g678493d Message-ID: <20150407200407.03338AE0C9@public.kitware.com> This is an automated email from 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 678493d60ff0e8c8e59caf9fa57b6f1e5e7e61b2 (commit) via 9410e24a4ad3a21b2c27d057798f723e88d14d45 (commit) via 7b7ae3b1a1d1c664eeef48392759883aa4040657 (commit) via 228c629c18d6b5e820376ac87babca0771205b6f (commit) via 2e50f5e7d9269ee1e2e3587a7a4b806df48510d3 (commit) via e62243674e7ce9a162b47567ef5893fae44ed153 (commit) via 9ada4c04335fc070f3f670df72bd9943eabec464 (commit) via 1fe7f24c2b62734d501427750586d8063149ea58 (commit) via 08c642c6ae47fd075fe1060fc0e28d8a24cc3c00 (commit) via cec8f97e5717fac279d310f3f0b9e849a0e59706 (commit) from 7ee897beec045761e796ac7468ed6e43cd58f1fe (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=678493d60ff0e8c8e59caf9fa57b6f1e5e7e61b2 commit 678493d60ff0e8c8e59caf9fa57b6f1e5e7e61b2 Merge: 7ee897b 9410e24 Author: Brad King AuthorDate: Tue Apr 7 16:04:05 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 16:04:05 2015 -0400 Merge topic 'refactor-cache-api' 9410e24a cmCacheManager: Port consumers to non-iterator API. 7b7ae3b1 Port QtDialog to non-iterator cache API. 228c629c Port CursesDialog to non-iterator cache API. 2e50f5e7 cmMakefile: Port away from CacheEntry.Initialized. e6224367 cmCacheManager: Add non-iterator-based API. 9ada4c04 cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue. 1fe7f24c Add API for cache loading, deleting and saving to the cmake class. 08c642c6 cmMakefile: Remove cache version accessors. cec8f97e cmMakefile: Simplify GetDefinitions implementation. ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestBuildAndTestHandler.cxx | 3 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 35 +++-- Source/CursesDialog/cmCursesCacheEntryComposite.h | 2 +- Source/CursesDialog/cmCursesMainForm.cxx | 151 +++++++++++------- Source/QtDialog/QCMake.cxx | 85 +++++----- Source/cmCPluginAPI.cxx | 6 +- Source/cmCTest.cxx | 2 +- Source/cmCacheManager.cxx | 16 +- Source/cmCacheManager.h | 77 ++++++++- Source/cmCommandArgumentParserHelper.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 6 +- Source/cmFindBase.cxx | 13 +- Source/cmGetPropertyCommand.cxx | 7 +- Source/cmGlobalGenerator.cxx | 14 +- Source/cmGlobalXCodeGenerator.cxx | 2 +- Source/cmLoadCacheCommand.cxx | 6 +- Source/cmMakefile.cxx | 54 +++---- Source/cmMakefile.h | 8 - Source/cmMarkAsAdvancedCommand.cxx | 15 +- Source/cmOptionCommand.cxx | 12 +- Source/cmSetCommand.cxx | 7 +- Source/cmSetPropertyCommand.cxx | 19 ++- Source/cmSetPropertyCommand.h | 2 +- Source/cmTryRunCommand.cxx | 19 ++- Source/cmUtilitySourceCommand.cxx | 6 +- Source/cmVariableRequiresCommand.cxx | 6 +- Source/cmake.cxx | 166 ++++++++++++-------- Source/cmake.h | 14 +- Source/cmakemain.cxx | 26 +-- 29 files changed, 471 insertions(+), 311 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 16:04:20 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 16:04:20 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1583-gc6f88a1 Message-ID: <20150407200420.865FCAE0CC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c6f88a1227a80f74728efbf7525798c4884786a7 (commit) via 678493d60ff0e8c8e59caf9fa57b6f1e5e7e61b2 (commit) from b6190f8d40a3110ef5c151312e688e4140a63cac (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6f88a1227a80f74728efbf7525798c4884786a7 commit c6f88a1227a80f74728efbf7525798c4884786a7 Merge: b6190f8 678493d Author: Brad King AuthorDate: Tue Apr 7 16:04:12 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 16:04:12 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Tue Apr 7 16:15:57 2015 From: steveire at gmail.com (Stephen Kelly) Date: Tue, 7 Apr 2015 16:15:57 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1585-g8d04367 Message-ID: <20150407201557.3F0CDAC49A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8d0436743079e56fc77d5352b62604266ddfc4f5 (commit) via 1eb97ae2e275aa24f483673414931365ccc5134d (commit) from c6f88a1227a80f74728efbf7525798c4884786a7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8d0436743079e56fc77d5352b62604266ddfc4f5 commit 8d0436743079e56fc77d5352b62604266ddfc4f5 Merge: c6f88a1 1eb97ae Author: Stephen Kelly AuthorDate: Tue Apr 7 16:15:55 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 16:15:55 2015 -0400 Merge topic 'introduce-cmConfiguration' into next 1eb97ae2 Revert topic. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1eb97ae2e275aa24f483673414931365ccc5134d commit 1eb97ae2e275aa24f483673414931365ccc5134d Author: Stephen Kelly AuthorDate: Tue Apr 7 22:14:38 2015 +0200 Commit: Stephen Kelly CommitDate: Tue Apr 7 22:15:15 2015 +0200 Revert topic. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 8354fd9..04f6a81 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -171,8 +171,6 @@ set(SRCS cmComputeLinkInformation.h cmComputeTargetDepends.h cmComputeTargetDepends.cxx - cmConfiguration.cxx - cmConfiguration.h cmCPackPropertiesGenerator.h cmCPackPropertiesGenerator.cxx cmCryptoHash.cxx diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index e013f81..3d92a2d 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -9,6 +9,7 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ +#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmake.h" #include "../cmDocumentation.h" diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx index d6329c5..fd15b99 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.cxx +++ b/Source/CursesDialog/cmCursesBoolWidget.cxx @@ -16,7 +16,7 @@ cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmConfiguration::BOOL; + this->Type = cmCacheManager::BOOL; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index e388409..4f028c4 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -19,7 +19,6 @@ #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" #include "../cmake.h" -#include "../cmConfiguration.h" #include @@ -51,11 +50,11 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - const char* value = cm->GetConfiguration()->GetCacheEntryValue(key); + const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); assert(value); - switch (cm->GetConfiguration()->GetCacheEntryType(key)) + switch (cm->GetCacheManager()->GetCacheEntryType(key)) { - case cmConfiguration::BOOL: + case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); if (cmSystemTools::IsOn(value)) { @@ -66,17 +65,17 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( static_cast(this->Entry)->SetValueAsBool(false); } break; - case cmConfiguration::PATH: + case cmCacheManager::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); static_cast(this->Entry)->SetString(value); break; - case cmConfiguration::FILEPATH: + case cmCacheManager::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); static_cast(this->Entry)->SetString(value); break; - case cmConfiguration::STRING: + case cmCacheManager::STRING: { - const char* stringsProp = cm->GetConfiguration() + const char* stringsProp = cm->GetCacheManager() ->GetCacheEntryProperty(key, "STRINGS"); if(stringsProp) { @@ -99,7 +98,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } break; } - case cmConfiguration::UNINITIALIZED: + case cmCacheManager::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", key.c_str()); break; diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index f280897..dc4ee4af 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -12,6 +12,7 @@ #ifndef cmCursesCacheEntryComposite_h #define cmCursesCacheEntryComposite_h +#include "../cmCacheManager.h" #include "cmCursesLabelWidget.h" class cmCursesCacheEntryComposite diff --git a/Source/CursesDialog/cmCursesDummyWidget.cxx b/Source/CursesDialog/cmCursesDummyWidget.cxx index 0c5c09d..60086a5 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.cxx +++ b/Source/CursesDialog/cmCursesDummyWidget.cxx @@ -15,7 +15,7 @@ cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmConfiguration::INTERNAL; + this->Type = cmCacheManager::INTERNAL; } diff --git a/Source/CursesDialog/cmCursesFilePathWidget.cxx b/Source/CursesDialog/cmCursesFilePathWidget.cxx index fb04b44..01db014 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.cxx +++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx @@ -15,6 +15,6 @@ cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, int left, int top) : cmCursesPathWidget(width, height, left, top) { - this->Type = cmConfiguration::FILEPATH; + this->Type = cmCacheManager::FILEPATH; } diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 67e4aab..057f8f3 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -9,6 +9,7 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ +#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmake.h" #include "../cmVersion.h" diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index f97ea36..833d540 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -9,6 +9,7 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ +#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmVersion.h" #include "../cmake.h" @@ -22,7 +23,6 @@ #include "cmCursesCacheEntryComposite.h" #include "cmCursesLongMessageForm.h" #include "cmAlgorithms.h" -#include "cmConfiguration.h" inline int ctrl(int z) @@ -107,21 +107,21 @@ void cmCursesMainForm::InitializeUI() // which contain labels, entries and new entry markers std::vector* newEntries = new std::vector; - std::vector cacheKeys = - this->CMakeInstance->GetConfiguration()->GetCacheEntryKeys(); - newEntries->reserve(cacheKeys.size()); + newEntries->reserve(this->CMakeInstance->GetCacheManager()->GetSize()); // Count non-internal and non-static entries int count=0; + std::vector cacheKeys = + this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys(); for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() ->GetCacheEntryType(*it); - if (t != cmConfiguration::INTERNAL && - t != cmConfiguration::STATIC && - t != cmConfiguration::UNINITIALIZED) + if (t != cmCacheManager::INTERNAL && + t != cmCacheManager::STATIC && + t != cmCacheManager::UNINITIALIZED) { ++count; } @@ -147,11 +147,11 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() ->GetCacheEntryType(*it); - if (t == cmConfiguration::INTERNAL || - t == cmConfiguration::STATIC || - t == cmConfiguration::UNINITIALIZED ) + if (t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED ) { continue; } @@ -171,11 +171,11 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmConfiguration::CacheEntryType t = this->CMakeInstance->GetConfiguration() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() ->GetCacheEntryType(*it); - if (t == cmConfiguration::INTERNAL || - t == cmConfiguration::STATIC || - t == cmConfiguration::UNINITIALIZED ) + if (t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED ) { continue; } @@ -225,10 +225,10 @@ void cmCursesMainForm::RePost() for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -257,10 +257,10 @@ void cmCursesMainForm::RePost() for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -293,9 +293,9 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) cmCursesWidget* cw = reinterpret_cast (field_userptr(currentField)); // If in edit mode, get out of it - if ( cw->GetType() == cmConfiguration::STRING || - cw->GetType() == cmConfiguration::PATH || - cw->GetType() == cmConfiguration::FILEPATH ) + if ( cw->GetType() == cmCacheManager::STRING || + cw->GetType() == cmCacheManager::PATH || + cw->GetType() == cmCacheManager::FILEPATH ) { cmCursesStringWidget* sw = static_cast(cw); sw->SetInEdit(false); @@ -329,10 +329,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -352,10 +352,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -516,10 +516,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the help string of the current entry // and add it to the help string const char* existingValue = - this->CMakeInstance->GetConfiguration()->GetCacheEntryValue(curField); + this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField); if (existingValue) { - const char* hs = this->CMakeInstance->GetConfiguration() + const char* hs = this->CMakeInstance->GetCacheManager() ->GetCacheEntryProperty(curField, "HELPSTRING"); if ( hs ) { @@ -814,7 +814,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() for(size_t i=0; i < size; i++) { std::string cacheKey = (*this->Entries)[i]->Key; - const char* existingValue = this->CMakeInstance->GetConfiguration() + const char* existingValue = this->CMakeInstance->GetCacheManager() ->GetCacheEntryValue(cacheKey); if (existingValue) { @@ -822,8 +822,8 @@ void cmCursesMainForm::FillCacheManagerFromUI() std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - cmConfiguration::CacheEntryType t = - this->CMakeInstance->GetConfiguration() + cmCacheManager::CacheEntryType t = + this->CMakeInstance->GetCacheManager() ->GetCacheEntryType(cacheKey); this->FixValue(t, oldValue, fixedOldValue); this->FixValue(t, newValue, fixedNewValue); @@ -831,24 +831,24 @@ void cmCursesMainForm::FillCacheManagerFromUI() if(!(fixedOldValue == fixedNewValue)) { // The user has changed the value. Mark it as modified. - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true); - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->SetCacheEntryValue(cacheKey, fixedNewValue); } } } } -void cmCursesMainForm::FixValue(cmConfiguration::CacheEntryType type, +void cmCursesMainForm::FixValue(cmCacheManager::CacheEntryType type, const std::string& in, std::string& out) const { out = in.substr(0,in.find_last_not_of(" ")+1); - if(type == cmConfiguration::PATH || type == cmConfiguration::FILEPATH) + if(type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH) { cmSystemTools::ConvertToUnixSlashes(out); } - if(type == cmConfiguration::BOOL) + if(type == cmCacheManager::BOOL) { if(cmSystemTools::IsOff(out.c_str())) { @@ -1046,11 +1046,11 @@ void cmCursesMainForm::HandleInput() const char* helpString = 0; const char* existingValue = - this->CMakeInstance->GetConfiguration() + this->CMakeInstance->GetCacheManager() ->GetCacheEntryValue(curField); if (existingValue) { - helpString = this->CMakeInstance->GetConfiguration() + helpString = this->CMakeInstance->GetCacheManager() ->GetCacheEntryProperty(curField, "HELPSTRING"); } if (helpString) @@ -1161,7 +1161,7 @@ void cmCursesMainForm::HandleInput() field_userptr(this->Fields[findex-2])); if ( lbl ) { - this->CMakeInstance->GetConfiguration()->RemoveCacheEntry(lbl->GetValue()); + this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(lbl->GetValue()); std::string nextVal; if (nextCur) diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index d410a26..6455252 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -113,7 +113,7 @@ protected: // cache. void FillCacheManagerFromUI(); // Fix formatting of values to a consistent form. - void FixValue(cmConfiguration::CacheEntryType type, + void FixValue(cmCacheManager::CacheEntryType type, const std::string& in, std::string& out) const; // Re-post the existing fields. Used to toggle between // normal and advanced modes. Render() should be called diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx index 83b8b79..2f4b59e 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.cxx +++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx @@ -21,7 +21,7 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmConfiguration::BOOL; // this is a bit of a hack + this->Type = cmCacheManager::BOOL; // this is a bit of a hack // there is no option type, and string type causes ccmake to cast // the widget into a string widget at some point. BOOL is safe for // now. diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx index c1d1c7c..89e2238 100644 --- a/Source/CursesDialog/cmCursesPathWidget.cxx +++ b/Source/CursesDialog/cmCursesPathWidget.cxx @@ -18,7 +18,7 @@ cmCursesPathWidget::cmCursesPathWidget(int width, int height, int left, int top) : cmCursesStringWidget(width, height, left, top) { - this->Type = cmConfiguration::PATH; + this->Type = cmCacheManager::PATH; this->Cycle = false; this->CurrentIndex = 0; } @@ -59,7 +59,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w) } std::vector dirs; - cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmConfiguration::PATH?-1:0)); + cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmCacheManager::PATH?-1:0)); if ( this->CurrentIndex < dirs.size() ) { cstr = dirs[this->CurrentIndex]; diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index ce7df27..d25022d 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -22,7 +22,7 @@ cmCursesStringWidget::cmCursesStringWidget(int width, int height, cmCursesWidget(width, height, left, top) { this->InEdit = false; - this->Type = cmConfiguration::STRING; + this->Type = cmCacheManager::STRING; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h index 67b6876..7d82864 100644 --- a/Source/CursesDialog/cmCursesWidget.h +++ b/Source/CursesDialog/cmCursesWidget.h @@ -12,7 +12,7 @@ #ifndef cmCursesWidget_h #define cmCursesWidget_h -#include "../cmConfiguration.h" +#include "../cmCacheManager.h" #include "cmCursesStandardIncludes.h" class cmCursesMainForm; @@ -46,7 +46,7 @@ public: /** * Get the type of the widget (STRING, PATH etc...) */ - cmConfiguration::CacheEntryType GetType() + cmCacheManager::CacheEntryType GetType() { return this->Type; } /** @@ -77,7 +77,7 @@ protected: cmCursesWidget(const cmCursesWidget& from); void operator=(const cmCursesWidget&); - cmConfiguration::CacheEntryType Type; + cmCacheManager::CacheEntryType Type; std::string Value; FIELD* Field; // The page in the main form this widget is in diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 97e68e8..08d53ce 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -16,7 +16,7 @@ #include #include "cmake.h" -#include "cmConfiguration.h" +#include "cmCacheManager.h" #include "cmSystemTools.h" #include "cmExternalMakefileProjectGenerator.h" @@ -94,7 +94,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) { this->BinaryDirectory = QDir::fromNativeSeparators(dir); emit this->binaryDirChanged(this->BinaryDirectory); - cmConfiguration *config = this->CMakeInstance->GetConfiguration(); + cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); this->setGenerator(QString()); if(!this->CMakeInstance->LoadCache( this->BinaryDirectory.toLocal8Bit().data())) @@ -110,15 +110,15 @@ void QCMake::setBinaryDirectory(const QString& _dir) QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); - const char* homeDir = config->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + const char* homeDir = cachem->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (homeDir) { setSourceDirectory(QString::fromLocal8Bit(homeDir)); } - const char* gen = config->GetCacheEntryValue("CMAKE_GENERATOR"); + const char* gen = cachem->GetCacheEntryValue("CMAKE_GENERATOR"); if (gen) { - const char* extraGen = config + const char* extraGen = cachem ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: CreateFullGeneratorName(gen, extraGen? extraGen : ""); @@ -195,14 +195,14 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) QStringList toremove; // set the value of properties - cmConfiguration *config = this->CMakeInstance->GetConfiguration(); - std::vector cacheKeys = config->GetCacheEntryKeys(); + cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); + std::vector cacheKeys = cachem->GetCacheEntryKeys(); for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmConfiguration::CacheEntryType t = config->GetCacheEntryType(*it); - if(t == cmConfiguration::INTERNAL || - t == cmConfiguration::STATIC) + cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*it); + if(t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC) { continue; } @@ -219,11 +219,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - config->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); + cachem->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); } else { - config->SetCacheEntryValue(*it, + cachem->SetCacheEntryValue(*it, prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); @@ -236,7 +236,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) { this->CMakeInstance->UnwatchUnusedCli(s.toLocal8Bit().data()); - config->RemoveCacheEntry(s.toLocal8Bit().data()); + cachem->RemoveCacheEntry(s.toLocal8Bit().data()); } // add some new properites @@ -249,28 +249,28 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toBool() ? "ON" : "OFF", s.Help.toLocal8Bit().data(), - cmConfiguration::BOOL); + cmCacheManager::BOOL); } else if(s.Type == QCMakeProperty::STRING) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmConfiguration::STRING); + cmCacheManager::STRING); } else if(s.Type == QCMakeProperty::PATH) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmConfiguration::PATH); + cmCacheManager::PATH); } else if(s.Type == QCMakeProperty::FILEPATH) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); } } @@ -281,45 +281,45 @@ QCMakePropertyList QCMake::properties() const { QCMakePropertyList ret; - cmConfiguration *config = this->CMakeInstance->GetConfiguration(); - std::vector cacheKeys = config->GetCacheEntryKeys(); + cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); + std::vector cacheKeys = cachem->GetCacheEntryKeys(); for (std::vector::const_iterator i = cacheKeys.begin(); i != cacheKeys.end(); ++i) { - cmConfiguration::CacheEntryType t = config->GetCacheEntryType(*i); - if(t == cmConfiguration::INTERNAL || - t == cmConfiguration::STATIC || - t == cmConfiguration::UNINITIALIZED) + cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*i); + if(t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED) { continue; } - const char* cachedValue = config->GetCacheEntryValue(*i); + const char* cachedValue = cachem->GetCacheEntryValue(*i); QCMakeProperty prop; prop.Key = QString::fromLocal8Bit(i->c_str()); prop.Help = QString::fromLocal8Bit( - config->GetCacheEntryProperty(*i, "HELPSTRING")); + cachem->GetCacheEntryProperty(*i, "HELPSTRING")); prop.Value = QString::fromLocal8Bit(cachedValue); - prop.Advanced = config->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); - if(t == cmConfiguration::BOOL) + prop.Advanced = cachem->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); + if(t == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; prop.Value = cmSystemTools::IsOn(cachedValue); } - else if(t == cmConfiguration::PATH) + else if(t == cmCacheManager::PATH) { prop.Type = QCMakeProperty::PATH; } - else if(t == cmConfiguration::FILEPATH) + else if(t == cmCacheManager::FILEPATH) { prop.Type = QCMakeProperty::FILEPATH; } - else if(t == cmConfiguration::STRING) + else if(t == cmCacheManager::STRING) { prop.Type = QCMakeProperty::STRING; const char* stringsProperty = - config->GetCacheEntryProperty(*i, "STRINGS"); + cachem->GetCacheEntryProperty(*i, "STRINGS"); if (stringsProperty) { prop.Strings = QString::fromLocal8Bit(stringsProperty).split(";"); diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index c83c41f..5d32437 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -147,6 +147,6 @@ bool cmBuildCommand makecommand.c_str(), "Command used to build entire project " "from the command line.", - cmConfiguration::STRING); + cmCacheManager::STRING); return true; } diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 257d62e..171ed0f 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -39,7 +39,7 @@ bool cmBuildNameCommand this->Makefile->AddCacheDefinition(args[0], cv.c_str(), "Name of build.", - cmConfiguration::STRING); + cmCacheManager::STRING); } return true; } @@ -74,7 +74,7 @@ bool cmBuildNameCommand this->Makefile->AddCacheDefinition(args[0], buildname.c_str(), "Name of build.", - cmConfiguration::STRING); + cmCacheManager::STRING); return true; } diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index d27d4f5..987a7b1 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -87,27 +87,27 @@ void CCONV cmAddCacheDefinition(void *arg, const char* name, { case CM_CACHE_BOOL: mf->AddCacheDefinition(name,value,doc, - cmConfiguration::BOOL); + cmCacheManager::BOOL); break; case CM_CACHE_PATH: mf->AddCacheDefinition(name,value,doc, - cmConfiguration::PATH); + cmCacheManager::PATH); break; case CM_CACHE_FILEPATH: mf->AddCacheDefinition(name,value,doc, - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); break; case CM_CACHE_STRING: mf->AddCacheDefinition(name,value,doc, - cmConfiguration::STRING); + cmCacheManager::STRING); break; case CM_CACHE_INTERNAL: mf->AddCacheDefinition(name,value,doc, - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); break; case CM_CACHE_STATIC: mf->AddCacheDefinition(name,value,doc, - cmConfiguration::STATIC); + cmCacheManager::STATIC); break; } } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 364f767..1db057b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2279,7 +2279,7 @@ bool cmCTest::AddVariableDefinition(const std::string &arg) { std::string name; std::string value; - cmConfiguration::CacheEntryType type = cmConfiguration::UNINITIALIZED; + cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; if (cmake::ParseCacheEntry(arg, name, value, type)) { diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 4734562..f8f2dbd 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -23,6 +23,17 @@ #include #include +const char* cmCacheManagerTypes[] = +{ "BOOL", + "PATH", + "FILEPATH", + "STRING", + "INTERNAL", + "STATIC", + "UNINITIALIZED", + 0 +}; + cmCacheManager::cmCacheManager(cmake* cm) { this->CacheMajorVersion = 0; @@ -30,6 +41,41 @@ cmCacheManager::cmCacheManager(cmake* cm) this->CMakeInstance = cm; } +const char* cmCacheManager::TypeToString(cmCacheManager::CacheEntryType type) +{ + if ( type > 6 ) + { + return cmCacheManagerTypes[6]; + } + return cmCacheManagerTypes[type]; +} + +cmCacheManager::CacheEntryType cmCacheManager::StringToType(const char* s) +{ + int i = 0; + while(cmCacheManagerTypes[i]) + { + if(strcmp(s, cmCacheManagerTypes[i]) == 0) + { + return static_cast(i); + } + ++i; + } + return STRING; +} + +bool cmCacheManager::IsType(const char* s) +{ + for(int i=0; cmCacheManagerTypes[i]; ++i) + { + if(strcmp(s, cmCacheManagerTypes[i]) == 0) + { + return true; + } + } + return false; +} + bool cmCacheManager::LoadCache(const std::string& path) { std::set emptySet; @@ -77,7 +123,7 @@ static bool ParseEntryWithoutType(const std::string& entry, bool cmCacheManager::ParseEntry(const std::string& entry, std::string& var, std::string& value, - cmConfiguration::CacheEntryType& type) + CacheEntryType& type) { // input line is: key:type=value static cmsys::RegularExpression reg( @@ -89,14 +135,14 @@ bool cmCacheManager::ParseEntry(const std::string& entry, if(regQuoted.find(entry)) { var = regQuoted.match(1); - type = cmConfiguration::StringToCacheEntryType(regQuoted.match(2).c_str()); + type = cmCacheManager::StringToType(regQuoted.match(2).c_str()); value = regQuoted.match(3); flag = true; } else if (reg.find(entry)) { var = reg.match(1); - type = cmConfiguration::StringToCacheEntryType(reg.match(2).c_str()); + type = cmCacheManager::StringToType(reg.match(2).c_str()); value = reg.match(3); flag = true; } @@ -205,7 +251,7 @@ bool cmCacheManager::LoadCache(const std::string& path, // If the entry is not internal to the cache being loaded // or if it is in the list of internal entries to be // imported, load it. - if ( internal || (e.Type != cmConfiguration::INTERNAL) || + if ( internal || (e.Type != INTERNAL) || (includes.find(entryKey) != includes.end()) ) { // If we are loading the cache from another project, @@ -213,7 +259,7 @@ bool cmCacheManager::LoadCache(const std::string& path, // not visible in the gui if (!internal) { - e.Type = cmConfiguration::INTERNAL; + e.Type = INTERNAL; helpString = "DO NOT EDIT, "; helpString += entryKey; helpString += " loaded from external file. " @@ -261,10 +307,10 @@ bool cmCacheManager::LoadCache(const std::string& path, // Set as version 0.0 this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", "0", "Minor version of cmake used to create the " - "current loaded cache", cmConfiguration::INTERNAL); + "current loaded cache", cmCacheManager::INTERNAL); this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", "0", "Major version of cmake used to create the " - "current loaded cache", cmConfiguration::INTERNAL); + "current loaded cache", cmCacheManager::INTERNAL); } // check to make sure the cache directory has not @@ -306,7 +352,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, CacheEntry& e) { // All property entries are internal. - if(e.Type != cmConfiguration::INTERNAL) + if(e.Type != cmCacheManager::INTERNAL) { return false; } @@ -325,7 +371,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, // Create an entry and store the property. CacheEntry& ne = this->Cache[key]; ne.Properties.SetCMakeInstance(this->CMakeInstance); - ne.Type = cmConfiguration::UNINITIALIZED; + ne.Type = cmCacheManager::UNINITIALIZED; ne.SetProperty(*p, e.Value.c_str()); } else @@ -382,15 +428,15 @@ bool cmCacheManager::SaveCache(const std::string& path) sprintf(temp, "%d", cmVersion::GetMinorVersion()); this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp, "Minor version of cmake used to create the " - "current loaded cache", cmConfiguration::INTERNAL); + "current loaded cache", cmCacheManager::INTERNAL); sprintf(temp, "%d", cmVersion::GetMajorVersion()); this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", temp, "Major version of cmake used to create the " - "current loaded cache", cmConfiguration::INTERNAL); + "current loaded cache", cmCacheManager::INTERNAL); sprintf(temp, "%d", cmVersion::GetPatchVersion()); this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION", temp, "Patch version of cmake used to create the " - "current loaded cache", cmConfiguration::INTERNAL); + "current loaded cache", cmCacheManager::INTERNAL); // Let us store the current working directory so that if somebody // Copies it, he will not be surprised @@ -405,7 +451,7 @@ bool cmCacheManager::SaveCache(const std::string& path) cmSystemTools::ConvertToUnixSlashes(currentcwd); this->AddCacheEntry("CMAKE_CACHEFILE_DIR", currentcwd.c_str(), "This is the directory where this CMakeCache.txt" - " was created", cmConfiguration::INTERNAL); + " was created", cmCacheManager::INTERNAL); fout << "# This is the CMakeCache file.\n" << "# For build in directory: " << currentcwd << "\n"; @@ -439,7 +485,7 @@ bool cmCacheManager::SaveCache(const std::string& path) this->Cache.begin(); i != this->Cache.end(); ++i) { const CacheEntry& ce = (*i).second; - cmConfiguration::CacheEntryType t = ce.Type; + CacheEntryType t = ce.Type; if(!ce.Initialized) { /* @@ -448,7 +494,7 @@ bool cmCacheManager::SaveCache(const std::string& path) "\" is uninitialized"); */ } - else if(t != cmConfiguration::INTERNAL) + else if(t != INTERNAL) { // Format is key:type=value if(const char* help = ce.GetProperty("HELPSTRING")) @@ -460,7 +506,7 @@ bool cmCacheManager::SaveCache(const std::string& path) cmCacheManager::OutputHelpString(fout, "Missing description"); } this->OutputKey(fout, i->first); - fout << ":" << cmConfiguration::CacheEntryTypeToString(t) << "="; + fout << ":" << cmCacheManagerTypes[t] << "="; this->OutputValue(fout, ce.Value); fout << "\n\n"; } @@ -480,9 +526,9 @@ bool cmCacheManager::SaveCache(const std::string& path) continue; } - cmConfiguration::CacheEntryType t = i.GetType(); + CacheEntryType t = i.GetType(); this->WritePropertyEntries(fout, i); - if(t == cmConfiguration::INTERNAL) + if(t == cmCacheManager::INTERNAL) { // Format is key:type=value if(const char* help = i.GetProperty("HELPSTRING")) @@ -490,7 +536,7 @@ bool cmCacheManager::SaveCache(const std::string& path) this->OutputHelpString(fout, help); } this->OutputKey(fout, i.GetName()); - fout << ":" << cmConfiguration::CacheEntryTypeToString(t) << "="; + fout << ":" << cmCacheManagerTypes[t] << "="; this->OutputValue(fout, i.GetValue()); fout << "\n"; } @@ -632,7 +678,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const for(std::map::const_iterator i = this->Cache.begin(); i != this->Cache.end(); ++i) { - if((*i).second.Type != cmConfiguration::INTERNAL) + if((*i).second.Type != INTERNAL) { out << (*i).first << " = " << (*i).second.Value << std::endl; @@ -648,7 +694,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const void cmCacheManager::AddCacheEntry(const std::string& key, const char* value, const char* helpString, - cmConfiguration::CacheEntryType type) + CacheEntryType type) { CacheEntry& e = this->Cache[key]; e.Properties.SetCMakeInstance(this->CMakeInstance); @@ -663,7 +709,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key, } e.Type = type; // make sure we only use unix style paths - if(type == cmConfiguration::FILEPATH || type == cmConfiguration::PATH) + if(type == FILEPATH || type == PATH) { if(e.Value.find(';') != e.Value.npos) { @@ -744,7 +790,7 @@ cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const { if(prop == "TYPE") { - return cmConfiguration::CacheEntryTypeToString(this->Type); + return cmCacheManagerTypes[this->Type]; } else if(prop == "VALUE") { @@ -761,7 +807,7 @@ void cmCacheManager::CacheEntry::SetProperty(const std::string& prop, { if(prop == "TYPE") { - this->Type = cmConfiguration::StringToCacheEntryType(value? value : "STRING"); + this->Type = cmCacheManager::StringToType(value? value : "STRING"); } else if(prop == "VALUE") { @@ -780,7 +826,7 @@ void cmCacheManager::CacheEntry::AppendProperty(const std::string& prop, { if(prop == "TYPE") { - this->Type = cmConfiguration::StringToCacheEntryType(value? value : "STRING"); + this->Type = cmCacheManager::StringToType(value? value : "STRING"); } else if(prop == "VALUE") { diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 927651f..2d3f6e5 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -14,8 +14,6 @@ #include "cmStandardIncludes.h" #include "cmPropertyMap.h" -#include "cmConfiguration.h" - class cmMakefile; class cmMarkAsAdvancedCommand; class cmake; @@ -32,22 +30,21 @@ public: cmCacheManager(cmake* cm); class CacheIterator; friend class cmCacheManager::CacheIterator; + enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, + UNINITIALIZED }; private: struct CacheEntry { std::string Value; - cmConfiguration::CacheEntryType Type; + CacheEntryType Type; cmPropertyMap Properties; const char* GetProperty(const std::string&) const; void SetProperty(const std::string& property, const char* value); void AppendProperty(const std::string& property, const char* value, bool asString=false); bool Initialized; - CacheEntry() - : Value(""), - Type(cmConfiguration::UNINITIALIZED), - Initialized(false) + CacheEntry() : Value(""), Type(UNINITIALIZED), Initialized(false) {} }; @@ -71,10 +68,8 @@ public: std::string GetValue() const { return this->GetEntry().Value; } bool GetValueAsBool() const; void SetValue(const char*); - cmConfiguration::CacheEntryType GetType() const - { return this->GetEntry().Type; } - void SetType(cmConfiguration::CacheEntryType ty) - { this->GetEntry().Type = ty; } + CacheEntryType GetType() const { return this->GetEntry().Type; } + void SetType(CacheEntryType ty) { this->GetEntry().Type = ty; } bool Initialized() { return this->GetEntry().Initialized; } cmCacheManager &Container; std::map::iterator Position; @@ -99,6 +94,17 @@ public: return CacheIterator(*this); } + /** + * Types for the cache entries. These are useful as + * hints for a cache editor program. Path should bring + * up a file chooser, BOOL a check box, and STRING a + * text entry box, FILEPATH is a full path to a file which + * can be different than just a path input + */ + static CacheEntryType StringToType(const char*); + static const char* TypeToString(CacheEntryType); + static bool IsType(const char*); + ///! Load a cache for given makefile. Loads from path/CMakeCache.txt. bool LoadCache(const std::string& path); bool LoadCache(const std::string& path, bool internal, @@ -128,7 +134,7 @@ public: static bool ParseEntry(const std::string& entry, std::string& var, std::string& value, - cmConfiguration::CacheEntryType& type); + CacheEntryType& type); ///! Get a value from the cache given a key const char* GetInitializedCacheValue(const std::string& key) const; @@ -149,7 +155,7 @@ public: return this->GetCacheIterator(key.c_str()).GetProperty(propName); } - cmConfiguration::CacheEntryType GetCacheEntryType(std::string const& key) + CacheEntryType GetCacheEntryType(std::string const& key) { return this->GetCacheIterator(key.c_str()).GetType(); } @@ -217,8 +223,7 @@ public: protected: ///! Add an entry into the cache void AddCacheEntry(const std::string& key, const char* value, - const char* helpString, - cmConfiguration::CacheEntryType type); + const char* helpString, CacheEntryType type); ///! Get a cache entry object for a key CacheEntry *GetCacheEntry(const std::string& key); @@ -244,7 +249,6 @@ private: // Only cmake and cmMakefile should be able to add cache values // the commands should never use the cmCacheManager directly friend class cmMakefile; // allow access to add cache values - friend class cmConfiguration; // allow access to add cache values friend class cmake; // allow access to add cache values friend class cmMarkAsAdvancedCommand; // allow access to add cache values }; diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 0e4dd4b..99bf5f5 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -13,7 +13,6 @@ #include "cmSystemTools.h" #include "cmMakefile.h" -#include "cmConfiguration.h" #include "cmCommandArgumentLexer.h" @@ -91,7 +90,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } if ( strcmp(key, "CACHE") == 0 ) { - if(const char* c = this->Makefile->GetConfiguration() + if(const char* c = this->Makefile->GetCacheManager() ->GetInitializedCacheValue(var)) { if(this->EscapeQuotes) diff --git a/Source/cmConfiguration.cxx b/Source/cmConfiguration.cxx deleted file mode 100644 index 209cdd9..0000000 --- a/Source/cmConfiguration.cxx +++ /dev/null @@ -1,170 +0,0 @@ - -#include "cmConfiguration.h" - -#include "cmake.h" -#include "cmCacheManager.h" - -cmConfiguration::cmConfiguration(cmake* cm) - : CMakeInstance(cm) -{ -} - -const char* cmCacheEntryTypes[] = -{ "BOOL", - "PATH", - "FILEPATH", - "STRING", - "INTERNAL", - "STATIC", - "UNINITIALIZED", - 0 -}; - -const char* -cmConfiguration::CacheEntryTypeToString(cmConfiguration::CacheEntryType type) -{ - if ( type > 6 ) - { - return cmCacheEntryTypes[6]; - } - return cmCacheEntryTypes[type]; -} - -cmConfiguration::CacheEntryType -cmConfiguration::StringToCacheEntryType(const char* s) -{ - int i = 0; - while(cmCacheEntryTypes[i]) - { - if(strcmp(s, cmCacheEntryTypes[i]) == 0) - { - return static_cast(i); - } - ++i; - } - return STRING; -} - -bool cmConfiguration::IsCacheEntryType(std::string const& key) -{ - for(int i=0; cmCacheEntryTypes[i]; ++i) - { - if(strcmp(key.c_str(), cmCacheEntryTypes[i]) == 0) - { - return true; - } - } - return false; -} - -std::vector cmConfiguration::GetCacheEntryKeys() const -{ - std::vector definitions; - definitions.reserve(this->CMakeInstance->GetCacheManager()->GetSize()); - cmCacheManager::CacheIterator cit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(); - for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) - { - definitions.push_back(cit.GetName()); - } - return definitions; -} - -const char* cmConfiguration::GetCacheEntryValue(std::string const& key) const -{ - cmCacheManager::CacheEntry* e = this->CMakeInstance->GetCacheManager() - ->GetCacheEntry(key); - if (!e) - { - return 0; - } - return e->Value.c_str(); -} - -const char* -cmConfiguration::GetInitializedCacheValue(std::string const& key) const -{ - return this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue(key); -} - -cmConfiguration::CacheEntryType -cmConfiguration::GetCacheEntryType(std::string const& key) const -{ - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); - return it.GetType(); -} - -void cmConfiguration::SetCacheEntryValue(std::string const& key, - std::string const& value) -{ - this->CMakeInstance->GetCacheManager()->SetCacheEntryValue(key, value); -} - -void cmConfiguration::SetCacheEntryProperty(std::string const& key, - std::string const& propertyName, - std::string const& value) -{ - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); - it.SetProperty(propertyName, value.c_str()); -} - -void cmConfiguration::SetCacheEntryBoolProperty(std::string const& key, - std::string const& propertyName, - bool value) -{ - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); - it.SetProperty(propertyName, value); -} - -const char* cmConfiguration::GetCacheEntryProperty(std::string const& key, - std::string const& propertyName) -{ - cmCacheManager::CacheIterator it = this->CMakeInstance->GetCacheManager() - ->GetCacheIterator(key.c_str()); - if (!it.PropertyExists(propertyName)) - { - return 0; - } - return it.GetProperty(propertyName); -} - -bool cmConfiguration::GetCacheEntryPropertyAsBool(std::string const& key, - std::string const& propertyName) -{ - return this->CMakeInstance->GetCacheManager() - ->GetCacheIterator(key.c_str()).GetPropertyAsBool(propertyName); -} - -void cmConfiguration::AddCacheEntry(const std::string& key, const char* value, - const char* helpString, - cmConfiguration::CacheEntryType type) -{ - this->CMakeInstance->GetCacheManager()->AddCacheEntry(key, value, - helpString, type); -} - -void cmConfiguration::RemoveCacheEntry(std::string const& key) -{ - this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(key); -} - -void cmConfiguration::AppendCacheEntryProperty(const std::string& key, - const std::string& property, - const std::string& value, - bool asString) -{ - this->CMakeInstance->GetCacheManager() - ->GetCacheIterator(key.c_str()).AppendProperty(property, - value.c_str(), - asString); -} - -void cmConfiguration::RemoveCacheEntryProperty(std::string const& key, - std::string const& propertyName) -{ - this->CMakeInstance->GetCacheManager() - ->GetCacheIterator(key.c_str()).SetProperty(propertyName, (void*)0); -} diff --git a/Source/cmConfiguration.h b/Source/cmConfiguration.h deleted file mode 100644 index 72149fb..0000000 --- a/Source/cmConfiguration.h +++ /dev/null @@ -1,52 +0,0 @@ - -#ifndef cmConfiguration_h -#define cmConfiguration_h - -#include "cmStandardIncludes.h" - -class cmake; - -class cmConfiguration -{ -public: - cmConfiguration(cmake* cm); - - enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, - UNINITIALIZED }; - static CacheEntryType StringToCacheEntryType(const char*); - static const char* CacheEntryTypeToString(CacheEntryType); - static bool IsCacheEntryType(std::string const& key); - - std::vector GetCacheEntryKeys() const; - const char* GetCacheEntryValue(std::string const& key) const; - const char* GetInitializedCacheValue(std::string const& key) const; - CacheEntryType GetCacheEntryType(std::string const& key) const; - void SetCacheEntryValue(std::string const& key, std::string const& value); - void SetCacheValue(std::string const& key, std::string const& value); - - void AddCacheEntry(const std::string& key, const char* value, - const char* helpString, CacheEntryType type); - void RemoveCacheEntry(std::string const& key); - - void SetCacheEntryProperty(std::string const& key, - std::string const& propertyName, - std::string const& value); - void SetCacheEntryBoolProperty(std::string const& key, - std::string const& propertyName, - bool value); - const char* GetCacheEntryProperty(std::string const& key, - std::string const& propertyName); - bool GetCacheEntryPropertyAsBool(std::string const& key, - std::string const& propertyName); - void AppendCacheEntryProperty(std::string const& key, - const std::string& property, - const std::string& value, - bool asString = false); - void RemoveCacheEntryProperty(std::string const& key, - std::string const& propertyName); - -private: - cmake* CMakeInstance; -}; - -#endif diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 7217ce6..59efa52 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -11,6 +11,7 @@ ============================================================================*/ #include "cmCoreTryCompile.h" #include "cmake.h" +#include "cmCacheManager.h" #include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmAlgorithms.h" @@ -526,7 +527,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) this->Makefile->AddCacheDefinition(argv[0], (res == 0 ? "TRUE" : "FALSE"), "Result of TRY_COMPILE", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); if (!outputVariable.empty()) { diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 63de734..0d32e4b 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -16,7 +16,6 @@ #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" -#include "cmConfiguration.h" #include "cmTarget.h" #include "cmSourceFile.h" @@ -206,7 +205,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_"; cacheEntryName += envVar; - const char* cacheValue = mf->GetConfiguration()->GetInitializedCacheValue( + const char* cacheValue = mf->GetCacheManager()->GetInitializedCacheValue( cacheEntryName); // now we have both, decide which one to use @@ -222,7 +221,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, // in the cache valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), - cacheEntryName.c_str(), cmConfiguration::STRING, + cacheEntryName.c_str(), cmCacheManager::STRING, true); mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } @@ -243,7 +242,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, { valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), - cacheEntryName.c_str(), cmConfiguration::STRING, + cacheEntryName.c_str(), cmCacheManager::STRING, true); mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 7cc0cd2..cc08052 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -12,7 +12,6 @@ #include "cmFindBase.h" #include "cmAlgorithms.h" -#include "cmConfiguration.h" cmFindBase::cmFindBase() { @@ -367,8 +366,8 @@ bool cmFindBase::CheckForVariableInCache() if(const char* cacheValue = this->Makefile->GetDefinition(this->VariableName)) { - cmConfiguration* config = this->Makefile->GetConfiguration(); - const char* cacheEntry = config->GetCacheEntryValue(this->VariableName); + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); bool cached = cacheEntry ? true : false; if(found) @@ -377,8 +376,8 @@ bool cmFindBase::CheckForVariableInCache() // type we should add the type and docstring but keep the // original value. Tell the subclass implementations to do // this. - if(cached && config->GetCacheEntryType(this->VariableName) - == cmConfiguration::UNINITIALIZED) + if(cached && manager->GetCacheEntryType(this->VariableName) + == cmCacheManager::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; } @@ -386,7 +385,7 @@ bool cmFindBase::CheckForVariableInCache() } else if(cached) { - const char* hs = config->GetCacheEntryProperty(this->VariableName, + const char* hs = manager->GetCacheEntryProperty(this->VariableName, "HELPSTRING"); this->VariableDocumentation = hs?hs:"(none)"; } diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 649d00b..c499f61 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -10,6 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmFindLibraryCommand.h" +#include "cmCacheManager.h" #include #include @@ -38,7 +39,7 @@ bool cmFindLibraryCommand { this->Makefile->AddCacheDefinition(this->VariableName, "", this->VariableDocumentation.c_str(), - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); } return true; } @@ -71,14 +72,14 @@ bool cmFindLibraryCommand this->Makefile->AddCacheDefinition(this->VariableName, library.c_str(), this->VariableDocumentation.c_str(), - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); return true; } std::string notfound = this->VariableName + "-NOTFOUND"; this->Makefile->AddCacheDefinition(this->VariableName, notfound.c_str(), this->VariableDocumentation.c_str(), - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); return true; } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 6336ee4..4d7fd60 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -947,7 +947,7 @@ bool cmFindPackageCommand::FindConfig() // We force the value since we do not get here if it was already set. this->Makefile->AddCacheDefinition(this->Variable, init.c_str(), help.c_str(), - cmConfiguration::PATH, true); + cmCacheManager::PATH, true); return found; } diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 4317076..49fbf45 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -10,6 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmFindPathCommand.h" +#include "cmCacheManager.h" #include @@ -40,7 +41,7 @@ bool cmFindPathCommand this->VariableName, "", this->VariableDocumentation.c_str(), (this->IncludeFileInPath ? - cmConfiguration::FILEPATH :cmConfiguration::PATH) + cmCacheManager::FILEPATH :cmCacheManager::PATH) ); } return true; @@ -53,7 +54,7 @@ bool cmFindPathCommand (this->VariableName, result.c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? - cmConfiguration::FILEPATH :cmConfiguration::PATH); + cmCacheManager::FILEPATH :cmCacheManager::PATH); return true; } this->Makefile->AddCacheDefinition @@ -61,7 +62,7 @@ bool cmFindPathCommand (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? - cmConfiguration::FILEPATH :cmConfiguration::PATH); + cmCacheManager::FILEPATH :cmCacheManager::PATH); return true; } diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 75fe29b..4ee419c 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -10,6 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmFindProgramCommand.h" +#include "cmCacheManager.h" #include #if defined(__APPLE__) @@ -36,7 +37,7 @@ bool cmFindProgramCommand { this->Makefile->AddCacheDefinition(this->VariableName, "", this->VariableDocumentation.c_str(), - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); } return true; } @@ -48,14 +49,14 @@ bool cmFindProgramCommand this->Makefile->AddCacheDefinition(this->VariableName, result.c_str(), this->VariableDocumentation.c_str(), - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); return true; } this->Makefile->AddCacheDefinition(this->VariableName, (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); return true; } diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 979e756..9aceb39 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -117,13 +117,13 @@ bool cmGetFilenameComponentCommand { this->Makefile->AddCacheDefinition (storeArgs, programArgs.c_str(), - "", args[2] == "PATH" ? cmConfiguration::FILEPATH - : cmConfiguration::STRING); + "", args[2] == "PATH" ? cmCacheManager::FILEPATH + : cmCacheManager::STRING); } this->Makefile->AddCacheDefinition (args[0], result.c_str(), "", - args[2] == "PATH" ? cmConfiguration::FILEPATH - : cmConfiguration::STRING); + args[2] == "PATH" ? cmCacheManager::FILEPATH + : cmCacheManager::STRING); } else { diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 1fe53ac..0e6e0c2 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -12,7 +12,6 @@ #include "cmGetPropertyCommand.h" #include "cmake.h" -#include "cmConfiguration.h" #include "cmTest.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" @@ -392,9 +391,9 @@ bool cmGetPropertyCommand::HandleCacheMode() } const char* value = 0; - if(this->Makefile->GetConfiguration()->GetCacheEntryValue(this->Name)) + if(this->Makefile->GetCacheManager()->GetCacheEntryValue(this->Name)) { - value = this->Makefile->GetConfiguration() + value = this->Makefile->GetCacheManager() ->GetCacheEntryProperty(this->Name, this->PropertyName); } this->StoreResult(value); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index a9c73a7..35394b8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -20,7 +20,6 @@ #include "cmLocalGenerator.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmake.h" -#include "cmConfiguration.h" #include "cmMakefile.h" #include "cmQtAutoGenerators.h" #include "cmSourceFile.h" @@ -180,7 +179,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, return; } const char* cname = this->GetCMakeInstance()-> - GetConfiguration()->GetInitializedCacheValue(langComp); + GetCacheManager()->GetInitializedCacheValue(langComp); std::string changeVars; if(cname && !optional) { @@ -311,7 +310,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) makeProgram += saveFile; mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", makeProgram.c_str(), "make program", - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); } } @@ -1116,7 +1115,7 @@ void cmGlobalGenerator::Configure() sprintf(num,"%d",static_cast(this->LocalGenerators.size())); this->GetCMakeInstance()->AddCacheEntry ("CMAKE_NUMBER_OF_LOCAL_GENERATORS", num, - "number of local generators", cmConfiguration::INTERNAL); + "number of local generators", cmCacheManager::INTERNAL); // check for link libraries and include directories containing "NOTFOUND" // and for infinite loops @@ -1538,7 +1537,7 @@ void cmGlobalGenerator::CheckLocalGenerators() std::map notFoundMap; // std::set notFoundMap; // after it is all done do a ConfigureFinalPass - cmConfiguration* config = this->GetCMakeInstance()->GetConfiguration(); + cmCacheManager* manager = this->GetCMakeInstance()->GetCacheManager(); for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { this->LocalGenerators[i]->ConfigureFinalPass(); @@ -1560,7 +1559,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(lib->first.c_str())) { std::string varName = lib->first.substr(0, lib->first.size()-9); - if(config->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1591,7 +1590,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(incDir->c_str())) { std::string varName = incDir->substr(0, incDir->size()-9); - if(config->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1638,7 +1637,7 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir, // and there is a good chance that the try compile stuff will // take the bulk of the time, so try and guess some progress // by getting closer and closer to 100 without actually getting there. - if (!this->CMakeInstance->GetConfiguration()->GetInitializedCacheValue + if (!this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS")) { // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set @@ -1836,7 +1835,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) // update progress // estimate how many lg there will be const char *numGenC = - this->CMakeInstance->GetConfiguration()->GetInitializedCacheValue + this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"); if (!numGenC) @@ -1894,7 +1893,7 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen, gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM"); this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make, "make program", - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); // copy the enabled languages this->LanguageEnabled = gen->LanguageEnabled; this->LanguagesReady = gen->LanguagesReady; diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index d36a6fc..7648813 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -97,7 +97,7 @@ std::string cmGlobalUnixMakefileGenerator3::GetEditCacheCommand() const { cm->AddCacheEntry ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(), - "Path to cache edit program executable.", cmConfiguration::INTERNAL); + "Path to cache edit program executable.", cmCacheManager::INTERNAL); } } const char* edit_cmd = cm->GetCacheDefinition("CMAKE_EDIT_COMMAND"); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 2108715..0e0e63a 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -89,7 +89,7 @@ void cmGlobalVisualStudio7Generator "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmConfiguration::STRING); + cmCacheManager::STRING); } // Create list of configurations requested by user's cache, if any. @@ -109,7 +109,7 @@ void cmGlobalVisualStudio7Generator mf->AddCacheDefinition ("CMAKE_MSVCIDE_RUN_PATH", extraPath, "Saved environment variable CMAKE_MSVCIDE_RUN_PATH", - cmConfiguration::STATIC); + cmCacheManager::STATIC); } } @@ -335,7 +335,7 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmConfiguration::STRING); + cmCacheManager::STRING); } void cmGlobalVisualStudio7Generator::Generate() @@ -970,7 +970,7 @@ void cmGlobalVisualStudio7Generator::CreateGUID(const std::string& name) ret = cmSystemTools::UpperCase(ret); this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), ret.c_str(), "Stored GUID", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); } std::vector *cmGlobalVisualStudio7Generator::GetConfigurations() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 33349d2..0561a05 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -285,7 +285,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vectorconst& "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmConfiguration::STRING); + cmCacheManager::STRING); } } mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); @@ -2754,7 +2754,7 @@ std::string cmGlobalXCodeGenerator::GetOrCreateId(const std::string& name, } this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), - id.c_str(), "Stored Xcode object GUID", cmConfiguration::INTERNAL); + id.c_str(), "Stored Xcode object GUID", cmCacheManager::INTERNAL); return id; } diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index a8b8c2e..d40d8fe 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -73,7 +73,7 @@ bool cmIncludeExternalMSProjectCommand std::string guidVariable = utility_name + "_GUID_CMAKE"; this->Makefile->GetCMakeInstance()->AddCacheEntry( guidVariable.c_str(), customGuid.c_str(), - "Stored GUID", cmConfiguration::INTERNAL); + "Stored GUID", cmCacheManager::INTERNAL); } // Create a target instance for this utility. diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 256eb31..e2ae901 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -172,7 +172,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) // Check one line of the cache file. std::string var; std::string value; - cmConfiguration::CacheEntryType type = cmConfiguration::UNINITIALIZED; + cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; if(cmake::ParseCacheEntry(line, var, value, type)) { // Found a real entry. See if this one was requested. diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index 22abb79..aa70ab9 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -118,7 +118,7 @@ void cmLocalVisualStudio10Generator AddCacheEntry(guidStoreName.c_str(), parser.GUID.c_str(), "Stored GUID", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 2bbaab1..c4abeb2 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -16,6 +16,7 @@ #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmSourceFile.h" +#include "cmCacheManager.h" #include "cmGeneratorTarget.h" #include "cmCustomCommandGenerator.h" #include "cmake.h" @@ -2330,7 +2331,7 @@ void cmLocalVisualStudio7Generator::ReadAndStoreExternalGUID( AddCacheEntry(guidStoreName.c_str(), parser.GUID.c_str(), "Stored GUID", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 941aaf1..34b4621 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -18,7 +18,7 @@ #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmCommands.h" -#include "cmConfiguration.h" +#include "cmCacheManager.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" #include "cmCommandArgumentParserHelper.h" @@ -1805,16 +1805,16 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value) void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmConfiguration::CacheEntryType type, + cmCacheManager::CacheEntryType type, bool force) { bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; const char* existingValue = - this->GetConfiguration()->GetInitializedCacheValue(name); + this->GetCacheManager()->GetInitializedCacheValue(name); if(existingValue - && (this->GetConfiguration()->GetCacheEntryType(name) - == cmConfiguration::UNINITIALIZED)) + && (this->GetCacheManager()->GetCacheEntryType(name) + == cmCacheManager::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in @@ -1823,7 +1823,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, val = existingValue; haveVal = true; } - if ( type == cmConfiguration::PATH || type == cmConfiguration::FILEPATH ) + if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) { std::vector::size_type cc; std::vector files; @@ -1842,14 +1842,14 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, nvalue += files[cc]; } - this->GetConfiguration()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = this->GetConfiguration()->GetInitializedCacheValue(name); + this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); + val = this->GetCacheManager()->GetInitializedCacheValue(name); haveVal = true; } } - this->GetConfiguration()->AddCacheEntry(name, haveVal ? val.c_str() : 0, - doc, type); + this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -1976,7 +1976,7 @@ void cmMakefile::RemoveDefinition(const std::string& name) void cmMakefile::RemoveCacheDefinition(const std::string& name) { - this->GetConfiguration()->RemoveCacheEntry(name); + this->GetCacheManager()->RemoveCacheEntry(name); } void cmMakefile::SetProjectName(const char* p) @@ -2433,7 +2433,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const this->Internal->VarUsageStack.top().insert(name); if(!def) { - def = this->GetConfiguration()->GetInitializedCacheValue(name); + def = this->GetCacheManager()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE if(cmVariableWatch* vv = this->GetVariableWatch()) @@ -2458,7 +2458,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const const char* def = this->Internal->VarStack.top().Get(name); if(!def) { - def = this->GetConfiguration()->GetInitializedCacheValue(name); + def = this->GetCacheManager()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); @@ -2500,7 +2500,7 @@ std::vector cmMakefile res.insert(res.end(), definitions.begin(), definitions.end()); } std::vector cacheKeys = - this->GetConfiguration()->GetCacheEntryKeys(); + this->GetCacheManager()->GetCacheEntryKeys(); res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); std::sort(res.begin(), res.end()); @@ -2801,8 +2801,6 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( openstack.push(t_lookup()); cmake::MessageType mtype = cmake::LOG; - cmConfiguration* config = this->GetCMakeInstance()->GetConfiguration(); - do { char inc = *in; @@ -2836,7 +2834,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( value = cmSystemTools::GetEnv(lookup.c_str()); break; case CACHE: - value = config->GetCacheEntryValue(lookup); + value = this->GetCacheManager() + ->GetInitializedCacheValue(lookup); break; } // Get the string we're meant to append to. @@ -3616,7 +3615,7 @@ int cmMakefile::TryCompile(const std::string& srcdir, // Add this before the user-provided CMake arguments in case // one of the arguments is -DCMAKE_BUILD_TYPE=... cm.AddCacheEntry("CMAKE_BUILD_TYPE", config, - "Build configuration", cmConfiguration::STRING); + "Build configuration", cmCacheManager::STRING); } } // if cmake args were provided then pass them in @@ -3655,12 +3654,12 @@ int cmMakefile::TryCompile(const std::string& srcdir, if(this->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "TRUE", "", cmConfiguration::INTERNAL); + "TRUE", "", cmCacheManager::INTERNAL); } else { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "FALSE", "", cmConfiguration::INTERNAL); + "FALSE", "", cmCacheManager::INTERNAL); } if (cm.Configure() != 0) { @@ -3734,9 +3733,9 @@ void cmMakefile::GetListOfMacros(std::string& macros) const macros = cmJoin(this->MacrosList, ";"); } -cmConfiguration *cmMakefile::GetConfiguration() const +cmCacheManager *cmMakefile::GetCacheManager() const { - return this->GetCMakeInstance()->GetConfiguration(); + return this->GetCMakeInstance()->GetCacheManager(); } void cmMakefile::DisplayStatus(const char* message, float s) const @@ -4903,7 +4902,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, if(id == cmPolicies::CMP0001 && (status == cmPolicies::WARN || status == cmPolicies::OLD)) { - if(!(this->GetConfiguration() + if(!(this->GetCacheManager() ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) { // Set it to 2.4 because that is the last version where the @@ -4913,7 +4912,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, "For backwards compatibility, what version of CMake " "commands and " "syntax should this version of CMake try to support.", - cmConfiguration::STRING); + cmCacheManager::STRING); } } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5ba7d19..5209891 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -12,6 +12,7 @@ #ifndef cmMakefile_h #define cmMakefile_h +#include "cmCacheManager.h" #include "cmExecutionStatus.h" #include "cmListFileCache.h" #include "cmPolicies.h" @@ -22,7 +23,6 @@ #include "cmGeneratorTarget.h" #include "cmExpandedCommandArgument.h" #include "cmake.h" -#include "cmConfiguration.h" #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmSourceGroup.h" @@ -306,7 +306,7 @@ public: ///! Add a definition to this makefile and the global cmake cache. void AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmConfiguration::CacheEntryType type, + cmCacheManager::CacheEntryType type, bool force = false); /** @@ -765,7 +765,7 @@ public: ///enabled. void EnableLanguage(std::vectorconst& languages, bool optional); - cmConfiguration *GetConfiguration() const; + cmCacheManager *GetCacheManager() const; /** * Get the variable watch. This is used to determine when certain variables diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 5ed1ea1..cc094b1 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -36,20 +36,20 @@ bool cmMarkAsAdvancedCommand for(; i < args.size(); ++i) { std::string variable = args[i]; - cmConfiguration* config = this->Makefile->GetConfiguration(); - if (!config->GetCacheEntryValue(variable)) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + if (!manager->GetCacheEntryValue(variable)) { - config->AddCacheEntry(variable, 0, 0, cmConfiguration::UNINITIALIZED); + manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); overwrite = true; } - if (!config->GetCacheEntryValue(variable)) + if (!manager->GetCacheEntryValue(variable)) { cmSystemTools::Error("This should never happen..."); return false; } - if (!config->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) + if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) { - config->SetCacheEntryProperty(variable, "ADVANCED", value); + manager->SetCacheEntryProperty(variable, "ADVANCED", value); } } return true; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index c3d254f..baf5b1e 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,13 +42,13 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmConfiguration* config = this->Makefile->GetConfiguration(); - const char* existingValue = config->GetCacheEntryValue(args[0]); + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue = manager->GetCacheEntryValue(args[0]); if(existingValue) { - if (config->GetCacheEntryType(args[0]) != cmConfiguration::UNINITIALIZED) + if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) { - config->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); + manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; } initialValue = existingValue; @@ -59,6 +59,6 @@ bool cmOptionCommand } bool init = cmSystemTools::IsOn(initialValue.c_str()); this->Makefile->AddCacheDefinition(args[0], init? "ON":"OFF", - args[1].c_str(), cmConfiguration::BOOL); + args[1].c_str(), cmCacheManager::BOOL); return true; } diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index c26173e..61c0133 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -30,11 +30,11 @@ bool cmProjectCommand this->Makefile->AddCacheDefinition (bindir, this->Makefile->GetCurrentOutputDirectory(), - "Value Computed by CMake", cmConfiguration::STATIC); + "Value Computed by CMake", cmCacheManager::STATIC); this->Makefile->AddCacheDefinition (srcdir, this->Makefile->GetCurrentDirectory(), - "Value Computed by CMake", cmConfiguration::STATIC); + "Value Computed by CMake", cmCacheManager::STATIC); bindir = "PROJECT_BINARY_DIR"; srcdir = "PROJECT_SOURCE_DIR"; @@ -59,7 +59,7 @@ bool cmProjectCommand this->Makefile->AddCacheDefinition ("CMAKE_PROJECT_NAME", args[0].c_str(), - "Value Computed by CMake", cmConfiguration::STATIC); + "Value Computed by CMake", cmCacheManager::STATIC); } bool haveVersion = false; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index d74944e..e17474b 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -79,8 +79,8 @@ bool cmSetCommand bool cache = false; // optional bool force = false; // optional bool parentScope = false; - cmConfiguration::CacheEntryType type - = cmConfiguration::STRING; // required if cache + cmCacheManager::CacheEntryType type + = cmCacheManager::STRING; // required if cache const char* docstring = 0; // required if cache unsigned int ignoreLastArgs = 0; @@ -131,21 +131,21 @@ bool cmSetCommand if(cache) { std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0); - type = cmConfiguration::StringToCacheEntryType(args[cacheStart+1].c_str()); + type = cmCacheManager::StringToType(args[cacheStart+1].c_str()); docstring = args[cacheStart+2].c_str(); } // see if this is already in the cache - cmConfiguration* config = this->Makefile->GetConfiguration(); - const char* existingValue = config->GetCacheEntryValue(variable); + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue = manager->GetCacheEntryValue(variable); if(existingValue && - (config->GetCacheEntryType(variable) != cmConfiguration::UNINITIALIZED)) + (manager->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal // then leave now without setting any definitions in the cache // or the makefile - if(cache && type != cmConfiguration::INTERNAL && !force) + if(cache && type != cmCacheManager::INTERNAL && !force) { return true; } diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 87fb475..77f9fb9 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -14,6 +14,7 @@ #include "cmSetTestsPropertiesCommand.h" #include "cmSetSourceFilesPropertiesCommand.h" +#include "cmCacheManager.h" //---------------------------------------------------------------------------- cmSetPropertyCommand::cmSetPropertyCommand() @@ -425,7 +426,7 @@ bool cmSetPropertyCommand::HandleCacheMode() } else if(this->PropertyName == "TYPE") { - if(!cmConfiguration::IsCacheEntryType(this->PropertyValue.c_str())) + if(!cmCacheManager::IsType(this->PropertyValue.c_str())) { std::ostringstream e; e << "given invalid CACHE entry TYPE \"" << this->PropertyValue << "\""; @@ -452,7 +453,7 @@ bool cmSetPropertyCommand::HandleCacheMode() cmMakefile* mf = this->GetMakefile(); cmake* cm = mf->GetCMakeInstance(); const char* existingValue - = cm->GetConfiguration()->GetCacheEntryValue(*ni); + = cm->GetCacheManager()->GetCacheEntryValue(*ni); if(existingValue) { if(!this->HandleCacheEntry(*ni)) @@ -478,19 +479,20 @@ bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey) // Set or append the property. const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); - cmConfiguration* config = this->Makefile->GetConfiguration(); + cmCacheManager* manager = this->Makefile->GetCacheManager(); if (this->Remove) { - config->RemoveCacheEntryProperty(cacheKey, name); + manager->RemoveCacheEntryProperty(cacheKey, name); + return true; } if(this->AppendMode) { - config->AppendCacheEntryProperty(cacheKey, name, value, - this->AppendAsString); + manager->AppendCacheEntryProperty(cacheKey, name, value, + this->AppendAsString); } else { - config->SetCacheEntryProperty(cacheKey, name, value); + manager->SetCacheEntryProperty(cacheKey, name, value); } return true; diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 836f342..927888b 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -88,7 +88,7 @@ bool cmSiteNameCommand AddCacheDefinition(args[0], siteName.c_str(), "Name of the computer/site where compile is being run", - cmConfiguration::STRING); + cmCacheManager::STRING); return true; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ad461f0..b3d1155 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1181,7 +1181,7 @@ void cmTarget::ClearDependencyInformation( cmMakefile& mf, if (this->RecordDependencies) { mf.AddCacheDefinition(depname, "", - "Dependencies for target", cmConfiguration::STATIC); + "Dependencies for target", cmCacheManager::STATIC); } else { @@ -1369,7 +1369,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, dependencies += ";"; mf.AddCacheDefinition( targetEntry, dependencies.c_str(), "Dependencies for the target", - cmConfiguration::STATIC ); + cmCacheManager::STATIC ); } } diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 3cd8291..911ade8 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -10,6 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmTryRunCommand.h" +#include "cmCacheManager.h" #include "cmTryCompileCommand.h" #include @@ -216,7 +217,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, } this->Makefile->AddCacheDefinition(this->RunResultVariable, retChar, "Result of TRY_RUN", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); } /* This is only used when cross compiling. Instead of running the @@ -261,14 +262,14 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->Makefile->AddCacheDefinition(this->RunResultVariable, "PLEASE_FILL_OUT-FAILED_TO_RUN", comment.c_str(), - cmConfiguration::STRING); + cmCacheManager::STRING); - cmConfiguration* config = this->Makefile->GetConfiguration(); + cmCacheManager* manager = this->Makefile->GetCacheManager(); const char* existingValue - = config->GetCacheEntryValue(this->RunResultVariable); + = manager->GetCacheEntryValue(this->RunResultVariable); if (existingValue) { - config->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); + manager->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); } error = true; @@ -289,14 +290,14 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->Makefile->AddCacheDefinition(internalRunOutputName, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), - cmConfiguration::STRING); - cmConfiguration* config = this->Makefile->GetConfiguration(); + cmCacheManager::STRING); + cmCacheManager* manager = this->Makefile->GetCacheManager(); const char* existing = - config->GetCacheEntryValue(internalRunOutputName); + manager->GetCacheEntryValue(internalRunOutputName); if (existing) { - config->SetCacheEntryProperty(internalRunOutputName, - "ADVANCED", "1"); + manager->SetCacheEntryProperty(internalRunOutputName, + "ADVANCED", "1"); } error = true; diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index b68afbc..2799a9b 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -11,8 +11,6 @@ ============================================================================*/ #include "cmUtilitySourceCommand.h" -#include "cmCacheManager.h" - // cmUtilitySourceCommand bool cmUtilitySourceCommand ::InitialPass(std::vector const& args, cmExecutionStatus &) @@ -120,14 +118,14 @@ bool cmUtilitySourceCommand this->Makefile->AddCacheDefinition(cacheEntry, utilityExecutable.c_str(), "Path to an internal program.", - cmConfiguration::FILEPATH); + cmCacheManager::FILEPATH); // add a value into the cache that maps from the // full path to the name of the project cmSystemTools::ConvertToUnixSlashes(utilityExecutable); this->Makefile->AddCacheDefinition(utilityExecutable, utilityName.c_str(), "Executable to project name.", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); return true; } diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index bc6bc01..dd2a682 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -10,7 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmVariableRequiresCommand.h" -#include "cmConfiguration.h" +#include "cmCacheManager.h" // cmLibraryCommand bool cmVariableRequiresCommand @@ -34,7 +34,6 @@ bool cmVariableRequiresCommand bool requirementsMet = true; std::string notSet; bool hasAdvanced = false; - cmConfiguration* config = this->Makefile->GetConfiguration(); for(unsigned int i = 2; i < args.size(); ++i) { if(!this->Makefile->IsOn(args[i])) @@ -42,8 +41,9 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - if(config->GetCacheEntryValue(args[i]) && - config->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + if(manager->GetCacheEntryValue(args[i]) && + manager->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) { hasAdvanced = true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 328e273..64b332c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -21,7 +21,6 @@ #include "cmTest.h" #include "cmDocumentationFormatter.h" #include "cmAlgorithms.h" -#include "cmConfiguration.h" #if defined(CMAKE_BUILD_WITH_CMAKE) # include "cmGraphVizWriter.h" @@ -134,8 +133,6 @@ cmake::cmake() this->FileComparison = new cmFileTimeComparison; this->Policies = new cmPolicies(); - this->Configuration = new cmConfiguration(this); - this->InitializeProperties(); #ifdef __APPLE__ @@ -174,7 +171,6 @@ cmake::~cmake() { delete this->CacheManager; delete this->Policies; - delete this->Configuration; if (this->GlobalGenerator) { delete this->GlobalGenerator; @@ -338,7 +334,7 @@ bool cmake::SetCacheArgs(const std::vector& args) } } std::string var, value; - cmConfiguration::CacheEntryType type = cmConfiguration::UNINITIALIZED; + cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; if(cmCacheManager::ParseEntry(entry, var, value, type)) { // The value is transformed if it is a filepath for example, so @@ -348,7 +344,7 @@ bool cmake::SetCacheArgs(const std::vector& args) std::string cachedValue; if(this->WarnUnusedCli) { - if(const char *v = this->Configuration + if(const char *v = this->CacheManager ->GetInitializedCacheValue(var)) { haveValue = true; @@ -356,13 +352,13 @@ bool cmake::SetCacheArgs(const std::vector& args) } } - this->Configuration->AddCacheEntry(var, value.c_str(), + this->CacheManager->AddCacheEntry(var, value.c_str(), "No help, variable specified on the command line.", type); if(this->WarnUnusedCli) { if (!haveValue || - cachedValue != this->Configuration + cachedValue != this->CacheManager ->GetInitializedCacheValue(var)) { this->WatchUnusedCli(var); @@ -408,13 +404,13 @@ bool cmake::SetCacheArgs(const std::vector& args) //go through all cache entries and collect the vars which will be removed std::vector entriesToDelete; std::vector cacheKeys = - this->Configuration->GetCacheEntryKeys(); + this->CacheManager->GetCacheEntryKeys(); for (std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmConfiguration::CacheEntryType t = - this->Configuration->GetCacheEntryType(*it); - if(t != cmConfiguration::STATIC) + cmCacheManager::CacheEntryType t = + this->CacheManager->GetCacheEntryType(*it); + if(t != cmCacheManager::STATIC) { if (regex.find(it->c_str())) { @@ -429,7 +425,7 @@ bool cmake::SetCacheArgs(const std::vector& args) currentEntry != entriesToDelete.end(); ++currentEntry) { - this->Configuration->RemoveCacheEntry(*currentEntry); + this->CacheManager->RemoveCacheEntry(*currentEntry); } } else if(arg.find("-C",0) == 0) @@ -925,7 +921,7 @@ void cmake::SetDirectoriesFromFile(const char* arg) if(this->LoadCache(cachePath)) { const char* existingValue = - this->Configuration->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + this->CacheManager->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (existingValue) { this->SetHomeOutputDirectory(cachePath); @@ -979,14 +975,14 @@ int cmake::AddCMakePaths() // Save the value in the cache this->CacheManager->AddCacheEntry ("CMAKE_COMMAND", cmSystemTools::GetCMakeCommand().c_str(), - "Path to CMake executable.", cmConfiguration::INTERNAL); + "Path to CMake executable.", cmCacheManager::INTERNAL); #ifdef CMAKE_BUILD_WITH_CMAKE this->CacheManager->AddCacheEntry ("CMAKE_CTEST_COMMAND", cmSystemTools::GetCTestCommand().c_str(), - "Path to ctest program executable.", cmConfiguration::INTERNAL); + "Path to ctest program executable.", cmCacheManager::INTERNAL); this->CacheManager->AddCacheEntry ("CMAKE_CPACK_COMMAND", cmSystemTools::GetCPackCommand().c_str(), - "Path to cpack program executable.", cmConfiguration::INTERNAL); + "Path to cpack program executable.", cmCacheManager::INTERNAL); #endif if(!cmSystemTools::FileExists( (cmSystemTools::GetCMakeRoot()+"/Modules/CMake.cmake").c_str())) @@ -1000,7 +996,7 @@ int cmake::AddCMakePaths() } this->CacheManager->AddCacheEntry ("CMAKE_ROOT", cmSystemTools::GetCMakeRoot().c_str(), - "Path to CMake installation.", cmConfiguration::INTERNAL); + "Path to CMake installation.", cmCacheManager::INTERNAL); return 1; } @@ -1242,7 +1238,7 @@ struct SaveCacheEntry std::string key; std::string value; std::string help; - cmConfiguration::CacheEntryType type; + cmCacheManager::CacheEntryType type; }; int cmake::HandleDeleteCacheVariables(const std::string& var) @@ -1255,6 +1251,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) { return 0; } + cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator(); std::vector saved; std::ostringstream warning; warning @@ -1270,13 +1267,10 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) i++; save.value = *i; warning << *i << "\n"; - const char* existingValue = - this->CacheManager->GetCacheEntryValue(save.key); - if(existingValue) + if(ci.Find(save.key)) { - save.type = this->CacheManager->GetCacheEntryType(save.key); - if(const char* help = - this->CacheManager->GetCacheEntryProperty(save.key, "HELPSTRING")) + save.type = ci.GetType(); + if(const char* help = ci.GetProperty("HELPSTRING")) { save.help = help; } @@ -1315,7 +1309,7 @@ int cmake::Configure() AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE", "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); } else { @@ -1323,7 +1317,7 @@ int cmake::Configure() AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE", "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); } } int ret = this->ActualConfigure(); @@ -1359,7 +1353,7 @@ int cmake::ActualConfigure() this->GetHomeDirectory(), "Start directory with the top level CMakeLists.txt file for this " "project", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); } // no generator specified on the command line @@ -1468,11 +1462,11 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName().c_str(), "Name of generator.", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); this->CacheManager->AddCacheEntry("CMAKE_EXTRA_GENERATOR", this->GlobalGenerator->GetExtraGeneratorName().c_str(), "Name of external makefile project generator.", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); } if(const char* platformName = @@ -1500,7 +1494,7 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_PLATFORM", this->GeneratorPlatform.c_str(), "Name of generator platform.", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); } if(const char* tsName = @@ -1528,7 +1522,7 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_TOOLSET", this->GeneratorToolset.c_str(), "Name of generator toolset.", - cmConfiguration::INTERNAL); + cmCacheManager::INTERNAL); } // reset any system configuration information, except for when we are @@ -1558,51 +1552,49 @@ int cmake::ActualConfigure() // project requires compatibility with CMake 2.4. We detect this // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY // variable created when CMP0001 is not set to NEW. - if(this->Configuration + if(this->GetCacheManager() ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { - if(!this->Configuration->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) + if(!this->CacheManager->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) { - this->Configuration->AddCacheEntry + this->CacheManager->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", - cmConfiguration::PATH); + cmCacheManager::PATH); } - if(!this->Configuration + if(!this->CacheManager ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) { - this->Configuration->AddCacheEntry + this->CacheManager->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", "Single output directory for building all executables.", - cmConfiguration::PATH); + cmCacheManager::PATH); } } - if(!this->Configuration + if(!this->CacheManager ->GetInitializedCacheValue("CMAKE_USE_RELATIVE_PATHS")) { - this->Configuration->AddCacheEntry + this->CacheManager->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", - cmConfiguration::BOOL); - if (!this->Configuration->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED")) + cmCacheManager::BOOL); + if (!this->CacheManager->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED")) { - this->Configuration->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED", "1"); + this->CacheManager->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED", "1"); } } - if(cmSystemTools::GetFatalErrorOccured()) + if(cmSystemTools::GetFatalErrorOccured() && + (!this->CacheManager->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM") || + cmSystemTools::IsOff(this->CacheManager-> + GetInitializedCacheValue("CMAKE_MAKE_PROGRAM")))) { - const char* makeProgram = - this->Configuration->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM"); - if (!makeProgram || cmSystemTools::IsOff(makeProgram)) - { - // We must have a bad generator selection. Wipe the cache entry so the - // user can select another. - this->Configuration->RemoveCacheEntry("CMAKE_GENERATOR"); - this->Configuration->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR"); - } + // We must have a bad generator selection. Wipe the cache entry so the + // user can select another. + this->CacheManager->RemoveCacheEntry("CMAKE_GENERATOR"); + this->CacheManager->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR"); } cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); @@ -1808,7 +1800,7 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, { this->CacheManager->AddCacheEntry(key, value, helpString, - cmConfiguration::CacheEntryType(type)); + cmCacheManager::CacheEntryType(type)); } const char* cmake::GetCacheDefinition(const std::string& name) const @@ -1880,7 +1872,7 @@ void cmake::AddDefaultGenerators() bool cmake::ParseCacheEntry(const std::string& entry, std::string& var, std::string& value, - cmConfiguration::CacheEntryType& type) + cmCacheManager::CacheEntryType& type) { return cmCacheManager::ParseEntry(entry, var, value, type); } @@ -2208,7 +2200,7 @@ void cmake::TruncateOutputLog(const char* fname) { return; } - if (!this->Configuration->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")) + if ( !this->CacheManager->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR") ) { cmSystemTools::RemoveFile(fullPath); return; @@ -2326,7 +2318,7 @@ const char *cmake::GetProperty(const std::string& prop, if ( prop == "CACHE_VARIABLES" ) { std::vector cacheKeys = - this->Configuration->GetCacheEntryKeys(); + this->CacheManager->GetCacheEntryKeys(); this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); } else if ( prop == "COMMANDS" ) @@ -2479,7 +2471,7 @@ int cmake::GetSystemInformation(std::vector& args) // we have to find the module directory, so we can copy the files this->AddCMakePaths(); std::string modulesPath = - this->Configuration->GetInitializedCacheValue("CMAKE_ROOT"); + this->CacheManager->GetInitializedCacheValue("CMAKE_ROOT"); modulesPath += "/Modules"; std::string inFile = modulesPath; inFile += "/SystemInformation.cmake"; @@ -2689,7 +2681,7 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, if(t == cmake::AUTHOR_WARNING) { // Allow suppression of these warnings. - const char* suppress = this->Configuration->GetCacheEntryValue( + const char* suppress = this->CacheManager->GetCacheEntryValue( "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); if(suppress && cmSystemTools::IsOn(suppress)) { @@ -2810,7 +2802,7 @@ int cmake::Build(const std::string& dir, return 1; } const char* cachedGenerator = - this->Configuration->GetCacheEntryValue("CMAKE_GENERATOR"); + this->CacheManager->GetCacheEntryValue("CMAKE_GENERATOR"); if(!cachedGenerator) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; @@ -2827,7 +2819,7 @@ int cmake::Build(const std::string& dir, std::string output; std::string projName; const char* cachedProjectName = - this->Configuration->GetCacheEntryValue("CMAKE_PROJECT_NAME"); + this->CacheManager->GetCacheEntryValue("CMAKE_PROJECT_NAME"); if(!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; @@ -2836,7 +2828,7 @@ int cmake::Build(const std::string& dir, projName = cachedProjectName; bool verbose = false; const char* cachedVerbose = - this->Configuration->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); + this->CacheManager->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); if(cachedVerbose) { verbose = cmSystemTools::IsOn(cachedVerbose); diff --git a/Source/cmake.h b/Source/cmake.h index 1debfeb..3acf4a8 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -19,7 +19,6 @@ #include "cmPropertyMap.h" #include "cmInstalledFile.h" #include "cmCacheManager.h" -#include "cmConfiguration.h" class cmGlobalGeneratorFactory; class cmGlobalGenerator; @@ -33,7 +32,6 @@ class cmDocumentationSection; class cmPolicies; class cmTarget; class cmGeneratedFileStream; -class cmConfiguration; /** \brief Represents a cmake invocation. * @@ -179,7 +177,7 @@ class cmake static bool ParseCacheEntry(const std::string& entry, std::string& var, std::string& value, - cmConfiguration::CacheEntryType& type); + cmCacheManager::CacheEntryType& type); int LoadCache(); bool LoadCache(const std::string& path); @@ -389,9 +387,6 @@ class cmake void UnwatchUnusedCli(const std::string& var); void WatchUnusedCli(const std::string& var); - - cmConfiguration* GetConfiguration() const { return this->Configuration; } - protected: void RunCheckForUnusedVariables(); void InitializeProperties(); @@ -480,8 +475,6 @@ private: std::vector DebugConfigs; InstalledFilesMap InstalledFiles; - cmConfiguration* Configuration; - void UpdateConversionPathTable(); }; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 9ab49ee..3b518be 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -18,7 +18,7 @@ #include "cmake.h" #include "cmcmd.h" -#include "cmConfiguration.h" +#include "cmCacheManager.h" #include "cmListFileCache.h" #include "cmSourceFile.h" #include "cmGlobalGenerator.h" @@ -330,28 +330,28 @@ int do_cmake(int ac, char const* const* av) { std::cout << "-- Cache values" << std::endl; std::vector keys = - cm.GetConfiguration()->GetCacheEntryKeys(); + cm.GetCacheManager()->GetCacheEntryKeys(); for (std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) { - cmConfiguration::CacheEntryType t = - cm.GetConfiguration()->GetCacheEntryType(*it); - if ( t != cmConfiguration::INTERNAL && t != cmConfiguration::STATIC && - t != cmConfiguration::UNINITIALIZED ) + cmCacheManager::CacheEntryType t = + cm.GetCacheManager()->GetCacheEntryType(*it); + if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && + t != cmCacheManager::UNINITIALIZED ) { const char* advancedProp = - cm.GetConfiguration()->GetCacheEntryProperty(*it, "ADVANCED"); + cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED"); if ( list_all_cached || !advancedProp) { if ( list_help ) { std::cout << "// " - << cm.GetConfiguration()->GetCacheEntryProperty(*it, + << cm.GetCacheManager()->GetCacheEntryProperty(*it, "HELPSTRING") << std::endl; } std::cout << *it << ":" << - cmConfiguration::CacheEntryTypeToString(t) - << "=" << cm.GetConfiguration()->GetCacheEntryValue(*it) + cmCacheManager::TypeToString(t) + << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it) << std::endl; if ( list_help ) { diff --git a/bootstrap b/bootstrap index b8e9885..4239802 100755 --- a/bootstrap +++ b/bootstrap @@ -302,7 +302,6 @@ CMAKE_CXX_SOURCES="\ cmCommandsForBootstrap \ cmTarget \ cmTest \ - cmConfiguration \ cmCustomCommand \ cmCustomCommandGenerator \ cmCacheManager \ ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 2 - Source/CursesDialog/ccmake.cxx | 1 + Source/CursesDialog/cmCursesBoolWidget.cxx | 2 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 17 +- Source/CursesDialog/cmCursesCacheEntryComposite.h | 1 + Source/CursesDialog/cmCursesDummyWidget.cxx | 2 +- Source/CursesDialog/cmCursesFilePathWidget.cxx | 2 +- Source/CursesDialog/cmCursesLongMessageForm.cxx | 1 + Source/CursesDialog/cmCursesMainForm.cxx | 80 ++++----- Source/CursesDialog/cmCursesMainForm.h | 2 +- Source/CursesDialog/cmCursesOptionsWidget.cxx | 2 +- Source/CursesDialog/cmCursesPathWidget.cxx | 4 +- Source/CursesDialog/cmCursesStringWidget.cxx | 2 +- Source/CursesDialog/cmCursesWidget.h | 6 +- Source/QtDialog/QCMake.cxx | 62 +++---- Source/cmBuildCommand.cxx | 2 +- Source/cmBuildNameCommand.cxx | 4 +- Source/cmCPluginAPI.cxx | 12 +- Source/cmCTest.cxx | 2 +- Source/cmCacheManager.cxx | 96 ++++++++--- Source/cmCacheManager.h | 36 +++-- Source/cmCommandArgumentParserHelper.cxx | 3 +- Source/cmConfiguration.cxx | 170 -------------------- Source/cmConfiguration.h | 52 ------ Source/cmCoreTryCompile.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 7 +- Source/cmFindBase.cxx | 11 +- Source/cmFindLibraryCommand.cxx | 7 +- Source/cmFindPackageCommand.cxx | 2 +- Source/cmFindPathCommand.cxx | 7 +- Source/cmFindProgramCommand.cxx | 7 +- Source/cmGetFilenameComponentCommand.cxx | 8 +- Source/cmGetPropertyCommand.cxx | 5 +- Source/cmGlobalGenerator.cxx | 19 ++- Source/cmGlobalUnixMakefileGenerator3.cxx | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 8 +- Source/cmGlobalXCodeGenerator.cxx | 4 +- Source/cmIncludeExternalMSProjectCommand.cxx | 2 +- Source/cmLoadCacheCommand.cxx | 2 +- Source/cmLocalVisualStudio10Generator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 3 +- Source/cmMakefile.cxx | 47 +++--- Source/cmMakefile.h | 6 +- Source/cmMarkAsAdvancedCommand.cxx | 12 +- Source/cmOptionCommand.cxx | 10 +- Source/cmProjectCommand.cxx | 6 +- Source/cmSetCommand.cxx | 14 +- Source/cmSetPropertyCommand.cxx | 16 +- Source/cmSiteNameCommand.cxx | 2 +- Source/cmTarget.cxx | 4 +- Source/cmTryRunCommand.cxx | 21 +-- Source/cmUtilitySourceCommand.cxx | 6 +- Source/cmVariableRequiresCommand.cxx | 8 +- Source/cmake.cxx | 122 +++++++------- Source/cmake.h | 9 +- Source/cmakemain.cxx | 20 +-- bootstrap | 1 - 57 files changed, 389 insertions(+), 577 deletions(-) delete mode 100644 Source/cmConfiguration.cxx delete mode 100644 Source/cmConfiguration.h hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 17:15:49 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 17:15:49 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1587-g92e7b42 Message-ID: <20150407211549.6ADB0AE06E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 92e7b42c7f9b5cb99d039207c06b372b7a33cd9a (commit) via 3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94 (commit) from 8d0436743079e56fc77d5352b62604266ddfc4f5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92e7b42c7f9b5cb99d039207c06b372b7a33cd9a commit 92e7b42c7f9b5cb99d039207c06b372b7a33cd9a Merge: 8d04367 3347c5e Author: Brad King AuthorDate: Tue Apr 7 17:15:46 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 17:15:46 2015 -0400 Merge topic 'refactor-cache-api' into next 3347c5e4 Revert topic 'refactor-cache-api' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94 commit 3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94 Author: Brad King AuthorDate: Tue Apr 7 17:14:41 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 17:15:04 2015 -0400 Revert topic 'refactor-cache-api' This topic was never tested without some follow-up commits. The GetCacheEntryValue API returns a pointer to memory freed on return. It will have to be revised along with the rest of the original topic. diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 586070b..0827037 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -18,6 +18,7 @@ #include "cmGlobalGenerator.h" #include #include "cmCTestTestHandler.h" +#include "cmCacheManager.h" //---------------------------------------------------------------------- cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler() @@ -254,7 +255,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) cm.SetGeneratorToolset(this->BuildGeneratorToolset); // Load the cache to make CMAKE_MAKE_PROGRAM available. - cm.LoadCache(this->BinaryDir); + cm.GetCacheManager()->LoadCache(this->BinaryDir); } else { diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 4f028c4..682f95f 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -18,9 +18,6 @@ #include "cmCursesFilePathWidget.h" #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" -#include "../cmake.h" - -#include cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( const std::string& key, @@ -35,7 +32,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( - const std::string& key, cmake *cm, bool isNew, + const std::string& key, const cmCacheManager::CacheIterator& it, bool isNew, int labelwidth, int entrywidth) : Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth) { @@ -50,13 +47,11 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); - assert(value); - switch (cm->GetCacheManager()->GetCacheEntryType(key)) + switch ( it.GetType() ) { - case cmCacheManager::BOOL: + case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); - if (cmSystemTools::IsOn(value)) + if (cmSystemTools::IsOn(it.GetValue().c_str())) { static_cast(this->Entry)->SetValueAsBool(true); } @@ -67,40 +62,40 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( break; case cmCacheManager::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString(value); + static_cast(this->Entry)->SetString( + it.GetValue()); break; case cmCacheManager::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString(value); + static_cast(this->Entry)->SetString( + it.GetValue()); break; case cmCacheManager::STRING: - { - const char* stringsProp = cm->GetCacheManager() - ->GetCacheEntryProperty(key, "STRINGS"); - if(stringsProp) + if(it.PropertyExists("STRINGS")) { cmCursesOptionsWidget* ow = new cmCursesOptionsWidget(this->EntryWidth, 1, 1, 1); this->Entry = ow; std::vector options; - cmSystemTools::ExpandListArgument(stringsProp, options); + cmSystemTools::ExpandListArgument( + std::string(it.GetProperty("STRINGS")), options); for(std::vector::iterator si = options.begin(); si != options.end(); ++si) { ow->AddOption(*si); } - ow->SetOption(value); + ow->SetOption(it.GetValue()); } else { this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString(value); + static_cast(this->Entry)->SetString( + it.GetValue()); } break; - } case cmCacheManager::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", - key.c_str()); + it.GetName().c_str()); break; default: // TODO : put warning message here diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index dc4ee4af..7cdf13b 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -21,7 +21,7 @@ public: cmCursesCacheEntryComposite(const std::string& key, int labelwidth, int entrywidth); cmCursesCacheEntryComposite(const std::string& key, - cmake *cm, + const cmCacheManager::CacheIterator& it, bool isNew, int labelwidth, int entrywidth); ~cmCursesCacheEntryComposite(); const char* GetValue(); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 833d540..d60062e 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -111,17 +111,13 @@ void cmCursesMainForm::InitializeUI() // Count non-internal and non-static entries int count=0; - std::vector cacheKeys = - this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys(); - - for(std::vector::const_iterator it = cacheKeys.begin(); - it != cacheKeys.end(); ++it) + for(cmCacheManager::CacheIterator i = + this->CMakeInstance->GetCacheManager()->NewIterator(); + !i.IsAtEnd(); i.Next()) { - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() - ->GetCacheEntryType(*it); - if (t != cmCacheManager::INTERNAL && - t != cmCacheManager::STATIC && - t != cmCacheManager::UNINITIALIZED) + if ( i.GetType() != cmCacheManager::INTERNAL && + i.GetType() != cmCacheManager::STATIC && + i.GetType() != cmCacheManager::UNINITIALIZED) { ++count; } @@ -143,49 +139,45 @@ void cmCursesMainForm::InitializeUI() // Create the composites. // First add entries which are new - for(std::vector::const_iterator it = cacheKeys.begin(); - it != cacheKeys.end(); ++it) + for(cmCacheManager::CacheIterator i = + this->CMakeInstance->GetCacheManager()->NewIterator(); + !i.IsAtEnd(); i.Next()) { - std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() - ->GetCacheEntryType(*it); - if (t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED ) + std::string key = i.GetName(); + if ( i.GetType() == cmCacheManager::INTERNAL || + i.GetType() == cmCacheManager::STATIC || + i.GetType() == cmCacheManager::UNINITIALIZED ) { continue; } if (!this->LookForCacheEntry(key)) { - newEntries->push_back(new cmCursesCacheEntryComposite(key, - this->CMakeInstance, - true, 30, - entrywidth)); + newEntries->push_back(new cmCursesCacheEntryComposite(key, i, + true, 30, + entrywidth)); this->OkToGenerate = false; } } // then add entries which are old - for(std::vector::const_iterator it = cacheKeys.begin(); - it != cacheKeys.end(); ++it) + for(cmCacheManager::CacheIterator i = + this->CMakeInstance->GetCacheManager()->NewIterator(); + !i.IsAtEnd(); i.Next()) { - std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() - ->GetCacheEntryType(*it); - if (t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED ) + std::string key = i.GetName(); + if ( i.GetType() == cmCacheManager::INTERNAL || + i.GetType() == cmCacheManager::STATIC || + i.GetType() == cmCacheManager::UNINITIALIZED ) { continue; } if (this->LookForCacheEntry(key)) { - newEntries->push_back(new cmCursesCacheEntryComposite(key, - this->CMakeInstance, - false, 30, - entrywidth)); + newEntries->push_back(new cmCursesCacheEntryComposite(key, i, + false, 30, + entrywidth)); } } } @@ -224,13 +216,10 @@ void cmCursesMainForm::RePost() std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - const char* existingValue = - this->CMakeInstance->GetCacheManager() - ->GetCacheEntryValue((*it)->GetValue()); - bool advanced = - this->CMakeInstance->GetCacheManager() - ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); - if (!existingValue || (!this->AdvancedMode && advanced)) + cmCacheManager::CacheIterator mit = + this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); + if (mit.IsAtEnd() || + (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) { continue; } @@ -256,13 +245,10 @@ void cmCursesMainForm::RePost() std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - const char* existingValue = - this->CMakeInstance->GetCacheManager() - ->GetCacheEntryValue((*it)->GetValue()); - bool advanced = - this->CMakeInstance->GetCacheManager() - ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); - if (!existingValue || (!this->AdvancedMode && advanced)) + cmCacheManager::CacheIterator mit = + this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); + if (mit.IsAtEnd() || + (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) { continue; } @@ -328,13 +314,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - const char* existingValue = - this->CMakeInstance->GetCacheManager() - ->GetCacheEntryValue((*it)->GetValue()); - bool advanced = - this->CMakeInstance->GetCacheManager() - ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); - if (!existingValue || (!this->AdvancedMode && advanced)) + cmCacheManager::CacheIterator mit = + this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); + if (mit.IsAtEnd() || + (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) { continue; } @@ -351,13 +334,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - const char* existingValue = - this->CMakeInstance->GetCacheManager() - ->GetCacheEntryValue((*it)->GetValue()); - bool advanced = - this->CMakeInstance->GetCacheManager() - ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); - if (!existingValue || (!this->AdvancedMode && advanced)) + cmCacheManager::CacheIterator mit = + this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); + if (mit.IsAtEnd() || + (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) { continue; } @@ -515,12 +495,11 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the help string of the current entry // and add it to the help string - const char* existingValue = - this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField); - if (existingValue) + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField); + if (!it.IsAtEnd()) { - const char* hs = this->CMakeInstance->GetCacheManager() - ->GetCacheEntryProperty(curField, "HELPSTRING"); + const char* hs = it.GetProperty("HELPSTRING"); if ( hs ) { strncpy(help, hs, 127); @@ -660,7 +639,7 @@ int cmCursesMainForm::Configure(int noconfigure) // always save the current gui values to disk this->FillCacheManagerFromUI(); - this->CMakeInstance->SaveCache( + this->CMakeInstance->GetCacheManager()->SaveCache( this->CMakeInstance->GetHomeOutputDirectory()); this->LoadCache(0); @@ -813,28 +792,23 @@ void cmCursesMainForm::FillCacheManagerFromUI() size_t size = this->Entries->size(); for(size_t i=0; i < size; i++) { - std::string cacheKey = (*this->Entries)[i]->Key; - const char* existingValue = this->CMakeInstance->GetCacheManager() - ->GetCacheEntryValue(cacheKey); - if (existingValue) + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator( + (*this->Entries)[i]->Key.c_str()); + if (!it.IsAtEnd()) { - std::string oldValue = existingValue; + std::string oldValue = it.GetValue(); std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - cmCacheManager::CacheEntryType t = - this->CMakeInstance->GetCacheManager() - ->GetCacheEntryType(cacheKey); - this->FixValue(t, oldValue, fixedOldValue); - this->FixValue(t, newValue, fixedNewValue); + this->FixValue(it.GetType(), oldValue, fixedOldValue); + this->FixValue(it.GetType(), newValue, fixedNewValue); if(!(fixedOldValue == fixedNewValue)) { // The user has changed the value. Mark it as modified. - this->CMakeInstance->GetCacheManager() - ->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true); - this->CMakeInstance->GetCacheManager() - ->SetCacheEntryValue(cacheKey, fixedNewValue); + it.SetProperty("MODIFIED", true); + it.SetValue(fixedNewValue.c_str()); } } } @@ -1043,15 +1017,12 @@ void cmCursesMainForm::HandleInput() cmCursesWidget* lbl = reinterpret_cast(field_userptr( this->Fields[findex-2])); const char* curField = lbl->GetValue(); - const char* helpString = 0; - - const char* existingValue = - this->CMakeInstance->GetCacheManager() - ->GetCacheEntryValue(curField); - if (existingValue) + const char* helpString=0; + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField); + if (!it.IsAtEnd()) { - helpString = this->CMakeInstance->GetCacheManager() - ->GetCacheEntryProperty(curField, "HELPSTRING"); + helpString = it.GetProperty("HELPSTRING"); } if (helpString) { diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 08d53ce..996aa75 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -96,7 +96,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) emit this->binaryDirChanged(this->BinaryDirectory); cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); this->setGenerator(QString()); - if(!this->CMakeInstance->LoadCache( + if(!this->CMakeInstance->GetCacheManager()->LoadCache( this->BinaryDirectory.toLocal8Bit().data())) { QDir testDir(this->BinaryDirectory); @@ -110,18 +110,16 @@ void QCMake::setBinaryDirectory(const QString& _dir) QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); - const char* homeDir = cachem->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); - if (homeDir) + cmCacheManager::CacheIterator itm = cachem->NewIterator(); + if ( itm.Find("CMAKE_HOME_DIRECTORY")) { - setSourceDirectory(QString::fromLocal8Bit(homeDir)); + setSourceDirectory(QString::fromLocal8Bit(itm.GetValue().c_str())); } - const char* gen = cachem->GetCacheEntryValue("CMAKE_GENERATOR"); - if (gen) + if ( itm.Find("CMAKE_GENERATOR")) { - const char* extraGen = cachem - ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); + const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: - CreateFullGeneratorName(gen, extraGen? extraGen : ""); + CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : ""); this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); } } @@ -196,35 +194,33 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) // set the value of properties cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - std::vector cacheKeys = cachem->GetCacheEntryKeys(); - for(std::vector::const_iterator it = cacheKeys.begin(); - it != cacheKeys.end(); ++it) + for(cmCacheManager::CacheIterator i = cachem->NewIterator(); + !i.IsAtEnd(); i.Next()) { - cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*it); - if(t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC) + + if(i.GetType() == cmCacheManager::INTERNAL || + i.GetType() == cmCacheManager::STATIC) { continue; } QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(it->c_str()); + prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); int idx = props.indexOf(prop); if(idx == -1) { - toremove.append(QString::fromLocal8Bit(it->c_str())); + toremove.append(QString::fromLocal8Bit(i.GetName().c_str())); } else { prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - cachem->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); + i.SetValue(prop.Value.toBool() ? "ON" : "OFF"); } else { - cachem->SetCacheEntryValue(*it, - prop.Value.toString().toLocal8Bit().data()); + i.SetValue(prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); } @@ -274,7 +270,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) } } - this->CMakeInstance->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); + cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); } QCMakePropertyList QCMake::properties() const @@ -282,47 +278,42 @@ QCMakePropertyList QCMake::properties() const QCMakePropertyList ret; cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - std::vector cacheKeys = cachem->GetCacheEntryKeys(); - for (std::vector::const_iterator i = cacheKeys.begin(); - i != cacheKeys.end(); ++i) + for(cmCacheManager::CacheIterator i = cachem->NewIterator(); + !i.IsAtEnd(); i.Next()) { - cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*i); - if(t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED) + + if(i.GetType() == cmCacheManager::INTERNAL || + i.GetType() == cmCacheManager::STATIC || + i.GetType() == cmCacheManager::UNINITIALIZED) { continue; } - const char* cachedValue = cachem->GetCacheEntryValue(*i); - QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i->c_str()); - prop.Help = QString::fromLocal8Bit( - cachem->GetCacheEntryProperty(*i, "HELPSTRING")); - prop.Value = QString::fromLocal8Bit(cachedValue); - prop.Advanced = cachem->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); - if(t == cmCacheManager::BOOL) + prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); + prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING")); + prop.Value = QString::fromLocal8Bit(i.GetValue().c_str()); + prop.Advanced = i.GetPropertyAsBool("ADVANCED"); + + if(i.GetType() == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; - prop.Value = cmSystemTools::IsOn(cachedValue); + prop.Value = cmSystemTools::IsOn(i.GetValue().c_str()); } - else if(t == cmCacheManager::PATH) + else if(i.GetType() == cmCacheManager::PATH) { prop.Type = QCMakeProperty::PATH; } - else if(t == cmCacheManager::FILEPATH) + else if(i.GetType() == cmCacheManager::FILEPATH) { prop.Type = QCMakeProperty::FILEPATH; } - else if(t == cmCacheManager::STRING) + else if(i.GetType() == cmCacheManager::STRING) { prop.Type = QCMakeProperty::STRING; - const char* stringsProperty = - cachem->GetCacheEntryProperty(*i, "STRINGS"); - if (stringsProperty) + if (i.PropertyExists("STRINGS")) { - prop.Strings = QString::fromLocal8Bit(stringsProperty).split(";"); + prop.Strings = QString::fromLocal8Bit(i.GetProperty("STRINGS")).split(";"); } } @@ -406,9 +397,9 @@ QStringList QCMake::availableGenerators() const void QCMake::deleteCache() { // delete cache - this->CMakeInstance->DeleteCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->GetCacheManager()->DeleteCache(this->BinaryDirectory.toLocal8Bit().data()); // reload to make our cache empty - this->CMakeInstance->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit no generator and no properties this->setGenerator(QString()); QCMakePropertyList props = this->properties(); @@ -421,7 +412,7 @@ void QCMake::reloadCache() QCMakePropertyList props; emit this->propertiesChanged(props); // reload - this->CMakeInstance->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit new cache properties props = this->properties(); emit this->propertiesChanged(props); diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 987a7b1..691d80d 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -51,14 +51,12 @@ void CCONV cmSetError(void *info, const char *err) unsigned int CCONV cmGetCacheMajorVersion(void *arg) { cmMakefile *mf = static_cast(arg); - cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager(); - return manager->GetCacheMajorVersion(); + return mf->GetCacheMajorVersion(); } unsigned int CCONV cmGetCacheMinorVersion(void *arg) { cmMakefile *mf = static_cast(arg); - cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager(); - return manager->GetCacheMinorVersion(); + return mf->GetCacheMinorVersion(); } unsigned int CCONV cmGetMajorVersion(void *) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 1db057b..df61fe6 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2281,7 +2281,7 @@ bool cmCTest::AddVariableDefinition(const std::string &arg) std::string value; cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; - if (cmake::ParseCacheEntry(arg, name, value, type)) + if (cmCacheManager::ParseEntry(arg, name, value, type)) { this->Definitions[name] = value; return true; diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index f8f2dbd..fa7eff3 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -284,16 +284,14 @@ bool cmCacheManager::LoadCache(const std::string& path, } this->CacheMajorVersion = 0; this->CacheMinorVersion = 0; - if(const char* cmajor = - this->GetInitializedCacheValue("CMAKE_CACHE_MAJOR_VERSION")) + if(const char* cmajor = this->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION")) { unsigned int v=0; if(sscanf(cmajor, "%u", &v) == 1) { this->CacheMajorVersion = v; } - if(const char* cminor = - this->GetInitializedCacheValue("CMAKE_CACHE_MINOR_VERSION")) + if(const char* cminor = this->GetCacheValue("CMAKE_CACHE_MINOR_VERSION")) { if(sscanf(cminor, "%u", &v) == 1) { @@ -315,11 +313,10 @@ bool cmCacheManager::LoadCache(const std::string& path, } // check to make sure the cache directory has not // been moved - const char* oldDir = this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR"); - if (internal && oldDir) + if ( internal && this->GetCacheValue("CMAKE_CACHEFILE_DIR") ) { std::string currentcwd = path; - std::string oldcwd = oldDir; + std::string oldcwd = this->GetCacheValue("CMAKE_CACHEFILE_DIR"); cmSystemTools::ConvertToUnixSlashes(currentcwd); currentcwd += "/CMakeCache.txt"; oldcwd += "/CMakeCache.txt"; @@ -328,7 +325,7 @@ bool cmCacheManager::LoadCache(const std::string& path, std::string message = std::string("The current CMakeCache.txt directory ") + currentcwd + std::string(" is different than the directory ") + - std::string(this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")) + + std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) + std::string(" where CMakeCache.txt was created. This may result " "in binaries being created in the wrong place. If you " "are not sure, reedit the CMakeCache.txt"); @@ -658,8 +655,7 @@ cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator( return CacheIterator(*this, key); } -const char* -cmCacheManager::GetInitializedCacheValue(const std::string& key) const +const char* cmCacheManager::GetCacheValue(const std::string& key) const { CacheEntryMap::const_iterator i = this->Cache.find(key); if(i != this->Cache.end() && diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 2d3f6e5..f7f8776 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -137,82 +137,7 @@ public: CacheEntryType& type); ///! Get a value from the cache given a key - const char* GetInitializedCacheValue(const std::string& key) const; - - const char* GetCacheEntryValue(const std::string& key) - { - cmCacheManager::CacheIterator it = this->GetCacheIterator(key.c_str()); - if (it.IsAtEnd()) - { - return 0; - } - return it.GetValue().c_str(); - } - - const char* GetCacheEntryProperty(std::string const& key, - std::string const& propName) - { - return this->GetCacheIterator(key.c_str()).GetProperty(propName); - } - - CacheEntryType GetCacheEntryType(std::string const& key) - { - return this->GetCacheIterator(key.c_str()).GetType(); - } - - bool GetCacheEntryPropertyAsBool(std::string const& key, - std::string const& propName) - { - return this->GetCacheIterator(key.c_str()).GetPropertyAsBool(propName); - } - - void SetCacheEntryProperty(std::string const& key, - std::string const& propName, - std::string const& value) - { - this->GetCacheIterator(key.c_str()).SetProperty(propName, value.c_str()); - } - - void SetCacheEntryBoolProperty(std::string const& key, - std::string const& propName, - bool value) - { - this->GetCacheIterator(key.c_str()).SetProperty(propName, value); - } - - void SetCacheEntryValue(std::string const& key, - std::string const& value) - { - this->GetCacheIterator(key.c_str()).SetValue(value.c_str()); - } - - void RemoveCacheEntryProperty(std::string const& key, - std::string const& propName) - { - this->GetCacheIterator(key.c_str()).SetProperty(propName, (void*)0); - } - - void AppendCacheEntryProperty(std::string const& key, - std::string const& propName, - std::string const& value, - bool asString = false) - { - this->GetCacheIterator(key.c_str()).AppendProperty(propName, - value.c_str(), - asString); - } - - std::vector GetCacheEntryKeys() - { - std::vector definitions; - definitions.reserve(this->GetSize()); - cmCacheManager::CacheIterator cit = this->GetCacheIterator(); - for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) - { - definitions.push_back(cit.GetName()); - } - return definitions; - } + const char* GetCacheValue(const std::string& key) const; /** Get the version of CMake that wrote the cache. */ unsigned int GetCacheMajorVersion() const diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 99bf5f5..747b7e4 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -90,8 +90,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } if ( strcmp(key, "CACHE") == 0 ) { - if(const char* c = this->Makefile->GetCacheManager() - ->GetInitializedCacheValue(var)) + if(const char* c = this->Makefile->GetCacheManager()->GetCacheValue(var)) { if(this->EscapeQuotes) { diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 0d32e4b..d64b0d7 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -205,7 +205,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_"; cacheEntryName += envVar; - const char* cacheValue = mf->GetCacheManager()->GetInitializedCacheValue( + const char* cacheValue = mf->GetCacheManager()->GetCacheValue( cacheEntryName); // now we have both, decide which one to use @@ -223,7 +223,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), cacheEntryName.c_str(), cmCacheManager::STRING, true); - mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); + mf->GetCacheManager()->SaveCache(mf->GetHomeOutputDirectory()); } else if (envVarValue==0 && cacheValue!=0) { @@ -244,7 +244,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), cacheEntryName.c_str(), cmCacheManager::STRING, true); - mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); + mf->GetCacheManager()->SaveCache(mf->GetHomeOutputDirectory()); } } diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index cc08052..f63df61 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -366,18 +366,18 @@ bool cmFindBase::CheckForVariableInCache() if(const char* cacheValue = this->Makefile->GetDefinition(this->VariableName)) { - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName); + cmCacheManager::CacheIterator it = + this->Makefile->GetCacheManager()-> + GetCacheIterator(this->VariableName.c_str()); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); - bool cached = cacheEntry ? true : false; + bool cached = !it.IsAtEnd(); if(found) { // If the user specifies the entry on the command line without a // type we should add the type and docstring but keep the // original value. Tell the subclass implementations to do // this. - if(cached && manager->GetCacheEntryType(this->VariableName) - == cmCacheManager::UNINITIALIZED) + if(cached && it.GetType() == cmCacheManager::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; } @@ -385,8 +385,7 @@ bool cmFindBase::CheckForVariableInCache() } else if(cached) { - const char* hs = manager->GetCacheEntryProperty(this->VariableName, - "HELPSTRING"); + const char* hs = it.GetProperty("HELPSTRING"); this->VariableDocumentation = hs?hs:"(none)"; } } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 0e6e0c2..f0b2686 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -391,10 +391,11 @@ bool cmGetPropertyCommand::HandleCacheMode() } const char* value = 0; - if(this->Makefile->GetCacheManager()->GetCacheEntryValue(this->Name)) + cmCacheManager::CacheIterator it = + this->Makefile->GetCacheManager()->GetCacheIterator(this->Name.c_str()); + if(!it.IsAtEnd()) { - value = this->Makefile->GetCacheManager() - ->GetCacheEntryProperty(this->Name, this->PropertyName); + value = it.GetProperty(this->PropertyName); } this->StoreResult(value); return true; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 35394b8..3c0a0e2 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -179,7 +179,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, return; } const char* cname = this->GetCMakeInstance()-> - GetCacheManager()->GetInitializedCacheValue(langComp); + GetCacheManager()->GetCacheValue(langComp); std::string changeVars; if(cname && !optional) { @@ -1559,7 +1559,9 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(lib->first.c_str())) { std::string varName = lib->first.substr(0, lib->first.size()-9); - if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + cmCacheManager::CacheIterator it = + manager->GetCacheIterator(varName.c_str()); + if(it.GetPropertyAsBool("ADVANCED")) { varName += " (ADVANCED)"; } @@ -1590,7 +1592,9 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(incDir->c_str())) { std::string varName = incDir->substr(0, incDir->size()-9); - if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + cmCacheManager::CacheIterator it = + manager->GetCacheIterator(varName.c_str()); + if(it.GetPropertyAsBool("ADVANCED")) { varName += " (ADVANCED)"; } @@ -1637,7 +1641,7 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir, // and there is a good chance that the try compile stuff will // take the bulk of the time, so try and guess some progress // by getting closer and closer to 100 without actually getting there. - if (!this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue + if (!this->CMakeInstance->GetCacheManager()->GetCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS")) { // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set @@ -1835,7 +1839,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) // update progress // estimate how many lg there will be const char *numGenC = - this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue + this->CMakeInstance->GetCacheManager()->GetCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"); if (!numGenC) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0561a05..5e584a4 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3703,7 +3703,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root, // Since this call may have created new cache entries, save the cache: // - root->GetMakefile()->GetCMakeInstance()->SaveCache( + root->GetMakefile()->GetCacheManager()->SaveCache( root->GetMakefile()->GetHomeOutputDirectory()); } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index e2ae901..93aec32 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -81,8 +81,8 @@ bool cmLoadCacheCommand { break; } - this->Makefile->GetCMakeInstance()->LoadCache(args[i], false, - excludes, includes); + this->Makefile->GetCacheManager()->LoadCache(args[i], false, + excludes, includes); } @@ -173,7 +173,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) std::string var; std::string value; cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; - if(cmake::ParseCacheEntry(line, var, value, type)) + if(cmCacheManager::ParseEntry(line, var, value, type)) { // Found a real entry. See if this one was requested. if(this->VariablesToRead.find(var) != this->VariablesToRead.end()) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 34b4621..215ee16 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -174,6 +174,16 @@ void cmMakefile::Initialize() this->CheckCMP0000 = false; } +unsigned int cmMakefile::GetCacheMajorVersion() const +{ + return this->GetCacheManager()->GetCacheMajorVersion(); +} + +unsigned int cmMakefile::GetCacheMinorVersion() const +{ + return this->GetCacheManager()->GetCacheMinorVersion(); +} + cmMakefile::~cmMakefile() { cmDeleteAll(this->InstallGenerators); @@ -1810,17 +1820,16 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, { bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; - const char* existingValue = - this->GetCacheManager()->GetInitializedCacheValue(name); - if(existingValue - && (this->GetCacheManager()->GetCacheEntryType(name) - == cmCacheManager::UNINITIALIZED)) + cmCacheManager::CacheIterator it = + this->GetCacheManager()->GetCacheIterator(name.c_str()); + if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED) && + it.Initialized()) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in if(!force) { - val = existingValue; + val = it.GetValue(); haveVal = true; } if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) @@ -1843,13 +1852,13 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, } this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = this->GetCacheManager()->GetInitializedCacheValue(name); + val = it.GetValue(); haveVal = true; } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, - doc, type); + this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, doc, + type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -2433,7 +2442,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const this->Internal->VarUsageStack.top().insert(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetCacheManager()->GetCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE if(cmVariableWatch* vv = this->GetVariableWatch()) @@ -2458,7 +2467,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const const char* def = this->Internal->VarStack.top().Get(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetCacheManager()->GetCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); @@ -2492,18 +2501,20 @@ const char* cmMakefile::GetSafeDefinition(const std::string& def) const std::vector cmMakefile ::GetDefinitions(int cacheonly /* = 0 */) const { - std::vector res; + std::set definitions; if ( !cacheonly ) { - std::set definitions = - this->Internal->VarStack.top().ClosureKeys(); - res.insert(res.end(), definitions.begin(), definitions.end()); + definitions = this->Internal->VarStack.top().ClosureKeys(); + } + cmCacheManager::CacheIterator cit = + this->GetCacheManager()->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + definitions.insert(cit.GetName()); } - std::vector cacheKeys = - this->GetCacheManager()->GetCacheEntryKeys(); - res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); - std::sort(res.begin(), res.end()); + std::vector res; + res.insert(res.end(), definitions.begin(), definitions.end()); return res; } @@ -2834,8 +2845,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( value = cmSystemTools::GetEnv(lookup.c_str()); break; case CACHE: - value = this->GetCacheManager() - ->GetInitializedCacheValue(lookup); + value = this->GetCacheManager()->GetCacheValue(lookup); break; } // Get the string we're meant to append to. @@ -4903,7 +4913,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, (status == cmPolicies::WARN || status == cmPolicies::OLD)) { if(!(this->GetCacheManager() - ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) + ->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) { // Set it to 2.4 because that is the last version where the // variable had meaning. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5209891..920b6b7 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -62,6 +62,14 @@ class cmMakefile class Internals; cmsys::auto_ptr Internal; public: + /** + * Return the major and minor version of the cmake that + * was used to write the currently loaded cache, note + * this method will not work before the cache is loaded. + */ + unsigned int GetCacheMajorVersion() const; + unsigned int GetCacheMinorVersion() const; + /* Check for unused variables in this scope */ void CheckForUnusedVariables() const; /* Mark a variable as used */ diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index cc094b1..f6a2c26 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -37,19 +37,24 @@ bool cmMarkAsAdvancedCommand { std::string variable = args[i]; cmCacheManager* manager = this->Makefile->GetCacheManager(); - if (!manager->GetCacheEntryValue(variable)) + cmCacheManager::CacheIterator it = + manager->GetCacheIterator(variable.c_str()); + if ( it.IsAtEnd() ) { - manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); + this->Makefile->GetCacheManager() + ->AddCacheEntry(variable, 0, 0, + cmCacheManager::UNINITIALIZED); overwrite = true; } - if (!manager->GetCacheEntryValue(variable)) + it.Find(variable); + if ( it.IsAtEnd() ) { cmSystemTools::Error("This should never happen..."); return false; } - if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) + if ( !it.PropertyExists("ADVANCED") || overwrite ) { - manager->SetCacheEntryProperty(variable, "ADVANCED", value); + it.SetProperty("ADVANCED", value); } } return true; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index baf5b1e..60728ea 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,16 +42,16 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(args[0]); - if(existingValue) + cmCacheManager::CacheIterator it = + this->Makefile->GetCacheManager()->GetCacheIterator(args[0].c_str()); + if(!it.IsAtEnd()) { - if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) + if ( it.GetType() != cmCacheManager::UNINITIALIZED ) { - manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); + it.SetProperty("HELPSTRING", args[1].c_str()); return true; } - initialValue = existingValue; + initialValue = it.GetValue(); } if(args.size() == 3) { diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index e17474b..204d95b 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -136,10 +136,9 @@ bool cmSetCommand } // see if this is already in the cache - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(variable); - if(existingValue && - (manager->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) + cmCacheManager::CacheIterator it = + this->Makefile->GetCacheManager()->GetCacheIterator(variable); + if(!it.IsAtEnd() && (it.GetType() != cmCacheManager::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 77f9fb9..1150bc7 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -452,11 +452,11 @@ bool cmSetPropertyCommand::HandleCacheMode() // Get the source file. cmMakefile* mf = this->GetMakefile(); cmake* cm = mf->GetCMakeInstance(); - const char* existingValue - = cm->GetCacheManager()->GetCacheEntryValue(*ni); - if(existingValue) + cmCacheManager::CacheIterator it = + cm->GetCacheManager()->GetCacheIterator(ni->c_str()); + if(!it.IsAtEnd()) { - if(!this->HandleCacheEntry(*ni)) + if(!this->HandleCacheEntry(it)) { return false; } @@ -474,25 +474,22 @@ bool cmSetPropertyCommand::HandleCacheMode() } //---------------------------------------------------------------------------- -bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey) +bool cmSetPropertyCommand::HandleCacheEntry(cmCacheManager::CacheIterator& it) { // Set or append the property. const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); - cmCacheManager* manager = this->Makefile->GetCacheManager(); if (this->Remove) { - manager->RemoveCacheEntryProperty(cacheKey, name); - return true; + value = 0; } if(this->AppendMode) { - manager->AppendCacheEntryProperty(cacheKey, name, value, - this->AppendAsString); + it.AppendProperty(name, value, this->AppendAsString); } else { - manager->SetCacheEntryProperty(cacheKey, name, value); + it.SetProperty(name, value); } return true; diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h index 3285e60..b06cb68 100644 --- a/Source/cmSetPropertyCommand.h +++ b/Source/cmSetPropertyCommand.h @@ -61,7 +61,7 @@ private: bool HandleTestMode(); bool HandleTest(cmTest* test); bool HandleCacheMode(); - bool HandleCacheEntry(std::string const&); + bool HandleCacheEntry(cmCacheManager::CacheIterator&); bool HandleInstallMode(); bool HandleInstall(cmInstalledFile* file); }; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 911ade8..b5280cf 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -264,12 +264,11 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment.c_str(), cmCacheManager::STRING); - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue - = manager->GetCacheEntryValue(this->RunResultVariable); - if (existingValue) + cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()-> + GetCacheIterator(this->RunResultVariable.c_str()); + if ( !it.IsAtEnd() ) { - manager->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); + it.SetProperty("ADVANCED", "1"); } error = true; @@ -291,13 +290,11 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmCacheManager::STRING); - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existing = - manager->GetCacheEntryValue(internalRunOutputName); - if (existing) + cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()-> + GetCacheIterator(internalRunOutputName.c_str()); + if ( !it.IsAtEnd() ) { - manager->SetCacheEntryProperty(internalRunOutputName, - "ADVANCED", "1"); + it.SetProperty("ADVANCED", "1"); } error = true; diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 2799a9b..ee1ff29 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -52,13 +52,11 @@ bool cmUtilitySourceCommand } else { - cmCacheManager *manager = - this->Makefile->GetCMakeInstance()->GetCacheManager(); haveCacheValue = (cacheValue && (strstr(cacheValue, "(IntDir)") == 0 || (intDir && strcmp(intDir, "$(IntDir)") == 0)) && - (manager->GetCacheMajorVersion() != 0 && - manager->GetCacheMinorVersion() != 0 )); + (this->Makefile->GetCacheMajorVersion() != 0 && + this->Makefile->GetCacheMinorVersion() != 0 )); } if(haveCacheValue) diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index dd2a682..80c1286 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -41,9 +41,9 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - cmCacheManager* manager = this->Makefile->GetCacheManager(); - if(manager->GetCacheEntryValue(args[i]) && - manager->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) + cmCacheManager::CacheIterator it = + this->Makefile->GetCacheManager()->GetCacheIterator(args[i].c_str()); + if(!it.IsAtEnd() && it.GetPropertyAsBool("ADVANCED")) { hasAdvanced = true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 64b332c..5c52a1a 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -344,8 +344,7 @@ bool cmake::SetCacheArgs(const std::vector& args) std::string cachedValue; if(this->WarnUnusedCli) { - if(const char *v = this->CacheManager - ->GetInitializedCacheValue(var)) + if(const char *v = this->CacheManager->GetCacheValue(var)) { haveValue = true; cachedValue = v; @@ -358,8 +357,7 @@ bool cmake::SetCacheArgs(const std::vector& args) if(this->WarnUnusedCli) { if (!haveValue || - cachedValue != this->CacheManager - ->GetInitializedCacheValue(var)) + cachedValue != this->CacheManager->GetCacheValue(var)) { this->WatchUnusedCli(var); } @@ -403,18 +401,17 @@ bool cmake::SetCacheArgs(const std::vector& args) cmsys::Glob::PatternToRegex(entryPattern, true, true).c_str()); //go through all cache entries and collect the vars which will be removed std::vector entriesToDelete; - std::vector cacheKeys = - this->CacheManager->GetCacheEntryKeys(); - for (std::vector::const_iterator it = cacheKeys.begin(); - it != cacheKeys.end(); ++it) + cmCacheManager::CacheIterator it = + this->CacheManager->GetCacheIterator(); + for ( it.Begin(); !it.IsAtEnd(); it.Next() ) { - cmCacheManager::CacheEntryType t = - this->CacheManager->GetCacheEntryType(*it); + cmCacheManager::CacheEntryType t = it.GetType(); if(t != cmCacheManager::STATIC) { - if (regex.find(it->c_str())) + std::string entryName = it.GetName(); + if (regex.find(entryName.c_str())) { - entriesToDelete.push_back(*it); + entriesToDelete.push_back(entryName); } } } @@ -918,18 +915,16 @@ void cmake::SetDirectoriesFromFile(const char* arg) // If there is a CMakeCache.txt file, use its settings. if(!cachePath.empty()) { - if(this->LoadCache(cachePath)) + cmCacheManager* cachem = this->GetCacheManager(); + cmCacheManager::CacheIterator it = cachem->NewIterator(); + if(cachem->LoadCache(cachePath) && + it.Find("CMAKE_HOME_DIRECTORY")) { - const char* existingValue = - this->CacheManager->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); - if (existingValue) - { - this->SetHomeOutputDirectory(cachePath); - this->SetStartOutputDirectory(cachePath); - this->SetHomeDirectory(existingValue); - this->SetStartDirectory(existingValue); - return; - } + this->SetHomeOutputDirectory(cachePath); + this->SetStartOutputDirectory(cachePath); + this->SetHomeDirectory(it.GetValue()); + this->SetStartDirectory(it.GetValue()); + return; } } @@ -1208,10 +1203,10 @@ int cmake::DoPreConfigureChecks() } // do a sanity check on some values - if(this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY")) + if(this->CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY")) { std::string cacheStart = - this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"); + this->CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY"); cacheStart += "/CMakeLists.txt"; std::string currentStart = this->GetHomeDirectory(); currentStart += "/CMakeLists.txt"; @@ -1360,9 +1355,9 @@ int cmake::ActualConfigure() if(!this->GlobalGenerator) { const char* genName = - this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR"); + this->CacheManager->GetCacheValue("CMAKE_GENERATOR"); const char* extraGenName = - this->CacheManager->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); + this->CacheManager->GetCacheValue("CMAKE_EXTRA_GENERATOR"); if(genName) { std::string fullName = cmExternalMakefileProjectGenerator:: @@ -1440,8 +1435,7 @@ int cmake::ActualConfigure() } } - const char* genName = this->CacheManager - ->GetInitializedCacheValue("CMAKE_GENERATOR"); + const char* genName = this->CacheManager->GetCacheValue("CMAKE_GENERATOR"); if(genName) { if(!this->GlobalGenerator->MatchesGeneratorName(genName)) @@ -1457,7 +1451,7 @@ int cmake::ActualConfigure() return -2; } } - if(!this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR")) + if(!this->CacheManager->GetCacheValue("CMAKE_GENERATOR")) { this->CacheManager->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName().c_str(), @@ -1470,7 +1464,7 @@ int cmake::ActualConfigure() } if(const char* platformName = - this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM")) + this->CacheManager->GetCacheValue("CMAKE_GENERATOR_PLATFORM")) { if(this->GeneratorPlatform.empty()) { @@ -1498,7 +1492,7 @@ int cmake::ActualConfigure() } if(const char* tsName = - this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET")) + this->CacheManager->GetCacheValue("CMAKE_GENERATOR_TOOLSET")) { if(this->GeneratorToolset.empty()) { @@ -1552,18 +1546,16 @@ int cmake::ActualConfigure() // project requires compatibility with CMake 2.4. We detect this // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY // variable created when CMP0001 is not set to NEW. - if(this->GetCacheManager() - ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) + if(this->GetCacheManager()->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { - if(!this->CacheManager->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) + if(!this->CacheManager->GetCacheValue("LIBRARY_OUTPUT_PATH")) { this->CacheManager->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", cmCacheManager::PATH); } - if(!this->CacheManager - ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) + if(!this->CacheManager->GetCacheValue("EXECUTABLE_OUTPUT_PATH")) { this->CacheManager->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", @@ -1571,25 +1563,24 @@ int cmake::ActualConfigure() cmCacheManager::PATH); } } - if(!this->CacheManager - ->GetInitializedCacheValue("CMAKE_USE_RELATIVE_PATHS")) + if(!this->CacheManager->GetCacheValue("CMAKE_USE_RELATIVE_PATHS")) { this->CacheManager->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", cmCacheManager::BOOL); - if (!this->CacheManager->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED")) + cmCacheManager::CacheIterator it = + this->CacheManager->GetCacheIterator("CMAKE_USE_RELATIVE_PATHS"); + if ( !it.PropertyExists("ADVANCED") ) { - this->CacheManager->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED", "1"); + it.SetProperty("ADVANCED", "1"); } } if(cmSystemTools::GetFatalErrorOccured() && - (!this->CacheManager->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM") || + (!this->CacheManager->GetCacheValue("CMAKE_MAKE_PROGRAM") || cmSystemTools::IsOff(this->CacheManager-> - GetInitializedCacheValue("CMAKE_MAKE_PROGRAM")))) + GetCacheValue("CMAKE_MAKE_PROGRAM")))) { // We must have a bad generator selection. Wipe the cache entry so the // user can select another. @@ -1805,7 +1796,7 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, const char* cmake::GetCacheDefinition(const std::string& name) const { - return this->CacheManager->GetInitializedCacheValue(name); + return this->CacheManager->GetCacheValue(name); } void cmake::AddDefaultCommands() @@ -1869,18 +1860,10 @@ void cmake::AddDefaultGenerators() #endif } -bool cmake::ParseCacheEntry(const std::string& entry, - std::string& var, - std::string& value, - cmCacheManager::CacheEntryType& type) -{ - return cmCacheManager::ParseEntry(entry, var, value, type); -} - int cmake::LoadCache() { // could we not read the cache - if (!this->LoadCache(this->GetHomeOutputDirectory())) + if (!this->CacheManager->LoadCache(this->GetHomeOutputDirectory())) { // if it does exist, but isn't readable then warn the user std::string cacheFile = this->GetHomeOutputDirectory(); @@ -1903,28 +1886,6 @@ int cmake::LoadCache() return 0; } -bool cmake::LoadCache(const std::string& path) -{ - return this->CacheManager->LoadCache(path); -} - -bool cmake::LoadCache(const std::string& path, bool internal, - std::set& excludes, - std::set& includes) -{ - return this->CacheManager->LoadCache(path, internal, excludes, includes); -} - -bool cmake::SaveCache(const std::string& path) -{ - return this->CacheManager->SaveCache(path); -} - -bool cmake::DeleteCache(const std::string& path) -{ - return this->CacheManager->DeleteCache(path); -} - void cmake::SetProgressCallback(ProgressCallbackType f, void *cd) { this->ProgressCallback = f; @@ -1965,8 +1926,7 @@ void cmake::UpdateConversionPathTable() { // Update the path conversion table with any specified file: const char* tablepath = - this->CacheManager - ->GetInitializedCacheValue("CMAKE_PATH_TRANSLATION_FILE"); + this->CacheManager->GetCacheValue("CMAKE_PATH_TRANSLATION_FILE"); if(tablepath) { @@ -2200,7 +2160,7 @@ void cmake::TruncateOutputLog(const char* fname) { return; } - if ( !this->CacheManager->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR") ) + if ( !this->CacheManager->GetCacheValue("CMAKE_CACHEFILE_DIR") ) { cmSystemTools::RemoveFile(fullPath); return; @@ -2317,9 +2277,17 @@ const char *cmake::GetProperty(const std::string& prop, std::string output = ""; if ( prop == "CACHE_VARIABLES" ) { - std::vector cacheKeys = - this->CacheManager->GetCacheEntryKeys(); - this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); + cmCacheManager::CacheIterator cit = + this->GetCacheManager()->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + if (!output.empty()) + { + output += ";"; + } + output += cit.GetName(); + } + this->SetProperty("CACHE_VARIABLES", output.c_str()); } else if ( prop == "COMMANDS" ) { @@ -2471,7 +2439,7 @@ int cmake::GetSystemInformation(std::vector& args) // we have to find the module directory, so we can copy the files this->AddCMakePaths(); std::string modulesPath = - this->CacheManager->GetInitializedCacheValue("CMAKE_ROOT"); + this->CacheManager->GetCacheValue("CMAKE_ROOT"); modulesPath += "/Modules"; std::string inFile = modulesPath; inFile += "/SystemInformation.cmake"; @@ -2681,9 +2649,9 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, if(t == cmake::AUTHOR_WARNING) { // Allow suppression of these warnings. - const char* suppress = this->CacheManager->GetCacheEntryValue( - "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); - if(suppress && cmSystemTools::IsOn(suppress)) + cmCacheManager::CacheIterator it = this->CacheManager + ->GetCacheIterator("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); + if(!it.IsAtEnd() && it.GetValueAsBool()) { return; } @@ -2796,42 +2764,38 @@ int cmake::Build(const std::string& dir, } std::string cachePath = dir; cmSystemTools::ConvertToUnixSlashes(cachePath); - if(!this->LoadCache(cachePath)) + cmCacheManager* cachem = this->GetCacheManager(); + cmCacheManager::CacheIterator it = cachem->NewIterator(); + if(!cachem->LoadCache(cachePath)) { std::cerr << "Error: could not load cache\n"; return 1; } - const char* cachedGenerator = - this->CacheManager->GetCacheEntryValue("CMAKE_GENERATOR"); - if(!cachedGenerator) + if(!it.Find("CMAKE_GENERATOR")) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; return 1; } cmsys::auto_ptr gen( - this->CreateGlobalGenerator(cachedGenerator)); + this->CreateGlobalGenerator(it.GetValue())); if(!gen.get()) { std::cerr << "Error: could create CMAKE_GENERATOR \"" - << cachedGenerator << "\"\n"; + << it.GetValue() << "\"\n"; return 1; } std::string output; std::string projName; - const char* cachedProjectName = - this->CacheManager->GetCacheEntryValue("CMAKE_PROJECT_NAME"); - if(!cachedProjectName) + if(!it.Find("CMAKE_PROJECT_NAME")) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; return 1; } - projName = cachedProjectName; + projName = it.GetValue(); bool verbose = false; - const char* cachedVerbose = - this->CacheManager->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); - if(cachedVerbose) + if(it.Find("CMAKE_VERBOSE_MAKEFILE")) { - verbose = cmSystemTools::IsOn(cachedVerbose); + verbose = it.GetValueAsBool(); } return gen->Build("", dir, projName, target, diff --git a/Source/cmake.h b/Source/cmake.h index 3acf4a8..c22b329 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -18,11 +18,11 @@ #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" #include "cmInstalledFile.h" -#include "cmCacheManager.h" class cmGlobalGeneratorFactory; class cmGlobalGenerator; class cmLocalGenerator; +class cmCacheManager; class cmMakefile; class cmCommand; class cmVariableWatch; @@ -173,19 +173,7 @@ class cmake int Configure(); int ActualConfigure(); - ///! Break up a line like VAR:type="value" into var, type and value - static bool ParseCacheEntry(const std::string& entry, - std::string& var, - std::string& value, - cmCacheManager::CacheEntryType& type); - int LoadCache(); - bool LoadCache(const std::string& path); - bool LoadCache(const std::string& path, bool internal, - std::set& excludes, - std::set& includes); - bool SaveCache(const std::string& path); - bool DeleteCache(const std::string& path); void PreLoadCMakeFiles(); ///! Create a GlobalGenerator diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 3b518be..ac73ad0 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -328,31 +328,25 @@ int do_cmake(int ac, char const* const* av) int res = cm.Run(args, view_only); if ( list_cached || list_all_cached ) { + cmCacheManager::CacheIterator it = + cm.GetCacheManager()->GetCacheIterator(); std::cout << "-- Cache values" << std::endl; - std::vector keys = - cm.GetCacheManager()->GetCacheEntryKeys(); - for (std::vector::const_iterator it = keys.begin(); - it != keys.end(); ++it) + for ( it.Begin(); !it.IsAtEnd(); it.Next() ) { - cmCacheManager::CacheEntryType t = - cm.GetCacheManager()->GetCacheEntryType(*it); + cmCacheManager::CacheEntryType t = it.GetType(); if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && t != cmCacheManager::UNINITIALIZED ) { - const char* advancedProp = - cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED"); - if ( list_all_cached || !advancedProp) + bool advanced = it.PropertyExists("ADVANCED"); + if ( list_all_cached || !advanced) { if ( list_help ) { - std::cout << "// " - << cm.GetCacheManager()->GetCacheEntryProperty(*it, - "HELPSTRING") << std::endl; + std::cout << "// " << it.GetProperty("HELPSTRING") << std::endl; } - std::cout << *it << ":" << - cmCacheManager::TypeToString(t) - << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it) - << std::endl; + std::cout << it.GetName() << ":" << + cmCacheManager::TypeToString(it.GetType()) + << "=" << it.GetValue() << std::endl; if ( list_help ) { std::cout << std::endl; ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestBuildAndTestHandler.cxx | 3 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 35 ++--- Source/CursesDialog/cmCursesCacheEntryComposite.h | 2 +- Source/CursesDialog/cmCursesMainForm.cxx | 151 +++++++----------- Source/QtDialog/QCMake.cxx | 85 +++++----- Source/cmCPluginAPI.cxx | 6 +- Source/cmCTest.cxx | 2 +- Source/cmCacheManager.cxx | 16 +- Source/cmCacheManager.h | 77 +-------- Source/cmCommandArgumentParserHelper.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 6 +- Source/cmFindBase.cxx | 13 +- Source/cmGetPropertyCommand.cxx | 7 +- Source/cmGlobalGenerator.cxx | 14 +- Source/cmGlobalXCodeGenerator.cxx | 2 +- Source/cmLoadCacheCommand.cxx | 6 +- Source/cmMakefile.cxx | 54 ++++--- Source/cmMakefile.h | 8 + Source/cmMarkAsAdvancedCommand.cxx | 15 +- Source/cmOptionCommand.cxx | 12 +- Source/cmSetCommand.cxx | 7 +- Source/cmSetPropertyCommand.cxx | 19 +-- Source/cmSetPropertyCommand.h | 2 +- Source/cmTryRunCommand.cxx | 19 +-- Source/cmUtilitySourceCommand.cxx | 6 +- Source/cmVariableRequiresCommand.cxx | 6 +- Source/cmake.cxx | 166 ++++++++------------ Source/cmake.h | 14 +- Source/cmakemain.cxx | 26 ++- 29 files changed, 311 insertions(+), 471 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 17:15:54 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 17:15:54 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-665-gd382326 Message-ID: <20150407211554.24FE8AE075@public.kitware.com> This is an automated email from 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 d3823263b2665e5b89668212bc498af3220ac992 (commit) via 3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94 (commit) from 678493d60ff0e8c8e59caf9fa57b6f1e5e7e61b2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3823263b2665e5b89668212bc498af3220ac992 commit d3823263b2665e5b89668212bc498af3220ac992 Merge: 678493d 3347c5e Author: Brad King AuthorDate: Tue Apr 7 17:15:52 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 17:15:52 2015 -0400 Merge topic 'refactor-cache-api' 3347c5e4 Revert topic 'refactor-cache-api' ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestBuildAndTestHandler.cxx | 3 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 35 ++--- Source/CursesDialog/cmCursesCacheEntryComposite.h | 2 +- Source/CursesDialog/cmCursesMainForm.cxx | 151 +++++++----------- Source/QtDialog/QCMake.cxx | 85 +++++----- Source/cmCPluginAPI.cxx | 6 +- Source/cmCTest.cxx | 2 +- Source/cmCacheManager.cxx | 16 +- Source/cmCacheManager.h | 77 +-------- Source/cmCommandArgumentParserHelper.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 6 +- Source/cmFindBase.cxx | 13 +- Source/cmGetPropertyCommand.cxx | 7 +- Source/cmGlobalGenerator.cxx | 14 +- Source/cmGlobalXCodeGenerator.cxx | 2 +- Source/cmLoadCacheCommand.cxx | 6 +- Source/cmMakefile.cxx | 54 ++++--- Source/cmMakefile.h | 8 + Source/cmMarkAsAdvancedCommand.cxx | 15 +- Source/cmOptionCommand.cxx | 12 +- Source/cmSetCommand.cxx | 7 +- Source/cmSetPropertyCommand.cxx | 19 +-- Source/cmSetPropertyCommand.h | 2 +- Source/cmTryRunCommand.cxx | 19 +-- Source/cmUtilitySourceCommand.cxx | 6 +- Source/cmVariableRequiresCommand.cxx | 6 +- Source/cmake.cxx | 166 ++++++++------------ Source/cmake.h | 14 +- Source/cmakemain.cxx | 26 ++- 29 files changed, 311 insertions(+), 471 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 7 17:16:09 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 7 Apr 2015 17:16:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1589-gc87272d Message-ID: <20150407211609.2CF9EAE07E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c87272d17c88eef8b337e7ac7e73cc04449d4f89 (commit) via d3823263b2665e5b89668212bc498af3220ac992 (commit) from 92e7b42c7f9b5cb99d039207c06b372b7a33cd9a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c87272d17c88eef8b337e7ac7e73cc04449d4f89 commit c87272d17c88eef8b337e7ac7e73cc04449d4f89 Merge: 92e7b42 d382326 Author: Brad King AuthorDate: Tue Apr 7 17:16:01 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 17:16:01 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From nilsgladitz at gmail.com Tue Apr 7 18:52:56 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 7 Apr 2015 18:52:56 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1592-g8a4b330 Message-ID: <20150407225256.D8CDAACEA0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8a4b330c63f28ce0e94aff4bc131a5a293fdb64c (commit) via 26a9be9f3ce972692018ae21f6b6a93d97802aff (commit) via 54c0ba6f5f2f9e824c37232fcf466ac4d3958bd5 (commit) from c87272d17c88eef8b337e7ac7e73cc04449d4f89 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a4b330c63f28ce0e94aff4bc131a5a293fdb64c commit 8a4b330c63f28ce0e94aff4bc131a5a293fdb64c Merge: c87272d 26a9be9 Author: Nils Gladitz AuthorDate: Tue Apr 7 18:52:53 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 18:52:53 2015 -0400 Merge topic 'tar-write-format' into next 26a9be9f Tests: Consolidate, refactor and extend -E tar tests 54c0ba6f cmake: Disallow -E tar compression flags with 7zip/zip http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26a9be9f3ce972692018ae21f6b6a93d97802aff commit 26a9be9f3ce972692018ae21f6b6a93d97802aff Author: Nils Gladitz AuthorDate: Tue Apr 7 19:40:33 2015 +0200 Commit: Nils Gladitz CommitDate: Wed Apr 8 00:52:01 2015 +0200 Tests: Consolidate, refactor and extend -E tar tests diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index f80191b..aa6a993 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -218,7 +218,6 @@ if(BUILD_TESTING) ADD_TEST_MACRO(FindModulesExecuteAll FindModulesExecuteAll) ADD_TEST_MACRO(StringFileTest StringFileTest) ADD_TEST_MACRO(TryCompile TryCompile) - ADD_TEST_MACRO(TarTest TarTest) ADD_TEST_MACRO(SystemInformation SystemInformation) ADD_TEST_MACRO(MathTest MathTest) ADD_TEST_MACRO(CompileFeatures CompileFeatures) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 60a8a82..891edf1 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -199,6 +199,7 @@ add_RunCMake_test(target_link_libraries) add_RunCMake_test(target_compile_features) add_RunCMake_test(CheckModules) add_RunCMake_test(CommandLine) +add_RunCMake_test(CommandLineTar) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index e3942a8..f879ee6 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,17 +1,5 @@ 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") -run_cmake_command(E_tar-bad-format ${CMAKE_COMMAND} -E tar cvf bad.tar "--format=bad-format") - run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) run_cmake_command(build-no-generator diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/7zip-gz-result.txt similarity index 100% copy from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt copy to Tests/RunCMake/CommandLineTar/7zip-gz-result.txt diff --git a/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt b/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt new file mode 100644 index 0000000..2fad326 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt @@ -0,0 +1 @@ +CMake Error: Can not use compression flags with format: 7zip diff --git a/Tests/RunCMake/CommandLineTar/7zip.cmake b/Tests/RunCMake/CommandLineTar/7zip.cmake new file mode 100644 index 0000000..4bc6548 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/7zip.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.7z") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=7zip) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("377abcaf271c" LIMIT 6 HEX) diff --git a/Tests/RunCMake/CommandLineTar/CMakeLists.txt b/Tests/RunCMake/CommandLineTar/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake new file mode 100644 index 0000000..12635db --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake @@ -0,0 +1,28 @@ +include(RunCMake) + +function(external_command_test NAME) + run_cmake_command(${NAME} ${CMAKE_COMMAND} -E ${ARGN}) +endfunction() + +external_command_test(bad-opt1 tar cvf bad.tar --bad) +external_command_test(bad-mtime1 tar cvf bad.tar --mtime=bad .) +external_command_test(bad-from1 tar cvf bad.tar --files-from=bad) +external_command_test(bad-from2 tar cvf bad.tar --files-from=.) +external_command_test(bad-from3 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from3.txt) +external_command_test(bad-from4 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from4.txt) +external_command_test(bad-from5 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from5.txt) +external_command_test(end-opt1 tar cvf bad.tar -- --bad) +external_command_test(end-opt2 tar cvf bad.tar --) +external_command_test(mtime tar cvf bad.tar "--mtime=1970-01-01 00:00:00 UTC") +external_command_test(bad-format tar cvf bad.tar "--format=bad-format") +external_command_test(zip-bz2 tar cvjf bad.tar "--format=zip") +external_command_test(7zip-gz tar cvzf bad.tar "--format=7zip") + +run_cmake(7zip) +run_cmake(gnutar) +run_cmake(gnutar-gz) +run_cmake(pax) +run_cmake(pax-xz) +run_cmake(paxr) +run_cmake(paxr-bz2) +run_cmake(zip) diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt b/Tests/RunCMake/CommandLineTar/bad-format-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-format-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-format-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-format-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt b/Tests/RunCMake/CommandLineTar/bad-from1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt b/Tests/RunCMake/CommandLineTar/bad-from2-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from2-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from2-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from2-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt b/Tests/RunCMake/CommandLineTar/bad-from3-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from3-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt similarity index 67% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt index 147bd80..da32ad9 100644 --- a/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt +++ b/Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt @@ -1,2 +1,2 @@ -^CMake Error: -E tar --files-from='.*/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt' file invalid line: +^CMake Error: -E tar --files-from='.*/Tests/RunCMake/CommandLineTar/bad-from3.txt' file invalid line: -add-file=option-typo$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt b/Tests/RunCMake/CommandLineTar/bad-from3.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3.txt rename to Tests/RunCMake/CommandLineTar/bad-from3.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt b/Tests/RunCMake/CommandLineTar/bad-from4-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from4-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4.txt b/Tests/RunCMake/CommandLineTar/bad-from4.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4.txt rename to Tests/RunCMake/CommandLineTar/bad-from4.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt b/Tests/RunCMake/CommandLineTar/bad-from5-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from5-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5.txt b/Tests/RunCMake/CommandLineTar/bad-from5.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5.txt rename to Tests/RunCMake/CommandLineTar/bad-from5.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt b/Tests/RunCMake/CommandLineTar/bad-mtime1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-mtime1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-mtime1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-mtime1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt b/Tests/RunCMake/CommandLineTar/bad-opt1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-opt1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-opt1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-opt1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/end-opt1-result.txt similarity index 100% copy from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt copy to Tests/RunCMake/CommandLineTar/end-opt1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt b/Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt rename to Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt diff --git a/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake b/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake new file mode 100644 index 0000000..5f2674a --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.gz") + +set(COMPRESSION_FLAGS cvzf) +set(COMPRESSION_OPTIONS --format=gnutar) + +set(DECOMPRESSION_FLAGS xvzf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("1f8b" LIMIT 2 HEX) diff --git a/Tests/RunCMake/CommandLineTar/gnutar.cmake b/Tests/RunCMake/CommandLineTar/gnutar.cmake new file mode 100644 index 0000000..aaca596 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/gnutar.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=gnutar) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172202000" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/pax-xz.cmake b/Tests/RunCMake/CommandLineTar/pax-xz.cmake new file mode 100644 index 0000000..baf63d5 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/pax-xz.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.xz") + +set(COMPRESSION_FLAGS cvJf) +set(COMPRESSION_OPTIONS --format=pax) + +set(DECOMPRESSION_FLAGS xvJf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("fd377a585a00" LIMIT 6 HEX) diff --git a/Tests/RunCMake/CommandLineTar/pax.cmake b/Tests/RunCMake/CommandLineTar/pax.cmake new file mode 100644 index 0000000..60ed238 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/pax.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=pax) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake b/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake new file mode 100644 index 0000000..881a0af --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.bz2") + +set(COMPRESSION_FLAGS cvjf) +set(COMPRESSION_OPTIONS --format=paxr) + +set(DECOMPRESSION_FLAGS xvjf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("425a68" LIMIT 3 HEX) diff --git a/Tests/RunCMake/CommandLineTar/paxr.cmake b/Tests/RunCMake/CommandLineTar/paxr.cmake new file mode 100644 index 0000000..968a103 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/paxr.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=paxr) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/roundtrip.cmake b/Tests/RunCMake/CommandLineTar/roundtrip.cmake new file mode 100644 index 0000000..dc1c885 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/roundtrip.cmake @@ -0,0 +1,81 @@ +foreach(parameter OUTPUT_NAME COMPRESSION_FLAGS DECOMPRESSION_FLAGS) + if(NOT DEFINED ${parameter}) + message(FATAL_ERROR "missing required parameter ${parameter}") + endif() +endforeach() + +function(run_tar WORKING_DIRECTORY) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar ${ARGN} + WORKING_DIRECTORY ${WORKING_DIRECTORY} + RESULT_VARIABLE result + ) + + if(NOT result STREQUAL "0") + message(FATAL_ERROR "tar failed with arguments [${ARGN}] result [${result}]") + endif() +endfunction() + +set(COMPRESS_DIR compress_dir) +set(FULL_COMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${COMPRESS_DIR}) + +set(DECOMPRESS_DIR decompress_dir) +set(FULL_DECOMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${DECOMPRESS_DIR}) + +set(FULL_OUTPUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}) + +set(CHECK_FILES + "f1.txt" + "d1/f1.txt" + "d 2/f1.txt" + "d + 3/f1.txt" + "d_4/f1.txt" + "d-4/f1.txt" + "My Special Directory/f1.txt" +) + +foreach(file ${CHECK_FILES}) + configure_file(${CMAKE_CURRENT_LIST_FILE} ${FULL_COMPRESS_DIR}/${file} COPYONLY) +endforeach() + +if(UNIX) + execute_process(COMMAND ln -sf f1.txt ${FULL_COMPRESS_DIR}/d1/f2.txt) + list(APPEND CHECK_FILES "d1/f2.txt") +endif() + +file(REMOVE ${FULL_OUTPUT_NAME}) +file(REMOVE_RECURSE ${FULL_DECOMPRESS_DIR}) +file(MAKE_DIRECTORY ${FULL_DECOMPRESS_DIR}) + +run_tar(${CMAKE_CURRENT_BINARY_DIR} ${COMPRESSION_FLAGS} ${FULL_OUTPUT_NAME} ${COMPRESSION_OPTIONS} ${COMPRESS_DIR}) +run_tar(${FULL_DECOMPRESS_DIR} ${DECOMPRESSION_FLAGS} ${FULL_OUTPUT_NAME} ${DECOMPRESSION_OPTIONS}) + +foreach(file ${CHECK_FILES}) + set(input ${FULL_COMPRESS_DIR}/${file}) + set(output ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file}) + + if(NOT EXISTS ${input}) + message(SEND_ERROR "Cannot find input file ${output}") + endif() + + if(NOT EXISTS ${output}) + message(SEND_ERROR "Cannot find output file ${output}") + endif() + + file(MD5 ${input} input_md5) + file(MD5 ${output} output_md5) + + if(NOT input_md5 STREQUAL output_md5) + message(SEND_ERROR "Files \"${input}\" and \"${output}\" are different") + endif() +endforeach() + +function(check_magic EXPECTED) + file(READ ${FULL_OUTPUT_NAME} ACTUAL + ${ARGN} + ) + + if(NOT ACTUAL STREQUAL EXPECTED) + message(FATAL_ERROR + "Actual [${ACTUAL}] does not match expected [${EXPECTED}]") + endif() +endfunction() diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/zip-bz2-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt rename to Tests/RunCMake/CommandLineTar/zip-bz2-result.txt diff --git a/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt b/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt new file mode 100644 index 0000000..1134b4f --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt @@ -0,0 +1 @@ +CMake Error: Can not use compression flags with format: zip diff --git a/Tests/RunCMake/CommandLineTar/zip.cmake b/Tests/RunCMake/CommandLineTar/zip.cmake new file mode 100644 index 0000000..08e2fdb --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/zip.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.zip") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=zip) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("504b0304" LIMIT 4 HEX) diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt deleted file mode 100644 index bcc340b..0000000 --- a/Tests/TarTest/CMakeLists.txt +++ /dev/null @@ -1,69 +0,0 @@ -cmake_minimum_required (VERSION 2.6) -project(TarTest) - -# this is macro that we will be running -macro(EXEC_TAR_COMMAND DIR ARGS) - exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET) - if(${RET}) - message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"") - endif() -endmacro() - -# Create a directory structure -set(CHECK_FILES) -macro(COPY F1 F2) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY) - set(CHECK_FILES ${CHECK_FILES} "${F2}") -endmacro() -COPY("CMakeLists.txt" "f1.txt") -COPY("CMakeLists.txt" "d1/f1.txt") -COPY("CMakeLists.txt" "d 2/f1.txt") -COPY("CMakeLists.txt" "d + 3/f1.txt") -COPY("CMakeLists.txt" "d_4/f1.txt") -COPY("CMakeLists.txt" "d-4/f1.txt") -COPY("CMakeLists.txt" "My Special Directory/f1.txt") - -if(UNIX) - exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"") - set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") -endif() - -# cleanup first in case there are files left from previous runs -# if the umask is odd on the machine it might create files that -# are not automatically over written. These tests are run -# each time the configure step is run. -file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar") -file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz") -file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") - -make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") - - -# Run tests -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\" tar_dir") -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\" tar_dir") - -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar" "xvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\"") -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz" "xvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\"") - -macro(CHECK_DIR_STRUCTURE DIR) - foreach(file ${CHECK_FILES}) - set(sfile "${DIR}/${file}") - set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}") - if(NOT EXISTS "${sfile}") - message(SEND_ERROR "Cannot find file ${sfile}") - else() - exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret) - if(${ret}) - message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different") - endif() - endif() - endforeach() -endmacro() - -CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir") - -add_executable(TarTest TestTarExec.cxx) - diff --git a/Tests/TarTest/TestTarExec.cxx b/Tests/TarTest/TestTarExec.cxx deleted file mode 100644 index 86f2cd1..0000000 --- a/Tests/TarTest/TestTarExec.cxx +++ /dev/null @@ -1,5 +0,0 @@ -int main() -{ - return 0; -} - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54c0ba6f5f2f9e824c37232fcf466ac4d3958bd5 commit 54c0ba6f5f2f9e824c37232fcf466ac4d3958bd5 Author: Nils Gladitz AuthorDate: Wed Apr 8 00:05:16 2015 +0200 Commit: Nils Gladitz CommitDate: Wed Apr 8 00:34:38 2015 +0200 cmake: Disallow -E tar compression flags with 7zip/zip diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index c561e17..2ef04ef 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -782,7 +782,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) compress = cmSystemTools::TarCompressGZip; ++nCompress; } - if ( nCompress > 1 ) + if ( (format == "7zip" || format == "zip") && nCompress > 0 ) + { + cmSystemTools::Error("Can not use compression flags with format: ", + format.c_str()); + return 1; + } + else 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"); ----------------------------------------------------------------------- Summary of changes: Source/cmcmd.cxx | 8 +- Tests/CMakeLists.txt | 1 - Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 12 --- .../7zip-gz-result.txt} | 0 Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt | 1 + Tests/RunCMake/CommandLineTar/7zip.cmake | 10 +++ .../{CMP0054 => CommandLineTar}/CMakeLists.txt | 0 Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake | 28 +++++++ .../bad-format-result.txt} | 0 .../bad-format-stderr.txt} | 0 .../bad-from1-result.txt} | 0 .../bad-from1-stderr.txt} | 0 .../bad-from2-result.txt} | 0 .../bad-from2-stderr.txt} | 0 .../bad-from3-result.txt} | 0 .../bad-from3-stderr.txt} | 2 +- .../bad-from3.txt} | 0 .../bad-from4-result.txt} | 0 .../bad-from4-stderr.txt} | 0 .../bad-from4.txt} | 0 .../bad-from5-result.txt} | 0 .../bad-from5-stderr.txt} | 0 .../bad-from5.txt} | 0 .../bad-mtime1-result.txt} | 0 .../bad-mtime1-stderr.txt} | 0 .../bad-opt1-result.txt} | 0 .../bad-opt1-stderr.txt} | 0 .../end-opt1-result.txt} | 0 .../end-opt1-stderr.txt} | 0 Tests/RunCMake/CommandLineTar/gnutar-gz.cmake | 10 +++ Tests/RunCMake/CommandLineTar/gnutar.cmake | 10 +++ Tests/RunCMake/CommandLineTar/pax-xz.cmake | 10 +++ Tests/RunCMake/CommandLineTar/pax.cmake | 10 +++ Tests/RunCMake/CommandLineTar/paxr-bz2.cmake | 10 +++ Tests/RunCMake/CommandLineTar/paxr.cmake | 10 +++ Tests/RunCMake/CommandLineTar/roundtrip.cmake | 81 ++++++++++++++++++++ .../zip-bz2-result.txt} | 0 Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt | 1 + Tests/RunCMake/CommandLineTar/zip.cmake | 10 +++ Tests/TarTest/CMakeLists.txt | 69 ----------------- Tests/TarTest/TestTarExec.cxx | 5 -- 42 files changed, 200 insertions(+), 89 deletions(-) rename Tests/RunCMake/{CommandLine/E_tar-bad-format-result.txt => CommandLineTar/7zip-gz-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt create mode 100644 Tests/RunCMake/CommandLineTar/7zip.cmake copy Tests/RunCMake/{CMP0054 => CommandLineTar}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake rename Tests/RunCMake/{CommandLine/E_tar-bad-from1-result.txt => CommandLineTar/bad-format-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-format-stderr.txt => CommandLineTar/bad-format-stderr.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from2-result.txt => CommandLineTar/bad-from1-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from1-stderr.txt => CommandLineTar/bad-from1-stderr.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from3-result.txt => CommandLineTar/bad-from2-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from2-stderr.txt => CommandLineTar/bad-from2-stderr.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from4-result.txt => CommandLineTar/bad-from3-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from3-stderr.txt => CommandLineTar/bad-from3-stderr.txt} (67%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from3.txt => CommandLineTar/bad-from3.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from5-result.txt => CommandLineTar/bad-from4-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from4-stderr.txt => CommandLineTar/bad-from4-stderr.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from4.txt => CommandLineTar/bad-from4.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-mtime1-result.txt => CommandLineTar/bad-from5-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from5-stderr.txt => CommandLineTar/bad-from5-stderr.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from5.txt => CommandLineTar/bad-from5.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-opt1-result.txt => CommandLineTar/bad-mtime1-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-mtime1-stderr.txt => CommandLineTar/bad-mtime1-stderr.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-end-opt1-result.txt => CommandLineTar/bad-opt1-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-opt1-stderr.txt => CommandLineTar/bad-opt1-stderr.txt} (100%) copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLineTar/end-opt1-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-end-opt1-stderr.txt => CommandLineTar/end-opt1-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CommandLineTar/gnutar-gz.cmake create mode 100644 Tests/RunCMake/CommandLineTar/gnutar.cmake create mode 100644 Tests/RunCMake/CommandLineTar/pax-xz.cmake create mode 100644 Tests/RunCMake/CommandLineTar/pax.cmake create mode 100644 Tests/RunCMake/CommandLineTar/paxr-bz2.cmake create mode 100644 Tests/RunCMake/CommandLineTar/paxr.cmake create mode 100644 Tests/RunCMake/CommandLineTar/roundtrip.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLineTar/zip-bz2-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt create mode 100644 Tests/RunCMake/CommandLineTar/zip.cmake delete mode 100644 Tests/TarTest/CMakeLists.txt delete mode 100644 Tests/TarTest/TestTarExec.cxx hooks/post-receive -- CMake From nilsgladitz at gmail.com Tue Apr 7 18:54:26 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Tue, 7 Apr 2015 18:54:26 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1596-g277b21a Message-ID: <20150407225430.8F2FCAD03C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 277b21a95f7a895adca29963fe9d619aac33f611 (commit) via 9434ac7e87b88c7587099aaa5563c698b317ee23 (commit) via 868ed9edce18f2b3d8f8d25cd5f4d4c8f3414d48 (commit) via 1093dfa22c9db9071671ea94f85b3b3264cdf810 (commit) from 8a4b330c63f28ce0e94aff4bc131a5a293fdb64c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=277b21a95f7a895adca29963fe9d619aac33f611 commit 277b21a95f7a895adca29963fe9d619aac33f611 Merge: 8a4b330 9434ac7 Author: Nils Gladitz AuthorDate: Tue Apr 7 18:54:24 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 7 18:54:24 2015 -0400 Merge topic 'tar-write-format' into next 9434ac7e Tests: Consolidate, refactor and extend -E tar tests 868ed9ed CTestCoverageCollectGCOV: Write tar files intended for CDash in gnutar format 1093dfa2 cmake: Teach "-E tar" command a "--format=" option http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9434ac7e87b88c7587099aaa5563c698b317ee23 commit 9434ac7e87b88c7587099aaa5563c698b317ee23 Author: Nils Gladitz AuthorDate: Tue Apr 7 19:40:33 2015 +0200 Commit: Nils Gladitz CommitDate: Wed Apr 8 00:54:05 2015 +0200 Tests: Consolidate, refactor and extend -E tar tests diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index f80191b..aa6a993 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -218,7 +218,6 @@ if(BUILD_TESTING) ADD_TEST_MACRO(FindModulesExecuteAll FindModulesExecuteAll) ADD_TEST_MACRO(StringFileTest StringFileTest) ADD_TEST_MACRO(TryCompile TryCompile) - ADD_TEST_MACRO(TarTest TarTest) ADD_TEST_MACRO(SystemInformation SystemInformation) ADD_TEST_MACRO(MathTest MathTest) ADD_TEST_MACRO(CompileFeatures CompileFeatures) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 60a8a82..891edf1 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -199,6 +199,7 @@ add_RunCMake_test(target_link_libraries) add_RunCMake_test(target_compile_features) add_RunCMake_test(CheckModules) add_RunCMake_test(CommandLine) +add_RunCMake_test(CommandLineTar) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index e3942a8..f879ee6 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,17 +1,5 @@ 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") -run_cmake_command(E_tar-bad-format ${CMAKE_COMMAND} -E tar cvf bad.tar "--format=bad-format") - run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) run_cmake_command(build-no-generator diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/7zip-gz-result.txt similarity index 100% copy from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt copy to Tests/RunCMake/CommandLineTar/7zip-gz-result.txt diff --git a/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt b/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt new file mode 100644 index 0000000..2fad326 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt @@ -0,0 +1 @@ +CMake Error: Can not use compression flags with format: 7zip diff --git a/Tests/RunCMake/CommandLineTar/7zip.cmake b/Tests/RunCMake/CommandLineTar/7zip.cmake new file mode 100644 index 0000000..4bc6548 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/7zip.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.7z") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=7zip) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("377abcaf271c" LIMIT 6 HEX) diff --git a/Tests/RunCMake/CommandLineTar/CMakeLists.txt b/Tests/RunCMake/CommandLineTar/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake new file mode 100644 index 0000000..12635db --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake @@ -0,0 +1,28 @@ +include(RunCMake) + +function(external_command_test NAME) + run_cmake_command(${NAME} ${CMAKE_COMMAND} -E ${ARGN}) +endfunction() + +external_command_test(bad-opt1 tar cvf bad.tar --bad) +external_command_test(bad-mtime1 tar cvf bad.tar --mtime=bad .) +external_command_test(bad-from1 tar cvf bad.tar --files-from=bad) +external_command_test(bad-from2 tar cvf bad.tar --files-from=.) +external_command_test(bad-from3 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from3.txt) +external_command_test(bad-from4 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from4.txt) +external_command_test(bad-from5 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from5.txt) +external_command_test(end-opt1 tar cvf bad.tar -- --bad) +external_command_test(end-opt2 tar cvf bad.tar --) +external_command_test(mtime tar cvf bad.tar "--mtime=1970-01-01 00:00:00 UTC") +external_command_test(bad-format tar cvf bad.tar "--format=bad-format") +external_command_test(zip-bz2 tar cvjf bad.tar "--format=zip") +external_command_test(7zip-gz tar cvzf bad.tar "--format=7zip") + +run_cmake(7zip) +run_cmake(gnutar) +run_cmake(gnutar-gz) +run_cmake(pax) +run_cmake(pax-xz) +run_cmake(paxr) +run_cmake(paxr-bz2) +run_cmake(zip) diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt b/Tests/RunCMake/CommandLineTar/bad-format-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-format-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-format-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-format-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt b/Tests/RunCMake/CommandLineTar/bad-from1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt b/Tests/RunCMake/CommandLineTar/bad-from2-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from2-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from2-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from2-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt b/Tests/RunCMake/CommandLineTar/bad-from3-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from3-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt similarity index 67% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt index 147bd80..da32ad9 100644 --- a/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt +++ b/Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt @@ -1,2 +1,2 @@ -^CMake Error: -E tar --files-from='.*/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt' file invalid line: +^CMake Error: -E tar --files-from='.*/Tests/RunCMake/CommandLineTar/bad-from3.txt' file invalid line: -add-file=option-typo$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt b/Tests/RunCMake/CommandLineTar/bad-from3.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3.txt rename to Tests/RunCMake/CommandLineTar/bad-from3.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt b/Tests/RunCMake/CommandLineTar/bad-from4-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from4-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4.txt b/Tests/RunCMake/CommandLineTar/bad-from4.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4.txt rename to Tests/RunCMake/CommandLineTar/bad-from4.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt b/Tests/RunCMake/CommandLineTar/bad-from5-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from5-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5.txt b/Tests/RunCMake/CommandLineTar/bad-from5.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5.txt rename to Tests/RunCMake/CommandLineTar/bad-from5.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt b/Tests/RunCMake/CommandLineTar/bad-mtime1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-mtime1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-mtime1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-mtime1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt b/Tests/RunCMake/CommandLineTar/bad-opt1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-opt1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-opt1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-opt1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/end-opt1-result.txt similarity index 100% copy from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt copy to Tests/RunCMake/CommandLineTar/end-opt1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt b/Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt rename to Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt diff --git a/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake b/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake new file mode 100644 index 0000000..5f2674a --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.gz") + +set(COMPRESSION_FLAGS cvzf) +set(COMPRESSION_OPTIONS --format=gnutar) + +set(DECOMPRESSION_FLAGS xvzf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("1f8b" LIMIT 2 HEX) diff --git a/Tests/RunCMake/CommandLineTar/gnutar.cmake b/Tests/RunCMake/CommandLineTar/gnutar.cmake new file mode 100644 index 0000000..aaca596 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/gnutar.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=gnutar) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172202000" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/pax-xz.cmake b/Tests/RunCMake/CommandLineTar/pax-xz.cmake new file mode 100644 index 0000000..baf63d5 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/pax-xz.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.xz") + +set(COMPRESSION_FLAGS cvJf) +set(COMPRESSION_OPTIONS --format=pax) + +set(DECOMPRESSION_FLAGS xvJf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("fd377a585a00" LIMIT 6 HEX) diff --git a/Tests/RunCMake/CommandLineTar/pax.cmake b/Tests/RunCMake/CommandLineTar/pax.cmake new file mode 100644 index 0000000..60ed238 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/pax.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=pax) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake b/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake new file mode 100644 index 0000000..881a0af --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.bz2") + +set(COMPRESSION_FLAGS cvjf) +set(COMPRESSION_OPTIONS --format=paxr) + +set(DECOMPRESSION_FLAGS xvjf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("425a68" LIMIT 3 HEX) diff --git a/Tests/RunCMake/CommandLineTar/paxr.cmake b/Tests/RunCMake/CommandLineTar/paxr.cmake new file mode 100644 index 0000000..968a103 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/paxr.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=paxr) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/roundtrip.cmake b/Tests/RunCMake/CommandLineTar/roundtrip.cmake new file mode 100644 index 0000000..dc1c885 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/roundtrip.cmake @@ -0,0 +1,81 @@ +foreach(parameter OUTPUT_NAME COMPRESSION_FLAGS DECOMPRESSION_FLAGS) + if(NOT DEFINED ${parameter}) + message(FATAL_ERROR "missing required parameter ${parameter}") + endif() +endforeach() + +function(run_tar WORKING_DIRECTORY) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar ${ARGN} + WORKING_DIRECTORY ${WORKING_DIRECTORY} + RESULT_VARIABLE result + ) + + if(NOT result STREQUAL "0") + message(FATAL_ERROR "tar failed with arguments [${ARGN}] result [${result}]") + endif() +endfunction() + +set(COMPRESS_DIR compress_dir) +set(FULL_COMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${COMPRESS_DIR}) + +set(DECOMPRESS_DIR decompress_dir) +set(FULL_DECOMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${DECOMPRESS_DIR}) + +set(FULL_OUTPUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}) + +set(CHECK_FILES + "f1.txt" + "d1/f1.txt" + "d 2/f1.txt" + "d + 3/f1.txt" + "d_4/f1.txt" + "d-4/f1.txt" + "My Special Directory/f1.txt" +) + +foreach(file ${CHECK_FILES}) + configure_file(${CMAKE_CURRENT_LIST_FILE} ${FULL_COMPRESS_DIR}/${file} COPYONLY) +endforeach() + +if(UNIX) + execute_process(COMMAND ln -sf f1.txt ${FULL_COMPRESS_DIR}/d1/f2.txt) + list(APPEND CHECK_FILES "d1/f2.txt") +endif() + +file(REMOVE ${FULL_OUTPUT_NAME}) +file(REMOVE_RECURSE ${FULL_DECOMPRESS_DIR}) +file(MAKE_DIRECTORY ${FULL_DECOMPRESS_DIR}) + +run_tar(${CMAKE_CURRENT_BINARY_DIR} ${COMPRESSION_FLAGS} ${FULL_OUTPUT_NAME} ${COMPRESSION_OPTIONS} ${COMPRESS_DIR}) +run_tar(${FULL_DECOMPRESS_DIR} ${DECOMPRESSION_FLAGS} ${FULL_OUTPUT_NAME} ${DECOMPRESSION_OPTIONS}) + +foreach(file ${CHECK_FILES}) + set(input ${FULL_COMPRESS_DIR}/${file}) + set(output ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file}) + + if(NOT EXISTS ${input}) + message(SEND_ERROR "Cannot find input file ${output}") + endif() + + if(NOT EXISTS ${output}) + message(SEND_ERROR "Cannot find output file ${output}") + endif() + + file(MD5 ${input} input_md5) + file(MD5 ${output} output_md5) + + if(NOT input_md5 STREQUAL output_md5) + message(SEND_ERROR "Files \"${input}\" and \"${output}\" are different") + endif() +endforeach() + +function(check_magic EXPECTED) + file(READ ${FULL_OUTPUT_NAME} ACTUAL + ${ARGN} + ) + + if(NOT ACTUAL STREQUAL EXPECTED) + message(FATAL_ERROR + "Actual [${ACTUAL}] does not match expected [${EXPECTED}]") + endif() +endfunction() diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/zip-bz2-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt rename to Tests/RunCMake/CommandLineTar/zip-bz2-result.txt diff --git a/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt b/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt new file mode 100644 index 0000000..1134b4f --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt @@ -0,0 +1 @@ +CMake Error: Can not use compression flags with format: zip diff --git a/Tests/RunCMake/CommandLineTar/zip.cmake b/Tests/RunCMake/CommandLineTar/zip.cmake new file mode 100644 index 0000000..08e2fdb --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/zip.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.zip") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=zip) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("504b0304" LIMIT 4 HEX) diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt deleted file mode 100644 index bcc340b..0000000 --- a/Tests/TarTest/CMakeLists.txt +++ /dev/null @@ -1,69 +0,0 @@ -cmake_minimum_required (VERSION 2.6) -project(TarTest) - -# this is macro that we will be running -macro(EXEC_TAR_COMMAND DIR ARGS) - exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET) - if(${RET}) - message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"") - endif() -endmacro() - -# Create a directory structure -set(CHECK_FILES) -macro(COPY F1 F2) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY) - set(CHECK_FILES ${CHECK_FILES} "${F2}") -endmacro() -COPY("CMakeLists.txt" "f1.txt") -COPY("CMakeLists.txt" "d1/f1.txt") -COPY("CMakeLists.txt" "d 2/f1.txt") -COPY("CMakeLists.txt" "d + 3/f1.txt") -COPY("CMakeLists.txt" "d_4/f1.txt") -COPY("CMakeLists.txt" "d-4/f1.txt") -COPY("CMakeLists.txt" "My Special Directory/f1.txt") - -if(UNIX) - exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"") - set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") -endif() - -# cleanup first in case there are files left from previous runs -# if the umask is odd on the machine it might create files that -# are not automatically over written. These tests are run -# each time the configure step is run. -file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar") -file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz") -file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") - -make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") - - -# Run tests -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\" tar_dir") -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\" tar_dir") - -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar" "xvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\"") -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz" "xvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\"") - -macro(CHECK_DIR_STRUCTURE DIR) - foreach(file ${CHECK_FILES}) - set(sfile "${DIR}/${file}") - set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}") - if(NOT EXISTS "${sfile}") - message(SEND_ERROR "Cannot find file ${sfile}") - else() - exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret) - if(${ret}) - message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different") - endif() - endif() - endforeach() -endmacro() - -CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir") - -add_executable(TarTest TestTarExec.cxx) - diff --git a/Tests/TarTest/TestTarExec.cxx b/Tests/TarTest/TestTarExec.cxx deleted file mode 100644 index 86f2cd1..0000000 --- a/Tests/TarTest/TestTarExec.cxx +++ /dev/null @@ -1,5 +0,0 @@ -int main() -{ - return 0; -} - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=868ed9edce18f2b3d8f8d25cd5f4d4c8f3414d48 commit 868ed9edce18f2b3d8f8d25cd5f4d4c8f3414d48 Author: Nils Gladitz AuthorDate: Tue Apr 7 12:41:55 2015 +0200 Commit: Nils Gladitz CommitDate: Wed Apr 8 00:54:05 2015 +0200 CTestCoverageCollectGCOV: Write tar files intended for CDash in gnutar format PHP's PharData can not currently (PHP 5.6.4) extract paxr tar archives with long filenames. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 8659a69..6c74cf3 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -198,6 +198,7 @@ ${label_files} execute_process(COMMAND ${CMAKE_COMMAND} -E tar ${tar_opts} ${GCOV_TARBALL} "--mtime=1970-01-01 0:0:0 UTC" + "--format=gnutar" --files-from=${coverage_dir}/coverage_file_list.txt WORKING_DIRECTORY ${binary_dir}) endfunction() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1093dfa22c9db9071671ea94f85b3b3264cdf810 commit 1093dfa22c9db9071671ea94f85b3b3264cdf810 Author: Nils Gladitz AuthorDate: Tue Apr 7 12:36:52 2015 +0200 Commit: Nils Gladitz CommitDate: Wed Apr 8 00:54:05 2015 +0200 cmake: Teach "-E tar" command a "--format=" option Allows specifying a libarchive defined archive format currently restricted to 7zip, gnutar, pax, paxr and zip. The default is "paxr" (pax restricted). diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index da41bbb..b2f7e9d 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -215,6 +215,10 @@ Available commands are: names start in ``-``. ``--mtime=`` Specify modification time recorded in tarball entries. + ``--format=`` + Specify the format of the archive to be created. + Supported formats are: ``7zip``, ``gnutar``, ``pax``, + ``paxr`` (restricted pax, default), and ``zip``. ``time [...]`` Run command and return elapsed time. diff --git a/Help/release/dev/tar-write-format.rst b/Help/release/dev/tar-write-format.rst new file mode 100644 index 0000000..004df21 --- /dev/null +++ b/Help/release/dev/tar-write-format.rst @@ -0,0 +1,6 @@ +tar-write-format +---------------- + +* The :manual:`cmake(1)` ``-E tar`` command learned a new + ``--format`` option to specify the archive format to + be written. diff --git a/Source/CPack/cmCPack7zGenerator.cxx b/Source/CPack/cmCPack7zGenerator.cxx index ce31ad4..2809e56 100644 --- a/Source/CPack/cmCPack7zGenerator.cxx +++ b/Source/CPack/cmCPack7zGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPack7zGenerator::cmCPack7zGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, - cmArchiveWrite::Type7Zip) + "7zip") { } diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 05b5cd9..58bd947 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -27,10 +27,10 @@ //---------------------------------------------------------------------- cmCPackArchiveGenerator::cmCPackArchiveGenerator(cmArchiveWrite::Compress t, - cmArchiveWrite::Type at) + std::string const& format) { this->Compress = t; - this->Archive = at; + this->ArchiveFormat = format; } //---------------------------------------------------------------------- @@ -108,7 +108,7 @@ if (!GenerateHeader(&gf)) \ << ">." << std::endl); \ return 0; \ } \ -cmArchiveWrite archive(gf,this->Compress, this->Archive); \ +cmArchiveWrite archive(gf,this->Compress, this->ArchiveFormat); \ if (!archive) \ { \ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " \ diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index 6411b1e..16e7632 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -31,7 +31,7 @@ public: /** * Construct generator */ - cmCPackArchiveGenerator(cmArchiveWrite::Compress, cmArchiveWrite::Type); + cmCPackArchiveGenerator(cmArchiveWrite::Compress, std::string const& format); virtual ~cmCPackArchiveGenerator(); // Used to add a header to the archive virtual int GenerateHeader(std::ostream* os); @@ -68,7 +68,7 @@ protected: int PackageComponentsAllInOne(); virtual const char* GetOutputExtension() = 0; cmArchiveWrite::Compress Compress; - cmArchiveWrite::Type Archive; + std::string ArchiveFormat; }; #endif diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx index 509c7f8..3fa2b64 100644 --- a/Source/CPack/cmCPackTGZGenerator.cxx +++ b/Source/CPack/cmCPackTGZGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTGZGenerator::cmCPackTGZGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressGZip, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTXZGenerator.cxx b/Source/CPack/cmCPackTXZGenerator.cxx index ecfc177..6d4ede1 100644 --- a/Source/CPack/cmCPackTXZGenerator.cxx +++ b/Source/CPack/cmCPackTXZGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTXZGenerator::cmCPackTXZGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx index ae73c37..9ff588b 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.cxx +++ b/Source/CPack/cmCPackTarBZip2Generator.cxx @@ -14,7 +14,7 @@ //---------------------------------------------------------------------- cmCPackTarBZip2Generator::cmCPackTarBZip2Generator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressBZip2, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx index df29408..1c8311b 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.cxx +++ b/Source/CPack/cmCPackTarCompressGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTarCompressGenerator::cmCPackTarCompressGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressCompress, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx index e6e4e77..7ef7729 100644 --- a/Source/CPack/cmCPackZIPGenerator.cxx +++ b/Source/CPack/cmCPackZIPGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackZIPGenerator::cmCPackZIPGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, - cmArchiveWrite::TypeZIP) + "zip") { } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index cf2fe82..72818f5 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -79,11 +79,12 @@ struct cmArchiveWrite::Callback }; //---------------------------------------------------------------------------- -cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): - Stream(os), - Archive(archive_write_new()), - Disk(archive_read_disk_new()), - Verbose(false) +cmArchiveWrite::cmArchiveWrite( + std::ostream& os, Compress c, std::string const& format): + Stream(os), + Archive(archive_write_new()), + Disk(archive_read_disk_new()), + Verbose(false) { switch (c) { @@ -141,35 +142,16 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): { this->Error = "archive_read_disk_set_standard_lookup: "; this->Error += cm_archive_error_string(this->Archive); - return;; + return; } #endif - switch (t) + + if(archive_write_set_format_by_name(this->Archive, format.c_str()) + != ARCHIVE_OK) { - case TypeZIP: - if(archive_write_set_format_zip(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_zip: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; - case TypeTAR: - if(archive_write_set_format_pax_restricted(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_pax_restricted: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; - case Type7Zip: - if(archive_write_set_format_7zip(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_7zip: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; + this->Error = "archive_write_set_format_by_name: "; + this->Error += cm_archive_error_string(this->Archive); + return; } // do not pad the last block!! diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 17357b4..794cb28 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -38,16 +38,10 @@ public: CompressXZ }; - /** Archive Type */ - enum Type - { - TypeTAR, - TypeZIP, - Type7Zip - }; - /** Construct with output stream to which to write archive. */ - cmArchiveWrite(std::ostream& os, Compress c = CompressNone, Type = TypeTAR); + cmArchiveWrite(std::ostream& os, Compress c = CompressNone, + std::string const& format = "paxr"); + ~cmArchiveWrite(); /** diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 5264123..95d05a6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1475,7 +1475,8 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, - bool verbose, std::string const& mtime) + bool verbose, std::string const& mtime, + std::string const& format) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1505,8 +1506,10 @@ bool cmSystemTools::CreateTar(const char* outFileName, compress = cmArchiveWrite::CompressNone; break; } + cmArchiveWrite a(fout, compress, - cmArchiveWrite::TypeTAR); + format.empty() ? "paxr" : format); + a.SetMTime(mtime); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index c59ae96..433ef46 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -395,7 +395,8 @@ public: static bool CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, bool verbose, - std::string const& mtime = std::string()); + std::string const& mtime = std::string(), + std::string const& format = 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/cmcmd.cxx b/Source/cmcmd.cxx index 9f2ea46..2ef04ef 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -703,10 +703,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) // Tar files else if (args[1] == "tar" && args.size() > 3) { + const char* knownFormats[] = + { + "7zip", + "gnutar", + "pax", + "paxr", + "zip" + }; + std::string flags = args[2]; std::string outFile = args[3]; std::vector files; std::string mtime; + std::string format; bool doing_options = true; for (std::string::size_type cc = 4; cc < args.size(); cc ++) { @@ -729,6 +739,19 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) return 1; } } + else if (cmHasLiteralPrefix(arg, "--format=")) + { + format = arg.substr(9); + bool isKnown = std::find(cmArrayBegin(knownFormats), + cmArrayEnd(knownFormats), format) != cmArrayEnd(knownFormats); + + if(!isKnown) + { + cmSystemTools::Error("Unknown -E tar --format= argument: ", + format.c_str()); + return 1; + } + } else { cmSystemTools::Error("Unknown option to -E tar: ", arg.c_str()); @@ -759,7 +782,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) compress = cmSystemTools::TarCompressGZip; ++nCompress; } - if ( nCompress > 1 ) + if ( (format == "7zip" || format == "zip") && nCompress > 0 ) + { + cmSystemTools::Error("Can not use compression flags with format: ", + format.c_str()); + return 1; + } + else 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"); @@ -781,7 +810,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, mtime) ) + outFile.c_str(), files, compress, verbose, mtime, format) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt new file mode 100644 index 0000000..fe9e2dc --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt @@ -0,0 +1 @@ +CMake Error: Unknown -E tar --format= argument: bad-format diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index e8b4584..e3942a8 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -10,6 +10,7 @@ run_cmake_command(E_tar-bad-from5 ${CMAKE_COMMAND} -E tar cvf bad.tar --files-f 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(E_tar-bad-format ${CMAKE_COMMAND} -E tar cvf bad.tar "--format=bad-format") run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Wed Apr 8 00:01:07 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 8 Apr 2015 00:01:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-666-gbddd8c0 Message-ID: <20150408040107.78D32AD76D@public.kitware.com> This is an automated email from 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 bddd8c055104d7c66b01799a4c99a2bbb6da8f00 (commit) from d3823263b2665e5b89668212bc498af3220ac992 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bddd8c055104d7c66b01799a4c99a2bbb6da8f00 commit bddd8c055104d7c66b01799a4c99a2bbb6da8f00 Author: Kitware Robot AuthorDate: Wed Apr 8 00:01:05 2015 -0400 Commit: Kitware Robot CommitDate: Wed Apr 8 00:01:05 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index eed106d..5214832 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150407) +set(CMake_VERSION_PATCH 20150408) #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 Wed Apr 8 02:55:55 2015 From: steveire at gmail.com (Stephen Kelly) Date: Wed, 8 Apr 2015 02:55:55 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1606-gbf53173 Message-ID: <20150408065555.CCC4BAD5B9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via bf53173a0d19d025fe21e53091a2efe6b1c62a21 (commit) via a580ee87517d40cd835df07be5f7618001c35e9e (commit) via 7a5c285e30a7cc5f1389c69fab79085c90443fcb (commit) via 51890a7e0718c675c064520bb9fdf5710a062ef5 (commit) via 9d97c4da28d5ebde5d5c47aadec826367eebd238 (commit) via 0b325419d12bbb51a3125f19d18302b49f0dc5c3 (commit) via 77f2807ce56491fab7637327564c7fb1033dadb1 (commit) via 14973054a2f3954111789cda5e54c2e2e2175521 (commit) via 1f2c12ebd196f3d23aa40d85c965654dbc36d0ad (commit) via 97c50a8dbd9f1ca5026f60e4a224e9a087e01f0e (commit) from 277b21a95f7a895adca29963fe9d619aac33f611 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf53173a0d19d025fe21e53091a2efe6b1c62a21 commit bf53173a0d19d025fe21e53091a2efe6b1c62a21 Merge: 277b21a a580ee8 Author: Stephen Kelly AuthorDate: Wed Apr 8 02:55:51 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 02:55:51 2015 -0400 Merge topic 'refactor-cache-api' into next a580ee87 cmCacheManager: Port consumers to non-iterator API. 7a5c285e Port QtDialog to non-iterator cache API. 51890a7e Port CursesDialog to non-iterator cache API. 9d97c4da cmMakefile: Port away from CacheEntry.Initialized. 0b325419 cmCacheManager: Add non-iterator-based API. 77f2807c cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue. 14973054 Add API for cache loading, deleting and saving to the cmake class. 1f2c12eb cmMakefile: Remove cache version accessors. 97c50a8d cmMakefile: Simplify GetDefinitions implementation. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a580ee87517d40cd835df07be5f7618001c35e9e commit a580ee87517d40cd835df07be5f7618001c35e9e Author: Stephen Kelly AuthorDate: Sun Apr 5 10:48:04 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 01:09:02 2015 +0200 cmCacheManager: Port consumers to non-iterator API. This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names. diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index f63df61..cc08052 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -366,18 +366,18 @@ bool cmFindBase::CheckForVariableInCache() if(const char* cacheValue = this->Makefile->GetDefinition(this->VariableName)) { - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()-> - GetCacheIterator(this->VariableName.c_str()); + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); - bool cached = !it.IsAtEnd(); + bool cached = cacheEntry ? true : false; if(found) { // If the user specifies the entry on the command line without a // type we should add the type and docstring but keep the // original value. Tell the subclass implementations to do // this. - if(cached && it.GetType() == cmCacheManager::UNINITIALIZED) + if(cached && manager->GetCacheEntryType(this->VariableName) + == cmCacheManager::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; } @@ -385,7 +385,8 @@ bool cmFindBase::CheckForVariableInCache() } else if(cached) { - const char* hs = it.GetProperty("HELPSTRING"); + const char* hs = manager->GetCacheEntryProperty(this->VariableName, + "HELPSTRING"); this->VariableDocumentation = hs?hs:"(none)"; } } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index f0b2686..0e6e0c2 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -391,11 +391,10 @@ bool cmGetPropertyCommand::HandleCacheMode() } const char* value = 0; - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(this->Name.c_str()); - if(!it.IsAtEnd()) + if(this->Makefile->GetCacheManager()->GetCacheEntryValue(this->Name)) { - value = it.GetProperty(this->PropertyName); + value = this->Makefile->GetCacheManager() + ->GetCacheEntryProperty(this->Name, this->PropertyName); } this->StoreResult(value); return true; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f23caa6..35394b8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1559,9 +1559,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(lib->first.c_str())) { std::string varName = lib->first.substr(0, lib->first.size()-9); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(varName.c_str()); - if(it.GetPropertyAsBool("ADVANCED")) + if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1592,9 +1590,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(incDir->c_str())) { std::string varName = incDir->substr(0, incDir->size()-9); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(varName.c_str()); - if(it.GetPropertyAsBool("ADVANCED")) + if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7c1b9c4..34b4621 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1848,8 +1848,8 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, doc, - type); + this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -2499,12 +2499,10 @@ std::vector cmMakefile this->Internal->VarStack.top().ClosureKeys(); res.insert(res.end(), definitions.begin(), definitions.end()); } - cmCacheManager::CacheIterator cit = - this->GetCacheManager()->GetCacheIterator(); - for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) - { - res.push_back(cit.GetName()); - } + std::vector cacheKeys = + this->GetCacheManager()->GetCacheEntryKeys(); + res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); + std::sort(res.begin(), res.end()); return res; } diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index f6a2c26..cc094b1 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -37,24 +37,19 @@ bool cmMarkAsAdvancedCommand { std::string variable = args[i]; cmCacheManager* manager = this->Makefile->GetCacheManager(); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(variable.c_str()); - if ( it.IsAtEnd() ) + if (!manager->GetCacheEntryValue(variable)) { - this->Makefile->GetCacheManager() - ->AddCacheEntry(variable, 0, 0, - cmCacheManager::UNINITIALIZED); + manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); overwrite = true; } - it.Find(variable); - if ( it.IsAtEnd() ) + if (!manager->GetCacheEntryValue(variable)) { cmSystemTools::Error("This should never happen..."); return false; } - if ( !it.PropertyExists("ADVANCED") || overwrite ) + if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) { - it.SetProperty("ADVANCED", value); + manager->SetCacheEntryProperty(variable, "ADVANCED", value); } } return true; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 60728ea..baf5b1e 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,16 +42,16 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(args[0].c_str()); - if(!it.IsAtEnd()) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue = manager->GetCacheEntryValue(args[0]); + if(existingValue) { - if ( it.GetType() != cmCacheManager::UNINITIALIZED ) + if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) { - it.SetProperty("HELPSTRING", args[1].c_str()); + manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; } - initialValue = it.GetValue(); + initialValue = existingValue; } if(args.size() == 3) { diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 204d95b..e17474b 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -136,9 +136,10 @@ bool cmSetCommand } // see if this is already in the cache - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(variable); - if(!it.IsAtEnd() && (it.GetType() != cmCacheManager::UNINITIALIZED)) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue = manager->GetCacheEntryValue(variable); + if(existingValue && + (manager->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 1150bc7..77f9fb9 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -452,11 +452,11 @@ bool cmSetPropertyCommand::HandleCacheMode() // Get the source file. cmMakefile* mf = this->GetMakefile(); cmake* cm = mf->GetCMakeInstance(); - cmCacheManager::CacheIterator it = - cm->GetCacheManager()->GetCacheIterator(ni->c_str()); - if(!it.IsAtEnd()) + const char* existingValue + = cm->GetCacheManager()->GetCacheEntryValue(*ni); + if(existingValue) { - if(!this->HandleCacheEntry(it)) + if(!this->HandleCacheEntry(*ni)) { return false; } @@ -474,22 +474,25 @@ bool cmSetPropertyCommand::HandleCacheMode() } //---------------------------------------------------------------------------- -bool cmSetPropertyCommand::HandleCacheEntry(cmCacheManager::CacheIterator& it) +bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey) { // Set or append the property. const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); + cmCacheManager* manager = this->Makefile->GetCacheManager(); if (this->Remove) { - value = 0; + manager->RemoveCacheEntryProperty(cacheKey, name); + return true; } if(this->AppendMode) { - it.AppendProperty(name, value, this->AppendAsString); + manager->AppendCacheEntryProperty(cacheKey, name, value, + this->AppendAsString); } else { - it.SetProperty(name, value); + manager->SetCacheEntryProperty(cacheKey, name, value); } return true; diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h index b06cb68..3285e60 100644 --- a/Source/cmSetPropertyCommand.h +++ b/Source/cmSetPropertyCommand.h @@ -61,7 +61,7 @@ private: bool HandleTestMode(); bool HandleTest(cmTest* test); bool HandleCacheMode(); - bool HandleCacheEntry(cmCacheManager::CacheIterator&); + bool HandleCacheEntry(std::string const&); bool HandleInstallMode(); bool HandleInstall(cmInstalledFile* file); }; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index b5280cf..911ade8 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -264,11 +264,12 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment.c_str(), cmCacheManager::STRING); - cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()-> - GetCacheIterator(this->RunResultVariable.c_str()); - if ( !it.IsAtEnd() ) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue + = manager->GetCacheEntryValue(this->RunResultVariable); + if (existingValue) { - it.SetProperty("ADVANCED", "1"); + manager->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); } error = true; @@ -290,11 +291,13 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmCacheManager::STRING); - cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()-> - GetCacheIterator(internalRunOutputName.c_str()); - if ( !it.IsAtEnd() ) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existing = + manager->GetCacheEntryValue(internalRunOutputName); + if (existing) { - it.SetProperty("ADVANCED", "1"); + manager->SetCacheEntryProperty(internalRunOutputName, + "ADVANCED", "1"); } error = true; diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index 80c1286..dd2a682 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -41,9 +41,9 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(args[i].c_str()); - if(!it.IsAtEnd() && it.GetPropertyAsBool("ADVANCED")) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + if(manager->GetCacheEntryValue(args[i]) && + manager->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) { hasAdvanced = true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 210c0ef..64b332c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -403,17 +403,18 @@ bool cmake::SetCacheArgs(const std::vector& args) cmsys::Glob::PatternToRegex(entryPattern, true, true).c_str()); //go through all cache entries and collect the vars which will be removed std::vector entriesToDelete; - cmCacheManager::CacheIterator it = - this->CacheManager->GetCacheIterator(); - for ( it.Begin(); !it.IsAtEnd(); it.Next() ) + std::vector cacheKeys = + this->CacheManager->GetCacheEntryKeys(); + for (std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = it.GetType(); + cmCacheManager::CacheEntryType t = + this->CacheManager->GetCacheEntryType(*it); if(t != cmCacheManager::STATIC) { - std::string entryName = it.GetName(); - if (regex.find(entryName.c_str())) + if (regex.find(it->c_str())) { - entriesToDelete.push_back(entryName); + entriesToDelete.push_back(*it); } } } @@ -917,16 +918,18 @@ void cmake::SetDirectoriesFromFile(const char* arg) // If there is a CMakeCache.txt file, use its settings. if(!cachePath.empty()) { - cmCacheManager* cachem = this->GetCacheManager(); - cmCacheManager::CacheIterator it = cachem->NewIterator(); - if(this->LoadCache(cachePath) && - it.Find("CMAKE_HOME_DIRECTORY")) + if(this->LoadCache(cachePath)) { - this->SetHomeOutputDirectory(cachePath); - this->SetStartOutputDirectory(cachePath); - this->SetHomeDirectory(it.GetValue()); - this->SetStartDirectory(it.GetValue()); - return; + const char* existingValue = + this->CacheManager->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + if (existingValue) + { + this->SetHomeOutputDirectory(cachePath); + this->SetStartOutputDirectory(cachePath); + this->SetHomeDirectory(existingValue); + this->SetStartDirectory(existingValue); + return; + } } } @@ -1575,11 +1578,11 @@ int cmake::ActualConfigure() ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", cmCacheManager::BOOL); - cmCacheManager::CacheIterator it = - this->CacheManager->GetCacheIterator("CMAKE_USE_RELATIVE_PATHS"); - if ( !it.PropertyExists("ADVANCED") ) + if (!this->CacheManager->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED")) { - it.SetProperty("ADVANCED", "1"); + this->CacheManager->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED", "1"); } } @@ -2314,17 +2317,9 @@ const char *cmake::GetProperty(const std::string& prop, std::string output = ""; if ( prop == "CACHE_VARIABLES" ) { - cmCacheManager::CacheIterator cit = - this->GetCacheManager()->GetCacheIterator(); - for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) - { - if (!output.empty()) - { - output += ";"; - } - output += cit.GetName(); - } - this->SetProperty("CACHE_VARIABLES", output.c_str()); + std::vector cacheKeys = + this->CacheManager->GetCacheEntryKeys(); + this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); } else if ( prop == "COMMANDS" ) { @@ -2686,9 +2681,9 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, if(t == cmake::AUTHOR_WARNING) { // Allow suppression of these warnings. - cmCacheManager::CacheIterator it = this->CacheManager - ->GetCacheIterator("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); - if(!it.IsAtEnd() && it.GetValueAsBool()) + const char* suppress = this->CacheManager->GetCacheEntryValue( + "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); + if(suppress && cmSystemTools::IsOn(suppress)) { return; } @@ -2801,37 +2796,42 @@ int cmake::Build(const std::string& dir, } std::string cachePath = dir; cmSystemTools::ConvertToUnixSlashes(cachePath); - cmCacheManager::CacheIterator it = this->GetCacheManager()->NewIterator(); if(!this->LoadCache(cachePath)) { std::cerr << "Error: could not load cache\n"; return 1; } - if(!it.Find("CMAKE_GENERATOR")) + const char* cachedGenerator = + this->CacheManager->GetCacheEntryValue("CMAKE_GENERATOR"); + if(!cachedGenerator) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; return 1; } cmsys::auto_ptr gen( - this->CreateGlobalGenerator(it.GetValue())); + this->CreateGlobalGenerator(cachedGenerator)); if(!gen.get()) { std::cerr << "Error: could create CMAKE_GENERATOR \"" - << it.GetValue() << "\"\n"; + << cachedGenerator << "\"\n"; return 1; } std::string output; std::string projName; - if(!it.Find("CMAKE_PROJECT_NAME")) + const char* cachedProjectName = + this->CacheManager->GetCacheEntryValue("CMAKE_PROJECT_NAME"); + if(!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; return 1; } - projName = it.GetValue(); + projName = cachedProjectName; bool verbose = false; - if(it.Find("CMAKE_VERBOSE_MAKEFILE")) + const char* cachedVerbose = + this->CacheManager->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); + if(cachedVerbose) { - verbose = it.GetValueAsBool(); + verbose = cmSystemTools::IsOn(cachedVerbose); } return gen->Build("", dir, projName, target, diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index ac73ad0..3b518be 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -328,25 +328,31 @@ int do_cmake(int ac, char const* const* av) int res = cm.Run(args, view_only); if ( list_cached || list_all_cached ) { - cmCacheManager::CacheIterator it = - cm.GetCacheManager()->GetCacheIterator(); std::cout << "-- Cache values" << std::endl; - for ( it.Begin(); !it.IsAtEnd(); it.Next() ) + std::vector keys = + cm.GetCacheManager()->GetCacheEntryKeys(); + for (std::vector::const_iterator it = keys.begin(); + it != keys.end(); ++it) { - cmCacheManager::CacheEntryType t = it.GetType(); + cmCacheManager::CacheEntryType t = + cm.GetCacheManager()->GetCacheEntryType(*it); if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && t != cmCacheManager::UNINITIALIZED ) { - bool advanced = it.PropertyExists("ADVANCED"); - if ( list_all_cached || !advanced) + const char* advancedProp = + cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED"); + if ( list_all_cached || !advancedProp) { if ( list_help ) { - std::cout << "// " << it.GetProperty("HELPSTRING") << std::endl; + std::cout << "// " + << cm.GetCacheManager()->GetCacheEntryProperty(*it, + "HELPSTRING") << std::endl; } - std::cout << it.GetName() << ":" << - cmCacheManager::TypeToString(it.GetType()) - << "=" << it.GetValue() << std::endl; + std::cout << *it << ":" << + cmCacheManager::TypeToString(t) + << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it) + << std::endl; if ( list_help ) { std::cout << std::endl; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7a5c285e30a7cc5f1389c69fab79085c90443fcb commit 7a5c285e30a7cc5f1389c69fab79085c90443fcb Author: Stephen Kelly AuthorDate: Mon Apr 6 12:14:40 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 01:09:02 2015 +0200 Port QtDialog to non-iterator cache API. diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 009d06e..08d53ce 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -110,17 +110,18 @@ void QCMake::setBinaryDirectory(const QString& _dir) QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); - cmCacheManager::CacheIterator itm = cachem->NewIterator(); - if ( itm.Find("CMAKE_HOME_DIRECTORY")) + const char* homeDir = cachem->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + if (homeDir) { - setSourceDirectory(QString::fromLocal8Bit(itm.GetValue().c_str())); + setSourceDirectory(QString::fromLocal8Bit(homeDir)); } - if ( itm.Find("CMAKE_GENERATOR")) + const char* gen = cachem->GetCacheEntryValue("CMAKE_GENERATOR"); + if (gen) { const char* extraGen = cachem ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: - CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : ""); + CreateFullGeneratorName(gen, extraGen? extraGen : ""); this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); } } @@ -195,33 +196,35 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) // set the value of properties cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - for(cmCacheManager::CacheIterator i = cachem->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = cachem->GetCacheEntryKeys(); + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - - if(i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC) + cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*it); + if(t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC) { continue; } QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); + prop.Key = QString::fromLocal8Bit(it->c_str()); int idx = props.indexOf(prop); if(idx == -1) { - toremove.append(QString::fromLocal8Bit(i.GetName().c_str())); + toremove.append(QString::fromLocal8Bit(it->c_str())); } else { prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - i.SetValue(prop.Value.toBool() ? "ON" : "OFF"); + cachem->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); } else { - i.SetValue(prop.Value.toString().toLocal8Bit().data()); + cachem->SetCacheEntryValue(*it, + prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); } @@ -279,42 +282,47 @@ QCMakePropertyList QCMake::properties() const QCMakePropertyList ret; cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - for(cmCacheManager::CacheIterator i = cachem->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = cachem->GetCacheEntryKeys(); + for (std::vector::const_iterator i = cacheKeys.begin(); + i != cacheKeys.end(); ++i) { - - if(i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED) + cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*i); + if(t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED) { continue; } - QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); - prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING")); - prop.Value = QString::fromLocal8Bit(i.GetValue().c_str()); - prop.Advanced = i.GetPropertyAsBool("ADVANCED"); + const char* cachedValue = cachem->GetCacheEntryValue(*i); - if(i.GetType() == cmCacheManager::BOOL) + QCMakeProperty prop; + prop.Key = QString::fromLocal8Bit(i->c_str()); + prop.Help = QString::fromLocal8Bit( + cachem->GetCacheEntryProperty(*i, "HELPSTRING")); + prop.Value = QString::fromLocal8Bit(cachedValue); + prop.Advanced = cachem->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); + if(t == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; - prop.Value = cmSystemTools::IsOn(i.GetValue().c_str()); + prop.Value = cmSystemTools::IsOn(cachedValue); } - else if(i.GetType() == cmCacheManager::PATH) + else if(t == cmCacheManager::PATH) { prop.Type = QCMakeProperty::PATH; } - else if(i.GetType() == cmCacheManager::FILEPATH) + else if(t == cmCacheManager::FILEPATH) { prop.Type = QCMakeProperty::FILEPATH; } - else if(i.GetType() == cmCacheManager::STRING) + else if(t == cmCacheManager::STRING) { prop.Type = QCMakeProperty::STRING; - if (i.PropertyExists("STRINGS")) + const char* stringsProperty = + cachem->GetCacheEntryProperty(*i, "STRINGS"); + if (stringsProperty) { - prop.Strings = QString::fromLocal8Bit(i.GetProperty("STRINGS")).split(";"); + prop.Strings = QString::fromLocal8Bit(stringsProperty).split(";"); } } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51890a7e0718c675c064520bb9fdf5710a062ef5 commit 51890a7e0718c675c064520bb9fdf5710a062ef5 Author: Stephen Kelly AuthorDate: Mon Apr 6 12:01:35 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 01:09:02 2015 +0200 Port CursesDialog to non-iterator cache API. diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 682f95f..4f028c4 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -18,6 +18,9 @@ #include "cmCursesFilePathWidget.h" #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" +#include "../cmake.h" + +#include cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( const std::string& key, @@ -32,7 +35,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( - const std::string& key, const cmCacheManager::CacheIterator& it, bool isNew, + const std::string& key, cmake *cm, bool isNew, int labelwidth, int entrywidth) : Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth) { @@ -47,11 +50,13 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - switch ( it.GetType() ) + const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); + assert(value); + switch (cm->GetCacheManager()->GetCacheEntryType(key)) { - case cmCacheManager::BOOL: + case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); - if (cmSystemTools::IsOn(it.GetValue().c_str())) + if (cmSystemTools::IsOn(value)) { static_cast(this->Entry)->SetValueAsBool(true); } @@ -62,40 +67,40 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( break; case cmCacheManager::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); break; case cmCacheManager::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); break; case cmCacheManager::STRING: - if(it.PropertyExists("STRINGS")) + { + const char* stringsProp = cm->GetCacheManager() + ->GetCacheEntryProperty(key, "STRINGS"); + if(stringsProp) { cmCursesOptionsWidget* ow = new cmCursesOptionsWidget(this->EntryWidth, 1, 1, 1); this->Entry = ow; std::vector options; - cmSystemTools::ExpandListArgument( - std::string(it.GetProperty("STRINGS")), options); + cmSystemTools::ExpandListArgument(stringsProp, options); for(std::vector::iterator si = options.begin(); si != options.end(); ++si) { ow->AddOption(*si); } - ow->SetOption(it.GetValue()); + ow->SetOption(value); } else { this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); } break; + } case cmCacheManager::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", - it.GetName().c_str()); + key.c_str()); break; default: // TODO : put warning message here diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index 7cdf13b..dc4ee4af 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -21,7 +21,7 @@ public: cmCursesCacheEntryComposite(const std::string& key, int labelwidth, int entrywidth); cmCursesCacheEntryComposite(const std::string& key, - const cmCacheManager::CacheIterator& it, + cmake *cm, bool isNew, int labelwidth, int entrywidth); ~cmCursesCacheEntryComposite(); const char* GetValue(); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 1217bda..833d540 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -111,13 +111,17 @@ void cmCursesMainForm::InitializeUI() // Count non-internal and non-static entries int count=0; - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = + this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys(); + + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - if ( i.GetType() != cmCacheManager::INTERNAL && - i.GetType() != cmCacheManager::STATIC && - i.GetType() != cmCacheManager::UNINITIALIZED) + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t != cmCacheManager::INTERNAL && + t != cmCacheManager::STATIC && + t != cmCacheManager::UNINITIALIZED) { ++count; } @@ -139,45 +143,49 @@ void cmCursesMainForm::InitializeUI() // Create the composites. // First add entries which are new - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - std::string key = i.GetName(); - if ( i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED ) + std::string key = *it; + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED ) { continue; } if (!this->LookForCacheEntry(key)) { - newEntries->push_back(new cmCursesCacheEntryComposite(key, i, - true, 30, - entrywidth)); + newEntries->push_back(new cmCursesCacheEntryComposite(key, + this->CMakeInstance, + true, 30, + entrywidth)); this->OkToGenerate = false; } } // then add entries which are old - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - std::string key = i.GetName(); - if ( i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED ) + std::string key = *it; + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED ) { continue; } if (this->LookForCacheEntry(key)) { - newEntries->push_back(new cmCursesCacheEntryComposite(key, i, - false, 30, - entrywidth)); + newEntries->push_back(new cmCursesCacheEntryComposite(key, + this->CMakeInstance, + false, 30, + entrywidth)); } } } @@ -216,10 +224,13 @@ void cmCursesMainForm::RePost() std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -245,10 +256,13 @@ void cmCursesMainForm::RePost() std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -314,10 +328,13 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -334,10 +351,13 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -495,11 +515,12 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the help string of the current entry // and add it to the help string - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField); - if (!it.IsAtEnd()) + const char* existingValue = + this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField); + if (existingValue) { - const char* hs = it.GetProperty("HELPSTRING"); + const char* hs = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryProperty(curField, "HELPSTRING"); if ( hs ) { strncpy(help, hs, 127); @@ -792,23 +813,28 @@ void cmCursesMainForm::FillCacheManagerFromUI() size_t size = this->Entries->size(); for(size_t i=0; i < size; i++) { - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator( - (*this->Entries)[i]->Key.c_str()); - if (!it.IsAtEnd()) + std::string cacheKey = (*this->Entries)[i]->Key; + const char* existingValue = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue(cacheKey); + if (existingValue) { - std::string oldValue = it.GetValue(); + std::string oldValue = existingValue; std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - this->FixValue(it.GetType(), oldValue, fixedOldValue); - this->FixValue(it.GetType(), newValue, fixedNewValue); + cmCacheManager::CacheEntryType t = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(cacheKey); + this->FixValue(t, oldValue, fixedOldValue); + this->FixValue(t, newValue, fixedNewValue); if(!(fixedOldValue == fixedNewValue)) { // The user has changed the value. Mark it as modified. - it.SetProperty("MODIFIED", true); - it.SetValue(fixedNewValue.c_str()); + this->CMakeInstance->GetCacheManager() + ->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true); + this->CMakeInstance->GetCacheManager() + ->SetCacheEntryValue(cacheKey, fixedNewValue); } } } @@ -1017,12 +1043,15 @@ void cmCursesMainForm::HandleInput() cmCursesWidget* lbl = reinterpret_cast(field_userptr( this->Fields[findex-2])); const char* curField = lbl->GetValue(); - const char* helpString=0; - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField); - if (!it.IsAtEnd()) + const char* helpString = 0; + + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue(curField); + if (existingValue) { - helpString = it.GetProperty("HELPSTRING"); + helpString = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryProperty(curField, "HELPSTRING"); } if (helpString) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d97c4da28d5ebde5d5c47aadec826367eebd238 commit 9d97c4da28d5ebde5d5c47aadec826367eebd238 Author: Stephen Kelly AuthorDate: Mon Apr 6 10:46:25 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 01:09:01 2015 +0200 cmMakefile: Port away from CacheEntry.Initialized. The API has no other external users. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b6eff3d..7c1b9c4 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1810,16 +1810,17 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, { bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; - cmCacheManager::CacheIterator it = - this->GetCacheManager()->GetCacheIterator(name.c_str()); - if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED) && - it.Initialized()) + const char* existingValue = + this->GetCacheManager()->GetInitializedCacheValue(name); + if(existingValue + && (this->GetCacheManager()->GetCacheEntryType(name) + == cmCacheManager::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in if(!force) { - val = it.GetValue(); + val = existingValue; haveVal = true; } if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) @@ -1842,7 +1843,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, } this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = it.GetValue(); + val = this->GetCacheManager()->GetInitializedCacheValue(name); haveVal = true; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b325419d12bbb51a3125f19d18302b49f0dc5c3 commit 0b325419d12bbb51a3125f19d18302b49f0dc5c3 Author: Stephen Kelly AuthorDate: Sun Apr 5 19:50:05 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 01:09:01 2015 +0200 cmCacheManager: Add non-iterator-based API. The iterator pattern is an unusual one for CMake, and it hinders refactoring all configuration-time data manipulation into a single class. diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 31d302a..a08006a 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -139,6 +139,83 @@ public: ///! Get a value from the cache given a key const char* GetInitializedCacheValue(const std::string& key) const; + const char* GetCacheEntryValue(const std::string& key) + { + cmCacheManager::CacheIterator it = this->GetCacheIterator(key.c_str()); + if (it.IsAtEnd()) + { + return 0; + } + static std::string value; + value = it.GetValue(); + return value.c_str(); + } + + const char* GetCacheEntryProperty(std::string const& key, + std::string const& propName) + { + return this->GetCacheIterator(key.c_str()).GetProperty(propName); + } + + CacheEntryType GetCacheEntryType(std::string const& key) + { + return this->GetCacheIterator(key.c_str()).GetType(); + } + + bool GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propName) + { + return this->GetCacheIterator(key.c_str()).GetPropertyAsBool(propName); + } + + void SetCacheEntryProperty(std::string const& key, + std::string const& propName, + std::string const& value) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, value.c_str()); + } + + void SetCacheEntryBoolProperty(std::string const& key, + std::string const& propName, + bool value) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, value); + } + + void SetCacheEntryValue(std::string const& key, + std::string const& value) + { + this->GetCacheIterator(key.c_str()).SetValue(value.c_str()); + } + + void RemoveCacheEntryProperty(std::string const& key, + std::string const& propName) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, (void*)0); + } + + void AppendCacheEntryProperty(std::string const& key, + std::string const& propName, + std::string const& value, + bool asString = false) + { + this->GetCacheIterator(key.c_str()).AppendProperty(propName, + value.c_str(), + asString); + } + + std::vector GetCacheEntryKeys() + { + std::vector definitions; + definitions.reserve(this->GetSize()); + cmCacheManager::CacheIterator cit = this->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + definitions.push_back(cit.GetName()); + } + return definitions; + } + /** Get the version of CMake that wrote the cache. */ unsigned int GetCacheMajorVersion() const { return this->CacheMajorVersion; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77f2807ce56491fab7637327564c7fb1033dadb1 commit 77f2807ce56491fab7637327564c7fb1033dadb1 Author: Stephen Kelly AuthorDate: Sun Apr 5 10:28:34 2015 +0200 Commit: Stephen Kelly CommitDate: Tue Apr 7 23:25:44 2015 +0200 cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue. Being initialized is a requirement for this method to return something, and is what differentiates it from using GetIterator with it.GetValue. diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 3df48d1..009d06e 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -117,7 +117,8 @@ void QCMake::setBinaryDirectory(const QString& _dir) } if ( itm.Find("CMAKE_GENERATOR")) { - const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR"); + const char* extraGen = cachem + ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : ""); this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index b8dfe04..5387d0c 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -283,14 +283,16 @@ bool cmCacheManager::LoadCache(const std::string& path, } this->CacheMajorVersion = 0; this->CacheMinorVersion = 0; - if(const char* cmajor = this->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION")) + if(const char* cmajor = + this->GetInitializedCacheValue("CMAKE_CACHE_MAJOR_VERSION")) { unsigned int v=0; if(sscanf(cmajor, "%u", &v) == 1) { this->CacheMajorVersion = v; } - if(const char* cminor = this->GetCacheValue("CMAKE_CACHE_MINOR_VERSION")) + if(const char* cminor = + this->GetInitializedCacheValue("CMAKE_CACHE_MINOR_VERSION")) { if(sscanf(cminor, "%u", &v) == 1) { @@ -312,10 +314,11 @@ bool cmCacheManager::LoadCache(const std::string& path, } // check to make sure the cache directory has not // been moved - if ( internal && this->GetCacheValue("CMAKE_CACHEFILE_DIR") ) + const char* oldDir = this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR"); + if (internal && oldDir) { std::string currentcwd = path; - std::string oldcwd = this->GetCacheValue("CMAKE_CACHEFILE_DIR"); + std::string oldcwd = oldDir; cmSystemTools::ConvertToUnixSlashes(currentcwd); currentcwd += "/CMakeCache.txt"; oldcwd += "/CMakeCache.txt"; @@ -324,7 +327,7 @@ bool cmCacheManager::LoadCache(const std::string& path, std::string message = std::string("The current CMakeCache.txt directory ") + currentcwd + std::string(" is different than the directory ") + - std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) + + std::string(this->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")) + std::string(" where CMakeCache.txt was created. This may result " "in binaries being created in the wrong place. If you " "are not sure, reedit the CMakeCache.txt"); @@ -654,7 +657,8 @@ cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator( return CacheIterator(*this, key); } -const char* cmCacheManager::GetCacheValue(const std::string& key) const +const char* +cmCacheManager::GetInitializedCacheValue(const std::string& key) const { CacheEntryMap::const_iterator i = this->Cache.find(key); if(i != this->Cache.end() && diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index f7f8776..31d302a 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -137,7 +137,7 @@ public: CacheEntryType& type); ///! Get a value from the cache given a key - const char* GetCacheValue(const std::string& key) const; + const char* GetInitializedCacheValue(const std::string& key) const; /** Get the version of CMake that wrote the cache. */ unsigned int GetCacheMajorVersion() const diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 747b7e4..99bf5f5 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -90,7 +90,8 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } if ( strcmp(key, "CACHE") == 0 ) { - if(const char* c = this->Makefile->GetCacheManager()->GetCacheValue(var)) + if(const char* c = this->Makefile->GetCacheManager() + ->GetInitializedCacheValue(var)) { if(this->EscapeQuotes) { diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 810ec57..0d32e4b 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -205,7 +205,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_"; cacheEntryName += envVar; - const char* cacheValue = mf->GetCacheManager()->GetCacheValue( + const char* cacheValue = mf->GetCacheManager()->GetInitializedCacheValue( cacheEntryName); // now we have both, decide which one to use diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 3c0a0e2..f23caa6 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -179,7 +179,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, return; } const char* cname = this->GetCMakeInstance()-> - GetCacheManager()->GetCacheValue(langComp); + GetCacheManager()->GetInitializedCacheValue(langComp); std::string changeVars; if(cname && !optional) { @@ -1641,7 +1641,7 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir, // and there is a good chance that the try compile stuff will // take the bulk of the time, so try and guess some progress // by getting closer and closer to 100 without actually getting there. - if (!this->CMakeInstance->GetCacheManager()->GetCacheValue + if (!this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS")) { // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set @@ -1839,7 +1839,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) // update progress // estimate how many lg there will be const char *numGenC = - this->CMakeInstance->GetCacheManager()->GetCacheValue + this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"); if (!numGenC) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ad4ad7c..b6eff3d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2432,7 +2432,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const this->Internal->VarUsageStack.top().insert(name); if(!def) { - def = this->GetCacheManager()->GetCacheValue(name); + def = this->GetCacheManager()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE if(cmVariableWatch* vv = this->GetVariableWatch()) @@ -2457,7 +2457,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const const char* def = this->Internal->VarStack.top().Get(name); if(!def) { - def = this->GetCacheManager()->GetCacheValue(name); + def = this->GetCacheManager()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); @@ -2835,7 +2835,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( value = cmSystemTools::GetEnv(lookup.c_str()); break; case CACHE: - value = this->GetCacheManager()->GetCacheValue(lookup); + value = this->GetCacheManager() + ->GetInitializedCacheValue(lookup); break; } // Get the string we're meant to append to. @@ -4903,7 +4904,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, (status == cmPolicies::WARN || status == cmPolicies::OLD)) { if(!(this->GetCacheManager() - ->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) + ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) { // Set it to 2.4 because that is the last version where the // variable had meaning. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e781417..210c0ef 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -344,7 +344,8 @@ bool cmake::SetCacheArgs(const std::vector& args) std::string cachedValue; if(this->WarnUnusedCli) { - if(const char *v = this->CacheManager->GetCacheValue(var)) + if(const char *v = this->CacheManager + ->GetInitializedCacheValue(var)) { haveValue = true; cachedValue = v; @@ -357,7 +358,8 @@ bool cmake::SetCacheArgs(const std::vector& args) if(this->WarnUnusedCli) { if (!haveValue || - cachedValue != this->CacheManager->GetCacheValue(var)) + cachedValue != this->CacheManager + ->GetInitializedCacheValue(var)) { this->WatchUnusedCli(var); } @@ -1203,10 +1205,10 @@ int cmake::DoPreConfigureChecks() } // do a sanity check on some values - if(this->CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY")) + if(this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY")) { std::string cacheStart = - this->CacheManager->GetCacheValue("CMAKE_HOME_DIRECTORY"); + this->CacheManager->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"); cacheStart += "/CMakeLists.txt"; std::string currentStart = this->GetHomeDirectory(); currentStart += "/CMakeLists.txt"; @@ -1355,9 +1357,9 @@ int cmake::ActualConfigure() if(!this->GlobalGenerator) { const char* genName = - this->CacheManager->GetCacheValue("CMAKE_GENERATOR"); + this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR"); const char* extraGenName = - this->CacheManager->GetCacheValue("CMAKE_EXTRA_GENERATOR"); + this->CacheManager->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); if(genName) { std::string fullName = cmExternalMakefileProjectGenerator:: @@ -1435,7 +1437,8 @@ int cmake::ActualConfigure() } } - const char* genName = this->CacheManager->GetCacheValue("CMAKE_GENERATOR"); + const char* genName = this->CacheManager + ->GetInitializedCacheValue("CMAKE_GENERATOR"); if(genName) { if(!this->GlobalGenerator->MatchesGeneratorName(genName)) @@ -1451,7 +1454,7 @@ int cmake::ActualConfigure() return -2; } } - if(!this->CacheManager->GetCacheValue("CMAKE_GENERATOR")) + if(!this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR")) { this->CacheManager->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName().c_str(), @@ -1464,7 +1467,7 @@ int cmake::ActualConfigure() } if(const char* platformName = - this->CacheManager->GetCacheValue("CMAKE_GENERATOR_PLATFORM")) + this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM")) { if(this->GeneratorPlatform.empty()) { @@ -1492,7 +1495,7 @@ int cmake::ActualConfigure() } if(const char* tsName = - this->CacheManager->GetCacheValue("CMAKE_GENERATOR_TOOLSET")) + this->CacheManager->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET")) { if(this->GeneratorToolset.empty()) { @@ -1546,16 +1549,18 @@ int cmake::ActualConfigure() // project requires compatibility with CMake 2.4. We detect this // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY // variable created when CMP0001 is not set to NEW. - if(this->GetCacheManager()->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) + if(this->GetCacheManager() + ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { - if(!this->CacheManager->GetCacheValue("LIBRARY_OUTPUT_PATH")) + if(!this->CacheManager->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) { this->CacheManager->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", cmCacheManager::PATH); } - if(!this->CacheManager->GetCacheValue("EXECUTABLE_OUTPUT_PATH")) + if(!this->CacheManager + ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) { this->CacheManager->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", @@ -1563,7 +1568,8 @@ int cmake::ActualConfigure() cmCacheManager::PATH); } } - if(!this->CacheManager->GetCacheValue("CMAKE_USE_RELATIVE_PATHS")) + if(!this->CacheManager + ->GetInitializedCacheValue("CMAKE_USE_RELATIVE_PATHS")) { this->CacheManager->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", @@ -1578,9 +1584,9 @@ int cmake::ActualConfigure() } if(cmSystemTools::GetFatalErrorOccured() && - (!this->CacheManager->GetCacheValue("CMAKE_MAKE_PROGRAM") || + (!this->CacheManager->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM") || cmSystemTools::IsOff(this->CacheManager-> - GetCacheValue("CMAKE_MAKE_PROGRAM")))) + GetInitializedCacheValue("CMAKE_MAKE_PROGRAM")))) { // We must have a bad generator selection. Wipe the cache entry so the // user can select another. @@ -1796,7 +1802,7 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, const char* cmake::GetCacheDefinition(const std::string& name) const { - return this->CacheManager->GetCacheValue(name); + return this->CacheManager->GetInitializedCacheValue(name); } void cmake::AddDefaultCommands() @@ -1956,7 +1962,8 @@ void cmake::UpdateConversionPathTable() { // Update the path conversion table with any specified file: const char* tablepath = - this->CacheManager->GetCacheValue("CMAKE_PATH_TRANSLATION_FILE"); + this->CacheManager + ->GetInitializedCacheValue("CMAKE_PATH_TRANSLATION_FILE"); if(tablepath) { @@ -2190,7 +2197,7 @@ void cmake::TruncateOutputLog(const char* fname) { return; } - if ( !this->CacheManager->GetCacheValue("CMAKE_CACHEFILE_DIR") ) + if ( !this->CacheManager->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR") ) { cmSystemTools::RemoveFile(fullPath); return; @@ -2469,7 +2476,7 @@ int cmake::GetSystemInformation(std::vector& args) // we have to find the module directory, so we can copy the files this->AddCMakePaths(); std::string modulesPath = - this->CacheManager->GetCacheValue("CMAKE_ROOT"); + this->CacheManager->GetInitializedCacheValue("CMAKE_ROOT"); modulesPath += "/Modules"; std::string inFile = modulesPath; inFile += "/SystemInformation.cmake"; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14973054a2f3954111789cda5e54c2e2e2175521 commit 14973054a2f3954111789cda5e54c2e2e2175521 Author: Stephen Kelly AuthorDate: Sun Apr 5 00:07:04 2015 +0200 Commit: Stephen Kelly CommitDate: Tue Apr 7 23:25:39 2015 +0200 Add API for cache loading, deleting and saving to the cmake class. Migrate existing users of the CacheManager API to use the new API. The CacheManager will be going away soon. diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 0827037..586070b 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -18,7 +18,6 @@ #include "cmGlobalGenerator.h" #include #include "cmCTestTestHandler.h" -#include "cmCacheManager.h" //---------------------------------------------------------------------- cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler() @@ -255,7 +254,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) cm.SetGeneratorToolset(this->BuildGeneratorToolset); // Load the cache to make CMAKE_MAKE_PROGRAM available. - cm.GetCacheManager()->LoadCache(this->BinaryDir); + cm.LoadCache(this->BinaryDir); } else { diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index d60062e..1217bda 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -639,7 +639,7 @@ int cmCursesMainForm::Configure(int noconfigure) // always save the current gui values to disk this->FillCacheManagerFromUI(); - this->CMakeInstance->GetCacheManager()->SaveCache( + this->CMakeInstance->SaveCache( this->CMakeInstance->GetHomeOutputDirectory()); this->LoadCache(0); diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 996aa75..3df48d1 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -96,7 +96,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) emit this->binaryDirChanged(this->BinaryDirectory); cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); this->setGenerator(QString()); - if(!this->CMakeInstance->GetCacheManager()->LoadCache( + if(!this->CMakeInstance->LoadCache( this->BinaryDirectory.toLocal8Bit().data())) { QDir testDir(this->BinaryDirectory); @@ -270,7 +270,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) } } - cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->SaveCache(this->BinaryDirectory.toLocal8Bit().data()); } QCMakePropertyList QCMake::properties() const @@ -397,9 +397,9 @@ QStringList QCMake::availableGenerators() const void QCMake::deleteCache() { // delete cache - this->CMakeInstance->GetCacheManager()->DeleteCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->DeleteCache(this->BinaryDirectory.toLocal8Bit().data()); // reload to make our cache empty - this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit no generator and no properties this->setGenerator(QString()); QCMakePropertyList props = this->properties(); @@ -412,7 +412,7 @@ void QCMake::reloadCache() QCMakePropertyList props; emit this->propertiesChanged(props); // reload - this->CMakeInstance->GetCacheManager()->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); + this->CMakeInstance->LoadCache(this->BinaryDirectory.toLocal8Bit().data()); // emit new cache properties props = this->properties(); emit this->propertiesChanged(props); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index df61fe6..1db057b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2281,7 +2281,7 @@ bool cmCTest::AddVariableDefinition(const std::string &arg) std::string value; cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; - if (cmCacheManager::ParseEntry(arg, name, value, type)) + if (cmake::ParseCacheEntry(arg, name, value, type)) { this->Definitions[name] = value; return true; diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index d64b0d7..810ec57 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -223,7 +223,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), cacheEntryName.c_str(), cmCacheManager::STRING, true); - mf->GetCacheManager()->SaveCache(mf->GetHomeOutputDirectory()); + mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } else if (envVarValue==0 && cacheValue!=0) { @@ -244,7 +244,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), cacheEntryName.c_str(), cmCacheManager::STRING, true); - mf->GetCacheManager()->SaveCache(mf->GetHomeOutputDirectory()); + mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 5e584a4..0561a05 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3703,7 +3703,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root, // Since this call may have created new cache entries, save the cache: // - root->GetMakefile()->GetCacheManager()->SaveCache( + root->GetMakefile()->GetCMakeInstance()->SaveCache( root->GetMakefile()->GetHomeOutputDirectory()); } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 93aec32..e2ae901 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -81,8 +81,8 @@ bool cmLoadCacheCommand { break; } - this->Makefile->GetCacheManager()->LoadCache(args[i], false, - excludes, includes); + this->Makefile->GetCMakeInstance()->LoadCache(args[i], false, + excludes, includes); } @@ -173,7 +173,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) std::string var; std::string value; cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; - if(cmCacheManager::ParseEntry(line, var, value, type)) + if(cmake::ParseCacheEntry(line, var, value, type)) { // Found a real entry. See if this one was requested. if(this->VariablesToRead.find(var) != this->VariablesToRead.end()) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5c52a1a..e781417 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -917,7 +917,7 @@ void cmake::SetDirectoriesFromFile(const char* arg) { cmCacheManager* cachem = this->GetCacheManager(); cmCacheManager::CacheIterator it = cachem->NewIterator(); - if(cachem->LoadCache(cachePath) && + if(this->LoadCache(cachePath) && it.Find("CMAKE_HOME_DIRECTORY")) { this->SetHomeOutputDirectory(cachePath); @@ -1860,10 +1860,18 @@ void cmake::AddDefaultGenerators() #endif } +bool cmake::ParseCacheEntry(const std::string& entry, + std::string& var, + std::string& value, + cmCacheManager::CacheEntryType& type) +{ + return cmCacheManager::ParseEntry(entry, var, value, type); +} + int cmake::LoadCache() { // could we not read the cache - if (!this->CacheManager->LoadCache(this->GetHomeOutputDirectory())) + if (!this->LoadCache(this->GetHomeOutputDirectory())) { // if it does exist, but isn't readable then warn the user std::string cacheFile = this->GetHomeOutputDirectory(); @@ -1886,6 +1894,28 @@ int cmake::LoadCache() return 0; } +bool cmake::LoadCache(const std::string& path) +{ + return this->CacheManager->LoadCache(path); +} + +bool cmake::LoadCache(const std::string& path, bool internal, + std::set& excludes, + std::set& includes) +{ + return this->CacheManager->LoadCache(path, internal, excludes, includes); +} + +bool cmake::SaveCache(const std::string& path) +{ + return this->CacheManager->SaveCache(path); +} + +bool cmake::DeleteCache(const std::string& path) +{ + return this->CacheManager->DeleteCache(path); +} + void cmake::SetProgressCallback(ProgressCallbackType f, void *cd) { this->ProgressCallback = f; @@ -2764,9 +2794,8 @@ int cmake::Build(const std::string& dir, } std::string cachePath = dir; cmSystemTools::ConvertToUnixSlashes(cachePath); - cmCacheManager* cachem = this->GetCacheManager(); - cmCacheManager::CacheIterator it = cachem->NewIterator(); - if(!cachem->LoadCache(cachePath)) + cmCacheManager::CacheIterator it = this->GetCacheManager()->NewIterator(); + if(!this->LoadCache(cachePath)) { std::cerr << "Error: could not load cache\n"; return 1; diff --git a/Source/cmake.h b/Source/cmake.h index c22b329..3acf4a8 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -18,11 +18,11 @@ #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" #include "cmInstalledFile.h" +#include "cmCacheManager.h" class cmGlobalGeneratorFactory; class cmGlobalGenerator; class cmLocalGenerator; -class cmCacheManager; class cmMakefile; class cmCommand; class cmVariableWatch; @@ -173,7 +173,19 @@ class cmake int Configure(); int ActualConfigure(); + ///! Break up a line like VAR:type="value" into var, type and value + static bool ParseCacheEntry(const std::string& entry, + std::string& var, + std::string& value, + cmCacheManager::CacheEntryType& type); + int LoadCache(); + bool LoadCache(const std::string& path); + bool LoadCache(const std::string& path, bool internal, + std::set& excludes, + std::set& includes); + bool SaveCache(const std::string& path); + bool DeleteCache(const std::string& path); void PreLoadCMakeFiles(); ///! Create a GlobalGenerator http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f2c12ebd196f3d23aa40d85c965654dbc36d0ad commit 1f2c12ebd196f3d23aa40d85c965654dbc36d0ad Author: Stephen Kelly AuthorDate: Mon Apr 6 13:32:00 2015 +0200 Commit: Stephen Kelly CommitDate: Tue Apr 7 23:25:35 2015 +0200 cmMakefile: Remove cache version accessors. They are only used by legacy code. Inline them there to simplify cmMakefile. diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 691d80d..987a7b1 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -51,12 +51,14 @@ void CCONV cmSetError(void *info, const char *err) unsigned int CCONV cmGetCacheMajorVersion(void *arg) { cmMakefile *mf = static_cast(arg); - return mf->GetCacheMajorVersion(); + cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager(); + return manager->GetCacheMajorVersion(); } unsigned int CCONV cmGetCacheMinorVersion(void *arg) { cmMakefile *mf = static_cast(arg); - return mf->GetCacheMinorVersion(); + cmCacheManager *manager = mf->GetCMakeInstance()->GetCacheManager(); + return manager->GetCacheMinorVersion(); } unsigned int CCONV cmGetMajorVersion(void *) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7f44da2..ad4ad7c 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -174,16 +174,6 @@ void cmMakefile::Initialize() this->CheckCMP0000 = false; } -unsigned int cmMakefile::GetCacheMajorVersion() const -{ - return this->GetCacheManager()->GetCacheMajorVersion(); -} - -unsigned int cmMakefile::GetCacheMinorVersion() const -{ - return this->GetCacheManager()->GetCacheMinorVersion(); -} - cmMakefile::~cmMakefile() { cmDeleteAll(this->InstallGenerators); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 920b6b7..5209891 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -62,14 +62,6 @@ class cmMakefile class Internals; cmsys::auto_ptr Internal; public: - /** - * Return the major and minor version of the cmake that - * was used to write the currently loaded cache, note - * this method will not work before the cache is loaded. - */ - unsigned int GetCacheMajorVersion() const; - unsigned int GetCacheMinorVersion() const; - /* Check for unused variables in this scope */ void CheckForUnusedVariables() const; /* Mark a variable as used */ diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index ee1ff29..2799a9b 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -52,11 +52,13 @@ bool cmUtilitySourceCommand } else { + cmCacheManager *manager = + this->Makefile->GetCMakeInstance()->GetCacheManager(); haveCacheValue = (cacheValue && (strstr(cacheValue, "(IntDir)") == 0 || (intDir && strcmp(intDir, "$(IntDir)") == 0)) && - (this->Makefile->GetCacheMajorVersion() != 0 && - this->Makefile->GetCacheMinorVersion() != 0 )); + (manager->GetCacheMajorVersion() != 0 && + manager->GetCacheMinorVersion() != 0 )); } if(haveCacheValue) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97c50a8dbd9f1ca5026f60e4a224e9a087e01f0e commit 97c50a8dbd9f1ca5026f60e4a224e9a087e01f0e Author: Stephen Kelly AuthorDate: Mon Apr 6 12:30:21 2015 +0200 Commit: Stephen Kelly CommitDate: Tue Apr 7 23:25:31 2015 +0200 cmMakefile: Simplify GetDefinitions implementation. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 215ee16..7f44da2 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2501,20 +2501,20 @@ const char* cmMakefile::GetSafeDefinition(const std::string& def) const std::vector cmMakefile ::GetDefinitions(int cacheonly /* = 0 */) const { - std::set definitions; + std::vector res; if ( !cacheonly ) { - definitions = this->Internal->VarStack.top().ClosureKeys(); + std::set definitions = + this->Internal->VarStack.top().ClosureKeys(); + res.insert(res.end(), definitions.begin(), definitions.end()); } cmCacheManager::CacheIterator cit = this->GetCacheManager()->GetCacheIterator(); for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) { - definitions.insert(cit.GetName()); + res.push_back(cit.GetName()); } - - std::vector res; - res.insert(res.end(), definitions.begin(), definitions.end()); + std::sort(res.begin(), res.end()); return res; } ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestBuildAndTestHandler.cxx | 3 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 35 +++-- Source/CursesDialog/cmCursesCacheEntryComposite.h | 2 +- Source/CursesDialog/cmCursesMainForm.cxx | 151 +++++++++++------- Source/QtDialog/QCMake.cxx | 85 +++++----- Source/cmCPluginAPI.cxx | 6 +- Source/cmCTest.cxx | 2 +- Source/cmCacheManager.cxx | 16 +- Source/cmCacheManager.h | 79 +++++++++- Source/cmCommandArgumentParserHelper.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 6 +- Source/cmFindBase.cxx | 13 +- Source/cmGetPropertyCommand.cxx | 7 +- Source/cmGlobalGenerator.cxx | 14 +- Source/cmGlobalXCodeGenerator.cxx | 2 +- Source/cmLoadCacheCommand.cxx | 6 +- Source/cmMakefile.cxx | 54 +++---- Source/cmMakefile.h | 8 - Source/cmMarkAsAdvancedCommand.cxx | 15 +- Source/cmOptionCommand.cxx | 12 +- Source/cmSetCommand.cxx | 7 +- Source/cmSetPropertyCommand.cxx | 19 ++- Source/cmSetPropertyCommand.h | 2 +- Source/cmTryRunCommand.cxx | 19 ++- Source/cmUtilitySourceCommand.cxx | 6 +- Source/cmVariableRequiresCommand.cxx | 6 +- Source/cmake.cxx | 166 ++++++++++++-------- Source/cmake.h | 14 +- Source/cmakemain.cxx | 26 +-- 29 files changed, 473 insertions(+), 311 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 08:47:39 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 08:47:39 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1608-gdbc20bf Message-ID: <20150408124739.471FFACD52@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via dbc20bf6b1c994b8cc5d8009928f7e9041bd9431 (commit) via 1e3843373f8e0dfd550809ec034d535d31276b6b (commit) from bf53173a0d19d025fe21e53091a2efe6b1c62a21 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dbc20bf6b1c994b8cc5d8009928f7e9041bd9431 commit dbc20bf6b1c994b8cc5d8009928f7e9041bd9431 Merge: bf53173 1e38433 Author: Brad King AuthorDate: Wed Apr 8 08:47:38 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 08:47:38 2015 -0400 Merge topic 'cmake-command-line-help-vs-arch' into next 1e384337 cmake: Show in --help how to select VS target platform (#15422) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e3843373f8e0dfd550809ec034d535d31276b6b commit 1e3843373f8e0dfd550809ec034d535d31276b6b Author: Brad King AuthorDate: Tue Apr 7 16:33:05 2015 -0400 Commit: Brad King CommitDate: Tue Apr 7 16:47:53 2015 -0400 cmake: Show in --help how to select VS target platform (#15422) * Re-order VS generators from newest to oldest. * Show how to specify a VS generator with a target platform * Increase the option output indentation to avoid extra wrapping with longer generator names. diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 4de59c0..6869e2f 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -204,7 +204,7 @@ void cmDocumentationFormatter if(!op->Name.empty()) { os << " " << op->Name; - this->TextIndent = " "; + this->TextIndent = " "; int align = static_cast(strlen(this->TextIndent))-4; for(int i = static_cast(op->Name.size()); i < align; ++i) { diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 18d40e1..1c6ac88 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -71,8 +71,11 @@ public: virtual void GetDocumentation(cmDocumentationEntry& entry) const { - entry.Name = vs10generatorName; - entry.Brief = "Generates Visual Studio 10 (VS 2010) project files."; + entry.Name = std::string(vs10generatorName) + " [arch]"; + entry.Brief = + "Generates Visual Studio 2010 project files. " + "Optional [arch] can be \"Win64\" or \"IA64\"." + ; } virtual void GetGenerators(std::vector& names) const diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index ed828b6..5d3ae16 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -78,8 +78,11 @@ public: virtual void GetDocumentation(cmDocumentationEntry& entry) const { - entry.Name = vs11generatorName; - entry.Brief = "Generates Visual Studio 11 (VS 2012) project files."; + entry.Name = std::string(vs11generatorName) + " [arch]"; + entry.Brief = + "Generates Visual Studio 2012 project files. " + "Optional [arch] can be \"Win64\" or \"ARM\"." + ; } virtual void GetGenerators(std::vector& names) const diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index c2e6f47..e70e082 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -66,8 +66,11 @@ public: virtual void GetDocumentation(cmDocumentationEntry& entry) const { - entry.Name = vs12generatorName; - entry.Brief = "Generates Visual Studio 12 (VS 2013) project files."; + entry.Name = std::string(vs12generatorName) + " [arch]"; + entry.Brief = + "Generates Visual Studio 2013 project files. " + "Optional [arch] can be \"Win64\" or \"ARM\"." + ; } virtual void GetGenerators(std::vector& names) const diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index b551c65..7b1dd24 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -66,8 +66,11 @@ public: virtual void GetDocumentation(cmDocumentationEntry& entry) const { - entry.Name = vs14generatorName; - entry.Brief = "Generates Visual Studio 14 (VS 2015) project files."; + entry.Name = std::string(vs14generatorName) + " [arch]"; + entry.Brief = + "Generates Visual Studio 2015 project files. " + "Optional [arch] can be \"Win64\" or \"ARM\"." + ; } virtual void GetGenerators(std::vector& names) const diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index e6ce45d..726db0f 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -66,8 +66,11 @@ public: } virtual void GetDocumentation(cmDocumentationEntry& entry) const { - entry.Name = vs8generatorName; - entry.Brief = "Generates Visual Studio 8 2005 project files."; + entry.Name = std::string(vs8generatorName) + " [arch]"; + entry.Brief = + "Generates Visual Studio 2005 project files. " + "Optional [arch] can be \"Win64\"." + ; } virtual void GetGenerators(std::vector& names) const { diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index 1d73b5c..1bc627f 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -70,8 +70,11 @@ public: } virtual void GetDocumentation(cmDocumentationEntry& entry) const { - entry.Name = vs9generatorName; - entry.Brief = "Generates Visual Studio 9 2008 project files."; + entry.Name = std::string(vs9generatorName) + " [arch]"; + entry.Brief = + "Generates Visual Studio 2008 project files. " + "Optional [arch] can be \"Win64\" or \"IA64\"." + ; } virtual void GetGenerators(std::vector& names) const { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5c52a1a..05cfea8 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1817,23 +1817,23 @@ void cmake::AddDefaultGenerators() #if defined(_WIN32) && !defined(__CYGWIN__) # if !defined(CMAKE_BOOT_MINGW) this->Generators.push_back( - cmGlobalVisualStudio6Generator::NewFactory()); - this->Generators.push_back( - cmGlobalVisualStudio7Generator::NewFactory()); + cmGlobalVisualStudio14Generator::NewFactory()); this->Generators.push_back( - cmGlobalVisualStudio10Generator::NewFactory()); + cmGlobalVisualStudio12Generator::NewFactory()); this->Generators.push_back( cmGlobalVisualStudio11Generator::NewFactory()); this->Generators.push_back( - cmGlobalVisualStudio12Generator::NewFactory()); + cmGlobalVisualStudio10Generator::NewFactory()); this->Generators.push_back( - cmGlobalVisualStudio14Generator::NewFactory()); + cmGlobalVisualStudio9Generator::NewFactory()); + this->Generators.push_back( + cmGlobalVisualStudio8Generator::NewFactory()); this->Generators.push_back( cmGlobalVisualStudio71Generator::NewFactory()); this->Generators.push_back( - cmGlobalVisualStudio8Generator::NewFactory()); + cmGlobalVisualStudio7Generator::NewFactory()); this->Generators.push_back( - cmGlobalVisualStudio9Generator::NewFactory()); + cmGlobalVisualStudio6Generator::NewFactory()); this->Generators.push_back( cmGlobalBorlandMakefileGenerator::NewFactory()); this->Generators.push_back( ----------------------------------------------------------------------- Summary of changes: Source/cmDocumentationFormatter.cxx | 2 +- Source/cmGlobalVisualStudio10Generator.cxx | 7 +++++-- Source/cmGlobalVisualStudio11Generator.cxx | 7 +++++-- Source/cmGlobalVisualStudio12Generator.cxx | 7 +++++-- Source/cmGlobalVisualStudio14Generator.cxx | 7 +++++-- Source/cmGlobalVisualStudio8Generator.cxx | 7 +++++-- Source/cmGlobalVisualStudio9Generator.cxx | 7 +++++-- Source/cmake.cxx | 16 ++++++++-------- 8 files changed, 39 insertions(+), 21 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 09:06:17 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 09:06:17 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1611-g7f0d8f2 Message-ID: <20150408130617.47457AE026@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7f0d8f29b814a77168f1df22030ddb161972759a (commit) via 9b6eeb719ca761217daa585cf63515f4abf9f579 (commit) via c552073c3057bdfc14c756360810c8bb0f3b1835 (commit) from dbc20bf6b1c994b8cc5d8009928f7e9041bd9431 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f0d8f29b814a77168f1df22030ddb161972759a commit 7f0d8f29b814a77168f1df22030ddb161972759a Merge: dbc20bf 9b6eeb7 Author: Brad King AuthorDate: Wed Apr 8 09:06:16 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 09:06:16 2015 -0400 Merge topic 'emulator-property' into next 9b6eeb71 fixup! try_run: Use CMAKE_CROSSCOMPILING_EMULATOR. c552073c Help: Add notes for topic 'emulator-property' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b6eeb719ca761217daa585cf63515f4abf9f579 commit 9b6eeb719ca761217daa585cf63515f4abf9f579 Author: Brad King AuthorDate: Wed Apr 8 09:05:42 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 09:05:42 2015 -0400 fixup! try_run: Use CMAKE_CROSSCOMPILING_EMULATOR. diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst index 43ee219..e3bd57d 100644 --- a/Help/command/try_run.rst +++ b/Help/command/try_run.rst @@ -73,7 +73,8 @@ When cross compiling, the executable compiled in the first step usually cannot be run on the build host. The ``try_run`` command checks the :variable:`CMAKE_CROSSCOMPILING` variable to detect whether CMake is in cross-compiling mode. If that is the case, it will still try to compile -the executable, but it will not try to run the executable. Instead it +the executable, but it will not try to run the executable unless the +:variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable is set. Instead it will create cache variables which must be filled by the user or by presetting them in some CMake script file to the values the executable would have produced if it had been run on its actual target platform. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c552073c3057bdfc14c756360810c8bb0f3b1835 commit c552073c3057bdfc14c756360810c8bb0f3b1835 Author: Brad King AuthorDate: Wed Apr 8 09:03:45 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 09:03:45 2015 -0400 Help: Add notes for topic 'emulator-property' diff --git a/Help/release/dev/emulator-property.rst b/Help/release/dev/emulator-property.rst new file mode 100644 index 0000000..1bc2f2d --- /dev/null +++ b/Help/release/dev/emulator-property.rst @@ -0,0 +1,7 @@ +emulator-property +----------------- + +* A :prop_tgt:`CROSSCOMPILING_EMULATOR` target property and supporting + :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable were introduced + to allow target platform binaries to run on the host during cross + compiling. ----------------------------------------------------------------------- Summary of changes: Help/command/try_run.rst | 3 ++- Help/release/dev/emulator-property.rst | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 Help/release/dev/emulator-property.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 09:06:42 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 09:06:42 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1615-g0cc3714 Message-ID: <20150408130642.A1DDFAE02F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0cc3714f771d042fe92ecd5479e555c0fe83b645 (commit) via 1975d53ae19c46ee4f7384cc96be355f7e94df61 (commit) via 9160d6c241adaeacc106d5b2ce4530f223345f22 (commit) via e942526b3d9e886da4ce832d9d3adb99cc5ede2f (commit) from 7f0d8f29b814a77168f1df22030ddb161972759a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0cc3714f771d042fe92ecd5479e555c0fe83b645 commit 0cc3714f771d042fe92ecd5479e555c0fe83b645 Merge: 7f0d8f2 1975d53 Author: Brad King AuthorDate: Wed Apr 8 09:06:41 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 09:06:41 2015 -0400 Merge topic 'emulator-property' into next 1975d53a Help: Add notes for topic 'emulator-property' 9160d6c2 TestGenerator: Add CROSSCOMPILING_EMULATOR support. e942526b try_run: Use CMAKE_CROSSCOMPILING_EMULATOR. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1975d53ae19c46ee4f7384cc96be355f7e94df61 commit 1975d53ae19c46ee4f7384cc96be355f7e94df61 Author: Brad King AuthorDate: Wed Apr 8 09:03:45 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 09:06:22 2015 -0400 Help: Add notes for topic 'emulator-property' diff --git a/Help/release/dev/emulator-property.rst b/Help/release/dev/emulator-property.rst new file mode 100644 index 0000000..1bc2f2d --- /dev/null +++ b/Help/release/dev/emulator-property.rst @@ -0,0 +1,7 @@ +emulator-property +----------------- + +* A :prop_tgt:`CROSSCOMPILING_EMULATOR` target property and supporting + :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable were introduced + to allow target platform binaries to run on the host during cross + compiling. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9160d6c241adaeacc106d5b2ce4530f223345f22 commit 9160d6c241adaeacc106d5b2ce4530f223345f22 Author: Matt McCormick AuthorDate: Sat Mar 28 22:05:35 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 09:06:22 2015 -0400 TestGenerator: Add CROSSCOMPILING_EMULATOR support. Prefix test commands with the CROSSCOMPILING_EMULATOR property for target executables. This allows test suites to be run on the host when crosscompiling. diff --git a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst index 2b5fd4d..3ef8e03 100644 --- a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst +++ b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst @@ -1,4 +1,6 @@ CROSSCOMPILING_EMULATOR ----------------------- -Use the given emulator to run executables created when crosscompiling. +Use the given emulator to run executables created when crosscompiling. This +command will be added as a prefix to :command:`add_test` test commands for +built target system executables. diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index f87a535..add80fa 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -82,11 +82,31 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, // be translated. std::string exe = command[0]; cmMakefile* mf = this->Test->GetMakefile(); + cmLocalGenerator* lg = mf->GetLocalGenerator(); cmTarget* target = mf->FindTargetToUse(exe); if(target && target->GetType() == cmTarget::EXECUTABLE) { // Use the target file on disk. exe = target->GetFullPath(config); + + // Prepend with the emulator when cross compiling if required. + const char * emulator = + target->GetProperty("CROSSCOMPILING_EMULATOR"); + if (emulator != 0) + { + std::vector emulatorWithArgs; + cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); + std::string emulatorExe(emulatorWithArgs[0]); + cmSystemTools::ConvertToUnixSlashes(emulatorExe); + os << lg->EscapeForCMake(emulatorExe) << " "; + for(std::vector::const_iterator ei = + emulatorWithArgs.begin()+1; + ei != emulatorWithArgs.end(); + ++ei) + { + os << lg->EscapeForCMake(*ei) << " "; + } + } } else { @@ -96,7 +116,6 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, } // Generate the command line with full escapes. - cmLocalGenerator* lg = mf->GetLocalGenerator(); os << lg->EscapeForCMake(exe); for(std::vector::const_iterator ci = command.begin()+1; ci != command.end(); ++ci) diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake new file mode 100644 index 0000000..0aae06c --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake @@ -0,0 +1,12 @@ +set(testfile "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake") +if(EXISTS "${testfile}") + file(READ "${testfile}" testfile_contents) +else() + message(FATAL_ERROR "Could not find expected CTestTestfile.cmake.") +endif() +if(testfile_contents MATCHES "add_test[(]DoesNotUseEmulator ^(pseudo_emulator)+$") + message(SEND_ERROR "Used emulator when it should not be used.") +endif() +if(NOT testfile_contents MATCHES "add_test[(]UsesEmulator .+pseudo_emulator.+$") + message(SEND_ERROR "Did not use emulator when it should be used.") +endif() diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake new file mode 100644 index 0000000..41850f2 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake @@ -0,0 +1,8 @@ +set(CMAKE_CROSSCOMPILING 1) +enable_testing() +add_test(NAME DoesNotUseEmulator + COMMAND ${CMAKE_COMMAND} -E echo "Hi") + +add_executable(generated_exe simple_src.cxx) +add_test(NAME UsesEmulator + COMMAND generated_exe) diff --git a/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in b/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in new file mode 100644 index 0000000..c95fd8b --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in @@ -0,0 +1 @@ +CMAKE_EMULATOR:STRING=@PSEUDO_EMULATOR@ diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake index 04fb7db..2581cfc 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -5,3 +5,4 @@ set(RunCMake_TEST_OPTIONS run_cmake(CrosscompilingEmulatorProperty) run_cmake(TryRun) +run_cmake(AddTest) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e942526b3d9e886da4ce832d9d3adb99cc5ede2f commit e942526b3d9e886da4ce832d9d3adb99cc5ede2f Author: Matt McCormick AuthorDate: Sat Mar 28 14:18:38 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 09:06:22 2015 -0400 try_run: Use CMAKE_CROSSCOMPILING_EMULATOR. If the CMAKE_CROSSCOMPILING_EMULATOR variable is defined, and CMAKE_CROSSCOMPILING is TRUE, then use CMAKE_CROSSCOMPILING_EMULATOR to run the try_run executables. This prevents the need to populate TryRunResults.cmake when cross compiling. diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst index 43ee219..e3bd57d 100644 --- a/Help/command/try_run.rst +++ b/Help/command/try_run.rst @@ -73,7 +73,8 @@ When cross compiling, the executable compiled in the first step usually cannot be run on the build host. The ``try_run`` command checks the :variable:`CMAKE_CROSSCOMPILING` variable to detect whether CMake is in cross-compiling mode. If that is the case, it will still try to compile -the executable, but it will not try to run the executable. Instead it +the executable, but it will not try to run the executable unless the +:variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable is set. Instead it will create cache variables which must be filled by the user or by presetting them in some CMake script file to the values the executable would have produced if it had been run on its actual target platform. diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst index fa6f1b7..95d2c7f 100644 --- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst +++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -1,5 +1,12 @@ CMAKE_CROSSCOMPILING_EMULATOR ----------------------------- -Default value for the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property of -executables. See that target property for additional information. +This variable is only used when :variable:`CMAKE_CROSSCOMPILING` is on. It +should point to a command on the host system that can run executable built +for the target system. + +The command will be used to run :command:`try_run` generated executables, +which avoids manual population of the TryRunResults.cmake file. + +It is also used as the default value for the +:prop_tgt:`CROSSCOMPILING_EMULATOR` target property of executables. diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index b5280cf..8b68d64 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -149,7 +149,8 @@ bool cmTryRunCommand { // "run" it and capture the output std::string runOutputContents; - if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING")) + if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING") && + !this->Makefile->IsDefinitionSet("CMAKE_CROSSCOMPILING_EMULATOR")) { this->DoNotRunExecutable(runArgs, argv[3], @@ -195,7 +196,28 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, std::string* out) { int retVal = -1; - std::string finalCommand = cmSystemTools::ConvertToRunCommandPath( + + std::string finalCommand; + const std::string emulator = + this->Makefile->GetSafeDefinition("CMAKE_CROSSCOMPILING_EMULATOR"); + if (!emulator.empty()) + { + std::vector emulatorWithArgs; + cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs); + finalCommand += cmSystemTools::ConvertToRunCommandPath( + emulatorWithArgs[0].c_str()); + finalCommand += " "; + for (std::vector::const_iterator ei = + emulatorWithArgs.begin()+1; + ei != emulatorWithArgs.end(); ++ei) + { + finalCommand += "\""; + finalCommand += *ei; + finalCommand += "\""; + finalCommand += " "; + } + } + finalCommand += cmSystemTools::ConvertToRunCommandPath( this->OutputFile.c_str()); if (!runArgs.empty()) { diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake index cecc57f..04fb7db 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake +++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake @@ -4,3 +4,4 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSSCOMPILING_EMULATOR=${PSEUDO_EMULATOR}") run_cmake(CrosscompilingEmulatorProperty) +run_cmake(TryRun) diff --git a/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt b/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt new file mode 100644 index 0000000..d012974 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt @@ -0,0 +1 @@ +run_result: 42 diff --git a/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake b/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake new file mode 100644 index 0000000..4851cc7 --- /dev/null +++ b/Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake @@ -0,0 +1,18 @@ +set(CMAKE_CROSSCOMPILING 1) + +try_run(run_result compile_result + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/simple_src.cxx + RUN_OUTPUT_VARIABLE run_output) + +message(STATUS "run_output: ${run_output}") +message(STATUS "run_result: ${run_result}") + +set(CMAKE_CROSSCOMPILING_EMULATOR ${CMAKE_CROSSCOMPILING_EMULATOR} + --flag + "multi arg") +try_run(run_result compile_result + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/simple_src.cxx + RUN_OUTPUT_VARIABLE run_output) +message(STATUS "Emulator with arguments run_output: ${run_output}") diff --git a/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx index 630adc6..e5e94f2 100644 --- a/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx +++ b/Tests/RunCMake/CrosscompilingEmulator/simple_src.cxx @@ -1,4 +1,4 @@ int main(int, char **) { - return 0; + return 13; } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 09:07:00 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 09:07:00 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-668-g710968e Message-ID: <20150408130700.D1154AE034@public.kitware.com> This is an automated email from 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 710968e37171681cb32e74d6249a4fd7daacf42e (commit) via dfd6f1f2904ca577743adb5f86f1722359723a0b (commit) from bddd8c055104d7c66b01799a4c99a2bbb6da8f00 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=710968e37171681cb32e74d6249a4fd7daacf42e commit 710968e37171681cb32e74d6249a4fd7daacf42e Merge: bddd8c0 dfd6f1f Author: Brad King AuthorDate: Wed Apr 8 09:06:59 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 09:06:59 2015 -0400 Merge topic 'xcode-quote-path' dfd6f1f2 Xcode: Also quote strings containing // (#15487) ----------------------------------------------------------------------- Summary of changes: Source/cmXCodeObject.cxx | 1 + Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 1 + Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote-check.cmake | 7 +++++++ Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote.cmake | 3 +++ .../RunCMake/XcodeProject/someFileWithoutSpecialChars | 0 5 files changed, 12 insertions(+) create mode 100644 Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote-check.cmake create mode 100644 Tests/RunCMake/XcodeProject/XcodeObjectNeedsQuote.cmake copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/XcodeProject/someFileWithoutSpecialChars (100%) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 09:07:02 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 09:07:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-670-g37ce091 Message-ID: <20150408130702.ADC30AE039@public.kitware.com> This is an automated email from 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 37ce091345f6e9ad57aff7a768cc3dc35ebc3913 (commit) via 322cdc48252e17501866a7177e89ca20a3cb583b (commit) from 710968e37171681cb32e74d6249a4fd7daacf42e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37ce091345f6e9ad57aff7a768cc3dc35ebc3913 commit 37ce091345f6e9ad57aff7a768cc3dc35ebc3913 Merge: 710968e 322cdc4 Author: Brad King AuthorDate: Wed Apr 8 09:07:01 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 09:07:01 2015 -0400 Merge topic 'document_supported_compiler_feature_compilers' 322cdc48 Help: Document supported compilers in cmake-compile-features.7 ----------------------------------------------------------------------- Summary of changes: Help/command/target_compile_features.rst | 2 +- Help/manual/cmake-compile-features.7.rst | 14 ++++++++++++++ Help/manual/cmake-generator-expressions.7.rst | 2 +- Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 2 +- Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst | 2 +- Help/prop_tgt/COMPILE_FEATURES.rst | 2 +- Help/prop_tgt/CXX_EXTENSIONS.rst | 2 +- Help/prop_tgt/CXX_STANDARD.rst | 2 +- Help/prop_tgt/CXX_STANDARD_REQUIRED.rst | 2 +- Help/prop_tgt/C_EXTENSIONS.rst | 2 +- Help/prop_tgt/C_STANDARD.rst | 2 +- Help/prop_tgt/C_STANDARD_REQUIRED.rst | 2 +- Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst | 2 +- Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst | 2 +- Help/variable/CMAKE_CXX_EXTENSIONS.rst | 2 +- Help/variable/CMAKE_CXX_STANDARD.rst | 2 +- Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst | 2 +- Help/variable/CMAKE_C_COMPILE_FEATURES.rst | 2 +- Help/variable/CMAKE_C_EXTENSIONS.rst | 2 +- Help/variable/CMAKE_C_STANDARD.rst | 2 +- Help/variable/CMAKE_C_STANDARD_REQUIRED.rst | 2 +- 21 files changed, 34 insertions(+), 20 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 09:07:05 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 09:07:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-675-g977796e Message-ID: <20150408130705.8BBD1AE037@public.kitware.com> This is an automated email from 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 977796e3077b390b72c32315138ca15ae3339fb7 (commit) via 1975d53ae19c46ee4f7384cc96be355f7e94df61 (commit) via 9160d6c241adaeacc106d5b2ce4530f223345f22 (commit) via e942526b3d9e886da4ce832d9d3adb99cc5ede2f (commit) via 579c4bec6e2352448f78d9333f7382ff34a08e5a (commit) from 37ce091345f6e9ad57aff7a768cc3dc35ebc3913 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=977796e3077b390b72c32315138ca15ae3339fb7 commit 977796e3077b390b72c32315138ca15ae3339fb7 Merge: 37ce091 1975d53 Author: Brad King AuthorDate: Wed Apr 8 09:07:03 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 09:07:03 2015 -0400 Merge topic 'emulator-property' 1975d53a Help: Add notes for topic 'emulator-property' 9160d6c2 TestGenerator: Add CROSSCOMPILING_EMULATOR support. e942526b try_run: Use CMAKE_CROSSCOMPILING_EMULATOR. 579c4bec Properties: Add CROSSCOMPILING_EMULATOR target property. ----------------------------------------------------------------------- Summary of changes: Help/command/try_run.rst | 3 ++- Help/manual/cmake-properties.7.rst | 1 + Help/manual/cmake-variables.7.rst | 1 + Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst | 6 +++++ Help/release/dev/emulator-property.rst | 7 +++++ Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst | 12 +++++++++ Source/cmTarget.cxx | 1 + Source/cmTestGenerator.cxx | 21 ++++++++++++++- Source/cmTryRunCommand.cxx | 26 ++++++++++++++++-- Tests/RunCMake/CMakeLists.txt | 4 +++ .../CrosscompilingEmulator/AddTest-check.cmake | 12 +++++++++ .../RunCMake/CrosscompilingEmulator/AddTest.cmake | 8 ++++++ .../CMakeLists.txt | 2 +- .../CrosscompilingEmulatorProperty.cmake | 28 ++++++++++++++++++++ .../CrosscompilingEmulator/InitialCache.txt.in | 1 + .../CrosscompilingEmulator/RunCMakeTest.cmake | 8 ++++++ .../CrosscompilingEmulator/TryRun-stdout.txt | 1 + Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake | 18 +++++++++++++ .../CrosscompilingEmulator/simple_src.cxx} | 3 +-- Tests/RunCMake/pseudo_emulator.c | 15 +++++++++++ 20 files changed, 171 insertions(+), 7 deletions(-) create mode 100644 Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst create mode 100644 Help/release/dev/emulator-property.rst create mode 100644 Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake copy Tests/RunCMake/{CMP0059 => CrosscompilingEmulator}/CMakeLists.txt (68%) create mode 100644 Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/InitialCache.txt.in create mode 100644 Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/CrosscompilingEmulator/TryRun-stdout.txt create mode 100644 Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake copy Tests/{InterfaceLibrary/dummy.cpp => RunCMake/CrosscompilingEmulator/simple_src.cxx} (67%) create mode 100644 Tests/RunCMake/pseudo_emulator.c hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 09:07:36 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 09:07:36 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1620-gf69ce49 Message-ID: <20150408130736.76367AE03E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f69ce492903266461285bc5e81147f07e49b9f4d (commit) via 977796e3077b390b72c32315138ca15ae3339fb7 (commit) via 37ce091345f6e9ad57aff7a768cc3dc35ebc3913 (commit) via 710968e37171681cb32e74d6249a4fd7daacf42e (commit) via bddd8c055104d7c66b01799a4c99a2bbb6da8f00 (commit) from 0cc3714f771d042fe92ecd5479e555c0fe83b645 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f69ce492903266461285bc5e81147f07e49b9f4d commit f69ce492903266461285bc5e81147f07e49b9f4d Merge: 0cc3714 977796e Author: Brad King AuthorDate: Wed Apr 8 09:07:29 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 09:07:29 2015 -0400 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 Apr 8 09:42:18 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 09:42:18 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-677-gf3be6c1 Message-ID: <20150408134218.48F068C4B8@public.kitware.com> This is an automated email from 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 f3be6c1b9b3df6f1121e578807f06c29a003c58d (commit) via 7e311773b5386663457bedd39cf2110da04438f2 (commit) from 977796e3077b390b72c32315138ca15ae3339fb7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3be6c1b9b3df6f1121e578807f06c29a003c58d commit f3be6c1b9b3df6f1121e578807f06c29a003c58d Merge: 977796e 7e31177 Author: Brad King AuthorDate: Wed Apr 8 09:42:17 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 09:42:17 2015 -0400 Merge topic 'FindMatlab_add_recent_versions' 7e311773 FindMatlab: Look for R2014b and R2015a ----------------------------------------------------------------------- Summary of changes: Modules/FindMatlab.cmake | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 09:42:34 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 09:42:34 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1622-g010f9fa Message-ID: <20150408134234.EE6958C77D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 010f9fa5324367cbb52d78340fc7f1ea3815c7ca (commit) via f3be6c1b9b3df6f1121e578807f06c29a003c58d (commit) from f69ce492903266461285bc5e81147f07e49b9f4d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=010f9fa5324367cbb52d78340fc7f1ea3815c7ca commit 010f9fa5324367cbb52d78340fc7f1ea3815c7ca Merge: f69ce49 f3be6c1 Author: Brad King AuthorDate: Wed Apr 8 09:42:26 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 09:42:26 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 10:17:21 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 10:17:21 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1624-gea7fc01 Message-ID: <20150408141721.182CDAD96C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ea7fc015a281f813c99ae3ce849afecebd502552 (commit) via 834885fc9de95c6f8d4c59c2976b7a446f0f2ae5 (commit) from 010f9fa5324367cbb52d78340fc7f1ea3815c7ca (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea7fc015a281f813c99ae3ce849afecebd502552 commit ea7fc015a281f813c99ae3ce849afecebd502552 Merge: 010f9fa 834885f Author: Brad King AuthorDate: Wed Apr 8 10:17:20 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 10:17:20 2015 -0400 Merge topic 'link-implicit-libs-full-path' into next 834885fc fixup! Link libraries by full path even in implicit directories http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=834885fc9de95c6f8d4c59c2976b7a446f0f2ae5 commit 834885fc9de95c6f8d4c59c2976b7a446f0f2ae5 Author: Brad King AuthorDate: Wed Apr 8 09:30:27 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 10:16:02 2015 -0400 fixup! Link libraries by full path even in implicit directories Do not depend on behavior of native tools to produce an error on an empty ".a" file. Instead arrange for a successful build when the policy is NEW and a full path is used. diff --git a/Tests/RunCMake/CMP0060/CMP0060-Common.cmake b/Tests/RunCMake/CMP0060/CMP0060-Common.cmake index 46cfbbf..e0a56e6 100644 --- a/Tests/RunCMake/CMP0060/CMP0060-Common.cmake +++ b/Tests/RunCMake/CMP0060/CMP0060-Common.cmake @@ -1,23 +1,35 @@ -# Use a predictable library file name on all platforms. -set(CMAKE_STATIC_LIBRARY_PREFIX lib) -set(CMAKE_STATIC_LIBRARY_SUFFIX .a) +# Always build in a predictable configuration. For multi-config +# generators we depend on RunCMakeTest.cmake to do this for us. +if(NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE Debug) +endif() # Convince CMake that it can instruct the linker to search for the # library of the proper linkage type, but do not really pass flags. set(CMAKE_EXE_LINK_STATIC_C_FLAGS " ") set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS " ") -# Convince CMake that our library is in an implicit linker search directory. -set(dir ${CMAKE_CURRENT_SOURCE_DIR}/lib) -list(APPEND CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${dir}) - # Make a link line asking for the linker to search for the library # look like a missing object file so we will get predictable content -# in the error message. +# in the error message. This also ensures that cases expected to use +# the full path can be verified by confirming that they link. set(CMAKE_LINK_LIBRARY_FLAG LINKFLAG_) set(CMAKE_LINK_LIBRARY_SUFFIX _LINKSUFFIX${CMAKE_C_OUTPUT_EXTENSION}) +# Convince CMake that our library is in an implicit linker search directory. +list(APPEND CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/lib) + +# Create a simple library file. Place it in our library directory. +add_library(CMP0060 STATIC cmp0060.c) +set_property(TARGET CMP0060 PROPERTY + ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/lib) + +# Add a target to link the library file by full path. add_executable(main1 main.c) -target_link_libraries(main1 ${dir}/libCMP0060.a) +target_link_libraries(main1 $) +add_dependencies(main1 CMP0060) + +# Add a second target to verify the warning only appears once. add_executable(main2 main.c) -target_link_libraries(main2 ${dir}/libCMP0060.a) +target_link_libraries(main2 $) +add_dependencies(main2 CMP0060) diff --git a/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt deleted file mode 100644 index d197c91..0000000 --- a/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt +++ /dev/null @@ -1 +0,0 @@ -[^0] diff --git a/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt deleted file mode 100644 index 258d73f..0000000 --- a/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -Tests[\/]RunCMake[\/]CMP0060[\/]lib[\/]libCMP0060.a diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt index c8d9d9a..f6cc978 100644 --- a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt @@ -6,7 +6,7 @@ Some library files are in directories implicitly searched by the linker when invoked for C: - .*/Tests/RunCMake/CMP0060/lib/libCMP0060.a + .*/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-build/lib/(lib)?CMP0060.(a|lib) For compatibility with older versions of CMake, the generated link line will ask the linker to search for these by library name. diff --git a/Tests/RunCMake/CMP0060/RunCMakeTest.cmake b/Tests/RunCMake/CMP0060/RunCMakeTest.cmake index afb78fc..445156f 100644 --- a/Tests/RunCMake/CMP0060/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0060/RunCMakeTest.cmake @@ -14,6 +14,6 @@ function(run_cmake_CMP0060 CASE) endfunction() run_cmake_CMP0060(OLD) -run_cmake_CMP0060(NEW) run_cmake_CMP0060(WARN-OFF) run_cmake_CMP0060(WARN-ON) +run_cmake_CMP0060(NEW) diff --git a/Tests/RunCMake/CMP0060/cmp0060.c b/Tests/RunCMake/CMP0060/cmp0060.c new file mode 100644 index 0000000..a2da227 --- /dev/null +++ b/Tests/RunCMake/CMP0060/cmp0060.c @@ -0,0 +1,4 @@ +int libCMP0060(void) +{ + return 0; +} diff --git a/Tests/RunCMake/CMP0060/lib/libCMP0060.a b/Tests/RunCMake/CMP0060/lib/libCMP0060.a deleted file mode 100644 index e69de29..0000000 diff --git a/Tests/RunCMake/CMP0060/main.c b/Tests/RunCMake/CMP0060/main.c index e69de29..91848c2 100644 --- a/Tests/RunCMake/CMP0060/main.c +++ b/Tests/RunCMake/CMP0060/main.c @@ -0,0 +1,5 @@ +extern int libCMP0060(void); +int main(void) +{ + return libCMP0060(); +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index de8db56..e53612f 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -65,9 +65,7 @@ add_RunCMake_test(CMP0054) add_RunCMake_test(CMP0055) add_RunCMake_test(CMP0057) add_RunCMake_test(CMP0059) -if (NOT CMAKE_GENERATOR STREQUAL "Watcom WMake") - add_RunCMake_test(CMP0060) -endif() +add_RunCMake_test(CMP0060) if(CMAKE_GENERATOR STREQUAL "Ninja") add_RunCMake_test(Ninja) endif() ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMP0060/CMP0060-Common.cmake | 32 ++++++++++++++------ .../RunCMake/CMP0060/CMP0060-NEW-Build-result.txt | 1 - .../RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt | 1 - Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt | 2 +- Tests/RunCMake/CMP0060/RunCMakeTest.cmake | 2 +- Tests/RunCMake/CMP0060/cmp0060.c | 4 +++ Tests/RunCMake/CMP0060/main.c | 5 +++ Tests/RunCMake/CMakeLists.txt | 4 +-- 8 files changed, 34 insertions(+), 17 deletions(-) delete mode 100644 Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt delete mode 100644 Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt create mode 100644 Tests/RunCMake/CMP0060/cmp0060.c delete mode 100644 Tests/RunCMake/CMP0060/lib/libCMP0060.a hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 10:20:36 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 10:20:36 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1626-gc80c588 Message-ID: <20150408142036.EBB00ADAD8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c80c588c16cfa8423bcaa63564b21ff0dc531939 (commit) via f4e6341846ed9a2c644bccb74912eab083657883 (commit) from ea7fc015a281f813c99ae3ce849afecebd502552 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c80c588c16cfa8423bcaa63564b21ff0dc531939 commit c80c588c16cfa8423bcaa63564b21ff0dc531939 Merge: ea7fc01 f4e6341 Author: Brad King AuthorDate: Wed Apr 8 10:20:36 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 10:20:36 2015 -0400 Merge topic 'link-implicit-libs-full-path' into next f4e63418 fixup! Link libraries by full path even in implicit directories http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4e6341846ed9a2c644bccb74912eab083657883 commit f4e6341846ed9a2c644bccb74912eab083657883 Author: Brad King AuthorDate: Wed Apr 8 10:20:22 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 10:20:22 2015 -0400 fixup! Link libraries by full path even in implicit directories diff --git a/Help/policy/CMP0060.rst b/Help/policy/CMP0060.rst index 489d68f..cc37b1b 100644 --- a/Help/policy/CMP0060.rst +++ b/Help/policy/CMP0060.rst @@ -4,10 +4,11 @@ CMP0060 Link libraries by full path even in implicit directories. Policy :policy:`CMP0003` was introduced with the intention of always -linking library files by full path when known. However, on some -platforms (e.g. HP-UX) the compiler front-end adds alternative library -search paths for the current architecture (e.g. ``/usr/lib/`` has -alternatives to libraries in ``/usr/lib`` for the current architecture). +linking library files by full path when a full path is given to the +:command:`target_link_libraries` command. However, on some platforms +(e.g. HP-UX) the compiler front-end adds alternative library search paths +for the current architecture (e.g. ``/usr/lib/`` has alternatives +to libraries in ``/usr/lib`` for the current architecture). On such platforms the :command:`find_library` may find a library such as ``/usr/lib/libfoo.so`` that does not belong to the current architecture. ----------------------------------------------------------------------- Summary of changes: Help/policy/CMP0060.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Wed Apr 8 12:43:04 2015 From: steveire at gmail.com (Stephen Kelly) Date: Wed, 8 Apr 2015 12:43:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1628-g575742d Message-ID: <20150408164304.1EDA58C523@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 575742d4f928f7a9e2a1c17c38de4ff4cece4ea3 (commit) via 1daa60f24719894fa885bf0ce8b306f086c5b855 (commit) from c80c588c16cfa8423bcaa63564b21ff0dc531939 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=575742d4f928f7a9e2a1c17c38de4ff4cece4ea3 commit 575742d4f928f7a9e2a1c17c38de4ff4cece4ea3 Merge: c80c588 1daa60f Author: Stephen Kelly AuthorDate: Wed Apr 8 12:43:03 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 12:43:03 2015 -0400 Merge topic 'refactor-cache-api' into next 1daa60f2 Remove static string hack. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1daa60f24719894fa885bf0ce8b306f086c5b855 commit 1daa60f24719894fa885bf0ce8b306f086c5b855 Author: Stephen Kelly AuthorDate: Wed Apr 8 18:42:12 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 18:42:12 2015 +0200 Remove static string hack. diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index a08006a..3b02fa6 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -65,7 +65,7 @@ public: void AppendProperty(const std::string& property, const char* value, bool asString=false); void SetProperty(const std::string& property, bool value); - std::string GetValue() const { return this->GetEntry().Value; } + const char* GetValue() const { return this->GetEntry().Value.c_str(); } bool GetValueAsBool() const; void SetValue(const char*); CacheEntryType GetType() const { return this->GetEntry().Type; } @@ -146,9 +146,7 @@ public: { return 0; } - static std::string value; - value = it.GetValue(); - return value.c_str(); + return it.GetValue(); } const char* GetCacheEntryProperty(std::string const& key, ----------------------------------------------------------------------- Summary of changes: Source/cmCacheManager.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Wed Apr 8 12:55:23 2015 From: steveire at gmail.com (Stephen Kelly) Date: Wed, 8 Apr 2015 12:55:23 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1635-gdbdae3b Message-ID: <20150408165523.D8084AD7A9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via dbdae3b67ad5ad036750d0e31f48d9514a1c5c6a (commit) via ba404938a202b51bb82bff8692ed08e53b061ad4 (commit) via f3922a9a5b463420db5f7fae08efdf1b4abdfe5e (commit) via 3e6a76e48b93b2756cd3e1f28941c79c5a8f9709 (commit) via 9e64156725e431ae15ce92be4e470cae6edf5bd6 (commit) via 1e2dbfce37acd1b7e7dc5bb1b45d71c5ac0c3599 (commit) via 60a62a91c4c67859d8e8f51aafcf0eb929edc036 (commit) from 575742d4f928f7a9e2a1c17c38de4ff4cece4ea3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dbdae3b67ad5ad036750d0e31f48d9514a1c5c6a commit dbdae3b67ad5ad036750d0e31f48d9514a1c5c6a Merge: 575742d ba40493 Author: Stephen Kelly AuthorDate: Wed Apr 8 12:55:22 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 12:55:22 2015 -0400 Merge topic 'refactor-cache-api' into next ba404938 cmCacheManager: Port consumers to non-iterator API. f3922a9a Port QtDialog to non-iterator cache API. 3e6a76e4 Port CursesDialog to non-iterator cache API. 9e641567 cmMakefile: Port away from CacheEntry.Initialized. 1e2dbfce cmCacheManager: Add non-iterator-based API. 60a62a91 cmCacheManager: Return a C string from GetValue. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ba404938a202b51bb82bff8692ed08e53b061ad4 commit ba404938a202b51bb82bff8692ed08e53b061ad4 Author: Stephen Kelly AuthorDate: Sun Apr 5 10:48:04 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 18:47:00 2015 +0200 cmCacheManager: Port consumers to non-iterator API. This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names. diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index f63df61..cc08052 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -366,18 +366,18 @@ bool cmFindBase::CheckForVariableInCache() if(const char* cacheValue = this->Makefile->GetDefinition(this->VariableName)) { - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()-> - GetCacheIterator(this->VariableName.c_str()); + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); - bool cached = !it.IsAtEnd(); + bool cached = cacheEntry ? true : false; if(found) { // If the user specifies the entry on the command line without a // type we should add the type and docstring but keep the // original value. Tell the subclass implementations to do // this. - if(cached && it.GetType() == cmCacheManager::UNINITIALIZED) + if(cached && manager->GetCacheEntryType(this->VariableName) + == cmCacheManager::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; } @@ -385,7 +385,8 @@ bool cmFindBase::CheckForVariableInCache() } else if(cached) { - const char* hs = it.GetProperty("HELPSTRING"); + const char* hs = manager->GetCacheEntryProperty(this->VariableName, + "HELPSTRING"); this->VariableDocumentation = hs?hs:"(none)"; } } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index f0b2686..0e6e0c2 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -391,11 +391,10 @@ bool cmGetPropertyCommand::HandleCacheMode() } const char* value = 0; - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(this->Name.c_str()); - if(!it.IsAtEnd()) + if(this->Makefile->GetCacheManager()->GetCacheEntryValue(this->Name)) { - value = it.GetProperty(this->PropertyName); + value = this->Makefile->GetCacheManager() + ->GetCacheEntryProperty(this->Name, this->PropertyName); } this->StoreResult(value); return true; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f23caa6..35394b8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1559,9 +1559,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(lib->first.c_str())) { std::string varName = lib->first.substr(0, lib->first.size()-9); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(varName.c_str()); - if(it.GetPropertyAsBool("ADVANCED")) + if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1592,9 +1590,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(incDir->c_str())) { std::string varName = incDir->substr(0, incDir->size()-9); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(varName.c_str()); - if(it.GetPropertyAsBool("ADVANCED")) + if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7c1b9c4..34b4621 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1848,8 +1848,8 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, doc, - type); + this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -2499,12 +2499,10 @@ std::vector cmMakefile this->Internal->VarStack.top().ClosureKeys(); res.insert(res.end(), definitions.begin(), definitions.end()); } - cmCacheManager::CacheIterator cit = - this->GetCacheManager()->GetCacheIterator(); - for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) - { - res.push_back(cit.GetName()); - } + std::vector cacheKeys = + this->GetCacheManager()->GetCacheEntryKeys(); + res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); + std::sort(res.begin(), res.end()); return res; } diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index f6a2c26..cc094b1 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -37,24 +37,19 @@ bool cmMarkAsAdvancedCommand { std::string variable = args[i]; cmCacheManager* manager = this->Makefile->GetCacheManager(); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(variable.c_str()); - if ( it.IsAtEnd() ) + if (!manager->GetCacheEntryValue(variable)) { - this->Makefile->GetCacheManager() - ->AddCacheEntry(variable, 0, 0, - cmCacheManager::UNINITIALIZED); + manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); overwrite = true; } - it.Find(variable); - if ( it.IsAtEnd() ) + if (!manager->GetCacheEntryValue(variable)) { cmSystemTools::Error("This should never happen..."); return false; } - if ( !it.PropertyExists("ADVANCED") || overwrite ) + if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) { - it.SetProperty("ADVANCED", value); + manager->SetCacheEntryProperty(variable, "ADVANCED", value); } } return true; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 60728ea..baf5b1e 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,16 +42,16 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(args[0].c_str()); - if(!it.IsAtEnd()) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue = manager->GetCacheEntryValue(args[0]); + if(existingValue) { - if ( it.GetType() != cmCacheManager::UNINITIALIZED ) + if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) { - it.SetProperty("HELPSTRING", args[1].c_str()); + manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; } - initialValue = it.GetValue(); + initialValue = existingValue; } if(args.size() == 3) { diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 204d95b..e17474b 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -136,9 +136,10 @@ bool cmSetCommand } // see if this is already in the cache - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(variable); - if(!it.IsAtEnd() && (it.GetType() != cmCacheManager::UNINITIALIZED)) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue = manager->GetCacheEntryValue(variable); + if(existingValue && + (manager->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 1150bc7..77f9fb9 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -452,11 +452,11 @@ bool cmSetPropertyCommand::HandleCacheMode() // Get the source file. cmMakefile* mf = this->GetMakefile(); cmake* cm = mf->GetCMakeInstance(); - cmCacheManager::CacheIterator it = - cm->GetCacheManager()->GetCacheIterator(ni->c_str()); - if(!it.IsAtEnd()) + const char* existingValue + = cm->GetCacheManager()->GetCacheEntryValue(*ni); + if(existingValue) { - if(!this->HandleCacheEntry(it)) + if(!this->HandleCacheEntry(*ni)) { return false; } @@ -474,22 +474,25 @@ bool cmSetPropertyCommand::HandleCacheMode() } //---------------------------------------------------------------------------- -bool cmSetPropertyCommand::HandleCacheEntry(cmCacheManager::CacheIterator& it) +bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey) { // Set or append the property. const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); + cmCacheManager* manager = this->Makefile->GetCacheManager(); if (this->Remove) { - value = 0; + manager->RemoveCacheEntryProperty(cacheKey, name); + return true; } if(this->AppendMode) { - it.AppendProperty(name, value, this->AppendAsString); + manager->AppendCacheEntryProperty(cacheKey, name, value, + this->AppendAsString); } else { - it.SetProperty(name, value); + manager->SetCacheEntryProperty(cacheKey, name, value); } return true; diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h index b06cb68..3285e60 100644 --- a/Source/cmSetPropertyCommand.h +++ b/Source/cmSetPropertyCommand.h @@ -61,7 +61,7 @@ private: bool HandleTestMode(); bool HandleTest(cmTest* test); bool HandleCacheMode(); - bool HandleCacheEntry(cmCacheManager::CacheIterator&); + bool HandleCacheEntry(std::string const&); bool HandleInstallMode(); bool HandleInstall(cmInstalledFile* file); }; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index b5280cf..911ade8 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -264,11 +264,12 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment.c_str(), cmCacheManager::STRING); - cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()-> - GetCacheIterator(this->RunResultVariable.c_str()); - if ( !it.IsAtEnd() ) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existingValue + = manager->GetCacheEntryValue(this->RunResultVariable); + if (existingValue) { - it.SetProperty("ADVANCED", "1"); + manager->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); } error = true; @@ -290,11 +291,13 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmCacheManager::STRING); - cmCacheManager::CacheIterator it = this->Makefile->GetCacheManager()-> - GetCacheIterator(internalRunOutputName.c_str()); - if ( !it.IsAtEnd() ) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + const char* existing = + manager->GetCacheEntryValue(internalRunOutputName); + if (existing) { - it.SetProperty("ADVANCED", "1"); + manager->SetCacheEntryProperty(internalRunOutputName, + "ADVANCED", "1"); } error = true; diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index 80c1286..dd2a682 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -41,9 +41,9 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - cmCacheManager::CacheIterator it = - this->Makefile->GetCacheManager()->GetCacheIterator(args[i].c_str()); - if(!it.IsAtEnd() && it.GetPropertyAsBool("ADVANCED")) + cmCacheManager* manager = this->Makefile->GetCacheManager(); + if(manager->GetCacheEntryValue(args[i]) && + manager->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) { hasAdvanced = true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 210c0ef..64b332c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -403,17 +403,18 @@ bool cmake::SetCacheArgs(const std::vector& args) cmsys::Glob::PatternToRegex(entryPattern, true, true).c_str()); //go through all cache entries and collect the vars which will be removed std::vector entriesToDelete; - cmCacheManager::CacheIterator it = - this->CacheManager->GetCacheIterator(); - for ( it.Begin(); !it.IsAtEnd(); it.Next() ) + std::vector cacheKeys = + this->CacheManager->GetCacheEntryKeys(); + for (std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = it.GetType(); + cmCacheManager::CacheEntryType t = + this->CacheManager->GetCacheEntryType(*it); if(t != cmCacheManager::STATIC) { - std::string entryName = it.GetName(); - if (regex.find(entryName.c_str())) + if (regex.find(it->c_str())) { - entriesToDelete.push_back(entryName); + entriesToDelete.push_back(*it); } } } @@ -917,16 +918,18 @@ void cmake::SetDirectoriesFromFile(const char* arg) // If there is a CMakeCache.txt file, use its settings. if(!cachePath.empty()) { - cmCacheManager* cachem = this->GetCacheManager(); - cmCacheManager::CacheIterator it = cachem->NewIterator(); - if(this->LoadCache(cachePath) && - it.Find("CMAKE_HOME_DIRECTORY")) + if(this->LoadCache(cachePath)) { - this->SetHomeOutputDirectory(cachePath); - this->SetStartOutputDirectory(cachePath); - this->SetHomeDirectory(it.GetValue()); - this->SetStartDirectory(it.GetValue()); - return; + const char* existingValue = + this->CacheManager->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + if (existingValue) + { + this->SetHomeOutputDirectory(cachePath); + this->SetStartOutputDirectory(cachePath); + this->SetHomeDirectory(existingValue); + this->SetStartDirectory(existingValue); + return; + } } } @@ -1575,11 +1578,11 @@ int cmake::ActualConfigure() ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", cmCacheManager::BOOL); - cmCacheManager::CacheIterator it = - this->CacheManager->GetCacheIterator("CMAKE_USE_RELATIVE_PATHS"); - if ( !it.PropertyExists("ADVANCED") ) + if (!this->CacheManager->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED")) { - it.SetProperty("ADVANCED", "1"); + this->CacheManager->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED", "1"); } } @@ -2314,17 +2317,9 @@ const char *cmake::GetProperty(const std::string& prop, std::string output = ""; if ( prop == "CACHE_VARIABLES" ) { - cmCacheManager::CacheIterator cit = - this->GetCacheManager()->GetCacheIterator(); - for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) - { - if (!output.empty()) - { - output += ";"; - } - output += cit.GetName(); - } - this->SetProperty("CACHE_VARIABLES", output.c_str()); + std::vector cacheKeys = + this->CacheManager->GetCacheEntryKeys(); + this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); } else if ( prop == "COMMANDS" ) { @@ -2686,9 +2681,9 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, if(t == cmake::AUTHOR_WARNING) { // Allow suppression of these warnings. - cmCacheManager::CacheIterator it = this->CacheManager - ->GetCacheIterator("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); - if(!it.IsAtEnd() && it.GetValueAsBool()) + const char* suppress = this->CacheManager->GetCacheEntryValue( + "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); + if(suppress && cmSystemTools::IsOn(suppress)) { return; } @@ -2801,37 +2796,42 @@ int cmake::Build(const std::string& dir, } std::string cachePath = dir; cmSystemTools::ConvertToUnixSlashes(cachePath); - cmCacheManager::CacheIterator it = this->GetCacheManager()->NewIterator(); if(!this->LoadCache(cachePath)) { std::cerr << "Error: could not load cache\n"; return 1; } - if(!it.Find("CMAKE_GENERATOR")) + const char* cachedGenerator = + this->CacheManager->GetCacheEntryValue("CMAKE_GENERATOR"); + if(!cachedGenerator) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; return 1; } cmsys::auto_ptr gen( - this->CreateGlobalGenerator(it.GetValue())); + this->CreateGlobalGenerator(cachedGenerator)); if(!gen.get()) { std::cerr << "Error: could create CMAKE_GENERATOR \"" - << it.GetValue() << "\"\n"; + << cachedGenerator << "\"\n"; return 1; } std::string output; std::string projName; - if(!it.Find("CMAKE_PROJECT_NAME")) + const char* cachedProjectName = + this->CacheManager->GetCacheEntryValue("CMAKE_PROJECT_NAME"); + if(!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; return 1; } - projName = it.GetValue(); + projName = cachedProjectName; bool verbose = false; - if(it.Find("CMAKE_VERBOSE_MAKEFILE")) + const char* cachedVerbose = + this->CacheManager->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); + if(cachedVerbose) { - verbose = it.GetValueAsBool(); + verbose = cmSystemTools::IsOn(cachedVerbose); } return gen->Build("", dir, projName, target, diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index ac73ad0..3b518be 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -328,25 +328,31 @@ int do_cmake(int ac, char const* const* av) int res = cm.Run(args, view_only); if ( list_cached || list_all_cached ) { - cmCacheManager::CacheIterator it = - cm.GetCacheManager()->GetCacheIterator(); std::cout << "-- Cache values" << std::endl; - for ( it.Begin(); !it.IsAtEnd(); it.Next() ) + std::vector keys = + cm.GetCacheManager()->GetCacheEntryKeys(); + for (std::vector::const_iterator it = keys.begin(); + it != keys.end(); ++it) { - cmCacheManager::CacheEntryType t = it.GetType(); + cmCacheManager::CacheEntryType t = + cm.GetCacheManager()->GetCacheEntryType(*it); if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && t != cmCacheManager::UNINITIALIZED ) { - bool advanced = it.PropertyExists("ADVANCED"); - if ( list_all_cached || !advanced) + const char* advancedProp = + cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED"); + if ( list_all_cached || !advancedProp) { if ( list_help ) { - std::cout << "// " << it.GetProperty("HELPSTRING") << std::endl; + std::cout << "// " + << cm.GetCacheManager()->GetCacheEntryProperty(*it, + "HELPSTRING") << std::endl; } - std::cout << it.GetName() << ":" << - cmCacheManager::TypeToString(it.GetType()) - << "=" << it.GetValue() << std::endl; + std::cout << *it << ":" << + cmCacheManager::TypeToString(t) + << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it) + << std::endl; if ( list_help ) { std::cout << std::endl; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3922a9a5b463420db5f7fae08efdf1b4abdfe5e commit f3922a9a5b463420db5f7fae08efdf1b4abdfe5e Author: Stephen Kelly AuthorDate: Mon Apr 6 12:14:40 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 18:47:00 2015 +0200 Port QtDialog to non-iterator cache API. diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 009d06e..08d53ce 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -110,17 +110,18 @@ void QCMake::setBinaryDirectory(const QString& _dir) QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); - cmCacheManager::CacheIterator itm = cachem->NewIterator(); - if ( itm.Find("CMAKE_HOME_DIRECTORY")) + const char* homeDir = cachem->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + if (homeDir) { - setSourceDirectory(QString::fromLocal8Bit(itm.GetValue().c_str())); + setSourceDirectory(QString::fromLocal8Bit(homeDir)); } - if ( itm.Find("CMAKE_GENERATOR")) + const char* gen = cachem->GetCacheEntryValue("CMAKE_GENERATOR"); + if (gen) { const char* extraGen = cachem ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: - CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : ""); + CreateFullGeneratorName(gen, extraGen? extraGen : ""); this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); } } @@ -195,33 +196,35 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) // set the value of properties cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - for(cmCacheManager::CacheIterator i = cachem->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = cachem->GetCacheEntryKeys(); + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - - if(i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC) + cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*it); + if(t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC) { continue; } QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); + prop.Key = QString::fromLocal8Bit(it->c_str()); int idx = props.indexOf(prop); if(idx == -1) { - toremove.append(QString::fromLocal8Bit(i.GetName().c_str())); + toremove.append(QString::fromLocal8Bit(it->c_str())); } else { prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - i.SetValue(prop.Value.toBool() ? "ON" : "OFF"); + cachem->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); } else { - i.SetValue(prop.Value.toString().toLocal8Bit().data()); + cachem->SetCacheEntryValue(*it, + prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); } @@ -279,42 +282,47 @@ QCMakePropertyList QCMake::properties() const QCMakePropertyList ret; cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - for(cmCacheManager::CacheIterator i = cachem->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = cachem->GetCacheEntryKeys(); + for (std::vector::const_iterator i = cacheKeys.begin(); + i != cacheKeys.end(); ++i) { - - if(i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED) + cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*i); + if(t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED) { continue; } - QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); - prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING")); - prop.Value = QString::fromLocal8Bit(i.GetValue().c_str()); - prop.Advanced = i.GetPropertyAsBool("ADVANCED"); + const char* cachedValue = cachem->GetCacheEntryValue(*i); - if(i.GetType() == cmCacheManager::BOOL) + QCMakeProperty prop; + prop.Key = QString::fromLocal8Bit(i->c_str()); + prop.Help = QString::fromLocal8Bit( + cachem->GetCacheEntryProperty(*i, "HELPSTRING")); + prop.Value = QString::fromLocal8Bit(cachedValue); + prop.Advanced = cachem->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); + if(t == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; - prop.Value = cmSystemTools::IsOn(i.GetValue().c_str()); + prop.Value = cmSystemTools::IsOn(cachedValue); } - else if(i.GetType() == cmCacheManager::PATH) + else if(t == cmCacheManager::PATH) { prop.Type = QCMakeProperty::PATH; } - else if(i.GetType() == cmCacheManager::FILEPATH) + else if(t == cmCacheManager::FILEPATH) { prop.Type = QCMakeProperty::FILEPATH; } - else if(i.GetType() == cmCacheManager::STRING) + else if(t == cmCacheManager::STRING) { prop.Type = QCMakeProperty::STRING; - if (i.PropertyExists("STRINGS")) + const char* stringsProperty = + cachem->GetCacheEntryProperty(*i, "STRINGS"); + if (stringsProperty) { - prop.Strings = QString::fromLocal8Bit(i.GetProperty("STRINGS")).split(";"); + prop.Strings = QString::fromLocal8Bit(stringsProperty).split(";"); } } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e6a76e48b93b2756cd3e1f28941c79c5a8f9709 commit 3e6a76e48b93b2756cd3e1f28941c79c5a8f9709 Author: Stephen Kelly AuthorDate: Mon Apr 6 12:01:35 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 18:47:00 2015 +0200 Port CursesDialog to non-iterator cache API. diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 682f95f..4f028c4 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -18,6 +18,9 @@ #include "cmCursesFilePathWidget.h" #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" +#include "../cmake.h" + +#include cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( const std::string& key, @@ -32,7 +35,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( - const std::string& key, const cmCacheManager::CacheIterator& it, bool isNew, + const std::string& key, cmake *cm, bool isNew, int labelwidth, int entrywidth) : Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth) { @@ -47,11 +50,13 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - switch ( it.GetType() ) + const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); + assert(value); + switch (cm->GetCacheManager()->GetCacheEntryType(key)) { - case cmCacheManager::BOOL: + case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); - if (cmSystemTools::IsOn(it.GetValue().c_str())) + if (cmSystemTools::IsOn(value)) { static_cast(this->Entry)->SetValueAsBool(true); } @@ -62,40 +67,40 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( break; case cmCacheManager::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); break; case cmCacheManager::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); break; case cmCacheManager::STRING: - if(it.PropertyExists("STRINGS")) + { + const char* stringsProp = cm->GetCacheManager() + ->GetCacheEntryProperty(key, "STRINGS"); + if(stringsProp) { cmCursesOptionsWidget* ow = new cmCursesOptionsWidget(this->EntryWidth, 1, 1, 1); this->Entry = ow; std::vector options; - cmSystemTools::ExpandListArgument( - std::string(it.GetProperty("STRINGS")), options); + cmSystemTools::ExpandListArgument(stringsProp, options); for(std::vector::iterator si = options.begin(); si != options.end(); ++si) { ow->AddOption(*si); } - ow->SetOption(it.GetValue()); + ow->SetOption(value); } else { this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); - static_cast(this->Entry)->SetString( - it.GetValue()); + static_cast(this->Entry)->SetString(value); } break; + } case cmCacheManager::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", - it.GetName().c_str()); + key.c_str()); break; default: // TODO : put warning message here diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index 7cdf13b..dc4ee4af 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -21,7 +21,7 @@ public: cmCursesCacheEntryComposite(const std::string& key, int labelwidth, int entrywidth); cmCursesCacheEntryComposite(const std::string& key, - const cmCacheManager::CacheIterator& it, + cmake *cm, bool isNew, int labelwidth, int entrywidth); ~cmCursesCacheEntryComposite(); const char* GetValue(); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 1217bda..833d540 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -111,13 +111,17 @@ void cmCursesMainForm::InitializeUI() // Count non-internal and non-static entries int count=0; - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + std::vector cacheKeys = + this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys(); + + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - if ( i.GetType() != cmCacheManager::INTERNAL && - i.GetType() != cmCacheManager::STATIC && - i.GetType() != cmCacheManager::UNINITIALIZED) + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t != cmCacheManager::INTERNAL && + t != cmCacheManager::STATIC && + t != cmCacheManager::UNINITIALIZED) { ++count; } @@ -139,45 +143,49 @@ void cmCursesMainForm::InitializeUI() // Create the composites. // First add entries which are new - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - std::string key = i.GetName(); - if ( i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED ) + std::string key = *it; + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED ) { continue; } if (!this->LookForCacheEntry(key)) { - newEntries->push_back(new cmCursesCacheEntryComposite(key, i, - true, 30, - entrywidth)); + newEntries->push_back(new cmCursesCacheEntryComposite(key, + this->CMakeInstance, + true, 30, + entrywidth)); this->OkToGenerate = false; } } // then add entries which are old - for(cmCacheManager::CacheIterator i = - this->CMakeInstance->GetCacheManager()->NewIterator(); - !i.IsAtEnd(); i.Next()) + for(std::vector::const_iterator it = cacheKeys.begin(); + it != cacheKeys.end(); ++it) { - std::string key = i.GetName(); - if ( i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED ) + std::string key = *it; + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(*it); + if (t == cmCacheManager::INTERNAL || + t == cmCacheManager::STATIC || + t == cmCacheManager::UNINITIALIZED ) { continue; } if (this->LookForCacheEntry(key)) { - newEntries->push_back(new cmCursesCacheEntryComposite(key, i, - false, 30, - entrywidth)); + newEntries->push_back(new cmCursesCacheEntryComposite(key, + this->CMakeInstance, + false, 30, + entrywidth)); } } } @@ -216,10 +224,13 @@ void cmCursesMainForm::RePost() std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -245,10 +256,13 @@ void cmCursesMainForm::RePost() std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -314,10 +328,13 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -334,10 +351,13 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) std::vector::iterator it; for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { - cmCacheManager::CacheIterator mit = - this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); - if (mit.IsAtEnd() || - (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))) + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue((*it)->GetValue()); + bool advanced = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); + if (!existingValue || (!this->AdvancedMode && advanced)) { continue; } @@ -495,11 +515,12 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the help string of the current entry // and add it to the help string - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField); - if (!it.IsAtEnd()) + const char* existingValue = + this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField); + if (existingValue) { - const char* hs = it.GetProperty("HELPSTRING"); + const char* hs = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryProperty(curField, "HELPSTRING"); if ( hs ) { strncpy(help, hs, 127); @@ -792,23 +813,28 @@ void cmCursesMainForm::FillCacheManagerFromUI() size_t size = this->Entries->size(); for(size_t i=0; i < size; i++) { - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator( - (*this->Entries)[i]->Key.c_str()); - if (!it.IsAtEnd()) + std::string cacheKey = (*this->Entries)[i]->Key; + const char* existingValue = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue(cacheKey); + if (existingValue) { - std::string oldValue = it.GetValue(); + std::string oldValue = existingValue; std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - this->FixValue(it.GetType(), oldValue, fixedOldValue); - this->FixValue(it.GetType(), newValue, fixedNewValue); + cmCacheManager::CacheEntryType t = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryType(cacheKey); + this->FixValue(t, oldValue, fixedOldValue); + this->FixValue(t, newValue, fixedNewValue); if(!(fixedOldValue == fixedNewValue)) { // The user has changed the value. Mark it as modified. - it.SetProperty("MODIFIED", true); - it.SetValue(fixedNewValue.c_str()); + this->CMakeInstance->GetCacheManager() + ->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true); + this->CMakeInstance->GetCacheManager() + ->SetCacheEntryValue(cacheKey, fixedNewValue); } } } @@ -1017,12 +1043,15 @@ void cmCursesMainForm::HandleInput() cmCursesWidget* lbl = reinterpret_cast(field_userptr( this->Fields[findex-2])); const char* curField = lbl->GetValue(); - const char* helpString=0; - cmCacheManager::CacheIterator it = - this->CMakeInstance->GetCacheManager()->GetCacheIterator(curField); - if (!it.IsAtEnd()) + const char* helpString = 0; + + const char* existingValue = + this->CMakeInstance->GetCacheManager() + ->GetCacheEntryValue(curField); + if (existingValue) { - helpString = it.GetProperty("HELPSTRING"); + helpString = this->CMakeInstance->GetCacheManager() + ->GetCacheEntryProperty(curField, "HELPSTRING"); } if (helpString) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e64156725e431ae15ce92be4e470cae6edf5bd6 commit 9e64156725e431ae15ce92be4e470cae6edf5bd6 Author: Stephen Kelly AuthorDate: Mon Apr 6 10:46:25 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 18:47:00 2015 +0200 cmMakefile: Port away from CacheEntry.Initialized. The API has no other external users. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b6eff3d..7c1b9c4 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1810,16 +1810,17 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, { bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; - cmCacheManager::CacheIterator it = - this->GetCacheManager()->GetCacheIterator(name.c_str()); - if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED) && - it.Initialized()) + const char* existingValue = + this->GetCacheManager()->GetInitializedCacheValue(name); + if(existingValue + && (this->GetCacheManager()->GetCacheEntryType(name) + == cmCacheManager::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in if(!force) { - val = it.GetValue(); + val = existingValue; haveVal = true; } if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) @@ -1842,7 +1843,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, } this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = it.GetValue(); + val = this->GetCacheManager()->GetInitializedCacheValue(name); haveVal = true; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e2dbfce37acd1b7e7dc5bb1b45d71c5ac0c3599 commit 1e2dbfce37acd1b7e7dc5bb1b45d71c5ac0c3599 Author: Stephen Kelly AuthorDate: Sun Apr 5 19:50:05 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 18:47:00 2015 +0200 cmCacheManager: Add non-iterator-based API. The iterator pattern is an unusual one for CMake, and it hinders refactoring all configuration-time data manipulation into a single class. diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index d2712bb..3b02fa6 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -139,6 +139,81 @@ public: ///! Get a value from the cache given a key const char* GetInitializedCacheValue(const std::string& key) const; + const char* GetCacheEntryValue(const std::string& key) + { + cmCacheManager::CacheIterator it = this->GetCacheIterator(key.c_str()); + if (it.IsAtEnd()) + { + return 0; + } + return it.GetValue(); + } + + const char* GetCacheEntryProperty(std::string const& key, + std::string const& propName) + { + return this->GetCacheIterator(key.c_str()).GetProperty(propName); + } + + CacheEntryType GetCacheEntryType(std::string const& key) + { + return this->GetCacheIterator(key.c_str()).GetType(); + } + + bool GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propName) + { + return this->GetCacheIterator(key.c_str()).GetPropertyAsBool(propName); + } + + void SetCacheEntryProperty(std::string const& key, + std::string const& propName, + std::string const& value) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, value.c_str()); + } + + void SetCacheEntryBoolProperty(std::string const& key, + std::string const& propName, + bool value) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, value); + } + + void SetCacheEntryValue(std::string const& key, + std::string const& value) + { + this->GetCacheIterator(key.c_str()).SetValue(value.c_str()); + } + + void RemoveCacheEntryProperty(std::string const& key, + std::string const& propName) + { + this->GetCacheIterator(key.c_str()).SetProperty(propName, (void*)0); + } + + void AppendCacheEntryProperty(std::string const& key, + std::string const& propName, + std::string const& value, + bool asString = false) + { + this->GetCacheIterator(key.c_str()).AppendProperty(propName, + value.c_str(), + asString); + } + + std::vector GetCacheEntryKeys() + { + std::vector definitions; + definitions.reserve(this->GetSize()); + cmCacheManager::CacheIterator cit = this->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + definitions.push_back(cit.GetName()); + } + return definitions; + } + /** Get the version of CMake that wrote the cache. */ unsigned int GetCacheMajorVersion() const { return this->CacheMajorVersion; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60a62a91c4c67859d8e8f51aafcf0eb929edc036 commit 60a62a91c4c67859d8e8f51aafcf0eb929edc036 Author: Stephen Kelly AuthorDate: Wed Apr 8 18:43:46 2015 +0200 Commit: Stephen Kelly CommitDate: Wed Apr 8 18:45:51 2015 +0200 cmCacheManager: Return a C string from GetValue. This is for consistency with other CMake access interfaces such as definitions and properties which use a null value as a 'not present' value. It is source compatible with existing callers, and it returns a pointer into actual real cache entry storage. diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 31d302a..d2712bb 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -65,7 +65,7 @@ public: void AppendProperty(const std::string& property, const char* value, bool asString=false); void SetProperty(const std::string& property, bool value); - std::string GetValue() const { return this->GetEntry().Value; } + const char* GetValue() const { return this->GetEntry().Value.c_str(); } bool GetValueAsBool() const; void SetValue(const char*); CacheEntryType GetType() const { return this->GetEntry().Type; } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 13:09:53 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 13:09:53 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1637-ge830e12 Message-ID: <20150408170954.02189D4F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e830e12572e5e2e617bca1b849992d1016bb262f (commit) via a2df4a3f769a63822144c874660eb9461f233c22 (commit) from dbdae3b67ad5ad036750d0e31f48d9514a1c5c6a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e830e12572e5e2e617bca1b849992d1016bb262f commit e830e12572e5e2e617bca1b849992d1016bb262f Merge: dbdae3b a2df4a3 Author: Brad King AuthorDate: Wed Apr 8 13:09:53 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 13:09:53 2015 -0400 Merge topic 'fix-liblzma-XL-optimize' into next a2df4a3f liblzma: Disable XL compiler optimizations altogether http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2df4a3f769a63822144c874660eb9461f233c22 commit a2df4a3f769a63822144c874660eb9461f233c22 Author: Brad King AuthorDate: Wed Apr 8 13:07:44 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 13:08:53 2015 -0400 liblzma: Disable XL compiler optimizations altogether Revert commit 82c51a8a (liblzma: Disable XL compiler optimizations in one source to avoid crash, 2015-04-02) and instead add a compiler flag to disable optimizations in every source of liblzma. Somehow the XL compiler optimizations create incorrect behavior in liblzma and lead to crashes or truncated output during compression. diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt index d991438..991c699 100644 --- a/Utilities/cmliblzma/CMakeLists.txt +++ b/Utilities/cmliblzma/CMakeLists.txt @@ -211,4 +211,10 @@ ENDIF() ADD_LIBRARY(cmliblzma ${LZMA_SRCS}) +IF(CMAKE_C_COMPILER_ID STREQUAL "XL") + # Disable the XL compiler optimizer because it causes crashes + # and other bad behavior in liblzma code. + SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-qnooptimize") +ENDIF() + INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma) diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c index fc54d8d..d3a6348 100644 --- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c +++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c @@ -8,9 +8,6 @@ // You can do whatever you want with this file. // /////////////////////////////////////////////////////////////////////////////// -#if defined(__IBMC__) -# pragma options optimize=0 -#endif #include "lzma_encoder_private.h" #include "fastpos.h" ----------------------------------------------------------------------- Summary of changes: Utilities/cmliblzma/CMakeLists.txt | 6 ++++++ Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 13:56:01 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 13:56:01 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1639-g21453f9 Message-ID: <20150408175601.91D54ADC5C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 21453f911565fe00671107b49e0193c066d6ec49 (commit) via e5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4 (commit) from e830e12572e5e2e617bca1b849992d1016bb262f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=21453f911565fe00671107b49e0193c066d6ec49 commit 21453f911565fe00671107b49e0193c066d6ec49 Merge: e830e12 e5d336b Author: Brad King AuthorDate: Wed Apr 8 13:56:00 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 13:56:00 2015 -0400 Merge topic 'fix-liblzma-optimize' into next e5d336be liblzma: Disable GNU 3.3 compiler optimizations http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4 commit e5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4 Author: Brad King AuthorDate: Wed Apr 8 13:52:02 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 13:52:02 2015 -0400 liblzma: Disable GNU 3.3 compiler optimizations The GNU 3.3 optimizer causes bad behavior in liblzma, so disable it. diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt index 991c699..8920536 100644 --- a/Utilities/cmliblzma/CMakeLists.txt +++ b/Utilities/cmliblzma/CMakeLists.txt @@ -215,6 +215,10 @@ IF(CMAKE_C_COMPILER_ID STREQUAL "XL") # Disable the XL compiler optimizer because it causes crashes # and other bad behavior in liblzma code. SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-qnooptimize") +ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND + CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) + # Disable the old GNU compiler optimizer. + SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-O0") ENDIF() INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma) ----------------------------------------------------------------------- Summary of changes: Utilities/cmliblzma/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- CMake From nilsgladitz at gmail.com Wed Apr 8 13:59:02 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Wed, 8 Apr 2015 13:59:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1641-g2174a35 Message-ID: <20150408175902.EA6B3ADEC0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2174a358603a43337be5e68408f19a2106555108 (commit) via 8f774e92446de9ff59935b391fcd0c1c0325be22 (commit) from 21453f911565fe00671107b49e0193c066d6ec49 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2174a358603a43337be5e68408f19a2106555108 commit 2174a358603a43337be5e68408f19a2106555108 Merge: 21453f9 8f774e9 Author: Nils Gladitz AuthorDate: Wed Apr 8 13:59:02 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 13:59:02 2015 -0400 Merge topic 'tar-write-format' into next 8f774e92 libarchive: Use base-256 encoding for UID/GID like GNU tar does http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f774e92446de9ff59935b391fcd0c1c0325be22 commit 8f774e92446de9ff59935b391fcd0c1c0325be22 Author: Nils Gladitz AuthorDate: Wed Apr 8 19:58:08 2015 +0200 Commit: Nils Gladitz CommitDate: Wed Apr 8 19:58:08 2015 +0200 libarchive: Use base-256 encoding for UID/GID like GNU tar does diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c index 13942c1..8f5400c 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c @@ -644,18 +644,16 @@ archive_format_gnutar_header(struct archive_write *a, char h[512], format_octal(archive_entry_mode(entry) & 07777, h + GNUTAR_mode_offset, GNUTAR_mode_size); - /* TODO: How does GNU tar handle large UIDs? */ - if (format_octal(archive_entry_uid(entry), - h + GNUTAR_uid_offset, GNUTAR_uid_size)) { + if (format_number(archive_entry_uid(entry), h + GNUTAR_uid_offset, + GNUTAR_uid_size, GNUTAR_uid_max_size)) { archive_set_error(&a->archive, ERANGE, "Numeric user ID %jd too large", (intmax_t)archive_entry_uid(entry)); ret = ARCHIVE_FAILED; } - /* TODO: How does GNU tar handle large GIDs? */ - if (format_octal(archive_entry_gid(entry), - h + GNUTAR_gid_offset, GNUTAR_gid_size)) { + if (format_number(archive_entry_gid(entry), h + GNUTAR_gid_offset, + GNUTAR_gid_size, GNUTAR_gid_max_size)) { archive_set_error(&a->archive, ERANGE, "Numeric group ID %jd too large", (intmax_t)archive_entry_gid(entry)); ----------------------------------------------------------------------- Summary of changes: .../libarchive/archive_write_set_format_gnutar.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 14:13:35 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 14:13:35 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1643-gfc2f2bd Message-ID: <20150408181335.F23D8ABD9B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fc2f2bd87301bec14c1666a81d40b14b67c9cff9 (commit) via 91792cd17ecf0f129554ab632684c9e114e16248 (commit) from 2174a358603a43337be5e68408f19a2106555108 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc2f2bd87301bec14c1666a81d40b14b67c9cff9 commit fc2f2bd87301bec14c1666a81d40b14b67c9cff9 Merge: 2174a35 91792cd Author: Brad King AuthorDate: Wed Apr 8 14:13:35 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 14:13:35 2015 -0400 Merge topic 'tar-write-format' into next 91792cd1 fixup! libarchive: Use base-256 encoding for UID/GID like GNU tar does http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91792cd17ecf0f129554ab632684c9e114e16248 commit 91792cd17ecf0f129554ab632684c9e114e16248 Author: Brad King AuthorDate: Wed Apr 8 14:05:47 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 14:05:47 2015 -0400 fixup! libarchive: Use base-256 encoding for UID/GID like GNU tar does diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c index 8f5400c..647079d 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c @@ -644,6 +644,7 @@ archive_format_gnutar_header(struct archive_write *a, char h[512], format_octal(archive_entry_mode(entry) & 07777, h + GNUTAR_mode_offset, GNUTAR_mode_size); + /* GNU tar supports base-256 here, so should never overflow. */ if (format_number(archive_entry_uid(entry), h + GNUTAR_uid_offset, GNUTAR_uid_size, GNUTAR_uid_max_size)) { archive_set_error(&a->archive, ERANGE, @@ -652,7 +653,8 @@ archive_format_gnutar_header(struct archive_write *a, char h[512], ret = ARCHIVE_FAILED; } - if (format_number(archive_entry_gid(entry), h + GNUTAR_gid_offset, + /* GNU tar supports base-256 here, so should never overflow. */ + if (format_number(archive_entry_gid(entry), h + GNUTAR_gid_offset, GNUTAR_gid_size, GNUTAR_gid_max_size)) { archive_set_error(&a->archive, ERANGE, "Numeric group ID %jd too large", ----------------------------------------------------------------------- Summary of changes: .../cmlibarchive/libarchive/archive_write_set_format_gnutar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From jamesbigler at gmail.com Wed Apr 8 15:53:58 2015 From: jamesbigler at gmail.com (James Bigler) Date: Wed, 8 Apr 2015 15:53:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1645-g7fbfea4 Message-ID: <20150408195358.D0262AD8B1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7fbfea4b7571b9eae5819d73d866ee2e4f26714b (commit) via 6b291851d45e5704725a7a066dafb31515ac7e85 (commit) from fc2f2bd87301bec14c1666a81d40b14b67c9cff9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7fbfea4b7571b9eae5819d73d866ee2e4f26714b commit 7fbfea4b7571b9eae5819d73d866ee2e4f26714b Merge: fc2f2bd 6b29185 Author: James Bigler AuthorDate: Wed Apr 8 15:53:58 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 15:53:58 2015 -0400 Merge topic 'FindCUDA.cmake/C++11Flags' into next 6b291851 Use if(MATCHES) instead of STRING(REGEXP MATCH) + if(). http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b291851d45e5704725a7a066dafb31515ac7e85 commit 6b291851d45e5704725a7a066dafb31515ac7e85 Author: James Bigler AuthorDate: Wed Apr 8 13:52:47 2015 -0600 Commit: James Bigler CommitDate: Wed Apr 8 13:52:47 2015 -0600 Use if(MATCHES) instead of STRING(REGEXP MATCH) + if(). diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 54dd398..8f1b409 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1188,11 +1188,10 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses # the C preprocessor). In order to get this to work correctly, we need to use nvcc's # specific c++11 flag. - string(REGEX MATCH "-std=c\\+\\+11" _cuda_c11_host_flag_present "${_cuda_host_flags}") - if( _cuda_c11_host_flag_present ) + if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at # the main flag instead of the configuration specific flags. - string(REGEX MATCH "-std;c\\+\\+11" _cuda_c11_nvcc_flag_present "${CUDA_NVCC_FLAGS}") + if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std;c\\+\\+11" ) if( NOT _cuda_c11_nvcc_flag_present ) list(APPEND nvcc_flags --std c++11) endif() ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 16:23:28 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 16:23:28 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1647-g88c25e5 Message-ID: <20150408202328.CCEB5ADEA7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 88c25e5c71578dd0fdd7bf02a108e28dacde94b0 (commit) via 8b66e7c338d29493954af78e47493977d757160b (commit) from 7fbfea4b7571b9eae5819d73d866ee2e4f26714b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=88c25e5c71578dd0fdd7bf02a108e28dacde94b0 commit 88c25e5c71578dd0fdd7bf02a108e28dacde94b0 Merge: 7fbfea4 8b66e7c Author: Brad King AuthorDate: Wed Apr 8 16:23:27 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 16:23:27 2015 -0400 Merge topic 'FindCUDA.cmake/C++11Flags' into next 8b66e7c3 fixup! Use if(MATCHES) instead of STRING(REGEXP MATCH) + if(). http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b66e7c338d29493954af78e47493977d757160b commit 8b66e7c338d29493954af78e47493977d757160b Author: Brad King AuthorDate: Wed Apr 8 16:22:38 2015 -0400 Commit: Brad King CommitDate: Wed Apr 8 16:22:38 2015 -0400 fixup! Use if(MATCHES) instead of STRING(REGEXP MATCH) + if(). diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 8f1b409..7d9f772 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1192,7 +1192,6 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at # the main flag instead of the configuration specific flags. if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std;c\\+\\+11" ) - if( NOT _cuda_c11_nvcc_flag_present ) list(APPEND nvcc_flags --std c++11) endif() string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 1 - 1 file changed, 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 8 16:26:36 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 8 Apr 2015 16:26:36 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1649-gf920f7e Message-ID: <20150408202636.82AD9ADF44@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f920f7e2eab01001ecd438b4f5aec759ce684249 (commit) via 99abebdea01b9ef73e091db5594553f7b1694a1b (commit) from 88c25e5c71578dd0fdd7bf02a108e28dacde94b0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f920f7e2eab01001ecd438b4f5aec759ce684249 commit f920f7e2eab01001ecd438b4f5aec759ce684249 Merge: 88c25e5 99abebd Author: Brad King AuthorDate: Wed Apr 8 16:26:35 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 16:26:35 2015 -0400 Merge topic 'FindCUDA.cmake/C++11Flags' into next 99abebde FindCUDA: Handle c++11 host flag http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99abebdea01b9ef73e091db5594553f7b1694a1b commit 99abebdea01b9ef73e091db5594553f7b1694a1b Author: James Bigler AuthorDate: Sat Mar 21 23:01:24 2015 -0600 Commit: Brad King CommitDate: Wed Apr 8 16:25:47 2015 -0400 FindCUDA: Handle c++11 host flag If the host flags contain a c++11 flag (at least for gcc), then we can't automatically propagate to nvcc it using -Xcompiler. This is because nvcc can't use any C++ only flags. Instead we find this flag and add it to nvcc's flags (it has a special flag for dealing with c++11 code) and remove it from the host flags. Co-Author: Guillermo Marcus diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 81e1cad..7d9f772 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1184,6 +1184,19 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) set(_cuda_nvcc_flags_config "${_cuda_nvcc_flags_config}\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") endforeach() + # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and + # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses + # the C preprocessor). In order to get this to work correctly, we need to use nvcc's + # specific c++11 flag. + if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") + # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at + # the main flag instead of the configuration specific flags. + if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std;c\\+\\+11" ) + list(APPEND nvcc_flags --std c++11) + endif() + string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") + endif() + # Get the list of definitions from the directory property get_directory_property(CUDA_NVCC_DEFINITIONS COMPILE_DEFINITIONS) if(CUDA_NVCC_DEFINITIONS) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From jamesbigler at gmail.com Wed Apr 8 17:11:50 2015 From: jamesbigler at gmail.com (James Bigler) Date: Wed, 8 Apr 2015 17:11:50 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1654-g311d165 Message-ID: <20150408211150.633D58C4B5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 311d1653f9f79a4fe719491a116425aa56d95f78 (commit) via f0614dd68b2e7d7d939de807411a23ecc7df3722 (commit) via f6ffc18f28fc00be7f3fafdc6b063f4bac5226b1 (commit) via 094dff091da1125102c3e55890317af748798d8b (commit) via 2b475cd517f9ec42e1ccd2b72edab988ab2c178d (commit) from f920f7e2eab01001ecd438b4f5aec759ce684249 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=311d1653f9f79a4fe719491a116425aa56d95f78 commit 311d1653f9f79a4fe719491a116425aa56d95f78 Merge: f920f7e f0614dd Author: James Bigler AuthorDate: Wed Apr 8 17:11:49 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 8 17:11:49 2015 -0400 Merge topic 'FindCUDA.cmake/CUDA_SOURCE_FILE' into next f0614dd6 Merge topic 'link-implicit-libs-full-path' into FindCUDA.cmake/CUDA_SOURCE_FILE f6ffc18f Merge topic 'cmake-command-line-help-vs-arch' into FindCUDA.cmake/CUDA_SOURCE_FILE 094dff09 Add specific cuda_language_flag instead of using nvcc. Fixes bug. 2b475cd5 Allow setting CUDA_SOURCE_PROPERTY_FORMAT for non-.cu files. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0614dd68b2e7d7d939de807411a23ecc7df3722 commit f0614dd68b2e7d7d939de807411a23ecc7df3722 Merge: f6ffc18 f4e6341 Author: James Bigler AuthorDate: Wed Apr 8 15:09:29 2015 -0600 Commit: James Bigler CommitDate: Wed Apr 8 15:09:29 2015 -0600 Merge topic 'link-implicit-libs-full-path' into FindCUDA.cmake/CUDA_SOURCE_FILE http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f6ffc18f28fc00be7f3fafdc6b063f4bac5226b1 commit f6ffc18f28fc00be7f3fafdc6b063f4bac5226b1 Merge: 094dff0 1e38433 Author: James Bigler AuthorDate: Wed Apr 8 15:08:22 2015 -0600 Commit: James Bigler CommitDate: Wed Apr 8 15:08:22 2015 -0600 Merge topic 'cmake-command-line-help-vs-arch' into FindCUDA.cmake/CUDA_SOURCE_FILE Documentation comments collided with other commit. Conflicts: Modules/FindCUDA.cmake diff --cc Modules/FindCUDA.cmake index 054ffbd,8f80993..3d994b9 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@@ -106,11 -106,10 +106,17 @@@ # CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and # CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. # +# CUDA_SOURCE_PROPERTY_FORMAT - # -- If this source file property is set, it can override the format specified to - # CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file is not a .cu - # file, setting this file will cause it to be treated as a .cu file. See - # documentation for set_source_files_properties on how to set this property. ++# -- If this source file property is set, it can override the format specified ++# to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file ++# is not a .cu file, setting this file will cause it to be treated as a .cu ++# file. See documentation for set_source_files_properties on how to set ++# this property. ++# + # CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) + # -- When enabled the static version of the CUDA runtime library will be used + # in CUDA_LIBRARIES. If the version of CUDA configured doesn't support + # this option, then it will be silently disabled. # # CUDA_VERBOSE_BUILD (Default OFF) # -- Set to ON to see all the commands used when building the CUDA file. When http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=094dff091da1125102c3e55890317af748798d8b commit 094dff091da1125102c3e55890317af748798d8b Author: James Bigler AuthorDate: Wed Apr 1 17:23:51 2015 -0600 Commit: James Bigler CommitDate: Wed Apr 1 17:23:51 2015 -0600 Add specific cuda_language_flag instead of using nvcc. Fixes bug. I was previously appending to nvcc_flags inside the file loop. This caused the flag to be appended multiple times which freaks out nvcc. Now the flag is specifically handled per file. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 99c4b30..054ffbd 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1219,7 +1219,9 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) endif() # If file isn't a .cu file, we need to tell nvcc to treat it as such. if(NOT ${file} MATCHES "\\.cu$") - list(APPEND nvcc_flags "-x=cu") + set(cuda_language_flag -x=cu) + else() + set(cuda_language_flag) endif() if( ${_cuda_source_format} MATCHES "OBJ") diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake index abdd307..8032309 100644 --- a/Modules/FindCUDA/run_nvcc.cmake +++ b/Modules/FindCUDA/run_nvcc.cmake @@ -75,6 +75,7 @@ set(CUDA_NVCC_FLAGS @CUDA_NVCC_FLAGS@ ;; @CUDA_WRAP_OPTION_NVCC_FLAGS@) # list set(nvcc_flags @nvcc_flags@) # list set(CUDA_NVCC_INCLUDE_ARGS "@CUDA_NVCC_INCLUDE_ARGS@") # list (needs to be in quotes to handle spaces properly). set(format_flag "@format_flag@") # string +set(cuda_language_flag @cuda_language_flag@) # list if(build_cubin AND NOT generated_cubin_file) message(FATAL_ERROR "You must specify generated_cubin_file on the command line") @@ -238,6 +239,7 @@ cuda_execute_process( "Generating ${generated_file}" COMMAND "${CUDA_NVCC_EXECUTABLE}" "${source_file}" + ${cuda_language_flag} ${format_flag} -o "${generated_file}" ${CCBIN} ${nvcc_flags} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b475cd517f9ec42e1ccd2b72edab988ab2c178d commit 2b475cd517f9ec42e1ccd2b72edab988ab2c178d Author: James Bigler AuthorDate: Thu Mar 26 23:46:35 2015 -0600 Commit: James Bigler CommitDate: Thu Mar 26 23:46:35 2015 -0600 Allow setting CUDA_SOURCE_PROPERTY_FORMAT for non-.cu files. A previously undocumented feature allowed overriding the format specified to CUDA_WRAP_SRCS with a source file property called CUDA_SOURCE_PROPERTY_FORMAT. I added documentation for this feature as well as added the ability to let nvcc compile any file regardless of type if this property was found. In addition, I also fixed a couple of bugs with the calls to _cuda_get_important_host_flags that weren't garding the arguments with "" to prevent empty values from causing errors. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 81e1cad..99c4b30 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -106,6 +106,12 @@ # CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and # CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. # +# CUDA_SOURCE_PROPERTY_FORMAT +# -- If this source file property is set, it can override the format specified to +# CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file is not a .cu +# file, setting this file will cause it to be treated as a .cu file. See +# documentation for set_source_files_properties on how to set this property. +# # CUDA_VERBOSE_BUILD (Default OFF) # -- Set to ON to see all the commands used when building the CUDA file. When # using a Makefile generator the value defaults to VERBOSE (run make @@ -1204,13 +1210,17 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) foreach(file ${ARGN}) # Ignore any file marked as a HEADER_FILE_ONLY get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) - if(${file} MATCHES "\\.cu$" AND NOT _is_header) + # Allow per source file overrides of the format. Also allows compiling non-.cu files. + get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) + if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) - # Allow per source file overrides of the format. - get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) if(NOT _cuda_source_format) set(_cuda_source_format ${format}) endif() + # If file isn't a .cu file, we need to tell nvcc to treat it as such. + if(NOT ${file} MATCHES "\\.cu$") + list(APPEND nvcc_flags "-x=cu") + endif() if( ${_cuda_source_format} MATCHES "OBJ") set( cuda_compile_to_external_module OFF ) @@ -1223,7 +1233,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) elseif( ${_cuda_source_format} MATCHES "FATBIN") set( cuda_compile_to_external_module_type "fatbin" ) else() - message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") + message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") endif() endif() @@ -1382,10 +1392,10 @@ endmacro() function(_cuda_get_important_host_flags important_flags flag_string) if(CMAKE_GENERATOR MATCHES "Visual Studio") - string(REGEX MATCHALL "/M[DT][d]?" flags ${flag_string}) + string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") list(APPEND ${important_flags} ${flags}) else() - string(REGEX MATCHALL "-fPIC" flags ${flag_string}) + string(REGEX MATCHALL "-fPIC" flags "${flag_string}") list(APPEND ${important_flags} ${flags}) endif() set(${important_flags} ${${important_flags}} PARENT_SCOPE) @@ -1445,14 +1455,14 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options list(APPEND config_specific_flags $<$:${f}>) endforeach() set(important_host_flags) - _cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") foreach(f ${important_host_flags}) 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}) + _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() ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 29 +++++++++++++++++++++-------- Modules/FindCUDA/run_nvcc.cmake | 2 ++ 2 files changed, 23 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Apr 9 00:01:06 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 9 Apr 2015 00:01:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-678-g3049951 Message-ID: <20150409040106.6AFCCAE08F@public.kitware.com> This is an automated email from 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 3049951b6293486053da2d304737fad42de3b3d8 (commit) from f3be6c1b9b3df6f1121e578807f06c29a003c58d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3049951b6293486053da2d304737fad42de3b3d8 commit 3049951b6293486053da2d304737fad42de3b3d8 Author: Kitware Robot AuthorDate: Thu Apr 9 00:01:05 2015 -0400 Commit: Kitware Robot CommitDate: Thu Apr 9 00:01:05 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 5214832..1e4302e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150408) +set(CMake_VERSION_PATCH 20150409) #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 Apr 9 02:40:12 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 9 Apr 2015 02:40:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1659-g9a9f626 Message-ID: <20150409064012.E2C5A14BF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9a9f62683ff256cd90a1ab98effc12a821a48f0d (commit) via d0e13ab4761b02eaf1068327fc67337500e0fd6f (commit) via ff6f31993e160c20d2ad3b05e2d3623f3e98b201 (commit) via e3e9c2dbd7b3cea93aa24fccd780f1d79512c767 (commit) via 40c7d0eabed709f7187fd85cba2c7e1472a01bb1 (commit) from 311d1653f9f79a4fe719491a116425aa56d95f78 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a9f62683ff256cd90a1ab98effc12a821a48f0d commit 9a9f62683ff256cd90a1ab98effc12a821a48f0d Merge: 311d165 d0e13ab Author: Stephen Kelly AuthorDate: Thu Apr 9 02:40:10 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 02:40:10 2015 -0400 Merge topic 'introduce-cmState' into next d0e13ab4 cmState: Move CacheEntryType enum from cmCacheManager. ff6f3199 cmMakefile: Remove unused CacheManager accessor. e3e9c2db Port to cmState. 40c7d0ea Introduce cmState class. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d0e13ab4761b02eaf1068327fc67337500e0fd6f commit d0e13ab4761b02eaf1068327fc67337500e0fd6f Author: Stephen Kelly AuthorDate: Tue Apr 7 22:45:54 2015 +0200 Commit: Stephen Kelly CommitDate: Thu Apr 9 08:34:03 2015 +0200 cmState: Move CacheEntryType enum from cmCacheManager. diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx index fd15b99..29d9cb2 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.cxx +++ b/Source/CursesDialog/cmCursesBoolWidget.cxx @@ -16,7 +16,7 @@ cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::BOOL; + this->Type = cmState::BOOL; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 4eb8e6c..7e09242 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -55,7 +55,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( assert(value); switch (cm->GetState()->GetCacheEntryType(key)) { - case cmCacheManager::BOOL: + case cmState::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); if (cmSystemTools::IsOn(value)) { @@ -66,15 +66,15 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( static_cast(this->Entry)->SetValueAsBool(false); } break; - case cmCacheManager::PATH: + case cmState::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); static_cast(this->Entry)->SetString(value); break; - case cmCacheManager::FILEPATH: + case cmState::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); static_cast(this->Entry)->SetString(value); break; - case cmCacheManager::STRING: + case cmState::STRING: { const char* stringsProp = cm->GetState() ->GetCacheEntryProperty(key, "STRINGS"); @@ -99,7 +99,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } break; } - case cmCacheManager::UNINITIALIZED: + case cmState::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", key.c_str()); break; diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index dc4ee4af..f280897 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -12,7 +12,6 @@ #ifndef cmCursesCacheEntryComposite_h #define cmCursesCacheEntryComposite_h -#include "../cmCacheManager.h" #include "cmCursesLabelWidget.h" class cmCursesCacheEntryComposite diff --git a/Source/CursesDialog/cmCursesDummyWidget.cxx b/Source/CursesDialog/cmCursesDummyWidget.cxx index 60086a5..9801e4d 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.cxx +++ b/Source/CursesDialog/cmCursesDummyWidget.cxx @@ -15,7 +15,7 @@ cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::INTERNAL; + this->Type = cmState::INTERNAL; } diff --git a/Source/CursesDialog/cmCursesFilePathWidget.cxx b/Source/CursesDialog/cmCursesFilePathWidget.cxx index 01db014..51ed670 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.cxx +++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx @@ -15,6 +15,6 @@ cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, int left, int top) : cmCursesPathWidget(width, height, left, top) { - this->Type = cmCacheManager::FILEPATH; + this->Type = cmState::FILEPATH; } diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index b067743..be17a9f 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmVersion.h" #include "../cmake.h" @@ -118,11 +117,11 @@ void cmCursesMainForm::InitializeUI() for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() + cmState::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); - if (t != cmCacheManager::INTERNAL && - t != cmCacheManager::STATIC && - t != cmCacheManager::UNINITIALIZED) + if (t != cmState::INTERNAL && + t != cmState::STATIC && + t != cmState::UNINITIALIZED) { ++count; } @@ -148,11 +147,11 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() + cmState::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); - if (t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED ) + if (t == cmState::INTERNAL || + t == cmState::STATIC || + t == cmState::UNINITIALIZED ) { continue; } @@ -172,11 +171,11 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() + cmState::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); - if (t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED ) + if (t == cmState::INTERNAL || + t == cmState::STATIC || + t == cmState::UNINITIALIZED ) { continue; } @@ -294,9 +293,9 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) cmCursesWidget* cw = reinterpret_cast (field_userptr(currentField)); // If in edit mode, get out of it - if ( cw->GetType() == cmCacheManager::STRING || - cw->GetType() == cmCacheManager::PATH || - cw->GetType() == cmCacheManager::FILEPATH ) + if ( cw->GetType() == cmState::STRING || + cw->GetType() == cmState::PATH || + cw->GetType() == cmState::FILEPATH ) { cmCursesStringWidget* sw = static_cast(cw); sw->SetInEdit(false); @@ -823,7 +822,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - cmCacheManager::CacheEntryType t = + cmState::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(cacheKey); this->FixValue(t, oldValue, fixedOldValue); @@ -841,15 +840,15 @@ void cmCursesMainForm::FillCacheManagerFromUI() } } -void cmCursesMainForm::FixValue(cmCacheManager::CacheEntryType type, +void cmCursesMainForm::FixValue(cmState::CacheEntryType type, const std::string& in, std::string& out) const { out = in.substr(0,in.find_last_not_of(" ")+1); - if(type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH) + if(type == cmState::PATH || type == cmState::FILEPATH) { cmSystemTools::ConvertToUnixSlashes(out); } - if(type == cmCacheManager::BOOL) + if(type == cmState::BOOL) { if(cmSystemTools::IsOff(out.c_str())) { diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 6455252..255c823 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -113,7 +113,7 @@ protected: // cache. void FillCacheManagerFromUI(); // Fix formatting of values to a consistent form. - void FixValue(cmCacheManager::CacheEntryType type, + void FixValue(cmState::CacheEntryType type, const std::string& in, std::string& out) const; // Re-post the existing fields. Used to toggle between // normal and advanced modes. Render() should be called diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx index 2f4b59e..30110a4 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.cxx +++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx @@ -21,7 +21,7 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::BOOL; // this is a bit of a hack + this->Type = cmState::BOOL; // this is a bit of a hack // there is no option type, and string type causes ccmake to cast // the widget into a string widget at some point. BOOL is safe for // now. diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx index 89e2238..6116823 100644 --- a/Source/CursesDialog/cmCursesPathWidget.cxx +++ b/Source/CursesDialog/cmCursesPathWidget.cxx @@ -18,7 +18,7 @@ cmCursesPathWidget::cmCursesPathWidget(int width, int height, int left, int top) : cmCursesStringWidget(width, height, left, top) { - this->Type = cmCacheManager::PATH; + this->Type = cmState::PATH; this->Cycle = false; this->CurrentIndex = 0; } @@ -59,7 +59,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w) } std::vector dirs; - cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmCacheManager::PATH?-1:0)); + cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmState::PATH?-1:0)); if ( this->CurrentIndex < dirs.size() ) { cstr = dirs[this->CurrentIndex]; diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index d25022d..acf262f 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -22,7 +22,7 @@ cmCursesStringWidget::cmCursesStringWidget(int width, int height, cmCursesWidget(width, height, left, top) { this->InEdit = false; - this->Type = cmCacheManager::STRING; + this->Type = cmState::STRING; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h index 7d82864..7bbdff1 100644 --- a/Source/CursesDialog/cmCursesWidget.h +++ b/Source/CursesDialog/cmCursesWidget.h @@ -12,7 +12,7 @@ #ifndef cmCursesWidget_h #define cmCursesWidget_h -#include "../cmCacheManager.h" +#include "../cmState.h" #include "cmCursesStandardIncludes.h" class cmCursesMainForm; @@ -46,7 +46,7 @@ public: /** * Get the type of the widget (STRING, PATH etc...) */ - cmCacheManager::CacheEntryType GetType() + cmState::CacheEntryType GetType() { return this->Type; } /** @@ -77,7 +77,7 @@ protected: cmCursesWidget(const cmCursesWidget& from); void operator=(const cmCursesWidget&); - cmCacheManager::CacheEntryType Type; + cmState::CacheEntryType Type; std::string Value; FIELD* Field; // The page in the main form this widget is in diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 775c11c..6524350 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -200,9 +200,9 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = state->GetCacheEntryType(*it); - if(t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC) + cmState::CacheEntryType t = state->GetCacheEntryType(*it); + if(t == cmState::INTERNAL || + t == cmState::STATIC) { continue; } @@ -249,28 +249,28 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toBool() ? "ON" : "OFF", s.Help.toLocal8Bit().data(), - cmCacheManager::BOOL); + cmState::BOOL); } else if(s.Type == QCMakeProperty::STRING) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::STRING); + cmState::STRING); } else if(s.Type == QCMakeProperty::PATH) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::PATH); + cmState::PATH); } else if(s.Type == QCMakeProperty::FILEPATH) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); } } @@ -286,10 +286,10 @@ QCMakePropertyList QCMake::properties() const for (std::vector::const_iterator i = cacheKeys.begin(); i != cacheKeys.end(); ++i) { - cmCacheManager::CacheEntryType t = state->GetCacheEntryType(*i); - if(t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED) + cmState::CacheEntryType t = state->GetCacheEntryType(*i); + if(t == cmState::INTERNAL || + t == cmState::STATIC || + t == cmState::UNINITIALIZED) { continue; } @@ -302,20 +302,20 @@ QCMakePropertyList QCMake::properties() const state->GetCacheEntryProperty(*i, "HELPSTRING")); prop.Value = QString::fromLocal8Bit(cachedValue); prop.Advanced = state->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); - if(t == cmCacheManager::BOOL) + if(t == cmState::BOOL) { prop.Type = QCMakeProperty::BOOL; prop.Value = cmSystemTools::IsOn(cachedValue); } - else if(t == cmCacheManager::PATH) + else if(t == cmState::PATH) { prop.Type = QCMakeProperty::PATH; } - else if(t == cmCacheManager::FILEPATH) + else if(t == cmState::FILEPATH) { prop.Type = QCMakeProperty::FILEPATH; } - else if(t == cmCacheManager::STRING) + else if(t == cmState::STRING) { prop.Type = QCMakeProperty::STRING; const char* stringsProperty = diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 5d32437..cdca792 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -147,6 +147,6 @@ bool cmBuildCommand makecommand.c_str(), "Command used to build entire project " "from the command line.", - cmCacheManager::STRING); + cmState::STRING); return true; } diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 171ed0f..2a06574 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -39,7 +39,7 @@ bool cmBuildNameCommand this->Makefile->AddCacheDefinition(args[0], cv.c_str(), "Name of build.", - cmCacheManager::STRING); + cmState::STRING); } return true; } @@ -74,7 +74,7 @@ bool cmBuildNameCommand this->Makefile->AddCacheDefinition(args[0], buildname.c_str(), "Name of build.", - cmCacheManager::STRING); + cmState::STRING); return true; } diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 987a7b1..5ae7d4c 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -87,27 +87,27 @@ void CCONV cmAddCacheDefinition(void *arg, const char* name, { case CM_CACHE_BOOL: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::BOOL); + cmState::BOOL); break; case CM_CACHE_PATH: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::PATH); + cmState::PATH); break; case CM_CACHE_FILEPATH: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::FILEPATH); + cmState::FILEPATH); break; case CM_CACHE_STRING: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::STRING); + cmState::STRING); break; case CM_CACHE_INTERNAL: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::INTERNAL); + cmState::INTERNAL); break; case CM_CACHE_STATIC: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::STATIC); + cmState::STATIC); break; } } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 1db057b..6715638 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2279,7 +2279,7 @@ bool cmCTest::AddVariableDefinition(const std::string &arg) { std::string name; std::string value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmState::CacheEntryType type = cmState::UNINITIALIZED; if (cmake::ParseCacheEntry(arg, name, value, type)) { diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 5387d0c..289d0dc 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -22,17 +22,6 @@ #include #include -const char* cmCacheManagerTypes[] = -{ "BOOL", - "PATH", - "FILEPATH", - "STRING", - "INTERNAL", - "STATIC", - "UNINITIALIZED", - 0 -}; - cmCacheManager::cmCacheManager(cmake* cm) { this->CacheMajorVersion = 0; @@ -40,41 +29,6 @@ cmCacheManager::cmCacheManager(cmake* cm) this->CMakeInstance = cm; } -const char* cmCacheManager::TypeToString(cmCacheManager::CacheEntryType type) -{ - if ( type > 6 ) - { - return cmCacheManagerTypes[6]; - } - return cmCacheManagerTypes[type]; -} - -cmCacheManager::CacheEntryType cmCacheManager::StringToType(const char* s) -{ - int i = 0; - while(cmCacheManagerTypes[i]) - { - if(strcmp(s, cmCacheManagerTypes[i]) == 0) - { - return static_cast(i); - } - ++i; - } - return STRING; -} - -bool cmCacheManager::IsType(const char* s) -{ - for(int i=0; cmCacheManagerTypes[i]; ++i) - { - if(strcmp(s, cmCacheManagerTypes[i]) == 0) - { - return true; - } - } - return false; -} - bool cmCacheManager::LoadCache(const std::string& path) { std::set emptySet; @@ -122,7 +76,7 @@ static bool ParseEntryWithoutType(const std::string& entry, bool cmCacheManager::ParseEntry(const std::string& entry, std::string& var, std::string& value, - CacheEntryType& type) + cmState::CacheEntryType& type) { // input line is: key:type=value static cmsys::RegularExpression reg( @@ -134,14 +88,14 @@ bool cmCacheManager::ParseEntry(const std::string& entry, if(regQuoted.find(entry)) { var = regQuoted.match(1); - type = cmCacheManager::StringToType(regQuoted.match(2).c_str()); + type = cmState::StringToCacheEntryType(regQuoted.match(2).c_str()); value = regQuoted.match(3); flag = true; } else if (reg.find(entry)) { var = reg.match(1); - type = cmCacheManager::StringToType(reg.match(2).c_str()); + type = cmState::StringToCacheEntryType(reg.match(2).c_str()); value = reg.match(3); flag = true; } @@ -250,7 +204,7 @@ bool cmCacheManager::LoadCache(const std::string& path, // If the entry is not internal to the cache being loaded // or if it is in the list of internal entries to be // imported, load it. - if ( internal || (e.Type != INTERNAL) || + if ( internal || (e.Type != cmState::INTERNAL) || (includes.find(entryKey) != includes.end()) ) { // If we are loading the cache from another project, @@ -258,7 +212,7 @@ bool cmCacheManager::LoadCache(const std::string& path, // not visible in the gui if (!internal) { - e.Type = INTERNAL; + e.Type = cmState::INTERNAL; helpString = "DO NOT EDIT, "; helpString += entryKey; helpString += " loaded from external file. " @@ -306,10 +260,10 @@ bool cmCacheManager::LoadCache(const std::string& path, // Set as version 0.0 this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", "0", "Minor version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmState::INTERNAL); this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", "0", "Major version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmState::INTERNAL); } // check to make sure the cache directory has not @@ -351,7 +305,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, CacheEntry& e) { // All property entries are internal. - if(e.Type != cmCacheManager::INTERNAL) + if(e.Type != cmState::INTERNAL) { return false; } @@ -370,7 +324,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, // Create an entry and store the property. CacheEntry& ne = this->Cache[key]; ne.Properties.SetCMakeInstance(this->CMakeInstance); - ne.Type = cmCacheManager::UNINITIALIZED; + ne.Type = cmState::UNINITIALIZED; ne.SetProperty(*p, e.Value.c_str()); } else @@ -427,15 +381,15 @@ bool cmCacheManager::SaveCache(const std::string& path) sprintf(temp, "%d", cmVersion::GetMinorVersion()); this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp, "Minor version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmState::INTERNAL); sprintf(temp, "%d", cmVersion::GetMajorVersion()); this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", temp, "Major version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmState::INTERNAL); sprintf(temp, "%d", cmVersion::GetPatchVersion()); this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION", temp, "Patch version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmState::INTERNAL); // Let us store the current working directory so that if somebody // Copies it, he will not be surprised @@ -450,7 +404,7 @@ bool cmCacheManager::SaveCache(const std::string& path) cmSystemTools::ConvertToUnixSlashes(currentcwd); this->AddCacheEntry("CMAKE_CACHEFILE_DIR", currentcwd.c_str(), "This is the directory where this CMakeCache.txt" - " was created", cmCacheManager::INTERNAL); + " was created", cmState::INTERNAL); fout << "# This is the CMakeCache file.\n" << "# For build in directory: " << currentcwd << "\n"; @@ -484,7 +438,7 @@ bool cmCacheManager::SaveCache(const std::string& path) this->Cache.begin(); i != this->Cache.end(); ++i) { const CacheEntry& ce = (*i).second; - CacheEntryType t = ce.Type; + cmState::CacheEntryType t = ce.Type; if(!ce.Initialized) { /* @@ -493,7 +447,7 @@ bool cmCacheManager::SaveCache(const std::string& path) "\" is uninitialized"); */ } - else if(t != INTERNAL) + else if(t != cmState::INTERNAL) { // Format is key:type=value if(const char* help = ce.GetProperty("HELPSTRING")) @@ -505,7 +459,7 @@ bool cmCacheManager::SaveCache(const std::string& path) cmCacheManager::OutputHelpString(fout, "Missing description"); } this->OutputKey(fout, i->first); - fout << ":" << cmCacheManagerTypes[t] << "="; + fout << ":" << cmState::CacheEntryTypeToString(t) << "="; this->OutputValue(fout, ce.Value); fout << "\n\n"; } @@ -525,9 +479,9 @@ bool cmCacheManager::SaveCache(const std::string& path) continue; } - CacheEntryType t = i.GetType(); + cmState::CacheEntryType t = i.GetType(); this->WritePropertyEntries(fout, i); - if(t == cmCacheManager::INTERNAL) + if(t == cmState::INTERNAL) { // Format is key:type=value if(const char* help = i.GetProperty("HELPSTRING")) @@ -535,7 +489,7 @@ bool cmCacheManager::SaveCache(const std::string& path) this->OutputHelpString(fout, help); } this->OutputKey(fout, i.GetName()); - fout << ":" << cmCacheManagerTypes[t] << "="; + fout << ":" << cmState::CacheEntryTypeToString(t) << "="; this->OutputValue(fout, i.GetValue()); fout << "\n"; } @@ -677,7 +631,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const for(std::map::const_iterator i = this->Cache.begin(); i != this->Cache.end(); ++i) { - if((*i).second.Type != INTERNAL) + if((*i).second.Type != cmState::INTERNAL) { out << (*i).first << " = " << (*i).second.Value << std::endl; @@ -693,7 +647,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const void cmCacheManager::AddCacheEntry(const std::string& key, const char* value, const char* helpString, - CacheEntryType type) + cmState::CacheEntryType type) { CacheEntry& e = this->Cache[key]; e.Properties.SetCMakeInstance(this->CMakeInstance); @@ -708,7 +662,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key, } e.Type = type; // make sure we only use unix style paths - if(type == FILEPATH || type == PATH) + if(type == cmState::FILEPATH || type == cmState::PATH) { if(e.Value.find(';') != e.Value.npos) { @@ -789,7 +743,7 @@ cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const { if(prop == "TYPE") { - return cmCacheManagerTypes[this->Type]; + return cmState::CacheEntryTypeToString(this->Type); } else if(prop == "VALUE") { @@ -806,7 +760,7 @@ void cmCacheManager::CacheEntry::SetProperty(const std::string& prop, { if(prop == "TYPE") { - this->Type = cmCacheManager::StringToType(value? value : "STRING"); + this->Type = cmState::StringToCacheEntryType(value? value : "STRING"); } else if(prop == "VALUE") { @@ -825,7 +779,7 @@ void cmCacheManager::CacheEntry::AppendProperty(const std::string& prop, { if(prop == "TYPE") { - this->Type = cmCacheManager::StringToType(value? value : "STRING"); + this->Type = cmState::StringToCacheEntryType(value? value : "STRING"); } else if(prop == "VALUE") { diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 00ae334..8462259 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -14,6 +14,8 @@ #include "cmStandardIncludes.h" #include "cmPropertyMap.h" +#include "cmState.h" + class cmMakefile; class cmMarkAsAdvancedCommand; class cmake; @@ -30,21 +32,22 @@ public: cmCacheManager(cmake* cm); class CacheIterator; friend class cmCacheManager::CacheIterator; - enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, - UNINITIALIZED }; private: struct CacheEntry { std::string Value; - CacheEntryType Type; + cmState::CacheEntryType Type; cmPropertyMap Properties; const char* GetProperty(const std::string&) const; void SetProperty(const std::string& property, const char* value); void AppendProperty(const std::string& property, const char* value, bool asString=false); bool Initialized; - CacheEntry() : Value(""), Type(UNINITIALIZED), Initialized(false) + CacheEntry() + : Value(""), + Type(cmState::UNINITIALIZED), + Initialized(false) {} }; @@ -68,8 +71,10 @@ public: const char* GetValue() const { return this->GetEntry().Value.c_str(); } bool GetValueAsBool() const; void SetValue(const char*); - CacheEntryType GetType() const { return this->GetEntry().Type; } - void SetType(CacheEntryType ty) { this->GetEntry().Type = ty; } + cmState::CacheEntryType GetType() const + { return this->GetEntry().Type; } + void SetType(cmState::CacheEntryType ty) + { this->GetEntry().Type = ty; } bool Initialized() { return this->GetEntry().Initialized; } cmCacheManager &Container; std::map::iterator Position; @@ -94,17 +99,6 @@ public: return CacheIterator(*this); } - /** - * Types for the cache entries. These are useful as - * hints for a cache editor program. Path should bring - * up a file chooser, BOOL a check box, and STRING a - * text entry box, FILEPATH is a full path to a file which - * can be different than just a path input - */ - static CacheEntryType StringToType(const char*); - static const char* TypeToString(CacheEntryType); - static bool IsType(const char*); - ///! Load a cache for given makefile. Loads from path/CMakeCache.txt. bool LoadCache(const std::string& path); bool LoadCache(const std::string& path, bool internal, @@ -134,7 +128,7 @@ public: static bool ParseEntry(const std::string& entry, std::string& var, std::string& value, - CacheEntryType& type); + cmState::CacheEntryType& type); ///! Get a value from the cache given a key const char* GetInitializedCacheValue(const std::string& key) const; @@ -155,7 +149,7 @@ public: return this->GetCacheIterator(key.c_str()).GetProperty(propName); } - CacheEntryType GetCacheEntryType(std::string const& key) + cmState::CacheEntryType GetCacheEntryType(std::string const& key) { return this->GetCacheIterator(key.c_str()).GetType(); } @@ -223,7 +217,8 @@ public: protected: ///! Add an entry into the cache void AddCacheEntry(const std::string& key, const char* value, - const char* helpString, CacheEntryType type); + const char* helpString, + cmState::CacheEntryType type); ///! Get a cache entry object for a key CacheEntry *GetCacheEntry(const std::string& key); diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 59efa52..56a884c 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmCoreTryCompile.h" #include "cmake.h" -#include "cmCacheManager.h" #include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmAlgorithms.h" @@ -527,7 +526,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) this->Makefile->AddCacheDefinition(argv[0], (res == 0 ? "TRUE" : "FALSE"), "Result of TRY_COMPILE", - cmCacheManager::INTERNAL); + cmState::INTERNAL); if (!outputVariable.empty()) { diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 6750769..35b70e8 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -222,7 +222,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, // in the cache valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), - cacheEntryName.c_str(), cmCacheManager::STRING, + cacheEntryName.c_str(), cmState::STRING, true); mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } @@ -243,7 +243,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, { valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), - cacheEntryName.c_str(), cmCacheManager::STRING, + cacheEntryName.c_str(), cmState::STRING, true); mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index f10d545..add06a7 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -378,7 +378,7 @@ bool cmFindBase::CheckForVariableInCache() // original value. Tell the subclass implementations to do // this. if(cached && state->GetCacheEntryType(this->VariableName) - == cmCacheManager::UNINITIALIZED) + == cmState::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; } diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index c499f61..ef8340b 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindLibraryCommand.h" -#include "cmCacheManager.h" #include #include @@ -39,7 +38,7 @@ bool cmFindLibraryCommand { this->Makefile->AddCacheDefinition(this->VariableName, "", this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); } return true; } @@ -72,14 +71,14 @@ bool cmFindLibraryCommand this->Makefile->AddCacheDefinition(this->VariableName, library.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); return true; } std::string notfound = this->VariableName + "-NOTFOUND"; this->Makefile->AddCacheDefinition(this->VariableName, notfound.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); return true; } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 4d7fd60..b32f5fd 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -947,7 +947,7 @@ bool cmFindPackageCommand::FindConfig() // We force the value since we do not get here if it was already set. this->Makefile->AddCacheDefinition(this->Variable, init.c_str(), help.c_str(), - cmCacheManager::PATH, true); + cmState::PATH, true); return found; } diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 49fbf45..1f3d1a4 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindPathCommand.h" -#include "cmCacheManager.h" #include @@ -41,7 +40,7 @@ bool cmFindPathCommand this->VariableName, "", this->VariableDocumentation.c_str(), (this->IncludeFileInPath ? - cmCacheManager::FILEPATH :cmCacheManager::PATH) + cmState::FILEPATH :cmState::PATH) ); } return true; @@ -54,7 +53,7 @@ bool cmFindPathCommand (this->VariableName, result.c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? - cmCacheManager::FILEPATH :cmCacheManager::PATH); + cmState::FILEPATH :cmState::PATH); return true; } this->Makefile->AddCacheDefinition @@ -62,7 +61,7 @@ bool cmFindPathCommand (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? - cmCacheManager::FILEPATH :cmCacheManager::PATH); + cmState::FILEPATH :cmState::PATH); return true; } diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 4ee419c..fbd9fd3 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindProgramCommand.h" -#include "cmCacheManager.h" #include #if defined(__APPLE__) @@ -37,7 +36,7 @@ bool cmFindProgramCommand { this->Makefile->AddCacheDefinition(this->VariableName, "", this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); } return true; } @@ -49,14 +48,14 @@ bool cmFindProgramCommand this->Makefile->AddCacheDefinition(this->VariableName, result.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); return true; } this->Makefile->AddCacheDefinition(this->VariableName, (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); return true; } diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 9aceb39..6947a7f 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -117,13 +117,13 @@ bool cmGetFilenameComponentCommand { this->Makefile->AddCacheDefinition (storeArgs, programArgs.c_str(), - "", args[2] == "PATH" ? cmCacheManager::FILEPATH - : cmCacheManager::STRING); + "", args[2] == "PATH" ? cmState::FILEPATH + : cmState::STRING); } this->Makefile->AddCacheDefinition (args[0], result.c_str(), "", - args[2] == "PATH" ? cmCacheManager::FILEPATH - : cmCacheManager::STRING); + args[2] == "PATH" ? cmState::FILEPATH + : cmState::STRING); } else { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f6ec643..4a93446 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -311,7 +311,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) makeProgram += saveFile; mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", makeProgram.c_str(), "make program", - cmCacheManager::FILEPATH); + cmState::FILEPATH); } } @@ -1116,7 +1116,7 @@ void cmGlobalGenerator::Configure() sprintf(num,"%d",static_cast(this->LocalGenerators.size())); this->GetCMakeInstance()->AddCacheEntry ("CMAKE_NUMBER_OF_LOCAL_GENERATORS", num, - "number of local generators", cmCacheManager::INTERNAL); + "number of local generators", cmState::INTERNAL); // check for link libraries and include directories containing "NOTFOUND" // and for infinite loops @@ -1894,7 +1894,7 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen, gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM"); this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make, "make program", - cmCacheManager::FILEPATH); + cmState::FILEPATH); // copy the enabled languages this->LanguageEnabled = gen->LanguageEnabled; this->LanguagesReady = gen->LanguagesReady; diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 7648813..22d633c 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -97,7 +97,7 @@ std::string cmGlobalUnixMakefileGenerator3::GetEditCacheCommand() const { cm->AddCacheEntry ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(), - "Path to cache edit program executable.", cmCacheManager::INTERNAL); + "Path to cache edit program executable.", cmState::INTERNAL); } } const char* edit_cmd = cm->GetCacheDefinition("CMAKE_EDIT_COMMAND"); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 0e0e63a..6a3a145 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -89,7 +89,7 @@ void cmGlobalVisualStudio7Generator "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmState::STRING); } // Create list of configurations requested by user's cache, if any. @@ -109,7 +109,7 @@ void cmGlobalVisualStudio7Generator mf->AddCacheDefinition ("CMAKE_MSVCIDE_RUN_PATH", extraPath, "Saved environment variable CMAKE_MSVCIDE_RUN_PATH", - cmCacheManager::STATIC); + cmState::STATIC); } } @@ -335,7 +335,7 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmState::STRING); } void cmGlobalVisualStudio7Generator::Generate() @@ -970,7 +970,7 @@ void cmGlobalVisualStudio7Generator::CreateGUID(const std::string& name) ret = cmSystemTools::UpperCase(ret); this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), ret.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } std::vector *cmGlobalVisualStudio7Generator::GetConfigurations() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0561a05..7488386 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -285,7 +285,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vectorconst& "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmState::STRING); } } mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); @@ -2754,7 +2754,7 @@ std::string cmGlobalXCodeGenerator::GetOrCreateId(const std::string& name, } this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), - id.c_str(), "Stored Xcode object GUID", cmCacheManager::INTERNAL); + id.c_str(), "Stored Xcode object GUID", cmState::INTERNAL); return id; } diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index d40d8fe..1e7258a 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -73,7 +73,7 @@ bool cmIncludeExternalMSProjectCommand std::string guidVariable = utility_name + "_GUID_CMAKE"; this->Makefile->GetCMakeInstance()->AddCacheEntry( guidVariable.c_str(), customGuid.c_str(), - "Stored GUID", cmCacheManager::INTERNAL); + "Stored GUID", cmState::INTERNAL); } // Create a target instance for this utility. diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index e2ae901..6ade535 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -172,7 +172,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) // Check one line of the cache file. std::string var; std::string value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmState::CacheEntryType type = cmState::UNINITIALIZED; if(cmake::ParseCacheEntry(line, var, value, type)) { // Found a real entry. See if this one was requested. diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index aa70ab9..2b67562 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -118,7 +118,7 @@ void cmLocalVisualStudio10Generator AddCacheEntry(guidStoreName.c_str(), parser.GUID.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index c4abeb2..884212b 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -16,7 +16,6 @@ #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmSourceFile.h" -#include "cmCacheManager.h" #include "cmGeneratorTarget.h" #include "cmCustomCommandGenerator.h" #include "cmake.h" @@ -2331,7 +2330,7 @@ void cmLocalVisualStudio7Generator::ReadAndStoreExternalGUID( AddCacheEntry(guidStoreName.c_str(), parser.GUID.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 94e4695..6aa5224 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -18,7 +18,6 @@ #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmCommands.h" -#include "cmCacheManager.h" #include "cmState.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" @@ -1806,7 +1805,7 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value) void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmCacheManager::CacheEntryType type, + cmState::CacheEntryType type, bool force) { bool haveVal = value ? true : false; @@ -1815,7 +1814,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, this->GetState()->GetInitializedCacheValue(name); if(existingValue && (this->GetState()->GetCacheEntryType(name) - == cmCacheManager::UNINITIALIZED)) + == cmState::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in @@ -1824,7 +1823,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, val = existingValue; haveVal = true; } - if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) + if ( type == cmState::PATH || type == cmState::FILEPATH ) { std::vector::size_type cc; std::vector files; @@ -3617,7 +3616,7 @@ int cmMakefile::TryCompile(const std::string& srcdir, // Add this before the user-provided CMake arguments in case // one of the arguments is -DCMAKE_BUILD_TYPE=... cm.AddCacheEntry("CMAKE_BUILD_TYPE", config, - "Build configuration", cmCacheManager::STRING); + "Build configuration", cmState::STRING); } } // if cmake args were provided then pass them in @@ -3656,12 +3655,12 @@ int cmMakefile::TryCompile(const std::string& srcdir, if(this->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "TRUE", "", cmCacheManager::INTERNAL); + "TRUE", "", cmState::INTERNAL); } else { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "FALSE", "", cmCacheManager::INTERNAL); + "FALSE", "", cmState::INTERNAL); } if (cm.Configure() != 0) { @@ -4914,7 +4913,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, "For backwards compatibility, what version of CMake " "commands and " "syntax should this version of CMake try to support.", - cmCacheManager::STRING); + cmState::STRING); } } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index fad31d1..da92ad7 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -22,6 +22,7 @@ #include "cmGeneratorTarget.h" #include "cmExpandedCommandArgument.h" #include "cmake.h" +#include "cmState.h" #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmSourceGroup.h" @@ -305,7 +306,7 @@ public: ///! Add a definition to this makefile and the global cmake cache. void AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmCacheManager::CacheEntryType type, + cmState::CacheEntryType type, bool force = false); /** diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 66f1ebc..10d30f3 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -39,7 +39,7 @@ bool cmMarkAsAdvancedCommand cmState* state = this->Makefile->GetState(); if (!state->GetCacheEntryValue(variable)) { - state->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); + state->AddCacheEntry(variable, 0, 0, cmState::UNINITIALIZED); overwrite = true; } if (!state->GetCacheEntryValue(variable)) diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 6c090de..92be5f1 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -46,7 +46,7 @@ bool cmOptionCommand const char* existingValue = state->GetCacheEntryValue(args[0]); if(existingValue) { - if (state->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) + if (state->GetCacheEntryType(args[0]) != cmState::UNINITIALIZED) { state->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; @@ -59,6 +59,6 @@ bool cmOptionCommand } bool init = cmSystemTools::IsOn(initialValue.c_str()); this->Makefile->AddCacheDefinition(args[0], init? "ON":"OFF", - args[1].c_str(), cmCacheManager::BOOL); + args[1].c_str(), cmState::BOOL); return true; } diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 61c0133..601dc54 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -30,11 +30,11 @@ bool cmProjectCommand this->Makefile->AddCacheDefinition (bindir, this->Makefile->GetCurrentOutputDirectory(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmState::STATIC); this->Makefile->AddCacheDefinition (srcdir, this->Makefile->GetCurrentDirectory(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmState::STATIC); bindir = "PROJECT_BINARY_DIR"; srcdir = "PROJECT_SOURCE_DIR"; @@ -59,7 +59,7 @@ bool cmProjectCommand this->Makefile->AddCacheDefinition ("CMAKE_PROJECT_NAME", args[0].c_str(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmState::STATIC); } bool haveVersion = false; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index c636d53..bf9f42c 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -79,8 +79,8 @@ bool cmSetCommand bool cache = false; // optional bool force = false; // optional bool parentScope = false; - cmCacheManager::CacheEntryType type - = cmCacheManager::STRING; // required if cache + cmState::CacheEntryType type + = cmState::STRING; // required if cache const char* docstring = 0; // required if cache unsigned int ignoreLastArgs = 0; @@ -131,7 +131,7 @@ bool cmSetCommand if(cache) { std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0); - type = cmCacheManager::StringToType(args[cacheStart+1].c_str()); + type = cmState::StringToCacheEntryType(args[cacheStart+1].c_str()); docstring = args[cacheStart+2].c_str(); } @@ -139,13 +139,13 @@ bool cmSetCommand cmState* state = this->Makefile->GetState(); const char* existingValue = state->GetCacheEntryValue(variable); if(existingValue && - (state->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) + (state->GetCacheEntryType(variable) != cmState::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal // then leave now without setting any definitions in the cache // or the makefile - if(cache && type != cmCacheManager::INTERNAL && !force) + if(cache && type != cmState::INTERNAL && !force) { return true; } diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 08de585..bb94a72 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -14,7 +14,6 @@ #include "cmSetTestsPropertiesCommand.h" #include "cmSetSourceFilesPropertiesCommand.h" -#include "cmCacheManager.h" //---------------------------------------------------------------------------- cmSetPropertyCommand::cmSetPropertyCommand() @@ -426,7 +425,7 @@ bool cmSetPropertyCommand::HandleCacheMode() } else if(this->PropertyName == "TYPE") { - if(!cmCacheManager::IsType(this->PropertyValue.c_str())) + if(!cmState::IsCacheEntryType(this->PropertyValue.c_str())) { std::ostringstream e; e << "given invalid CACHE entry TYPE \"" << this->PropertyValue << "\""; diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 927888b..20a61a0 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -88,7 +88,7 @@ bool cmSiteNameCommand AddCacheDefinition(args[0], siteName.c_str(), "Name of the computer/site where compile is being run", - cmCacheManager::STRING); + cmState::STRING); return true; } diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 1802959..739beb6 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -2,26 +2,59 @@ #include "cmState.h" #include "cmake.h" +#include "cmCacheManager.h" cmState::cmState(cmake* cm) : CMakeInstance(cm) { } -cmCacheManager::CacheEntryType -cmState::StringToCacheEntryType(const char* s) + +const char* cmCacheEntryTypes[] = +{ "BOOL", + "PATH", + "FILEPATH", + "STRING", + "INTERNAL", + "STATIC", + "UNINITIALIZED", + 0 +}; + +const char* +cmState::CacheEntryTypeToString(cmState::CacheEntryType type) { - return cmCacheManager::StringToType(s); + if ( type > 6 ) + { + return cmCacheEntryTypes[6]; + } + return cmCacheEntryTypes[type]; } -const char* -cmState::CacheEntryTypeToString(cmCacheManager::CacheEntryType t) +cmState::CacheEntryType +cmState::StringToCacheEntryType(const char* s) { - return cmCacheManager::TypeToString(t); + int i = 0; + while(cmCacheEntryTypes[i]) + { + if(strcmp(s, cmCacheEntryTypes[i]) == 0) + { + return static_cast(i); + } + ++i; + } + return STRING; } bool cmState::IsCacheEntryType(std::string const& key) { - return cmCacheManager::IsType(key.c_str()); + for(int i=0; cmCacheEntryTypes[i]; ++i) + { + if(strcmp(key.c_str(), cmCacheEntryTypes[i]) == 0) + { + return true; + } + } + return false; } std::vector cmState::GetCacheEntryKeys() const @@ -54,7 +87,7 @@ cmState::GetInitializedCacheValue(std::string const& key) const return this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue(key); } -cmCacheManager::CacheEntryType +cmState::CacheEntryType cmState::GetCacheEntryType(std::string const& key) const { cmCacheManager::CacheIterator it = @@ -107,7 +140,7 @@ bool cmState::GetCacheEntryPropertyAsBool(std::string const& key, void cmState::AddCacheEntry(const std::string& key, const char* value, const char* helpString, - cmCacheManager::CacheEntryType type) + cmState::CacheEntryType type) { this->CMakeInstance->GetCacheManager()->AddCacheEntry(key, value, helpString, type); diff --git a/Source/cmState.h b/Source/cmState.h index 250df3e..9f19f8e 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -2,7 +2,7 @@ #ifndef cmState_h #define cmState_h -#include "cmCacheManager.h" +#include "cmStandardIncludes.h" class cmake; @@ -11,21 +11,21 @@ class cmState public: cmState(cmake* cm); - static cmCacheManager::CacheEntryType StringToCacheEntryType(const char*); - static const char* CacheEntryTypeToString(cmCacheManager::CacheEntryType); + enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, + UNINITIALIZED }; + static CacheEntryType StringToCacheEntryType(const char*); + static const char* CacheEntryTypeToString(CacheEntryType); static bool IsCacheEntryType(std::string const& key); std::vector GetCacheEntryKeys() const; const char* GetCacheEntryValue(std::string const& key) const; const char* GetInitializedCacheValue(std::string const& key) const; - cmCacheManager::CacheEntryType - GetCacheEntryType(std::string const& key) const; + CacheEntryType GetCacheEntryType(std::string const& key) const; void SetCacheEntryValue(std::string const& key, std::string const& value); void SetCacheValue(std::string const& key, std::string const& value); void AddCacheEntry(const std::string& key, const char* value, - const char* helpString, - cmCacheManager::CacheEntryType type); + const char* helpString, CacheEntryType type); void RemoveCacheEntry(std::string const& key); void SetCacheEntryProperty(std::string const& key, diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b3d1155..1702a7d 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1181,7 +1181,7 @@ void cmTarget::ClearDependencyInformation( cmMakefile& mf, if (this->RecordDependencies) { mf.AddCacheDefinition(depname, "", - "Dependencies for target", cmCacheManager::STATIC); + "Dependencies for target", cmState::STATIC); } else { @@ -1369,7 +1369,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, dependencies += ";"; mf.AddCacheDefinition( targetEntry, dependencies.c_str(), "Dependencies for the target", - cmCacheManager::STATIC ); + cmState::STATIC ); } } diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 3f766ab..bcc4a83 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmTryRunCommand.h" -#include "cmCacheManager.h" #include "cmTryCompileCommand.h" #include @@ -217,7 +216,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, } this->Makefile->AddCacheDefinition(this->RunResultVariable, retChar, "Result of TRY_RUN", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } /* This is only used when cross compiling. Instead of running the @@ -262,7 +261,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->Makefile->AddCacheDefinition(this->RunResultVariable, "PLEASE_FILL_OUT-FAILED_TO_RUN", comment.c_str(), - cmCacheManager::STRING); + cmState::STRING); cmState* state = this->Makefile->GetState(); const char* existingValue @@ -290,7 +289,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->Makefile->AddCacheDefinition(internalRunOutputName, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), - cmCacheManager::STRING); + cmState::STRING); cmState* state = this->Makefile->GetState(); const char* existing = state->GetCacheEntryValue(internalRunOutputName); diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 2799a9b..10122e9 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmUtilitySourceCommand.h" +#include "cmCacheManager.h" + // cmUtilitySourceCommand bool cmUtilitySourceCommand ::InitialPass(std::vector const& args, cmExecutionStatus &) @@ -118,14 +120,14 @@ bool cmUtilitySourceCommand this->Makefile->AddCacheDefinition(cacheEntry, utilityExecutable.c_str(), "Path to an internal program.", - cmCacheManager::FILEPATH); + cmState::FILEPATH); // add a value into the cache that maps from the // full path to the name of the project cmSystemTools::ConvertToUnixSlashes(utilityExecutable); this->Makefile->AddCacheDefinition(utilityExecutable, utilityName.c_str(), "Executable to project name.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); return true; } diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 00386f6..5c9a18f 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -255,7 +255,7 @@ void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag) //---------------------------------------------------------------------------- void cmVisualStudioGeneratorOptions::SetConfiguration(const char* config) { - this->Configuration = config; + this->State = config; } //---------------------------------------------------------------------------- @@ -274,12 +274,12 @@ cmVisualStudioGeneratorOptions { // if there are configuration specific flags, then // use the configuration specific tag for PreprocessorDefinitions - if(this->Configuration.size()) + if(this->State.size()) { fout << prefix; this->TargetGenerator->WritePlatformConfigTag( "PreprocessorDefinitions", - this->Configuration.c_str(), + this->State.c_str(), 0, 0, 0, &fout); } @@ -346,11 +346,11 @@ cmVisualStudioGeneratorOptions m != this->FlagMap.end(); ++m) { fout << indent; - if(this->Configuration.size()) + if(this->State.size()) { this->TargetGenerator->WritePlatformConfigTag( m->first.c_str(), - this->Configuration.c_str(), + this->State.c_str(), 0, 0, 0, &fout); } @@ -398,11 +398,11 @@ cmVisualStudioGeneratorOptions if(this->Version >= cmLocalVisualStudioGenerator::VS10) { fout << prefix; - if(this->Configuration.size()) + if(this->State.size()) { this->TargetGenerator->WritePlatformConfigTag( "AdditionalOptions", - this->Configuration.c_str(), + this->State.c_str(), 0, 0, 0, &fout); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a337b2c..b1eea98 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -338,7 +338,7 @@ bool cmake::SetCacheArgs(const std::vector& args) } } std::string var, value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmState::CacheEntryType type = cmState::UNINITIALIZED; if(cmCacheManager::ParseEntry(entry, var, value, type)) { // The value is transformed if it is a filepath for example, so @@ -409,8 +409,8 @@ bool cmake::SetCacheArgs(const std::vector& args) for (std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = this->State->GetCacheEntryType(*it); - if(t != cmCacheManager::STATIC) + cmState::CacheEntryType t = this->State->GetCacheEntryType(*it); + if(t != cmState::STATIC) { if (regex.find(it->c_str())) { @@ -975,14 +975,14 @@ int cmake::AddCMakePaths() // Save the value in the cache this->CacheManager->AddCacheEntry ("CMAKE_COMMAND", cmSystemTools::GetCMakeCommand().c_str(), - "Path to CMake executable.", cmCacheManager::INTERNAL); + "Path to CMake executable.", cmState::INTERNAL); #ifdef CMAKE_BUILD_WITH_CMAKE this->CacheManager->AddCacheEntry ("CMAKE_CTEST_COMMAND", cmSystemTools::GetCTestCommand().c_str(), - "Path to ctest program executable.", cmCacheManager::INTERNAL); + "Path to ctest program executable.", cmState::INTERNAL); this->CacheManager->AddCacheEntry ("CMAKE_CPACK_COMMAND", cmSystemTools::GetCPackCommand().c_str(), - "Path to cpack program executable.", cmCacheManager::INTERNAL); + "Path to cpack program executable.", cmState::INTERNAL); #endif if(!cmSystemTools::FileExists( (cmSystemTools::GetCMakeRoot()+"/Modules/CMake.cmake").c_str())) @@ -996,7 +996,7 @@ int cmake::AddCMakePaths() } this->CacheManager->AddCacheEntry ("CMAKE_ROOT", cmSystemTools::GetCMakeRoot().c_str(), - "Path to CMake installation.", cmCacheManager::INTERNAL); + "Path to CMake installation.", cmState::INTERNAL); return 1; } @@ -1238,7 +1238,7 @@ struct SaveCacheEntry std::string key; std::string value; std::string help; - cmCacheManager::CacheEntryType type; + cmState::CacheEntryType type; }; int cmake::HandleDeleteCacheVariables(const std::string& var) @@ -1311,7 +1311,7 @@ int cmake::Configure() AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE", "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } else { @@ -1319,7 +1319,7 @@ int cmake::Configure() AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE", "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } } int ret = this->ActualConfigure(); @@ -1355,7 +1355,7 @@ int cmake::ActualConfigure() this->GetHomeDirectory(), "Start directory with the top level CMakeLists.txt file for this " "project", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } // no generator specified on the command line @@ -1464,11 +1464,11 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName().c_str(), "Name of generator.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); this->CacheManager->AddCacheEntry("CMAKE_EXTRA_GENERATOR", this->GlobalGenerator->GetExtraGeneratorName().c_str(), "Name of external makefile project generator.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } if(const char* platformName = @@ -1496,7 +1496,7 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_PLATFORM", this->GeneratorPlatform.c_str(), "Name of generator platform.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } if(const char* tsName = @@ -1524,7 +1524,7 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_TOOLSET", this->GeneratorToolset.c_str(), "Name of generator toolset.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } // reset any system configuration information, except for when we are @@ -1562,7 +1562,7 @@ int cmake::ActualConfigure() this->State->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", - cmCacheManager::PATH); + cmState::PATH); } if(!this->State ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) @@ -1570,7 +1570,7 @@ int cmake::ActualConfigure() this->State->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", "Single output directory for building all executables.", - cmCacheManager::PATH); + cmState::PATH); } } if(!this->State @@ -1579,7 +1579,7 @@ int cmake::ActualConfigure() this->State->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", - cmCacheManager::BOOL); + cmState::BOOL); if (!this->State->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", "ADVANCED")) { @@ -1804,7 +1804,7 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, { this->CacheManager->AddCacheEntry(key, value, helpString, - cmCacheManager::CacheEntryType(type)); + cmState::CacheEntryType(type)); } const char* cmake::GetCacheDefinition(const std::string& name) const @@ -1876,7 +1876,7 @@ void cmake::AddDefaultGenerators() bool cmake::ParseCacheEntry(const std::string& entry, std::string& var, std::string& value, - cmCacheManager::CacheEntryType& type) + cmState::CacheEntryType& type) { return cmCacheManager::ParseEntry(entry, var, value, type); } diff --git a/Source/cmake.h b/Source/cmake.h index 0b24ed6..bbeb95d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -19,6 +19,7 @@ #include "cmPropertyMap.h" #include "cmInstalledFile.h" #include "cmCacheManager.h" +#include "cmState.h" class cmGlobalGeneratorFactory; class cmGlobalGenerator; @@ -178,7 +179,7 @@ class cmake static bool ParseCacheEntry(const std::string& entry, std::string& var, std::string& value, - cmCacheManager::CacheEntryType& type); + cmState::CacheEntryType& type); int LoadCache(); bool LoadCache(const std::string& path); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index f678c6a..c8cf2d4 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -19,7 +19,6 @@ #include "cmake.h" #include "cmcmd.h" #include "cmState.h" -#include "cmCacheManager.h" #include "cmListFileCache.h" #include "cmSourceFile.h" #include "cmGlobalGenerator.h" @@ -330,15 +329,13 @@ int do_cmake(int ac, char const* const* av) if ( list_cached || list_all_cached ) { std::cout << "-- Cache values" << std::endl; - std::vector keys = - cm.GetState()->GetCacheEntryKeys(); + std::vector keys = cm.GetState()->GetCacheEntryKeys(); for (std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) { - cmCacheManager::CacheEntryType t = - cm.GetState()->GetCacheEntryType(*it); - if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && - t != cmCacheManager::UNINITIALIZED ) + cmState::CacheEntryType t = cm.GetState()->GetCacheEntryType(*it); + if (t != cmState::INTERNAL && t != cmState::STATIC && + t != cmState::UNINITIALIZED) { const char* advancedProp = cm.GetState()->GetCacheEntryProperty(*it, "ADVANCED"); @@ -351,7 +348,7 @@ int do_cmake(int ac, char const* const* av) "HELPSTRING") << std::endl; } std::cout << *it << ":" << - cmCacheManager::TypeToString(t) + cmState::CacheEntryTypeToString(t) << "=" << cm.GetState()->GetCacheEntryValue(*it) << std::endl; if ( list_help ) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff6f31993e160c20d2ad3b05e2d3623f3e98b201 commit ff6f31993e160c20d2ad3b05e2d3623f3e98b201 Author: Stephen Kelly AuthorDate: Tue Apr 7 22:36:13 2015 +0200 Commit: Stephen Kelly CommitDate: Thu Apr 9 08:34:03 2015 +0200 cmMakefile: Remove unused CacheManager accessor. Remove unneeded friend declarations from cmCacheManager. diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 64c7c0d..00ae334 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -248,10 +248,8 @@ private: CacheEntryMap Cache; // Only cmake and cmMakefile should be able to add cache values // the commands should never use the cmCacheManager directly - friend class cmMakefile; // allow access to add cache values friend class cmState; // allow access to add cache values friend class cmake; // allow access to add cache values - friend class cmMarkAsAdvancedCommand; // allow access to add cache values }; #endif diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ca50bc7..94e4695 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3735,11 +3735,6 @@ void cmMakefile::GetListOfMacros(std::string& macros) const macros = cmJoin(this->MacrosList, ";"); } -cmCacheManager *cmMakefile::GetCacheManager() const -{ - return this->GetCMakeInstance()->GetCacheManager(); -} - cmState *cmMakefile::GetState() const { return this->GetCMakeInstance()->GetState(); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 49bab4c..fad31d1 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -12,7 +12,6 @@ #ifndef cmMakefile_h #define cmMakefile_h -#include "cmCacheManager.h" #include "cmExecutionStatus.h" #include "cmListFileCache.h" #include "cmPolicies.h" @@ -765,7 +764,6 @@ public: ///enabled. void EnableLanguage(std::vectorconst& languages, bool optional); - cmCacheManager *GetCacheManager() const; cmState *GetState() const; /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3e9c2dbd7b3cea93aa24fccd780f1d79512c767 commit e3e9c2dbd7b3cea93aa24fccd780f1d79512c767 Author: Stephen Kelly AuthorDate: Mon Apr 6 10:52:45 2015 +0200 Commit: Stephen Kelly CommitDate: Thu Apr 9 08:34:02 2015 +0200 Port to cmState. diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 3d92a2d..e013f81 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmake.h" #include "../cmDocumentation.h" diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 4f028c4..4eb8e6c 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -19,6 +19,7 @@ #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" #include "../cmake.h" +#include "../cmState.h" #include @@ -50,9 +51,9 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); + const char* value = cm->GetState()->GetCacheEntryValue(key); assert(value); - switch (cm->GetCacheManager()->GetCacheEntryType(key)) + switch (cm->GetState()->GetCacheEntryType(key)) { case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); @@ -75,7 +76,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( break; case cmCacheManager::STRING: { - const char* stringsProp = cm->GetCacheManager() + const char* stringsProp = cm->GetState() ->GetCacheEntryProperty(key, "STRINGS"); if(stringsProp) { diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 057f8f3..67e4aab 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmake.h" #include "../cmVersion.h" diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 833d540..b067743 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -23,6 +23,7 @@ #include "cmCursesCacheEntryComposite.h" #include "cmCursesLongMessageForm.h" #include "cmAlgorithms.h" +#include "cmState.h" inline int ctrl(int z) @@ -107,17 +108,17 @@ void cmCursesMainForm::InitializeUI() // which contain labels, entries and new entry markers std::vector* newEntries = new std::vector; - newEntries->reserve(this->CMakeInstance->GetCacheManager()->GetSize()); + std::vector cacheKeys = + this->CMakeInstance->GetState()->GetCacheEntryKeys(); + newEntries->reserve(cacheKeys.size()); // Count non-internal and non-static entries int count=0; - std::vector cacheKeys = - this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys(); for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); if (t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && @@ -147,7 +148,7 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); if (t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || @@ -171,7 +172,7 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); if (t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || @@ -225,10 +226,10 @@ void cmCursesMainForm::RePost() for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -257,10 +258,10 @@ void cmCursesMainForm::RePost() for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -329,10 +330,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -352,10 +353,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -516,10 +517,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the help string of the current entry // and add it to the help string const char* existingValue = - this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField); + this->CMakeInstance->GetState()->GetCacheEntryValue(curField); if (existingValue) { - const char* hs = this->CMakeInstance->GetCacheManager() + const char* hs = this->CMakeInstance->GetState() ->GetCacheEntryProperty(curField, "HELPSTRING"); if ( hs ) { @@ -814,7 +815,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() for(size_t i=0; i < size; i++) { std::string cacheKey = (*this->Entries)[i]->Key; - const char* existingValue = this->CMakeInstance->GetCacheManager() + const char* existingValue = this->CMakeInstance->GetState() ->GetCacheEntryValue(cacheKey); if (existingValue) { @@ -823,7 +824,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() std::string fixedOldValue; std::string fixedNewValue; cmCacheManager::CacheEntryType t = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryType(cacheKey); this->FixValue(t, oldValue, fixedOldValue); this->FixValue(t, newValue, fixedNewValue); @@ -831,9 +832,9 @@ void cmCursesMainForm::FillCacheManagerFromUI() if(!(fixedOldValue == fixedNewValue)) { // The user has changed the value. Mark it as modified. - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true); - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->SetCacheEntryValue(cacheKey, fixedNewValue); } } @@ -1046,11 +1047,11 @@ void cmCursesMainForm::HandleInput() const char* helpString = 0; const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryValue(curField); if (existingValue) { - helpString = this->CMakeInstance->GetCacheManager() + helpString = this->CMakeInstance->GetState() ->GetCacheEntryProperty(curField, "HELPSTRING"); } if (helpString) @@ -1161,7 +1162,7 @@ void cmCursesMainForm::HandleInput() field_userptr(this->Fields[findex-2])); if ( lbl ) { - this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(lbl->GetValue()); + this->CMakeInstance->GetState()->RemoveCacheEntry(lbl->GetValue()); std::string nextVal; if (nextCur) diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 08d53ce..775c11c 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -16,7 +16,7 @@ #include #include "cmake.h" -#include "cmCacheManager.h" +#include "cmState.h" #include "cmSystemTools.h" #include "cmExternalMakefileProjectGenerator.h" @@ -94,7 +94,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) { this->BinaryDirectory = QDir::fromNativeSeparators(dir); emit this->binaryDirChanged(this->BinaryDirectory); - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); + cmState* state = this->CMakeInstance->GetState(); this->setGenerator(QString()); if(!this->CMakeInstance->LoadCache( this->BinaryDirectory.toLocal8Bit().data())) @@ -110,15 +110,15 @@ void QCMake::setBinaryDirectory(const QString& _dir) QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); - const char* homeDir = cachem->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + const char* homeDir = state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (homeDir) { setSourceDirectory(QString::fromLocal8Bit(homeDir)); } - const char* gen = cachem->GetCacheEntryValue("CMAKE_GENERATOR"); + const char* gen = state->GetCacheEntryValue("CMAKE_GENERATOR"); if (gen) { - const char* extraGen = cachem + const char* extraGen = state ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: CreateFullGeneratorName(gen, extraGen? extraGen : ""); @@ -195,12 +195,12 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) QStringList toremove; // set the value of properties - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - std::vector cacheKeys = cachem->GetCacheEntryKeys(); + cmState* state = this->CMakeInstance->GetState(); + std::vector cacheKeys = state->GetCacheEntryKeys(); for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*it); + cmCacheManager::CacheEntryType t = state->GetCacheEntryType(*it); if(t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC) { @@ -219,11 +219,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - cachem->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); + state->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); } else { - cachem->SetCacheEntryValue(*it, + state->SetCacheEntryValue(*it, prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); @@ -236,7 +236,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) { this->CMakeInstance->UnwatchUnusedCli(s.toLocal8Bit().data()); - cachem->RemoveCacheEntry(s.toLocal8Bit().data()); + state->RemoveCacheEntry(s.toLocal8Bit().data()); } // add some new properites @@ -281,12 +281,12 @@ QCMakePropertyList QCMake::properties() const { QCMakePropertyList ret; - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - std::vector cacheKeys = cachem->GetCacheEntryKeys(); + cmState* state = this->CMakeInstance->GetState(); + std::vector cacheKeys = state->GetCacheEntryKeys(); for (std::vector::const_iterator i = cacheKeys.begin(); i != cacheKeys.end(); ++i) { - cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*i); + cmCacheManager::CacheEntryType t = state->GetCacheEntryType(*i); if(t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || t == cmCacheManager::UNINITIALIZED) @@ -294,14 +294,14 @@ QCMakePropertyList QCMake::properties() const continue; } - const char* cachedValue = cachem->GetCacheEntryValue(*i); + const char* cachedValue = state->GetCacheEntryValue(*i); QCMakeProperty prop; prop.Key = QString::fromLocal8Bit(i->c_str()); prop.Help = QString::fromLocal8Bit( - cachem->GetCacheEntryProperty(*i, "HELPSTRING")); + state->GetCacheEntryProperty(*i, "HELPSTRING")); prop.Value = QString::fromLocal8Bit(cachedValue); - prop.Advanced = cachem->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); + prop.Advanced = state->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); if(t == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; @@ -319,7 +319,7 @@ QCMakePropertyList QCMake::properties() const { prop.Type = QCMakeProperty::STRING; const char* stringsProperty = - cachem->GetCacheEntryProperty(*i, "STRINGS"); + state->GetCacheEntryProperty(*i, "STRINGS"); if (stringsProperty) { prop.Strings = QString::fromLocal8Bit(stringsProperty).split(";"); diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 99bf5f5..0d1c86d 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -13,6 +13,7 @@ #include "cmSystemTools.h" #include "cmMakefile.h" +#include "cmState.h" #include "cmCommandArgumentLexer.h" @@ -90,7 +91,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } if ( strcmp(key, "CACHE") == 0 ) { - if(const char* c = this->Makefile->GetCacheManager() + if(const char* c = this->Makefile->GetState() ->GetInitializedCacheValue(var)) { if(this->EscapeQuotes) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 0d32e4b..6750769 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -16,6 +16,7 @@ #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" +#include "cmState.h" #include "cmTarget.h" #include "cmSourceFile.h" @@ -205,7 +206,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_"; cacheEntryName += envVar; - const char* cacheValue = mf->GetCacheManager()->GetInitializedCacheValue( + const char* cacheValue = mf->GetState()->GetInitializedCacheValue( cacheEntryName); // now we have both, decide which one to use diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index cc08052..f10d545 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -12,6 +12,7 @@ #include "cmFindBase.h" #include "cmAlgorithms.h" +#include "cmState.h" cmFindBase::cmFindBase() { @@ -366,8 +367,8 @@ bool cmFindBase::CheckForVariableInCache() if(const char* cacheValue = this->Makefile->GetDefinition(this->VariableName)) { - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName); + cmState* state = this->Makefile->GetState(); + const char* cacheEntry = state->GetCacheEntryValue(this->VariableName); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); bool cached = cacheEntry ? true : false; if(found) @@ -376,7 +377,7 @@ bool cmFindBase::CheckForVariableInCache() // type we should add the type and docstring but keep the // original value. Tell the subclass implementations to do // this. - if(cached && manager->GetCacheEntryType(this->VariableName) + if(cached && state->GetCacheEntryType(this->VariableName) == cmCacheManager::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; @@ -385,7 +386,7 @@ bool cmFindBase::CheckForVariableInCache() } else if(cached) { - const char* hs = manager->GetCacheEntryProperty(this->VariableName, + const char* hs = state->GetCacheEntryProperty(this->VariableName, "HELPSTRING"); this->VariableDocumentation = hs?hs:"(none)"; } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 0e6e0c2..80edbcd 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -12,6 +12,7 @@ #include "cmGetPropertyCommand.h" #include "cmake.h" +#include "cmState.h" #include "cmTest.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" @@ -391,9 +392,9 @@ bool cmGetPropertyCommand::HandleCacheMode() } const char* value = 0; - if(this->Makefile->GetCacheManager()->GetCacheEntryValue(this->Name)) + if(this->Makefile->GetState()->GetCacheEntryValue(this->Name)) { - value = this->Makefile->GetCacheManager() + value = this->Makefile->GetState() ->GetCacheEntryProperty(this->Name, this->PropertyName); } this->StoreResult(value); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 35394b8..f6ec643 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -20,6 +20,7 @@ #include "cmLocalGenerator.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmake.h" +#include "cmState.h" #include "cmMakefile.h" #include "cmQtAutoGenerators.h" #include "cmSourceFile.h" @@ -179,7 +180,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, return; } const char* cname = this->GetCMakeInstance()-> - GetCacheManager()->GetInitializedCacheValue(langComp); + GetState()->GetInitializedCacheValue(langComp); std::string changeVars; if(cname && !optional) { @@ -1537,7 +1538,7 @@ void cmGlobalGenerator::CheckLocalGenerators() std::map notFoundMap; // std::set notFoundMap; // after it is all done do a ConfigureFinalPass - cmCacheManager* manager = this->GetCMakeInstance()->GetCacheManager(); + cmState* state = this->GetCMakeInstance()->GetState(); for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { this->LocalGenerators[i]->ConfigureFinalPass(); @@ -1559,7 +1560,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(lib->first.c_str())) { std::string varName = lib->first.substr(0, lib->first.size()-9); - if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + if(state->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1590,7 +1591,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(incDir->c_str())) { std::string varName = incDir->substr(0, incDir->size()-9); - if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + if(state->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1637,7 +1638,7 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir, // and there is a good chance that the try compile stuff will // take the bulk of the time, so try and guess some progress // by getting closer and closer to 100 without actually getting there. - if (!this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue + if (!this->CMakeInstance->GetState()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS")) { // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set @@ -1835,7 +1836,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) // update progress // estimate how many lg there will be const char *numGenC = - this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue + this->CMakeInstance->GetState()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"); if (!numGenC) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index fefa648..ca50bc7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1812,9 +1812,9 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; const char* existingValue = - this->GetCacheManager()->GetInitializedCacheValue(name); + this->GetState()->GetInitializedCacheValue(name); if(existingValue - && (this->GetCacheManager()->GetCacheEntryType(name) + && (this->GetState()->GetCacheEntryType(name) == cmCacheManager::UNINITIALIZED)) { // if this is not a force, then use the value from the cache @@ -1843,14 +1843,14 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, nvalue += files[cc]; } - this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = this->GetCacheManager()->GetInitializedCacheValue(name); + this->GetState()->AddCacheEntry(name, nvalue.c_str(), doc, type); + val = this->GetState()->GetInitializedCacheValue(name); haveVal = true; } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, - doc, type); + this->GetState()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -1977,7 +1977,7 @@ void cmMakefile::RemoveDefinition(const std::string& name) void cmMakefile::RemoveCacheDefinition(const std::string& name) { - this->GetCacheManager()->RemoveCacheEntry(name); + this->GetState()->RemoveCacheEntry(name); } void cmMakefile::SetProjectName(const char* p) @@ -2434,7 +2434,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const this->Internal->VarUsageStack.top().insert(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetState()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE if(cmVariableWatch* vv = this->GetVariableWatch()) @@ -2459,7 +2459,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const const char* def = this->Internal->VarStack.top().Get(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetState()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); @@ -2501,7 +2501,7 @@ std::vector cmMakefile res.insert(res.end(), definitions.begin(), definitions.end()); } std::vector cacheKeys = - this->GetCacheManager()->GetCacheEntryKeys(); + this->GetState()->GetCacheEntryKeys(); res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); std::sort(res.begin(), res.end()); @@ -2802,6 +2802,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( openstack.push(t_lookup()); cmake::MessageType mtype = cmake::LOG; + cmState* state = this->GetCMakeInstance()->GetState(); + do { char inc = *in; @@ -2835,8 +2837,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( value = cmSystemTools::GetEnv(lookup.c_str()); break; case CACHE: - value = this->GetCacheManager() - ->GetInitializedCacheValue(lookup); + value = state->GetCacheEntryValue(lookup); break; } // Get the string we're meant to append to. @@ -4908,7 +4909,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, if(id == cmPolicies::CMP0001 && (status == cmPolicies::WARN || status == cmPolicies::OLD)) { - if(!(this->GetCacheManager() + if(!(this->GetState() ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) { // Set it to 2.4 because that is the last version where the diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index cc094b1..66f1ebc 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -36,20 +36,20 @@ bool cmMarkAsAdvancedCommand for(; i < args.size(); ++i) { std::string variable = args[i]; - cmCacheManager* manager = this->Makefile->GetCacheManager(); - if (!manager->GetCacheEntryValue(variable)) + cmState* state = this->Makefile->GetState(); + if (!state->GetCacheEntryValue(variable)) { - manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); + state->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); overwrite = true; } - if (!manager->GetCacheEntryValue(variable)) + if (!state->GetCacheEntryValue(variable)) { cmSystemTools::Error("This should never happen..."); return false; } - if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) + if (!state->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) { - manager->SetCacheEntryProperty(variable, "ADVANCED", value); + state->SetCacheEntryProperty(variable, "ADVANCED", value); } } return true; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index baf5b1e..6c090de 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,13 +42,13 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(args[0]); + cmState* state = this->Makefile->GetState(); + const char* existingValue = state->GetCacheEntryValue(args[0]); if(existingValue) { - if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) + if (state->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) { - manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); + state->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; } initialValue = existingValue; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index e17474b..c636d53 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -136,10 +136,10 @@ bool cmSetCommand } // see if this is already in the cache - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(variable); + cmState* state = this->Makefile->GetState(); + const char* existingValue = state->GetCacheEntryValue(variable); if(existingValue && - (manager->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) + (state->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 77f9fb9..08de585 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -453,7 +453,7 @@ bool cmSetPropertyCommand::HandleCacheMode() cmMakefile* mf = this->GetMakefile(); cmake* cm = mf->GetCMakeInstance(); const char* existingValue - = cm->GetCacheManager()->GetCacheEntryValue(*ni); + = cm->GetState()->GetCacheEntryValue(*ni); if(existingValue) { if(!this->HandleCacheEntry(*ni)) @@ -479,20 +479,19 @@ bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey) // Set or append the property. const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmState* state = this->Makefile->GetState(); if (this->Remove) { - manager->RemoveCacheEntryProperty(cacheKey, name); - return true; + state->RemoveCacheEntryProperty(cacheKey, name); } if(this->AppendMode) { - manager->AppendCacheEntryProperty(cacheKey, name, value, - this->AppendAsString); + state->AppendCacheEntryProperty(cacheKey, name, value, + this->AppendAsString); } else { - manager->SetCacheEntryProperty(cacheKey, name, value); + state->SetCacheEntryProperty(cacheKey, name, value); } return true; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 911ade8..3f766ab 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -264,12 +264,12 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment.c_str(), cmCacheManager::STRING); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmState* state = this->Makefile->GetState(); const char* existingValue - = manager->GetCacheEntryValue(this->RunResultVariable); + = state->GetCacheEntryValue(this->RunResultVariable); if (existingValue) { - manager->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); + state->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); } error = true; @@ -291,13 +291,13 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmCacheManager::STRING); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmState* state = this->Makefile->GetState(); const char* existing = - manager->GetCacheEntryValue(internalRunOutputName); + state->GetCacheEntryValue(internalRunOutputName); if (existing) { - manager->SetCacheEntryProperty(internalRunOutputName, - "ADVANCED", "1"); + state->SetCacheEntryProperty(internalRunOutputName, + "ADVANCED", "1"); } error = true; diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index dd2a682..1d33db1 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -10,7 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmVariableRequiresCommand.h" -#include "cmCacheManager.h" +#include "cmState.h" // cmLibraryCommand bool cmVariableRequiresCommand @@ -34,6 +34,7 @@ bool cmVariableRequiresCommand bool requirementsMet = true; std::string notSet; bool hasAdvanced = false; + cmState* state = this->Makefile->GetState(); for(unsigned int i = 2; i < args.size(); ++i) { if(!this->Makefile->IsOn(args[i])) @@ -41,9 +42,8 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - cmCacheManager* manager = this->Makefile->GetCacheManager(); - if(manager->GetCacheEntryValue(args[i]) && - manager->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) + if(state->GetCacheEntryValue(args[i]) && + state->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) { hasAdvanced = true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index c419edc..a337b2c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -348,22 +348,20 @@ bool cmake::SetCacheArgs(const std::vector& args) std::string cachedValue; if(this->WarnUnusedCli) { - if(const char *v = this->CacheManager - ->GetInitializedCacheValue(var)) + if(const char *v = this->State->GetInitializedCacheValue(var)) { haveValue = true; cachedValue = v; } } - this->CacheManager->AddCacheEntry(var, value.c_str(), + this->State->AddCacheEntry(var, value.c_str(), "No help, variable specified on the command line.", type); if(this->WarnUnusedCli) { if (!haveValue || - cachedValue != this->CacheManager - ->GetInitializedCacheValue(var)) + cachedValue != this->State->GetInitializedCacheValue(var)) { this->WatchUnusedCli(var); } @@ -407,13 +405,11 @@ bool cmake::SetCacheArgs(const std::vector& args) cmsys::Glob::PatternToRegex(entryPattern, true, true).c_str()); //go through all cache entries and collect the vars which will be removed std::vector entriesToDelete; - std::vector cacheKeys = - this->CacheManager->GetCacheEntryKeys(); + std::vector cacheKeys = this->State->GetCacheEntryKeys(); for (std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = - this->CacheManager->GetCacheEntryType(*it); + cmCacheManager::CacheEntryType t = this->State->GetCacheEntryType(*it); if(t != cmCacheManager::STATIC) { if (regex.find(it->c_str())) @@ -429,7 +425,7 @@ bool cmake::SetCacheArgs(const std::vector& args) currentEntry != entriesToDelete.end(); ++currentEntry) { - this->CacheManager->RemoveCacheEntry(*currentEntry); + this->State->RemoveCacheEntry(*currentEntry); } } else if(arg.find("-C",0) == 0) @@ -925,7 +921,7 @@ void cmake::SetDirectoriesFromFile(const char* arg) if(this->LoadCache(cachePath)) { const char* existingValue = - this->CacheManager->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + this->State->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (existingValue) { this->SetHomeOutputDirectory(cachePath); @@ -1255,7 +1251,6 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) { return 0; } - cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator(); std::vector saved; std::ostringstream warning; warning @@ -1271,10 +1266,13 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) i++; save.value = *i; warning << *i << "\n"; - if(ci.Find(save.key)) + const char* existingValue = + this->CacheManager->GetCacheEntryValue(save.key); + if(existingValue) { - save.type = ci.GetType(); - if(const char* help = ci.GetProperty("HELPSTRING")) + save.type = this->CacheManager->GetCacheEntryType(save.key); + if(const char* help = + this->CacheManager->GetCacheEntryProperty(save.key, "HELPSTRING")) { save.help = help; } @@ -1556,49 +1554,51 @@ int cmake::ActualConfigure() // project requires compatibility with CMake 2.4. We detect this // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY // variable created when CMP0001 is not set to NEW. - if(this->GetCacheManager() + if(this->State ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { - if(!this->CacheManager->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) + if(!this->State->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) { - this->CacheManager->AddCacheEntry + this->State->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", cmCacheManager::PATH); } - if(!this->CacheManager + if(!this->State ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) { - this->CacheManager->AddCacheEntry + this->State->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", "Single output directory for building all executables.", cmCacheManager::PATH); } } - if(!this->CacheManager + if(!this->State ->GetInitializedCacheValue("CMAKE_USE_RELATIVE_PATHS")) { - this->CacheManager->AddCacheEntry + this->State->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", cmCacheManager::BOOL); - if (!this->CacheManager->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED")) + if (!this->State->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED")) { - this->CacheManager->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED", "1"); + this->State->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED", "1"); } } - if(cmSystemTools::GetFatalErrorOccured() && - (!this->CacheManager->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM") || - cmSystemTools::IsOff(this->CacheManager-> - GetInitializedCacheValue("CMAKE_MAKE_PROGRAM")))) + if(cmSystemTools::GetFatalErrorOccured()) { - // We must have a bad generator selection. Wipe the cache entry so the - // user can select another. - this->CacheManager->RemoveCacheEntry("CMAKE_GENERATOR"); - this->CacheManager->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR"); + const char* makeProgram = + this->State->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM"); + if (!makeProgram || cmSystemTools::IsOff(makeProgram)) + { + // We must have a bad generator selection. Wipe the cache entry so the + // user can select another. + this->State->RemoveCacheEntry("CMAKE_GENERATOR"); + this->State->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR"); + } } cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); @@ -2204,7 +2204,7 @@ void cmake::TruncateOutputLog(const char* fname) { return; } - if ( !this->CacheManager->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR") ) + if (!this->State->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")) { cmSystemTools::RemoveFile(fullPath); return; @@ -2321,8 +2321,7 @@ const char *cmake::GetProperty(const std::string& prop, std::string output = ""; if ( prop == "CACHE_VARIABLES" ) { - std::vector cacheKeys = - this->CacheManager->GetCacheEntryKeys(); + std::vector cacheKeys = this->State->GetCacheEntryKeys(); this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); } else if ( prop == "COMMANDS" ) @@ -2475,7 +2474,7 @@ int cmake::GetSystemInformation(std::vector& args) // we have to find the module directory, so we can copy the files this->AddCMakePaths(); std::string modulesPath = - this->CacheManager->GetInitializedCacheValue("CMAKE_ROOT"); + this->State->GetInitializedCacheValue("CMAKE_ROOT"); modulesPath += "/Modules"; std::string inFile = modulesPath; inFile += "/SystemInformation.cmake"; @@ -2685,7 +2684,7 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, if(t == cmake::AUTHOR_WARNING) { // Allow suppression of these warnings. - const char* suppress = this->CacheManager->GetCacheEntryValue( + const char* suppress = this->State->GetCacheEntryValue( "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); if(suppress && cmSystemTools::IsOn(suppress)) { @@ -2806,7 +2805,7 @@ int cmake::Build(const std::string& dir, return 1; } const char* cachedGenerator = - this->CacheManager->GetCacheEntryValue("CMAKE_GENERATOR"); + this->State->GetCacheEntryValue("CMAKE_GENERATOR"); if(!cachedGenerator) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; @@ -2823,7 +2822,7 @@ int cmake::Build(const std::string& dir, std::string output; std::string projName; const char* cachedProjectName = - this->CacheManager->GetCacheEntryValue("CMAKE_PROJECT_NAME"); + this->State->GetCacheEntryValue("CMAKE_PROJECT_NAME"); if(!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; @@ -2832,7 +2831,7 @@ int cmake::Build(const std::string& dir, projName = cachedProjectName; bool verbose = false; const char* cachedVerbose = - this->CacheManager->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); + this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); if(cachedVerbose) { verbose = cmSystemTools::IsOn(cachedVerbose); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 3b518be..f678c6a 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -18,6 +18,7 @@ #include "cmake.h" #include "cmcmd.h" +#include "cmState.h" #include "cmCacheManager.h" #include "cmListFileCache.h" #include "cmSourceFile.h" @@ -330,28 +331,28 @@ int do_cmake(int ac, char const* const* av) { std::cout << "-- Cache values" << std::endl; std::vector keys = - cm.GetCacheManager()->GetCacheEntryKeys(); + cm.GetState()->GetCacheEntryKeys(); for (std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) { cmCacheManager::CacheEntryType t = - cm.GetCacheManager()->GetCacheEntryType(*it); + cm.GetState()->GetCacheEntryType(*it); if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && t != cmCacheManager::UNINITIALIZED ) { const char* advancedProp = - cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED"); + cm.GetState()->GetCacheEntryProperty(*it, "ADVANCED"); if ( list_all_cached || !advancedProp) { if ( list_help ) { std::cout << "// " - << cm.GetCacheManager()->GetCacheEntryProperty(*it, + << cm.GetState()->GetCacheEntryProperty(*it, "HELPSTRING") << std::endl; } std::cout << *it << ":" << cmCacheManager::TypeToString(t) - << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it) + << "=" << cm.GetState()->GetCacheEntryValue(*it) << std::endl; if ( list_help ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=40c7d0eabed709f7187fd85cba2c7e1472a01bb1 commit 40c7d0eabed709f7187fd85cba2c7e1472a01bb1 Author: Stephen Kelly AuthorDate: Sat Apr 4 21:20:12 2015 +0200 Commit: Stephen Kelly CommitDate: Thu Apr 9 08:34:02 2015 +0200 Introduce cmState class. At this point, it is an interface to the cache. It will be extended to be a universal interface for access to and manipulation of configuration-time data (defintions, properties on targets, directories, source files etc). This will allow porting all command implementations away from the cmMakefile and cmTarget classes, and result in something more-purely related to configuration-time processing of cmake commands. That should serve at least the following goals: * Split the CMake implementation more definitively into three stages: Configuration, computation and generation, and be able to implement each optimally for memory access patterns etc. * Make better IDE integration possible by making more configuration data available. * Make it possiblte to use a smaller library than CMakeLib.a in cpack and ctest, resulting in smaller executables. * Make it possible to run the configure step multiple times in the same CMake run (#14539). Manage its lifetime in the cmake class, and add a convenience accessor to cmMakefile. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 04f6a81..c847bc8 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -323,6 +323,8 @@ set(SRCS cmSourceFileLocation.h cmSourceGroup.cxx cmSourceGroup.h + cmState.cxx + cmState.h cmSystemTools.cxx cmSystemTools.h cmTarget.cxx diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 3b02fa6..64c7c0d 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -249,6 +249,7 @@ private: // Only cmake and cmMakefile should be able to add cache values // the commands should never use the cmCacheManager directly friend class cmMakefile; // allow access to add cache values + friend class cmState; // allow access to add cache values friend class cmake; // allow access to add cache values friend class cmMarkAsAdvancedCommand; // allow access to add cache values }; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 34b4621..fefa648 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -19,6 +19,7 @@ #include "cmLocalGenerator.h" #include "cmCommands.h" #include "cmCacheManager.h" +#include "cmState.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" #include "cmCommandArgumentParserHelper.h" @@ -3738,6 +3739,11 @@ cmCacheManager *cmMakefile::GetCacheManager() const return this->GetCMakeInstance()->GetCacheManager(); } +cmState *cmMakefile::GetState() const +{ + return this->GetCMakeInstance()->GetState(); +} + void cmMakefile::DisplayStatus(const char* message, float s) const { cmake* cm = this->GetLocalGenerator()->GetGlobalGenerator() diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5209891..49bab4c 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -766,6 +766,7 @@ public: void EnableLanguage(std::vectorconst& languages, bool optional); cmCacheManager *GetCacheManager() const; + cmState *GetState() const; /** * Get the variable watch. This is used to determine when certain variables diff --git a/Source/cmState.cxx b/Source/cmState.cxx new file mode 100644 index 0000000..1802959 --- /dev/null +++ b/Source/cmState.cxx @@ -0,0 +1,137 @@ + +#include "cmState.h" + +#include "cmake.h" + +cmState::cmState(cmake* cm) + : CMakeInstance(cm) +{ +} +cmCacheManager::CacheEntryType +cmState::StringToCacheEntryType(const char* s) +{ + return cmCacheManager::StringToType(s); +} + +const char* +cmState::CacheEntryTypeToString(cmCacheManager::CacheEntryType t) +{ + return cmCacheManager::TypeToString(t); +} + +bool cmState::IsCacheEntryType(std::string const& key) +{ + return cmCacheManager::IsType(key.c_str()); +} + +std::vector cmState::GetCacheEntryKeys() const +{ + std::vector definitions; + definitions.reserve(this->CMakeInstance->GetCacheManager()->GetSize()); + cmCacheManager::CacheIterator cit = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + definitions.push_back(cit.GetName()); + } + return definitions; +} + +const char* cmState::GetCacheEntryValue(std::string const& key) const +{ + cmCacheManager::CacheEntry* e = this->CMakeInstance->GetCacheManager() + ->GetCacheEntry(key); + if (!e) + { + return 0; + } + return e->Value.c_str(); +} + +const char* +cmState::GetInitializedCacheValue(std::string const& key) const +{ + return this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue(key); +} + +cmCacheManager::CacheEntryType +cmState::GetCacheEntryType(std::string const& key) const +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + return it.GetType(); +} + +void cmState::SetCacheEntryValue(std::string const& key, + std::string const& value) +{ + this->CMakeInstance->GetCacheManager()->SetCacheEntryValue(key, value); +} + +void cmState::SetCacheEntryProperty(std::string const& key, + std::string const& propertyName, + std::string const& value) +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + it.SetProperty(propertyName, value.c_str()); +} + +void cmState::SetCacheEntryBoolProperty(std::string const& key, + std::string const& propertyName, + bool value) +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + it.SetProperty(propertyName, value); +} + +const char* cmState::GetCacheEntryProperty(std::string const& key, + std::string const& propertyName) +{ + cmCacheManager::CacheIterator it = this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()); + if (!it.PropertyExists(propertyName)) + { + return 0; + } + return it.GetProperty(propertyName); +} + +bool cmState::GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propertyName) +{ + return this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).GetPropertyAsBool(propertyName); +} + +void cmState::AddCacheEntry(const std::string& key, const char* value, + const char* helpString, + cmCacheManager::CacheEntryType type) +{ + this->CMakeInstance->GetCacheManager()->AddCacheEntry(key, value, + helpString, type); +} + +void cmState::RemoveCacheEntry(std::string const& key) +{ + this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(key); +} + +void cmState::AppendCacheEntryProperty(const std::string& key, + const std::string& property, + const std::string& value, + bool asString) +{ + this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).AppendProperty(property, + value.c_str(), + asString); +} + +void cmState::RemoveCacheEntryProperty(std::string const& key, + std::string const& propertyName) +{ + this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).SetProperty(propertyName, (void*)0); +} diff --git a/Source/cmState.h b/Source/cmState.h new file mode 100644 index 0000000..250df3e --- /dev/null +++ b/Source/cmState.h @@ -0,0 +1,52 @@ + +#ifndef cmState_h +#define cmState_h + +#include "cmCacheManager.h" + +class cmake; + +class cmState +{ +public: + cmState(cmake* cm); + + static cmCacheManager::CacheEntryType StringToCacheEntryType(const char*); + static const char* CacheEntryTypeToString(cmCacheManager::CacheEntryType); + static bool IsCacheEntryType(std::string const& key); + + std::vector GetCacheEntryKeys() const; + const char* GetCacheEntryValue(std::string const& key) const; + const char* GetInitializedCacheValue(std::string const& key) const; + cmCacheManager::CacheEntryType + GetCacheEntryType(std::string const& key) const; + void SetCacheEntryValue(std::string const& key, std::string const& value); + void SetCacheValue(std::string const& key, std::string const& value); + + void AddCacheEntry(const std::string& key, const char* value, + const char* helpString, + cmCacheManager::CacheEntryType type); + void RemoveCacheEntry(std::string const& key); + + void SetCacheEntryProperty(std::string const& key, + std::string const& propertyName, + std::string const& value); + void SetCacheEntryBoolProperty(std::string const& key, + std::string const& propertyName, + bool value); + const char* GetCacheEntryProperty(std::string const& key, + std::string const& propertyName); + bool GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propertyName); + void AppendCacheEntryProperty(std::string const& key, + const std::string& property, + const std::string& value, + bool asString = false); + void RemoveCacheEntryProperty(std::string const& key, + std::string const& propertyName); + +private: + cmake* CMakeInstance; +}; + +#endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 64b332c..c419edc 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -21,6 +21,7 @@ #include "cmTest.h" #include "cmDocumentationFormatter.h" #include "cmAlgorithms.h" +#include "cmState.h" #if defined(CMAKE_BUILD_WITH_CMAKE) # include "cmGraphVizWriter.h" @@ -133,6 +134,8 @@ cmake::cmake() this->FileComparison = new cmFileTimeComparison; this->Policies = new cmPolicies(); + this->State = new cmState(this); + this->InitializeProperties(); #ifdef __APPLE__ @@ -171,6 +174,7 @@ cmake::~cmake() { delete this->CacheManager; delete this->Policies; + delete this->State; if (this->GlobalGenerator) { delete this->GlobalGenerator; diff --git a/Source/cmake.h b/Source/cmake.h index 3acf4a8..0b24ed6 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -32,6 +32,7 @@ class cmDocumentationSection; class cmPolicies; class cmTarget; class cmGeneratedFileStream; +class cmState; /** \brief Represents a cmake invocation. * @@ -387,6 +388,9 @@ class cmake void UnwatchUnusedCli(const std::string& var); void WatchUnusedCli(const std::string& var); + + cmState* GetState() const { return this->State; } + protected: void RunCheckForUnusedVariables(); void InitializeProperties(); @@ -475,6 +479,8 @@ private: std::vector DebugConfigs; InstalledFilesMap InstalledFiles; + cmState* State; + void UpdateConversionPathTable(); }; diff --git a/bootstrap b/bootstrap index 4239802..69855b4 100755 --- a/bootstrap +++ b/bootstrap @@ -285,6 +285,7 @@ CMAKE_CXX_SOURCES="\ cmScriptGenerator \ cmSourceFile \ cmSourceFileLocation \ + cmState \ cmSystemTools \ cmTestGenerator \ cmVersion \ ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 2 + Source/CursesDialog/ccmake.cxx | 1 - Source/CursesDialog/cmCursesBoolWidget.cxx | 2 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 17 +- Source/CursesDialog/cmCursesCacheEntryComposite.h | 1 - Source/CursesDialog/cmCursesDummyWidget.cxx | 2 +- Source/CursesDialog/cmCursesFilePathWidget.cxx | 2 +- Source/CursesDialog/cmCursesLongMessageForm.cxx | 1 - Source/CursesDialog/cmCursesMainForm.cxx | 80 ++++----- Source/CursesDialog/cmCursesMainForm.h | 2 +- Source/CursesDialog/cmCursesOptionsWidget.cxx | 2 +- Source/CursesDialog/cmCursesPathWidget.cxx | 4 +- Source/CursesDialog/cmCursesStringWidget.cxx | 2 +- Source/CursesDialog/cmCursesWidget.h | 6 +- Source/QtDialog/QCMake.cxx | 62 +++---- Source/cmBuildCommand.cxx | 2 +- Source/cmBuildNameCommand.cxx | 4 +- Source/cmCPluginAPI.cxx | 12 +- Source/cmCTest.cxx | 2 +- Source/cmCacheManager.cxx | 96 +++-------- Source/cmCacheManager.h | 38 ++--- Source/cmCommandArgumentParserHelper.cxx | 3 +- Source/cmCoreTryCompile.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 7 +- Source/cmFindBase.cxx | 11 +- Source/cmFindLibraryCommand.cxx | 7 +- Source/cmFindPackageCommand.cxx | 2 +- Source/cmFindPathCommand.cxx | 7 +- Source/cmFindProgramCommand.cxx | 7 +- Source/cmGetFilenameComponentCommand.cxx | 8 +- Source/cmGetPropertyCommand.cxx | 5 +- Source/cmGlobalGenerator.cxx | 19 +-- Source/cmGlobalUnixMakefileGenerator3.cxx | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 8 +- Source/cmGlobalXCodeGenerator.cxx | 4 +- Source/cmIncludeExternalMSProjectCommand.cxx | 2 +- Source/cmLoadCacheCommand.cxx | 2 +- Source/cmLocalVisualStudio10Generator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 3 +- Source/cmMakefile.cxx | 47 +++--- Source/cmMakefile.h | 6 +- Source/cmMarkAsAdvancedCommand.cxx | 12 +- Source/cmOptionCommand.cxx | 10 +- Source/cmProjectCommand.cxx | 6 +- Source/cmSetCommand.cxx | 14 +- Source/cmSetPropertyCommand.cxx | 16 +- Source/cmSiteNameCommand.cxx | 2 +- Source/cmState.cxx | 170 ++++++++++++++++++++ Source/cmState.h | 52 ++++++ Source/cmTarget.cxx | 4 +- Source/cmTryRunCommand.cxx | 21 ++- Source/cmUtilitySourceCommand.cxx | 6 +- Source/cmVariableRequiresCommand.cxx | 8 +- Source/cmVisualStudioGeneratorOptions.cxx | 14 +- Source/cmake.cxx | 125 +++++++------- Source/cmake.h | 9 +- Source/cmakemain.cxx | 20 ++- bootstrap | 1 + 58 files changed, 582 insertions(+), 403 deletions(-) create mode 100644 Source/cmState.cxx create mode 100644 Source/cmState.h hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 07:48:02 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 07:48:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1661-g0d1ae09 Message-ID: <20150409114802.966C2AD32E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0d1ae09d6d166a285b42611ebe348b6c32a3ed21 (commit) via fd5cbbe0008c53ebfd666fe34be958d5b5456880 (commit) from 9a9f62683ff256cd90a1ab98effc12a821a48f0d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d1ae09d6d166a285b42611ebe348b6c32a3ed21 commit 0d1ae09d6d166a285b42611ebe348b6c32a3ed21 Merge: 9a9f626 fd5cbbe Author: Brad King AuthorDate: Thu Apr 9 07:48:01 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 07:48:01 2015 -0400 Merge topic 'suppress-osx-arch-linker-warning' into next fd5cbbe0 CTestCustom: Suppress more OS X universal binary link arch warnings http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd5cbbe0008c53ebfd666fe34be958d5b5456880 commit fd5cbbe0008c53ebfd666fe34be958d5b5456880 Author: Brad King AuthorDate: Thu Apr 9 07:47:36 2015 -0400 Commit: Brad King CommitDate: Thu Apr 9 07:47:36 2015 -0400 CTestCustom: Suppress more OS X universal binary link arch warnings diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index d716498..15f83ad 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -53,6 +53,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION "CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element" "cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast "ld: warning: directory not found for option .-(F|L)" + "ld: warning: ignoring file .*/libgcc.a, file was built for archive which is not the architecture being linked" "ld: warning: in .*/libgcc.a, file is not of required architecture" "warning.*This version of Mac OS X is unsupported" "clang.*: warning: argument unused during compilation: .-g" ----------------------------------------------------------------------- Summary of changes: CTestCustom.cmake.in | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 08:04:24 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 08:04:24 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1663-g78b6e5f Message-ID: <20150409120424.36052AE0BB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 78b6e5f85d2e10bdd6b2dab8dea4393c8b7b06f4 (commit) via 73dcba5181e6dd7937aa83958a54cabaea8c3576 (commit) from 0d1ae09d6d166a285b42611ebe348b6c32a3ed21 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78b6e5f85d2e10bdd6b2dab8dea4393c8b7b06f4 commit 78b6e5f85d2e10bdd6b2dab8dea4393c8b7b06f4 Merge: 0d1ae09 73dcba5 Author: Brad King AuthorDate: Thu Apr 9 08:04:23 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 08:04:23 2015 -0400 Merge topic 'simplify-osx-install-prefix' into next 73dcba51 Simplify logic to compute install prefix in OS X CMake.app http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73dcba5181e6dd7937aa83958a54cabaea8c3576 commit 73dcba5181e6dd7937aa83958a54cabaea8c3576 Author: Brad King AuthorDate: Thu Apr 9 08:02:40 2015 -0400 Commit: Brad King CommitDate: Thu Apr 9 08:02:40 2015 -0400 Simplify logic to compute install prefix in OS X CMake.app Also avoid explicitly dereferencing a variable in an if() condition. diff --git a/CMakeLists.txt b/CMakeLists.txt index d86ae96..e979d4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -543,10 +543,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}") # make sure CMAKE_INSTALL_PREFIX ends in / - string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) - math(EXPR LEN "${LEN} -1" ) - string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH) - if(NOT "${ENDCH}" STREQUAL "/") + if(NOT CMAKE_INSTALL_PREFIX MATCHES "/$") set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") endif() set(CMAKE_INSTALL_PREFIX ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 11:03:02 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 11:03:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1665-g00d8fd8 Message-ID: <20150409150302.37950ADF22@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 00d8fd810f35dee272776639c104ec38d7ab16ff (commit) via 6e3e4c66d5a5fe56818a261d68b23b48ef78cc49 (commit) from 78b6e5f85d2e10bdd6b2dab8dea4393c8b7b06f4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00d8fd810f35dee272776639c104ec38d7ab16ff commit 00d8fd810f35dee272776639c104ec38d7ab16ff Merge: 78b6e5f 6e3e4c6 Author: Brad King AuthorDate: Thu Apr 9 11:03:01 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 11:03:01 2015 -0400 Merge topic 'introduce-cmState' into next 6e3e4c66 fixup! cmState: Move CacheEntryType enum from cmCacheManager. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e3e4c66d5a5fe56818a261d68b23b48ef78cc49 commit 6e3e4c66d5a5fe56818a261d68b23b48ef78cc49 Author: Brad King AuthorDate: Thu Apr 9 11:02:31 2015 -0400 Commit: Brad King CommitDate: Thu Apr 9 11:02:31 2015 -0400 fixup! cmState: Move CacheEntryType enum from cmCacheManager. diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 5c9a18f..00386f6 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -255,7 +255,7 @@ void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag) //---------------------------------------------------------------------------- void cmVisualStudioGeneratorOptions::SetConfiguration(const char* config) { - this->State = config; + this->Configuration = config; } //---------------------------------------------------------------------------- @@ -274,12 +274,12 @@ cmVisualStudioGeneratorOptions { // if there are configuration specific flags, then // use the configuration specific tag for PreprocessorDefinitions - if(this->State.size()) + if(this->Configuration.size()) { fout << prefix; this->TargetGenerator->WritePlatformConfigTag( "PreprocessorDefinitions", - this->State.c_str(), + this->Configuration.c_str(), 0, 0, 0, &fout); } @@ -346,11 +346,11 @@ cmVisualStudioGeneratorOptions m != this->FlagMap.end(); ++m) { fout << indent; - if(this->State.size()) + if(this->Configuration.size()) { this->TargetGenerator->WritePlatformConfigTag( m->first.c_str(), - this->State.c_str(), + this->Configuration.c_str(), 0, 0, 0, &fout); } @@ -398,11 +398,11 @@ cmVisualStudioGeneratorOptions if(this->Version >= cmLocalVisualStudioGenerator::VS10) { fout << prefix; - if(this->State.size()) + if(this->Configuration.size()) { this->TargetGenerator->WritePlatformConfigTag( "AdditionalOptions", - this->State.c_str(), + this->Configuration.c_str(), 0, 0, 0, &fout); } ----------------------------------------------------------------------- Summary of changes: Source/cmVisualStudioGeneratorOptions.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 11:29:43 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 11:29:43 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1667-ge15b301 Message-ID: <20150409152943.3AB14ADEE9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e15b301d0ceeb3bc57090379bf223396e2e316a0 (commit) via 882f48e5ba335a1dbc1750c23e6dea5fa92a3adc (commit) from 00d8fd810f35dee272776639c104ec38d7ab16ff (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e15b301d0ceeb3bc57090379bf223396e2e316a0 commit e15b301d0ceeb3bc57090379bf223396e2e316a0 Merge: 00d8fd8 882f48e Author: Brad King AuthorDate: Thu Apr 9 11:29:42 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 11:29:42 2015 -0400 Merge topic 'link-implicit-libs-full-path' into next 882f48e5 Link libraries by full path even in implicit directories http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=882f48e5ba335a1dbc1750c23e6dea5fa92a3adc commit 882f48e5ba335a1dbc1750c23e6dea5fa92a3adc Author: Brad King AuthorDate: Tue Apr 7 10:43:47 2015 -0400 Commit: Brad King CommitDate: Thu Apr 9 11:29:18 2015 -0400 Link libraries by full path even in implicit directories When CMP0003 was first introduced we wanted to link all libraries by full path. However, some projects had problems on platforms where find_library would find /usr/lib/libfoo.so when the project really wanted to link to /usr/lib//libfoo.so and had been working by accident because pre-CMP0003 behavior used -lfoo to link. We first tried to address that in commit v2.6.0~440 (Teach find_library to avoid returning library paths in system directories, 2008-01-23) by returning just "foo" for libraries in implicit link directories. This caused problems for projects expecting find_library to always return a full path. We ended up using the solution in commit v2.6.0~366 (... switch library paths found in implicit link directories to use -l, 2008-01-31). However, the special case for libraries in implicit link directories has also proven problematic and confusing. Introduce policy CMP0060 to switch to linking all libraries by full path even if they are in implicit link directories. Explain in the policy documentation the factors that led to the original approach and now to this approach. diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index 393c8b4..d903d05 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -34,14 +34,20 @@ Each ```` may be: automatically be added in the build system to make sure the named library target is up-to-date before the ```` links. + If an imported library has the :prop_tgt:`IMPORTED_NO_SONAME` + target property set, CMake may ask the linker to search for + the library instead of using the full path + (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``). + * **A full path to a library file**: The generated link line will - normally preserve the full path to the file. However, there are - some cases where CMake must ask the linker to search for the library - (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``), such as when it - appears in a system library directory that the compiler front-end - may replace with an alternative. Either way, the buildsystem will + normally preserve the full path to the file. The buildsystem will have a dependency to re-link ```` if the library file changes. + There are some cases where CMake may ask the linker to search for + the library (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``), such + as when a shared library is detected to have no ``SONAME`` field. + See policy :policy:`CMP0060` for discussion of another case. + If the library file is in a Mac OSX framework, the ``Headers`` directory of the framework will also be processed as a :ref:`usage requirement `. This has the same diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index d2960de..aff696d 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -117,3 +117,4 @@ All Policies /policy/CMP0057 /policy/CMP0058 /policy/CMP0059 + /policy/CMP0060 diff --git a/Help/policy/CMP0060.rst b/Help/policy/CMP0060.rst new file mode 100644 index 0000000..cc37b1b --- /dev/null +++ b/Help/policy/CMP0060.rst @@ -0,0 +1,63 @@ +CMP0060 +------- + +Link libraries by full path even in implicit directories. + +Policy :policy:`CMP0003` was introduced with the intention of always +linking library files by full path when a full path is given to the +:command:`target_link_libraries` command. However, on some platforms +(e.g. HP-UX) the compiler front-end adds alternative library search paths +for the current architecture (e.g. ``/usr/lib/`` has alternatives +to libraries in ``/usr/lib`` for the current architecture). +On such platforms the :command:`find_library` may find a library such as +``/usr/lib/libfoo.so`` that does not belong to the current architecture. + +Prior to policy :policy:`CMP0003` projects would still build in such +cases because the incorrect library path would be converted to ``-lfoo`` +on the link line and the linker would find the proper library in the +arch-specific search path provided by the compiler front-end implicitly. +At the time we chose to remain compatible with such projects by always +converting library files found in implicit link directories to ``-lfoo`` +flags to ask the linker to search for them. This approach allowed existing +projects to continue to build while still linking to libraries outside +implicit link directories via full path (such as those in the build tree). + +CMake does allow projects to override this behavior by using an +:ref:`IMPORTED library target ` with its +:prop_tgt:`IMPORTED_LOCATION` property set to the desired full path to +a library file. In fact, many :ref:`Find Modules` are learning to provide +:ref:`Imported Targets` instead of just the traditional ``Foo_LIBRARIES`` +variable listing library files. However, this makes the link line +generated for a library found by a Find Module depend on whether it +is linked through an imported target or not, which is inconsistent. +Furthermore, this behavior has been a source of confusion because the +generated link line for a library file depends on its location. It is +also problematic for projects trying to link statically because flags +like ``-Wl,-Bstatic -lfoo -Wl,-Bdynamic`` may be used to help the linker +select ``libfoo.a`` instead of ``libfoo.so`` but then leak dynamic linking +to following libraries. (See the :prop_tgt:`LINK_SEARCH_END_STATIC` +target property for a solution typically used for that problem.) + +When the special case for libraries in implicit link directories was first +introduced the list of implicit link directories was simply hard-coded +(e.g. ``/lib``, ``/usr/lib``, and a few others). Since that time, CMake +has learned to detect the implicit link directories used by the compiler +front-end. If necessary, the :command:`find_library` command could be +taught to use this information to help find libraries of the proper +architecture. + +For these reasons, CMake 3.3 and above prefer to drop the special case +and link libraries by full path even when they are in implicit link +directories. Policy ``CMP0060`` provides compatibility for existing +projects. + +The OLD behavior for this policy is to ask the linker to search for +libraries whose full paths are known to be in implicit link directories. +The NEW behavior for this policy is to link libraries by full path even +if they are in implicit link directories. + +This policy was introduced in CMake version 3.3. Unlike most policies, +CMake version |release| does *not* warn by default when this policy +is not set and simply uses OLD behavior. See documentation of the +:variable:`CMAKE_POLICY_WARNING_CMP0060 >` +variable to control the warning. diff --git a/Help/release/dev/link-implicit-libs-full-path.rst b/Help/release/dev/link-implicit-libs-full-path.rst new file mode 100644 index 0000000..7ed7245 --- /dev/null +++ b/Help/release/dev/link-implicit-libs-full-path.rst @@ -0,0 +1,6 @@ +link-implicit-libs-full-path +---------------------------- + +* Linking to library files by a full path in an implicit linker search + directory (e.g. ``/usr/lib/libfoo.a``) no longer asks the linker to + search for the library (e.g. ``-lfoo``). See policy :policy:`CMP0060`. diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst index a83c807..092fe3e 100644 --- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst +++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst @@ -11,6 +11,8 @@ warn by default: policy :policy:`CMP0047`. * ``CMAKE_POLICY_WARNING_CMP0056`` controls the warning for policy :policy:`CMP0056`. +* ``CMAKE_POLICY_WARNING_CMP0060`` controls the warning for + policy :policy:`CMP0060`. This variable should not be set by a project in CMake code. Project developers running CMake may set this variable in their cache to diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index b0e0f36..8880667 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -411,6 +411,10 @@ cmComputeLinkInformation std::vector const& dirs = this->Target->GetLinkDirectories(); this->OldLinkDirMask.insert(dirs.begin(), dirs.end()); } + + this->CMP0060Warn = + this->Makefile->PolicyOptionalWarningEnabled( + "CMAKE_POLICY_WARNING_CMP0060"); } //---------------------------------------------------------------------------- @@ -548,6 +552,22 @@ bool cmComputeLinkInformation::Compute() // Add implicit language runtime libraries and directories. this->AddImplicitLinkInfo(); + if (!this->CMP0060WarnItems.empty()) + { + std::ostringstream w; + w << (this->Makefile->GetCMakeInstance()->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0060)) << "\n" + "Some library files are in directories implicitly searched by " + "the linker when invoked for " << this->LinkLanguage << ":\n" + " " << cmJoin(this->CMP0060WarnItems, "\n ") << "\n" + "For compatibility with older versions of CMake, the generated " + "link line will ask the linker to search for these by library " + "name." + ; + this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), + this->Target->GetBacktrace()); + } + return true; } @@ -1190,6 +1210,28 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(std::string const& item) return false; } + // Check the policy for whether we should use the approach below. + switch (this->Target->GetPolicyStatusCMP0060()) + { + case cmPolicies::WARN: + if (this->CMP0060Warn) + { + // Print the warning at most once for this item. + std::string const& wid = "CMP0060-WARNING-GIVEN-" + item; + if (!this->CMakeInstance->GetPropertyAsBool(wid)) + { + this->CMakeInstance->SetProperty(wid, "1"); + this->CMP0060WarnItems.insert(item); + } + } + case cmPolicies::OLD: + break; + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::NEW: + return false; + } + // Many system linkers support multiple architectures by // automatically selecting the implicit linker search path for the // current architecture. If the library appears in an implicit link diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index e5d674a..8847141 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -175,6 +175,10 @@ private: std::vector OldUserFlagItems; bool OldLinkDirMode; + // CMP0060 warnings. + bool CMP0060Warn; + std::set CMP0060WarnItems; + // Runtime path computation. cmOrderDirectories* OrderRuntimeSearchPath; void AddLibraryRuntimeInfo(std::string const& fullPath, diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 0a61bca..e7678cb 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -390,6 +390,11 @@ cmPolicies::cmPolicies() CMP0059, "CMP0059", "Do no treat DEFINITIONS as a built-in directory property.", 3,3,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0060, "CMP0060", + "Link libraries by full path even in implicit directories.", + 3,3,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index ced9d8c..1d108c1 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -118,6 +118,7 @@ public: CMP0058, ///< Ninja requires custom command byproducts to be explicit CMP0059, ///< Do not treat ``DEFINITIONS`` as a built-in directory /// property. + CMP0060, ///< Link libraries by full path even in implicit directories. /** \brief Always the last entry. * diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a4ef977..55bf234 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -34,7 +34,8 @@ F(CMP0041) \ F(CMP0042) \ F(CMP0046) \ - F(CMP0052) + F(CMP0052) \ + F(CMP0060) class cmake; class cmMakefile; diff --git a/Tests/RunCMake/CMP0060/CMP0060-Common.cmake b/Tests/RunCMake/CMP0060/CMP0060-Common.cmake new file mode 100644 index 0000000..e0a56e6 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-Common.cmake @@ -0,0 +1,35 @@ +# Always build in a predictable configuration. For multi-config +# generators we depend on RunCMakeTest.cmake to do this for us. +if(NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE Debug) +endif() + +# Convince CMake that it can instruct the linker to search for the +# library of the proper linkage type, but do not really pass flags. +set(CMAKE_EXE_LINK_STATIC_C_FLAGS " ") +set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS " ") + +# Make a link line asking for the linker to search for the library +# look like a missing object file so we will get predictable content +# in the error message. This also ensures that cases expected to use +# the full path can be verified by confirming that they link. +set(CMAKE_LINK_LIBRARY_FLAG LINKFLAG_) +set(CMAKE_LINK_LIBRARY_SUFFIX _LINKSUFFIX${CMAKE_C_OUTPUT_EXTENSION}) + +# Convince CMake that our library is in an implicit linker search directory. +list(APPEND CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/lib) + +# Create a simple library file. Place it in our library directory. +add_library(CMP0060 STATIC cmp0060.c) +set_property(TARGET CMP0060 PROPERTY + ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/lib) + +# Add a target to link the library file by full path. +add_executable(main1 main.c) +target_link_libraries(main1 $) +add_dependencies(main1 CMP0060) + +# Add a second target to verify the warning only appears once. +add_executable(main2 main.c) +target_link_libraries(main2 $) +add_dependencies(main2 CMP0060) diff --git a/Tests/RunCMake/CMP0060/CMP0060-NEW.cmake b/Tests/RunCMake/CMP0060/CMP0060-NEW.cmake new file mode 100644 index 0000000..0414e4b --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0060 NEW) +include(CMP0060-Common.cmake) diff --git a/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt new file mode 100644 index 0000000..240764c --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt @@ -0,0 +1 @@ +LINKFLAG_CMP0060_LINKSUFFIX diff --git a/Tests/RunCMake/CMP0060/CMP0060-OLD.cmake b/Tests/RunCMake/CMP0060/CMP0060-OLD.cmake new file mode 100644 index 0000000..a9cffef --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0060 OLD) +include(CMP0060-Common.cmake) diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt new file mode 100644 index 0000000..240764c --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt @@ -0,0 +1 @@ +LINKFLAG_CMP0060_LINKSUFFIX diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake new file mode 100644 index 0000000..6b84565 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake @@ -0,0 +1 @@ +include(CMP0060-Common.cmake) diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt new file mode 100644 index 0000000..240764c --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt @@ -0,0 +1 @@ +LINKFLAG_CMP0060_LINKSUFFIX diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt new file mode 100644 index 0000000..f6cc978 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt @@ -0,0 +1,16 @@ +^CMake Warning \(dev\) at CMP0060-Common.cmake:[0-9]+ \(add_executable\): + Policy CMP0060 is not set: Link libraries by full path even in implicit + directories. Run "cmake --help-policy CMP0060" for policy details. Use + the cmake_policy command to set the policy and suppress this warning. + + Some library files are in directories implicitly searched by the linker + when invoked for C: + + .*/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-build/lib/(lib)?CMP0060.(a|lib) + + For compatibility with older versions of CMake, the generated link line + will ask the linker to search for these by library name. +Call Stack \(most recent call first\): + CMP0060-WARN-ON.cmake:[0-9]+ \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake new file mode 100644 index 0000000..a0a7950 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake @@ -0,0 +1,2 @@ +set(CMAKE_POLICY_WARNING_CMP0060 1) +include(CMP0060-Common.cmake) diff --git a/Tests/RunCMake/CMP0060/CMakeLists.txt b/Tests/RunCMake/CMP0060/CMakeLists.txt new file mode 100644 index 0000000..db6b701 --- /dev/null +++ b/Tests/RunCMake/CMP0060/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.2) +project(${RunCMake_TEST} C) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0060/RunCMakeTest.cmake b/Tests/RunCMake/CMP0060/RunCMakeTest.cmake new file mode 100644 index 0000000..445156f --- /dev/null +++ b/Tests/RunCMake/CMP0060/RunCMakeTest.cmake @@ -0,0 +1,19 @@ +include(RunCMake) + +function(run_cmake_CMP0060 CASE) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0060-${CASE}-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(CMP0060-${CASE}) + set(RunCMake_TEST_OUTPUT_MERGE 1) + run_cmake_command(CMP0060-${CASE}-Build + ${CMAKE_COMMAND} --build . --config Debug + ) +endfunction() + +run_cmake_CMP0060(OLD) +run_cmake_CMP0060(WARN-OFF) +run_cmake_CMP0060(WARN-ON) +run_cmake_CMP0060(NEW) diff --git a/Tests/RunCMake/CMP0060/cmp0060.c b/Tests/RunCMake/CMP0060/cmp0060.c new file mode 100644 index 0000000..a2da227 --- /dev/null +++ b/Tests/RunCMake/CMP0060/cmp0060.c @@ -0,0 +1,4 @@ +int libCMP0060(void) +{ + return 0; +} diff --git a/Tests/RunCMake/CMP0060/main.c b/Tests/RunCMake/CMP0060/main.c new file mode 100644 index 0000000..91848c2 --- /dev/null +++ b/Tests/RunCMake/CMP0060/main.c @@ -0,0 +1,5 @@ +extern int libCMP0060(void); +int main(void) +{ + return libCMP0060(); +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 60a8a82..e53612f 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -65,6 +65,7 @@ add_RunCMake_test(CMP0054) add_RunCMake_test(CMP0055) add_RunCMake_test(CMP0057) add_RunCMake_test(CMP0059) +add_RunCMake_test(CMP0060) if(CMAKE_GENERATOR STREQUAL "Ninja") add_RunCMake_test(Ninja) endif() diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index f4b744b..1da1623 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -17,6 +17,7 @@ \* CMP0042 \* CMP0046 \* CMP0052 + \* CMP0060 Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 11:32:33 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 11:32:33 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-682-g1a1bdbf Message-ID: <20150409153233.C9047ADF7B@public.kitware.com> This is an automated email from 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 1a1bdbfd87ec2dcf3205f062ab8145d5e0189146 (commit) via 882f48e5ba335a1dbc1750c23e6dea5fa92a3adc (commit) via 318cd37097c724fac13a364fe3beb21055575ae7 (commit) via 1535dcd894eab9eea023d93aec6a0274babc7fd3 (commit) from 3049951b6293486053da2d304737fad42de3b3d8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1a1bdbfd87ec2dcf3205f062ab8145d5e0189146 commit 1a1bdbfd87ec2dcf3205f062ab8145d5e0189146 Merge: 3049951 882f48e Author: Brad King AuthorDate: Thu Apr 9 11:32:31 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 11:32:31 2015 -0400 Merge topic 'link-implicit-libs-full-path' 882f48e5 Link libraries by full path even in implicit directories 318cd370 Help: Add link target for Find Modules section of cmake-developer.7 1535dcd8 Tests: Teach RunCMake to optionally merge command output to stdout ----------------------------------------------------------------------- Summary of changes: Help/command/target_link_libraries.rst | 16 +++-- Help/manual/cmake-developer.7.rst | 1 + Help/manual/cmake-policies.7.rst | 1 + Help/policy/CMP0060.rst | 63 ++++++++++++++++++++ Help/release/dev/link-implicit-libs-full-path.rst | 6 ++ Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst | 2 + Source/cmComputeLinkInformation.cxx | 42 +++++++++++++ Source/cmComputeLinkInformation.h | 4 ++ Source/cmPolicies.cxx | 5 ++ Source/cmPolicies.h | 1 + Source/cmTarget.h | 3 +- Tests/RunCMake/CMP0060/CMP0060-Common.cmake | 35 +++++++++++ Tests/RunCMake/CMP0060/CMP0060-NEW.cmake | 2 + .../RunCMake/CMP0060/CMP0060-OLD-Build-result.txt | 1 + .../RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt | 1 + Tests/RunCMake/CMP0060/CMP0060-OLD.cmake | 2 + .../CMP0060/CMP0060-WARN-OFF-Build-result.txt | 1 + .../CMP0060/CMP0060-WARN-OFF-Build-stdout.txt | 1 + Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake | 1 + .../CMP0060/CMP0060-WARN-ON-Build-result.txt | 1 + .../CMP0060/CMP0060-WARN-ON-Build-stdout.txt | 1 + Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt | 16 +++++ Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake | 2 + Tests/RunCMake/{try_run => CMP0060}/CMakeLists.txt | 2 +- Tests/RunCMake/CMP0060/RunCMakeTest.cmake | 19 ++++++ Tests/RunCMake/CMP0060/cmp0060.c | 4 ++ Tests/RunCMake/CMP0060/main.c | 5 ++ Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/RunCMake.cmake | 10 +++- .../RunCMake/TargetPolicies/PolicyList-stderr.txt | 1 + 30 files changed, 241 insertions(+), 9 deletions(-) create mode 100644 Help/policy/CMP0060.rst create mode 100644 Help/release/dev/link-implicit-libs-full-path.rst create mode 100644 Tests/RunCMake/CMP0060/CMP0060-Common.cmake create mode 100644 Tests/RunCMake/CMP0060/CMP0060-NEW.cmake create mode 100644 Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-OLD.cmake create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake copy Tests/RunCMake/{try_run => CMP0060}/CMakeLists.txt (61%) create mode 100644 Tests/RunCMake/CMP0060/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/CMP0060/cmp0060.c create mode 100644 Tests/RunCMake/CMP0060/main.c hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 11:32:36 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 11:32:36 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-684-g81f627d Message-ID: <20150409153236.2606DADF7A@public.kitware.com> This is an automated email from 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 81f627d53bd3bdb50379eb3e1b9cd87bb0ff0bbc (commit) via 1e3843373f8e0dfd550809ec034d535d31276b6b (commit) from 1a1bdbfd87ec2dcf3205f062ab8145d5e0189146 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=81f627d53bd3bdb50379eb3e1b9cd87bb0ff0bbc commit 81f627d53bd3bdb50379eb3e1b9cd87bb0ff0bbc Merge: 1a1bdbf 1e38433 Author: Brad King AuthorDate: Thu Apr 9 11:32:34 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 11:32:34 2015 -0400 Merge topic 'cmake-command-line-help-vs-arch' 1e384337 cmake: Show in --help how to select VS target platform (#15422) ----------------------------------------------------------------------- Summary of changes: Source/cmDocumentationFormatter.cxx | 2 +- Source/cmGlobalVisualStudio10Generator.cxx | 7 +++++-- Source/cmGlobalVisualStudio11Generator.cxx | 7 +++++-- Source/cmGlobalVisualStudio12Generator.cxx | 7 +++++-- Source/cmGlobalVisualStudio14Generator.cxx | 7 +++++-- Source/cmGlobalVisualStudio8Generator.cxx | 7 +++++-- Source/cmGlobalVisualStudio9Generator.cxx | 7 +++++-- Source/cmake.cxx | 16 ++++++++-------- 8 files changed, 39 insertions(+), 21 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 11:32:38 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 11:32:38 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-695-g26d6c09 Message-ID: <20150409153238.7BB8DADF85@public.kitware.com> This is an automated email from 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 26d6c095d6117d7f9cb02378acb74d86efe59d0b (commit) via ba404938a202b51bb82bff8692ed08e53b061ad4 (commit) via f3922a9a5b463420db5f7fae08efdf1b4abdfe5e (commit) via 3e6a76e48b93b2756cd3e1f28941c79c5a8f9709 (commit) via 9e64156725e431ae15ce92be4e470cae6edf5bd6 (commit) via 1e2dbfce37acd1b7e7dc5bb1b45d71c5ac0c3599 (commit) via 60a62a91c4c67859d8e8f51aafcf0eb929edc036 (commit) via 77f2807ce56491fab7637327564c7fb1033dadb1 (commit) via 14973054a2f3954111789cda5e54c2e2e2175521 (commit) via 1f2c12ebd196f3d23aa40d85c965654dbc36d0ad (commit) via 97c50a8dbd9f1ca5026f60e4a224e9a087e01f0e (commit) from 81f627d53bd3bdb50379eb3e1b9cd87bb0ff0bbc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26d6c095d6117d7f9cb02378acb74d86efe59d0b commit 26d6c095d6117d7f9cb02378acb74d86efe59d0b Merge: 81f627d ba40493 Author: Brad King AuthorDate: Thu Apr 9 11:32:36 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 11:32:36 2015 -0400 Merge topic 'refactor-cache-api' ba404938 cmCacheManager: Port consumers to non-iterator API. f3922a9a Port QtDialog to non-iterator cache API. 3e6a76e4 Port CursesDialog to non-iterator cache API. 9e641567 cmMakefile: Port away from CacheEntry.Initialized. 1e2dbfce cmCacheManager: Add non-iterator-based API. 60a62a91 cmCacheManager: Return a C string from GetValue. 77f2807c cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue. 14973054 Add API for cache loading, deleting and saving to the cmake class. 1f2c12eb cmMakefile: Remove cache version accessors. 97c50a8d cmMakefile: Simplify GetDefinitions implementation. ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestBuildAndTestHandler.cxx | 3 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 35 +++-- Source/CursesDialog/cmCursesCacheEntryComposite.h | 2 +- Source/CursesDialog/cmCursesMainForm.cxx | 151 +++++++++++------- Source/QtDialog/QCMake.cxx | 85 +++++----- Source/cmCPluginAPI.cxx | 6 +- Source/cmCTest.cxx | 2 +- Source/cmCacheManager.cxx | 16 +- Source/cmCacheManager.h | 79 +++++++++- Source/cmCommandArgumentParserHelper.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 6 +- Source/cmFindBase.cxx | 13 +- Source/cmGetPropertyCommand.cxx | 7 +- Source/cmGlobalGenerator.cxx | 14 +- Source/cmGlobalXCodeGenerator.cxx | 2 +- Source/cmLoadCacheCommand.cxx | 6 +- Source/cmMakefile.cxx | 54 +++---- Source/cmMakefile.h | 8 - Source/cmMarkAsAdvancedCommand.cxx | 15 +- Source/cmOptionCommand.cxx | 12 +- Source/cmSetCommand.cxx | 7 +- Source/cmSetPropertyCommand.cxx | 19 ++- Source/cmSetPropertyCommand.h | 2 +- Source/cmTryRunCommand.cxx | 19 ++- Source/cmUtilitySourceCommand.cxx | 6 +- Source/cmVariableRequiresCommand.cxx | 6 +- Source/cmake.cxx | 166 ++++++++++++-------- Source/cmake.h | 14 +- Source/cmakemain.cxx | 26 +-- 29 files changed, 472 insertions(+), 312 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 11:32:40 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 11:32:40 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-697-g48040c1 Message-ID: <20150409153240.B5049ADF8D@public.kitware.com> This is an automated email from 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 48040c19d5f1bcec55a130fcf8f8d83db27291b4 (commit) via 99abebdea01b9ef73e091db5594553f7b1694a1b (commit) from 26d6c095d6117d7f9cb02378acb74d86efe59d0b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48040c19d5f1bcec55a130fcf8f8d83db27291b4 commit 48040c19d5f1bcec55a130fcf8f8d83db27291b4 Merge: 26d6c09 99abebd Author: Brad King AuthorDate: Thu Apr 9 11:32:39 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 11:32:39 2015 -0400 Merge topic 'FindCUDA.cmake/C++11Flags' 99abebde FindCUDA: Handle c++11 host flag ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 11:32:59 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 11:32:59 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1673-g43042ba Message-ID: <20150409153259.B6A62ADF87@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 43042badb4307673d415ac9cecfb7e4cb3eaabbd (commit) via 48040c19d5f1bcec55a130fcf8f8d83db27291b4 (commit) via 26d6c095d6117d7f9cb02378acb74d86efe59d0b (commit) via 81f627d53bd3bdb50379eb3e1b9cd87bb0ff0bbc (commit) via 1a1bdbfd87ec2dcf3205f062ab8145d5e0189146 (commit) via 3049951b6293486053da2d304737fad42de3b3d8 (commit) from e15b301d0ceeb3bc57090379bf223396e2e316a0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=43042badb4307673d415ac9cecfb7e4cb3eaabbd commit 43042badb4307673d415ac9cecfb7e4cb3eaabbd Merge: e15b301 48040c1 Author: Brad King AuthorDate: Thu Apr 9 11:32:52 2015 -0400 Commit: Brad King CommitDate: Thu Apr 9 11:32:52 2015 -0400 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 Apr 9 11:42:40 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 11:42:40 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1676-g5f9abec Message-ID: <20150409154240.21FE1A94B5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5f9abec54efaf06b31330a980703286e55b7fec9 (commit) via 1b0c77a33d2e598c48bc8ad385cfd0586b8294e9 (commit) via 8313de2d5adf4514f0b3cccca747e78ca07d3ad3 (commit) from 43042badb4307673d415ac9cecfb7e4cb3eaabbd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f9abec54efaf06b31330a980703286e55b7fec9 commit 5f9abec54efaf06b31330a980703286e55b7fec9 Merge: 43042ba 1b0c77a Author: Brad King AuthorDate: Thu Apr 9 11:42:39 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 11:42:39 2015 -0400 Merge topic 'FindCUDA.cmake/CUDA_SOURCE_FILE' into next 1b0c77a3 FindCUDA: Add specific cuda_language_flag instead of using nvcc. 8313de2d FindCUDA: Allow setting CUDA_SOURCE_PROPERTY_FORMAT for non-.cu files. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b0c77a33d2e598c48bc8ad385cfd0586b8294e9 commit 1b0c77a33d2e598c48bc8ad385cfd0586b8294e9 Author: James Bigler AuthorDate: Wed Apr 1 17:23:51 2015 -0600 Commit: Brad King CommitDate: Thu Apr 9 11:41:36 2015 -0400 FindCUDA: Add specific cuda_language_flag instead of using nvcc. I was previously appending to nvcc_flags inside the file loop. This caused the flag to be appended multiple times which freaks out nvcc. Now the flag is specifically handled per file. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index de66443..1802e61 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1310,7 +1310,9 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) endif() # If file isn't a .cu file, we need to tell nvcc to treat it as such. if(NOT ${file} MATCHES "\\.cu$") - list(APPEND nvcc_flags "-x=cu") + set(cuda_language_flag -x=cu) + else() + set(cuda_language_flag) endif() if( ${_cuda_source_format} MATCHES "OBJ") diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake index abdd307..8032309 100644 --- a/Modules/FindCUDA/run_nvcc.cmake +++ b/Modules/FindCUDA/run_nvcc.cmake @@ -75,6 +75,7 @@ set(CUDA_NVCC_FLAGS @CUDA_NVCC_FLAGS@ ;; @CUDA_WRAP_OPTION_NVCC_FLAGS@) # list set(nvcc_flags @nvcc_flags@) # list set(CUDA_NVCC_INCLUDE_ARGS "@CUDA_NVCC_INCLUDE_ARGS@") # list (needs to be in quotes to handle spaces properly). set(format_flag "@format_flag@") # string +set(cuda_language_flag @cuda_language_flag@) # list if(build_cubin AND NOT generated_cubin_file) message(FATAL_ERROR "You must specify generated_cubin_file on the command line") @@ -238,6 +239,7 @@ cuda_execute_process( "Generating ${generated_file}" COMMAND "${CUDA_NVCC_EXECUTABLE}" "${source_file}" + ${cuda_language_flag} ${format_flag} -o "${generated_file}" ${CCBIN} ${nvcc_flags} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8313de2d5adf4514f0b3cccca747e78ca07d3ad3 commit 8313de2d5adf4514f0b3cccca747e78ca07d3ad3 Author: James Bigler AuthorDate: Thu Mar 26 23:46:35 2015 -0600 Commit: Brad King CommitDate: Thu Apr 9 11:41:36 2015 -0400 FindCUDA: Allow setting CUDA_SOURCE_PROPERTY_FORMAT for non-.cu files. A previously undocumented feature allowed overriding the format specified to CUDA_WRAP_SRCS with a source file property called CUDA_SOURCE_PROPERTY_FORMAT. I added documentation for this feature as well as added the ability to let nvcc compile any file regardless of type if this property was found. In addition, I also fixed a couple of bugs with the calls to _cuda_get_important_host_flags that weren't garding the arguments with "" to prevent empty values from causing errors. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index ca32559..de66443 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -106,6 +106,13 @@ # CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and # CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. # +# CUDA_SOURCE_PROPERTY_FORMAT +# -- If this source file property is set, it can override the format specified +# to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file +# is not a .cu file, setting this file will cause it to be treated as a .cu +# file. See documentation for set_source_files_properties on how to set +# this property. +# # CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) # -- When enabled the static version of the CUDA runtime library will be used # in CUDA_LIBRARIES. If the version of CUDA configured doesn't support @@ -1294,13 +1301,17 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) foreach(file ${ARGN}) # Ignore any file marked as a HEADER_FILE_ONLY get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) - if(${file} MATCHES "\\.cu$" AND NOT _is_header) + # Allow per source file overrides of the format. Also allows compiling non-.cu files. + get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) + if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) - # Allow per source file overrides of the format. - get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) if(NOT _cuda_source_format) set(_cuda_source_format ${format}) endif() + # If file isn't a .cu file, we need to tell nvcc to treat it as such. + if(NOT ${file} MATCHES "\\.cu$") + list(APPEND nvcc_flags "-x=cu") + endif() if( ${_cuda_source_format} MATCHES "OBJ") set( cuda_compile_to_external_module OFF ) @@ -1313,7 +1324,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) elseif( ${_cuda_source_format} MATCHES "FATBIN") set( cuda_compile_to_external_module_type "fatbin" ) else() - message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") + message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") endif() endif() @@ -1472,10 +1483,10 @@ endmacro() function(_cuda_get_important_host_flags important_flags flag_string) if(CMAKE_GENERATOR MATCHES "Visual Studio") - string(REGEX MATCHALL "/M[DT][d]?" flags ${flag_string}) + string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") list(APPEND ${important_flags} ${flags}) else() - string(REGEX MATCHALL "-fPIC" flags ${flag_string}) + string(REGEX MATCHALL "-fPIC" flags "${flag_string}") list(APPEND ${important_flags} ${flags}) endif() set(${important_flags} ${${important_flags}} PARENT_SCOPE) @@ -1535,14 +1546,14 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options list(APPEND config_specific_flags $<$:${f}>) endforeach() set(important_host_flags) - _cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") foreach(f ${important_host_flags}) 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}) + _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() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 12:48:18 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 12:48:18 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1679-g9c4af87 Message-ID: <20150409164818.9A1C8AD5C0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9c4af87283f734060777856febe72d2dc1a187dc (commit) via a00be6653e8730339ca1e1412e368a977cb5052d (commit) via 051d8be17f1b36d52041bfe61856b926e36dfb8c (commit) from 5f9abec54efaf06b31330a980703286e55b7fec9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c4af87283f734060777856febe72d2dc1a187dc commit 9c4af87283f734060777856febe72d2dc1a187dc Merge: 5f9abec a00be66 Author: Brad King AuthorDate: Thu Apr 9 12:48:16 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 12:48:16 2015 -0400 Merge topic 'add-GreenHills-MULTI-generator' into next a00be665 Add a 'Green Hills MULTI' generator on Windows 051d8be1 cmLocalGenerator: Constify some cmTarget and cmGeneratorTarget arguments http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a00be6653e8730339ca1e1412e368a977cb5052d commit a00be6653e8730339ca1e1412e368a977cb5052d Author: Geoff Viola AuthorDate: Mon Mar 23 23:12:55 2015 -0600 Commit: Brad King CommitDate: Thu Apr 9 10:48:03 2015 -0400 Add a 'Green Hills MULTI' generator on Windows Green Hills MULTI is an IDE for embedded real-time systems. The IDE's product page can be found here: http://www.ghs.com/products/MULTI_IDE.html It supports cross compiling on ARM, Intel x86, and other architectures with various operating systems. The IDE exists on Linux and Windows host systems, but CMake will currently only generate the project files on Windows host systems. diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst new file mode 100644 index 0000000..79695f1 --- /dev/null +++ b/Help/generator/Green Hills MULTI.rst @@ -0,0 +1,11 @@ +Green Hills MULTI +----------------- + +Generates Green Hills MULTI project files. + +Customizations are available through the following cache variables: + +* ``GHS_BSP_NAME`` +* ``GHS_CUSTOMIZATION`` +* ``GHS_GPJ_MACROS`` +* ``GHS_OS_DIR`` diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst index 6f76fb1..723c308 100644 --- a/Help/manual/cmake-generators.7.rst +++ b/Help/manual/cmake-generators.7.rst @@ -73,6 +73,7 @@ Visual Studio Generators .. toctree:: :maxdepth: 1 + /generator/Green Hills MULTI /generator/Visual Studio 6 /generator/Visual Studio 7 /generator/Visual Studio 7 .NET 2003 diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 63f704d..865e1ef 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -182,6 +182,7 @@ Variables that Describe the System /variable/CMAKE_SYSTEM_VERSION /variable/CYGWIN /variable/ENV + /variable/GHS-MULTI /variable/MINGW /variable/MSVC10 /variable/MSVC11 @@ -307,6 +308,10 @@ Variables for Languages /variable/CMAKE_LANG_FLAGS_RELEASE /variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO /variable/CMAKE_LANG_FLAGS + /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG + /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL + /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE + /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO /variable/CMAKE_LANG_IGNORE_EXTENSIONS /variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES /variable/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst new file mode 100644 index 0000000..c5915c3 --- /dev/null +++ b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst @@ -0,0 +1,6 @@ +CMAKE__GHS_KERNEL_FLAGS_DEBUG +----------------------------------- + +GHS kernel flags for Debug build type or configuration. + + flags used when CMAKE_BUILD_TYPE is Debug. diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst new file mode 100644 index 0000000..f80e785 --- /dev/null +++ b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst @@ -0,0 +1,7 @@ +CMAKE__GHS_KERNEL_FLAGS_MINSIZEREL +---------------------------------------- + +GHS kernel flags for MinSizeRel build type or configuration. + + flags used when CMAKE_BUILD_TYPE is MinSizeRel.Short for +minimum size release. diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst new file mode 100644 index 0000000..fe02bc3 --- /dev/null +++ b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst @@ -0,0 +1,6 @@ +CMAKE__GHS_KERNEL_FLAGS_RELEASE +------------------------------------- + +GHS kernel flags for Release build type or configuration. + + flags used when CMAKE_BUILD_TYPE is Release diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst new file mode 100644 index 0000000..220f7f9 --- /dev/null +++ b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst @@ -0,0 +1,7 @@ +CMAKE__GHS_KERNEL_FLAGS_RELWITHDEBINFO +-------------------------------------------- + +GHS kernel flags for RelWithDebInfo type or configuration. + + flags used when CMAKE_BUILD_TYPE is RelWithDebInfo. Short for +Release With Debug Information. diff --git a/Help/variable/CMAKE_MAKE_PROGRAM.rst b/Help/variable/CMAKE_MAKE_PROGRAM.rst index f1d88a5..85b098b 100644 --- a/Help/variable/CMAKE_MAKE_PROGRAM.rst +++ b/Help/variable/CMAKE_MAKE_PROGRAM.rst @@ -56,6 +56,10 @@ to configure the project: the CMake cache then CMake will use the specified value if possible. +* The :generator:`Green Hills MULTI` generator sets this to ``gbuild``. + If a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to + the CMake cache then CMake will use the specified value. + The ``CMAKE_MAKE_PROGRAM`` variable is set for use by project code. The value is also used by the :manual:`cmake(1)` ``--build`` and :manual:`ctest(1)` ``--build-and-test`` tools to launch the native diff --git a/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst b/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst index 8ad89f1..2f5313b 100644 --- a/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst +++ b/Help/variable/CMAKE_SYSTEM_PROCESSOR.rst @@ -6,3 +6,5 @@ The name of the CPU CMake is building for. This variable is the same as :variable:`CMAKE_HOST_SYSTEM_PROCESSOR` if you build for the host system instead of the target system when cross compiling. + +* The Green Hills MULTI generator sets this to ``ARM`` by default diff --git a/Help/variable/GHS-MULTI.rst b/Help/variable/GHS-MULTI.rst new file mode 100644 index 0000000..0f91be8 --- /dev/null +++ b/Help/variable/GHS-MULTI.rst @@ -0,0 +1,4 @@ +GHS-MULTI +--------- + +True when using Green Hills MULTI diff --git a/Modules/Compiler/GHS-C.cmake b/Modules/Compiler/GHS-C.cmake new file mode 100644 index 0000000..e97d62c --- /dev/null +++ b/Modules/Compiler/GHS-C.cmake @@ -0,0 +1,27 @@ +set(CMAKE_C_VERBOSE_FLAG "-v") + +set(CMAKE_C_FLAGS_INIT "") +set(CMAKE_C_FLAGS_DEBUG_INIT "-Odebug -g") +set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Ospace") +set(CMAKE_C_FLAGS_RELEASE_INIT "-O") +set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O -g") + +set(CMAKE_C_GHS_KERNEL_FLAGS_DEBUG_INIT "-ldebug ${CMAKE_C_FLAGS_DEBUG_INIT}") +set(CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT}") +set(CMAKE_C_GHS_KERNEL_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT}") +set(CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT + "-ldebug ${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}") + +if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) + set (CMAKE_C_GHS_KERNEL_FLAGS_DEBUG "${CMAKE_C_GHS_KERNEL_FLAGS_DEBUG_INIT}" + CACHE STRING "Kernel flags used by the compiler during debug builds.") + set (CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL + "${CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL_INIT}" CACHE STRING + "Kernel flags used by the compiler during release builds for minimum size.") + set (CMAKE_C_GHS_KERNEL_FLAGS_RELEASE + "${CMAKE_C_GHS_KERNEL_FLAGS_RELEASE_INIT}" + CACHE STRING "Kernel flags used by the compiler during release builds.") + set (CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO + "${CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING + "Kernel flags used by the compiler during release builds with debug info.") +endif() diff --git a/Modules/Compiler/GHS-CXX.cmake b/Modules/Compiler/GHS-CXX.cmake new file mode 100644 index 0000000..71a0dec --- /dev/null +++ b/Modules/Compiler/GHS-CXX.cmake @@ -0,0 +1,31 @@ +set(CMAKE_CXX_VERBOSE_FLAG "-v") + +set(CMAKE_CXX_FLAGS_INIT "") +set(CMAKE_CXX_FLAGS_DEBUG_INIT "-Odebug -g") +set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Ospace") +set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O -g") + +set(CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG_INIT + "-ldebug ${CMAKE_CXX_FLAGS_DEBUG_INIT}") +set(CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL_INIT + "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}") +set(CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE_INIT + "${CMAKE_CXX_FLAGS_RELEASE_INIT}") +set(CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT + "-ldebug ${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}") + +if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) + set (CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG + "${CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG_INIT}" + CACHE STRING "Kernel flags used by the compiler during debug builds.") + set (CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL + "${CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL_INIT}" CACHE STRING + "Kernel flags used by the compiler during release builds for minimum size.") + set (CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE + "${CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE_INIT}" + CACHE STRING "Kernel flags used by the compiler during release builds.") + set (CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING + "Kernel flags used by the compiler during release builds with debug info.") +endif() diff --git a/Modules/Compiler/GHS-DetermineCompiler.cmake b/Modules/Compiler/GHS-DetermineCompiler.cmake new file mode 100644 index 0000000..56d24e2 --- /dev/null +++ b/Modules/Compiler/GHS-DetermineCompiler.cmake @@ -0,0 +1,6 @@ +set(_compiler_id_pp_test "defined(__INTEGRITY)") + +set(_compiler_id_version_compute " +# define @PREFIX at COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEGRITY_MAJOR_VERSION) +# define @PREFIX at COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEGRITY_MINOR_VERSION) +# define @PREFIX at COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEGRITY_PATCH_VERSION)") diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 466090b..c844aed 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -405,6 +405,8 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret) else() set (_boost_COMPILER "-il") endif() + elseif (GHSMULTI) + set(_boost_COMPILER "-ghs") elseif (MSVC14) set(_boost_COMPILER "-vc140") elseif (MSVC12) @@ -777,7 +779,8 @@ endif() # ------------------------------------------------------------------------ set(Boost_LIB_PREFIX "") -if ( WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) +if ( (GHSMULTI AND Boost_USE_STATIC_LIBS) OR + (WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) ) set(Boost_LIB_PREFIX "lib") endif() diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake new file mode 100644 index 0000000..342ad21 --- /dev/null +++ b/Modules/Platform/GHS-MULTI-Initialize.cmake @@ -0,0 +1,29 @@ + +#============================================================================= +# Copyright 2015 Geoffrey Viola +# +# 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.) + +#Setup Greenhills MULTI specific compilation information +find_path(GHS_INT_DIRECTORY INTEGRITY.ld PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware6433c345;InstallLocation]" #int1122 + "C:/ghs/int1122" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GreenHillsSoftware289b6625;InstallLocation]" #int1104 + "C:/ghs/int1104" + DOC "Path to integrity directory" + ) +set(GHS_OS_DIR ${GHS_INT_DIRECTORY} CACHE PATH "OS directory") +set(GHS_PRIMARY_TARGET "arm_integrity.tgt" CACHE STRING "target for compilation") +set(GHS_BSP_NAME "simarm" CACHE STRING "BSP name") +set(GHS_CUSTOMIZATION "" CACHE FILEPATH "optional GHS customization") +mark_as_advanced(GHS_CUSTOMIZATION) +set(GHS_GPJ_MACROS "" CACHE STRING "optional GHS macros generated in the .gpjs for legacy reasons") +mark_as_advanced(GHS_GPJ_MACROS) diff --git a/Modules/Platform/GHS-MULTI.cmake b/Modules/Platform/GHS-MULTI.cmake new file mode 100644 index 0000000..211cf3e --- /dev/null +++ b/Modules/Platform/GHS-MULTI.cmake @@ -0,0 +1,27 @@ + +#============================================================================= +# Copyright 2015 Geoffrey Viola +# +# 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.) + +# This module is shared by multiple languages; use include blocker. + +if(__GHSMULTI) + return() +endif() +set(__GHSMULTI 1) + +set(GHSMULTI 1) + +set(CMAKE_FIND_LIBRARY_PREFIXES "") +set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + +include(Platform/WindowsPaths) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 04f6a81..064b827 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -472,6 +472,14 @@ if (WIN32) cmVisualStudioSlnParser.cxx cmVisualStudioWCEPlatformParser.h cmVisualStudioWCEPlatformParser.cxx + cmGlobalGhsMultiGenerator.cxx + cmGlobalGhsMultiGenerator.h + cmLocalGhsMultiGenerator.cxx + cmLocalGhsMultiGenerator.h + cmGhsMultiTargetGenerator.cxx + cmGhsMultiTargetGenerator.h + cmGhsMultiGpj.cxx + cmGhsMultiGpj.h ) endif() endif () @@ -499,6 +507,7 @@ set(SRCS ${SRCS} cmNinjaUtilityTargetGenerator.cxx cmNinjaUtilityTargetGenerator.h ) + if(WIN32 AND NOT CYGWIN) set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501) add_executable(cmcldeps cmcldeps.cxx) diff --git a/Source/cmGhsMultiGpj.cxx b/Source/cmGhsMultiGpj.cxx new file mode 100644 index 0000000..e47d583 --- /dev/null +++ b/Source/cmGhsMultiGpj.cxx @@ -0,0 +1,41 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Geoffrey Viola + + 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 "cmGhsMultiGpj.h" + +#include "cmGeneratedFileStream.h" + +void GhsMultiGpj::WriteGpjTag(Types const gpjType, + cmGeneratedFileStream *const filestream) +{ + char const *tag; + switch (gpjType) + { + case INTERGRITY_APPLICATION: + tag = "INTEGRITY Application"; + break; + case PROJECT: + tag = "Project"; + break; + case PROGRAM: + tag = "Program"; + break; + case REFERENCE: + tag = "Reference"; + break; + case SUBPROJECT: + tag = "Subproject"; + break; + default: + tag = ""; + } + *filestream << "[" << tag << "]" << std::endl; +} diff --git a/Source/cmGhsMultiGpj.h b/Source/cmGhsMultiGpj.h new file mode 100644 index 0000000..7e5b942 --- /dev/null +++ b/Source/cmGhsMultiGpj.h @@ -0,0 +1,33 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Geoffrey Viola + + 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 cmGhsMultiGpj_h +#define cmGhsMultiGpj_h + +class cmGeneratedFileStream; + +class GhsMultiGpj +{ +public: + enum Types + { + INTERGRITY_APPLICATION, + PROJECT, + PROGRAM, + REFERENCE, + SUBPROJECT + }; + + static void WriteGpjTag(Types const gpjType, + cmGeneratedFileStream *filestream); +}; + +#endif // ! cmGhsMultiGpjType_h diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx new file mode 100644 index 0000000..e01c851 --- /dev/null +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -0,0 +1,614 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Geoffrey Viola + + 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 "cmGhsMultiTargetGenerator.h" +#include "cmGlobalGhsMultiGenerator.h" +#include "cmLocalGhsMultiGenerator.h" +#include "cmMakefile.h" +#include "cmTarget.h" +#include "cmGeneratedFileStream.h" +#include "cmSourceFile.h" +#include +#include + +std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic"); + +cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmTarget *target) + : Target(target) + , LocalGenerator(static_cast( + target->GetMakefile()->GetLocalGenerator())) + , Makefile(target->GetMakefile()) + , TargetGroup(DetermineIfTargetGroup(target)) + , DynamicDownload(false) +{ + this->RelBuildFilePath = this->GetRelBuildFilePath(target); + + this->RelOutputFileName = + this->RelBuildFilePath + this->Target->GetName() + ".a"; + + this->RelBuildFileName = this->RelBuildFilePath; + this->RelBuildFileName += this->GetBuildFileName(target); + + std::string absPathToRoot = this->GetAbsPathToRoot(target); + absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot); + this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath; + this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName; + this->AbsOutputFileName = absPathToRoot + this->RelOutputFileName; +} + +cmGhsMultiTargetGenerator::~cmGhsMultiTargetGenerator() +{ + cmDeleteAll(this->FolderBuildStreams); +} + +std::string +cmGhsMultiTargetGenerator::GetRelBuildFilePath(const cmTarget *target) +{ + std::string output; + char const *folderProp = target->GetProperty("FOLDER"); + output = NULL == folderProp ? "" : folderProp; + cmSystemTools::ConvertToUnixSlashes(output); + if (!output.empty()) + { + output += "/"; + } + output += target->GetName() + "/"; + return output; +} + +std::string +cmGhsMultiTargetGenerator::GetAbsPathToRoot(const cmTarget *target) +{ + return target->GetMakefile()->GetHomeOutputDirectory(); +} + +std::string +cmGhsMultiTargetGenerator::GetAbsBuildFilePath(const cmTarget *target) +{ + std::string output; + output = cmGhsMultiTargetGenerator::GetAbsPathToRoot(target); + output = cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(output); + output += cmGhsMultiTargetGenerator::GetRelBuildFilePath(target); + return output; +} + +std::string +cmGhsMultiTargetGenerator::GetRelBuildFileName(const cmTarget *target) +{ + std::string output; + output = cmGhsMultiTargetGenerator::GetRelBuildFilePath(target); + output = cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(output); + output += cmGhsMultiTargetGenerator::GetBuildFileName(target); + return output; +} + +std::string cmGhsMultiTargetGenerator::GetBuildFileName(const cmTarget *target) +{ + std::string output; + output = target->GetName(); + output += cmGlobalGhsMultiGenerator::FILE_EXTENSION; + return output; +} + +std::string +cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(std::string const &input) +{ + std::string output(input); + if (!cmHasLiteralSuffix(output, "/")) + { + output += "/"; + } + return output; +} + +void cmGhsMultiTargetGenerator::Generate() +{ + const std::vector objectSources = this->GetSources(); + if (!objectSources.empty() && this->IncludeThisTarget()) + { + if (!cmSystemTools::FileExists(this->AbsBuildFilePath.c_str())) + { + cmSystemTools::MakeDirectory(this->AbsBuildFilePath.c_str()); + } + cmGlobalGhsMultiGenerator::Open(std::string(""), this->AbsBuildFileName, + &this->FolderBuildStreams); + cmGlobalGhsMultiGenerator::OpenBuildFileStream( + this->GetFolderBuildStreams()); + std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); + if (0 == config.length()) + { + config = "RELEASE"; + } + const std::string language(this->Target->GetLinkerLanguage(config)); + config = cmSystemTools::UpperCase(config); + this->DynamicDownload = this->DetermineIfDynamicDownload(config, language); + if (this->DynamicDownload) + { + *this->GetFolderBuildStreams() << "#component integrity_dynamic_download" + << std::endl; + } + GhsMultiGpj::WriteGpjTag(this->GetGpjTag(), this->GetFolderBuildStreams()); + cmGlobalGhsMultiGenerator::WriteDisclaimer(this->GetFolderBuildStreams()); + + bool const notKernel = this->IsNotKernel(config, language); + this->WriteTypeSpecifics(config, notKernel); + this->SetCompilerFlags(config, language, notKernel); + this->WriteCompilerFlags(config, language); + this->WriteCompilerDefinitions(config, language); + this->WriteIncludes(config, language); + this->WriteTargetLinkLibraries(); + this->WriteCustomCommands(); + if (this->DynamicDownload) + { + *this->GetFolderBuildStreams() << " " << this->DDOption << std::endl; + } + + this->WriteSources(objectSources); + } +} + +bool cmGhsMultiTargetGenerator::IncludeThisTarget() +{ + bool output = true; + char const *excludeFromAll = this->Target->GetProperty("EXCLUDE_FROM_ALL"); + if (NULL != excludeFromAll && '1' == excludeFromAll[0] && + '\0' == excludeFromAll[1]) + { + output = false; + } + return output; +} + +std::vector cmGhsMultiTargetGenerator::GetSources() const +{ + std::vector output; + std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); + this->Target->GetSourceFiles(output, config); + return output; +} + +GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag() const +{ + return cmGhsMultiTargetGenerator::GetGpjTag(this->Target); +} + +GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag(const cmTarget *target) +{ + GhsMultiGpj::Types output; + if (cmGhsMultiTargetGenerator::DetermineIfTargetGroup(target)) + { + output = GhsMultiGpj::INTERGRITY_APPLICATION; + } + else + { + output = GhsMultiGpj::PROGRAM; + } + return output; +} + +cmGlobalGhsMultiGenerator* +cmGhsMultiTargetGenerator::GetGlobalGenerator() const +{ + return static_cast( + this->LocalGenerator->GetGlobalGenerator()); +} + +void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config, + bool const notKernel) +{ + std::string outputDir(this->GetOutputDirectory(config)); + std::string outputFilename(this->GetOutputFilename(config)); + + if (this->Target->GetType() == cmTarget::STATIC_LIBRARY) + { + *this->GetFolderBuildStreams() << " -relobj" << std::endl; + *this->GetFolderBuildStreams() << " {optgroup=GhsCommonOptions} -o \"" + << outputDir << outputFilename << ".a\"" + << std::endl; + } + else if (this->Target->GetType() == cmTarget::EXECUTABLE) + { + if (notKernel && !this->IsTargetGroup()) + { + *this->GetFolderBuildStreams() << " -relprog" << std::endl; + } + if (this->IsTargetGroup()) + { + *this->GetFolderBuildStreams() << " -non_shared" << std::endl; + *this->GetFolderBuildStreams() << " -o \"" << outputDir + << outputFilename << ".elf\"" + << std::endl; + } + else + { + *this->GetFolderBuildStreams() << " {optgroup=GhsCommonOptions} -o \"" + << outputDir << outputFilename << ".as\"" + << std::endl; + } + } +} + +void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const &config, + const std::string &language, + bool const notKernel) +{ + std::map::iterator i = + this->FlagsByLanguage.find(language); + if (i == this->FlagsByLanguage.end()) + { + std::string flags; + const char *lang = language.c_str(); + + if (notKernel) + { + this->LocalGenerator->AddLanguageFlags(flags, lang, config); + } + else + { + this->LocalGenerator->AddLanguageFlags( + flags, lang + std::string("_GHS_KERNEL"), config); + } + this->LocalGenerator->AddCMP0018Flags(flags, this->Target, lang, config); + this->LocalGenerator->AddVisibilityPresetFlags(flags, this->Target, lang); + + // Append old-style preprocessor definition flags. + this->LocalGenerator->AppendFlags(flags, + this->Makefile->GetDefineFlags()); + + // Add target-specific flags. + this->LocalGenerator->AddCompileOptions(flags, this->Target, lang, config); + + std::map::value_type entry(language, flags); + i = this->FlagsByLanguage.insert(entry).first; + } +} + +std::string cmGhsMultiTargetGenerator::GetDefines(const std::string &language, + std::string const &config) +{ + std::map::iterator i = + this->DefinesByLanguage.find(language); + if (i == this->DefinesByLanguage.end()) + { + std::set defines; + const char *lang = language.c_str(); + // Add the export symbol definition for shared library objects. + if (const char *exportMacro = this->Target->GetExportMacro()) + { + this->LocalGenerator->AppendDefines(defines, exportMacro); + } + + // Add preprocessor definitions for this target and configuration. + this->LocalGenerator->AddCompileDefinitions(defines, this->Target, config, + language); + + std::string definesString; + this->LocalGenerator->JoinDefines(defines, definesString, lang); + + std::map::value_type entry(language, + definesString); + i = this->DefinesByLanguage.insert(entry).first; + } + return i->second; +} + +void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::string const &config, + const std::string &language) +{ + //this->Target->GetCompileOptions(options, config, language); + static std::string const startFilePropName("-startfile_dir="); + bool hasStartfileDirProp = false; + std::map::iterator flagsByLangI = + this->FlagsByLanguage.find(language); + if (flagsByLangI != this->FlagsByLanguage.end()) + { + std::vector flags = + cmSystemTools::SplitString(flagsByLangI->second, ' '); + for (std::vector::const_iterator flagsI = flags.begin(); + flagsI != flags.end(); ++flagsI) + { + std::string flag = *flagsI; + if (" " != flag) + { + if (this->DDOption != flag) + { + if (flag.length() >= startFilePropName.length() && + startFilePropName == flag.substr(0, startFilePropName.length())) + { + hasStartfileDirProp = true; + } + cmSystemTools::ConvertToUnixSlashes(flag); + *this->GetFolderBuildStreams() << " " << flag << std::endl; + } + } + } + } + + // If this property is relative, make it relative to the root lists file + if (!hasStartfileDirProp && this->GetGlobalGenerator()->IsOSDirRelative()) + { + *this->GetFolderBuildStreams() << " " << startFilePropName << "\"" + << this->Makefile->GetHomeOutputDirectory() + << "/$(__LIBS_DIR_BASE)/$(__BSP_NAME)\"" + << std::endl; + } +} + +void cmGhsMultiTargetGenerator::WriteCompilerDefinitions( + const std::string &config, const std::string &language) +{ + std::vector compileDefinitions; + this->Target->GetCompileDefinitions(compileDefinitions, config, language); + for (std::vector::const_iterator cdI = + compileDefinitions.begin(); + cdI != compileDefinitions.end(); ++cdI) + { + *this->GetFolderBuildStreams() << " -D" << (*cdI) << std::endl; + } +} + +void cmGhsMultiTargetGenerator::WriteIncludes(const std::string &config, + const std::string &language) +{ + std::vector includes = + this->Target->GetIncludeDirectories(config, language); + for (std::vector::const_iterator includes_i = includes.begin(); + includes_i != includes.end(); ++includes_i) + { + *this->GetFolderBuildStreams() << " -I\"" << *includes_i << "\"" + << std::endl; + } +} + +void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries() +{ + // library directories + cmTargetDependSet tds = + this->GetGlobalGenerator()->GetTargetDirectDepends(*this->Target); + for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end(); + ++tdsI) + { + const cmTarget *tg(*tdsI); + *this->GetFolderBuildStreams() << " -L\"" << GetAbsBuildFilePath(tg) + << "\"" << std::endl; + } + // library targets + cmTarget::LinkLibraryVectorType llv = + this->Target->GetOriginalLinkLibraries(); + for (cmTarget::LinkLibraryVectorType::const_iterator llvI = llv.begin(); + llvI != llv.end(); ++llvI) + { + std::string libName = llvI->first; + // if it is a user defined target get the full path to the lib + cmTarget *tg(GetGlobalGenerator()->FindTarget(libName)); + if (NULL != tg) + { + cmGhsMultiTargetGenerator gmtg(tg); + libName = tg->GetName() + ".a"; + } + *this->GetFolderBuildStreams() << " -l\"" << libName << "\"" + << std::endl; + } +} + +void cmGhsMultiTargetGenerator::WriteCustomCommands() +{ + WriteCustomCommandsHelper(this->Target->GetPreBuildCommands(), + cmTarget::PRE_BUILD); + WriteCustomCommandsHelper(this->Target->GetPostBuildCommands(), + cmTarget::POST_BUILD); +} + +void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper( + std::vector const &commandsSet, + cmTarget::CustomCommandType const commandType) +{ + for (std::vector::const_iterator commandsSetI = + commandsSet.begin(); + commandsSetI != commandsSet.end(); ++commandsSetI) + { + cmCustomCommandLines const &commands = commandsSetI->GetCommandLines(); + for (cmCustomCommandLines::const_iterator commandI = commands.begin(); + commandI != commands.end(); ++commandI) + { + switch (commandType) + { + case cmTarget::PRE_BUILD: + *this->GetFolderBuildStreams() << " :preexecShellSafe="; + break; + case cmTarget::POST_BUILD: + *this->GetFolderBuildStreams() << " :postexecShellSafe="; + break; + default: + assert("Only pre and post are supported"); + } + cmCustomCommandLine const &command = *commandI; + for (cmCustomCommandLine::const_iterator commandLineI = command.begin(); + commandLineI != command.end(); ++commandLineI) + { + if (!command.empty()) + { + *this->GetFolderBuildStreams() + << (command.begin() == commandLineI ? "'" : " "); + } + *this->GetFolderBuildStreams() << *commandLineI; + } + if (!command.empty()) + { + *this->GetFolderBuildStreams() << "'" << std::endl; + } + } + } +} + +void cmGhsMultiTargetGenerator::WriteSources( + std::vector const &objectSources) +{ + for (std::vector::const_iterator si = objectSources.begin(); + si != objectSources.end(); ++si) + { + std::vector sourceGroups(this->Makefile->GetSourceGroups()); + char const *sourceFullPath = (*si)->GetFullPath().c_str(); + cmSourceGroup *sourceGroup = + this->Makefile->FindSourceGroup(sourceFullPath, sourceGroups); + std::string sgPath(sourceGroup->GetFullName()); + cmSystemTools::ConvertToUnixSlashes(sgPath); + cmGlobalGhsMultiGenerator::AddFilesUpToPath( + this->GetFolderBuildStreams(), &this->FolderBuildStreams, + this->Makefile->GetHomeOutputDirectory(), sgPath, + GhsMultiGpj::SUBPROJECT, this->RelBuildFilePath); + + if ((*si)->GetExtension() == ".int") + { + *this->FolderBuildStreams[sgPath] << "\"" << (*si)->GetFullPath() << "\"" + << std::endl; + } + else + { + *this->FolderBuildStreams[sgPath] << (*si)->GetFullPath() << std::endl; + } + + if ("ld" != (*si)->GetExtension() && "int" != (*si)->GetExtension() && + "bsp" != (*si)->GetExtension()) + { + this->WriteObjectLangOverride(this->FolderBuildStreams[sgPath], (*si)); + + this->WriteObjectDir(this->FolderBuildStreams[sgPath], + this->AbsBuildFilePath + sgPath); + } + } +} + +void cmGhsMultiTargetGenerator::WriteObjectLangOverride( + cmGeneratedFileStream *fileStream, cmSourceFile *sourceFile) +{ + const char *rawLangProp = sourceFile->GetProperty("LANGUAGE"); + if (NULL != rawLangProp) + { + std::string sourceLangProp(rawLangProp); + std::string extension(sourceFile->GetExtension()); + if ("CXX" == sourceLangProp && ("c" == extension || "C" == extension)) + { + *fileStream << " -dotciscxx" << std::endl; + } + } +} + +void cmGhsMultiTargetGenerator::WriteObjectDir( + cmGeneratedFileStream *fileStream, std::string const &dir) +{ + std::string workingDir(dir); + cmSystemTools::ConvertToUnixSlashes(workingDir); + if (!workingDir.empty()) + { + workingDir += "/"; + } + workingDir += "Objs"; + *fileStream << " -object_dir=\"" << workingDir << "\"" << std::endl; +} + +std::string +cmGhsMultiTargetGenerator::GetOutputDirectory(const std::string &config) const +{ + std::string outputDir(AbsBuildFilePath); + + const char *runtimeOutputProp = + this->Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY"); + if (NULL != runtimeOutputProp) + { + outputDir = runtimeOutputProp; + } + + std::string configCapped(cmSystemTools::UpperCase(config)); + const char *runtimeOutputSProp = + this->Target->GetProperty("RUNTIME_OUTPUT_DIRECTORY_" + configCapped); + if (NULL != runtimeOutputSProp) + { + outputDir = runtimeOutputSProp; + } + cmSystemTools::ConvertToUnixSlashes(outputDir); + + if (!outputDir.empty()) + { + outputDir += "/"; + } + + return outputDir; +} + +std::string +cmGhsMultiTargetGenerator::GetOutputFilename(const std::string &config) const +{ + std::string outputFilename(this->Target->GetName()); + + const char *outputNameProp = this->Target->GetProperty("OUTPUT_NAME"); + if (NULL != outputNameProp) + { + outputFilename = outputNameProp; + } + + std::string configCapped(cmSystemTools::UpperCase(config)); + const char *outputNameSProp = + this->Target->GetProperty(configCapped + "_OUTPUT_NAME"); + if (NULL != outputNameSProp) + { + outputFilename = outputNameSProp; + } + + return outputFilename; +} + +bool cmGhsMultiTargetGenerator::IsNotKernel(std::string const &config, + const std::string &language) +{ + bool output; + std::vector options; + this->Target->GetCompileOptions(options, config, language); + output = + options.end() == std::find(options.begin(), options.end(), "-kernel"); + return output; +} + +bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup(const cmTarget *target) +{ + bool output = false; + std::vector sources; + std::string config = + target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); + target->GetSourceFiles(sources, config); + for (std::vector::const_iterator sources_i = sources.begin(); + sources.end() != sources_i; ++sources_i) + { + if ("int" == (*sources_i)->GetExtension()) + { + output = true; + } + } + return output; +} + +bool cmGhsMultiTargetGenerator::DetermineIfDynamicDownload( + std::string const &config, const std::string &language) +{ + std::vector options; + bool output = false; + this->Target->GetCompileOptions(options, config, language); + for (std::vector::const_iterator options_i = options.begin(); + options_i != options.end(); ++options_i) + { + std::string option = *options_i; + if (this->DDOption == option) + { + output = true; + } + } + return output; +} diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h new file mode 100644 index 0000000..8e81db8 --- /dev/null +++ b/Source/cmGhsMultiTargetGenerator.h @@ -0,0 +1,119 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Geoffrey Viola + + 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 cmGhsMultiTargetGenerator_h +#define cmGhsMultiTargetGenerator_h + +#include "cmStandardIncludes.h" +#include "cmTarget.h" +#include "cmGhsMultiGpj.h" + +class cmGeneratedFileStream; +class cmGlobalGhsMultiGenerator; +class cmLocalGhsMultiGenerator; +class cmMakefile; +class cmSourceFile; +class cmGeneratedFileStream; +class cmCustomCommand; + +class cmGhsMultiTargetGenerator +{ +public: + cmGhsMultiTargetGenerator(cmTarget *target); + + virtual ~cmGhsMultiTargetGenerator(); + + virtual void Generate(); + + bool IncludeThisTarget(); + std::vector GetSources() const; + GhsMultiGpj::Types GetGpjTag() const; + static GhsMultiGpj::Types GetGpjTag(const cmTarget *target); + const char *GetAbsBuildFilePath() const + { + return this->AbsBuildFilePath.c_str(); + } + const char *GetRelBuildFileName() const + { + return this->RelBuildFileName.c_str(); + } + const char *GetAbsBuildFileName() const + { + return this->AbsBuildFileName.c_str(); + } + const char *GetAbsOutputFileName() const + { + return this->AbsOutputFileName.c_str(); + } + + static std::string GetRelBuildFilePath(const cmTarget *target); + static std::string GetAbsPathToRoot(const cmTarget *target); + static std::string GetAbsBuildFilePath(const cmTarget *target); + static std::string GetRelBuildFileName(const cmTarget *target); + static std::string GetBuildFileName(const cmTarget *target); + static std::string AddSlashIfNeededToPath(std::string const &input); + +private: + cmGlobalGhsMultiGenerator *GetGlobalGenerator() const; + cmGeneratedFileStream *GetFolderBuildStreams() + { + return this->FolderBuildStreams[""]; + }; + bool IsTargetGroup() const { return this->TargetGroup; } + + void WriteTypeSpecifics(const std::string &config, bool notKernel); + void WriteCompilerFlags(const std::string &config, + const std::string &language); + void WriteCompilerDefinitions(const std::string &config, + const std::string &language); + + void SetCompilerFlags(std::string const &config, const std::string &language, + bool const notKernel); + std::string GetDefines(const std::string &langugae, + std::string const &config); + + void WriteIncludes(const std::string &config, const std::string &language); + void WriteTargetLinkLibraries(); + void WriteCustomCommands(); + void + WriteCustomCommandsHelper(std::vector const &commandsSet, + cmTarget::CustomCommandType commandType); + void WriteSources(std::vector const &objectSources); + static void WriteObjectLangOverride(cmGeneratedFileStream *fileStream, + cmSourceFile *sourceFile); + static void WriteObjectDir(cmGeneratedFileStream *fileStream, + std::string const &dir); + std::string GetOutputDirectory(const std::string &config) const; + std::string GetOutputFilename(const std::string &config) const; + + bool IsNotKernel(std::string const &config, const std::string &language); + static bool DetermineIfTargetGroup(const cmTarget *target); + bool DetermineIfDynamicDownload(std::string const &config, + const std::string &language); + + cmTarget *Target; + cmLocalGhsMultiGenerator *LocalGenerator; + cmMakefile *Makefile; + std::string AbsBuildFilePath; + std::string RelBuildFilePath; + std::string AbsBuildFileName; + std::string RelBuildFileName; + std::string RelOutputFileName; + std::string AbsOutputFileName; + std::map FolderBuildStreams; + bool TargetGroup; + bool DynamicDownload; + static std::string const DDOption; + std::map FlagsByLanguage; + std::map DefinesByLanguage; +}; + +#endif // ! cmGhsMultiTargetGenerator_h diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx new file mode 100644 index 0000000..8850595 --- /dev/null +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -0,0 +1,548 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Geoffrey Viola + + 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 "cmGlobalGhsMultiGenerator.h" +#include "cmLocalGhsMultiGenerator.h" +#include "cmMakefile.h" +#include "cmVersion.h" +#include "cmGeneratedFileStream.h" +#include "cmGhsMultiTargetGenerator.h" +#include +#include + +const char *cmGlobalGhsMultiGenerator::FILE_EXTENSION = ".gpj"; +const char *cmGlobalGhsMultiGenerator::DEFAULT_MAKE_PROGRAM = "gbuild"; + +cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator() + : OSDirRelative(false) +{ + this->GhsBuildCommandInitialized = false; +} + +cmGlobalGhsMultiGenerator::~cmGlobalGhsMultiGenerator() +{ + cmDeleteAll(TargetFolderBuildStreams); +} + +cmLocalGenerator *cmGlobalGhsMultiGenerator::CreateLocalGenerator() +{ + cmLocalGenerator *lg = new cmLocalGhsMultiGenerator; + lg->SetGlobalGenerator(this); + this->SetCurrentLocalGenerator(lg); + return lg; +} + +void cmGlobalGhsMultiGenerator::GetDocumentation(cmDocumentationEntry &entry) +{ + entry.Name = GetActualName(); + entry.Brief = "Generates Green Hills MULTI files (experimental)."; +} + +void cmGlobalGhsMultiGenerator::EnableLanguage( + std::vector const &l, cmMakefile *mf, bool optional) +{ + mf->AddDefinition("CMAKE_SYSTEM_NAME", "GHS-MULTI"); + mf->AddDefinition("CMAKE_SYSTEM_PROCESSOR", "ARM"); + + const std::string ghsCompRoot(GetCompRoot()); + mf->AddDefinition("GHS_COMP_ROOT", ghsCompRoot.c_str()); + std::string ghsCompRootStart = + 0 == ghsCompRootStart.size() ? "" : ghsCompRoot + "/"; + mf->AddDefinition("CMAKE_C_COMPILER", + std::string(ghsCompRootStart + "ccarm.exe").c_str()); + mf->AddDefinition("CMAKE_C_COMPILER_ID_RUN", "TRUE"); + mf->AddDefinition("CMAKE_C_COMPILER_ID", "GHS"); + mf->AddDefinition("CMAKE_C_COMPILER_FORCED", "TRUE"); + + mf->AddDefinition("CMAKE_CXX_COMPILER", + std::string(ghsCompRootStart + "cxarm.exe").c_str()); + mf->AddDefinition("CMAKE_CXX_COMPILER_ID_RUN", "TRUE"); + mf->AddDefinition("CMAKE_CXX_COMPILER_ID", "GHS"); + mf->AddDefinition("CMAKE_CXX_COMPILER_FORCED", "TRUE"); + + if (!ghsCompRoot.empty()) + { + static const char *compPreFix = "comp_"; + std::string compFilename = + cmsys::SystemTools::FindLastString(ghsCompRoot.c_str(), compPreFix); + cmsys::SystemTools::ReplaceString(compFilename, compPreFix, ""); + mf->AddDefinition("CMAKE_SYSTEM_VERSION", compFilename.c_str()); + } + + mf->AddDefinition("GHSMULTI", "1"); // identifier for user CMake files + this->cmGlobalGenerator::EnableLanguage(l, mf, optional); +} + +void cmGlobalGhsMultiGenerator::FindMakeProgram(cmMakefile *mf) +{ + // The GHS 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->GetGhsBuildCommand().c_str()); + } +} + +std::string const &cmGlobalGhsMultiGenerator::GetGhsBuildCommand() +{ + if (!this->GhsBuildCommandInitialized) + { + this->GhsBuildCommandInitialized = true; + this->GhsBuildCommand = this->FindGhsBuildCommand(); + } + return this->GhsBuildCommand; +} + +std::string cmGlobalGhsMultiGenerator::FindGhsBuildCommand() +{ + std::vector userPaths; + userPaths.push_back(this->GetCompRoot()); + std::string makeProgram = + cmSystemTools::FindProgram(DEFAULT_MAKE_PROGRAM, userPaths); + if (makeProgram.empty()) + { + makeProgram = DEFAULT_MAKE_PROGRAM; + } + return makeProgram; +} + +std::string cmGlobalGhsMultiGenerator::GetCompRoot() +{ + std::string output; + + const std::vector + potentialDirsHardPaths(GetCompRootHardPaths()); + const std::vector potentialDirsRegistry(GetCompRootRegistry()); + + std::vector potentialDirsComplete; + potentialDirsComplete.insert(potentialDirsComplete.end(), + potentialDirsHardPaths.begin(), + potentialDirsHardPaths.end()); + potentialDirsComplete.insert(potentialDirsComplete.end(), + potentialDirsRegistry.begin(), + potentialDirsRegistry.end()); + + // Use latest version + std::string outputDirName; + for (std::vector::const_iterator potentialDirsCompleteIt = + potentialDirsComplete.begin(); + potentialDirsCompleteIt != potentialDirsComplete.end(); + ++potentialDirsCompleteIt) + { + const std::string dirName( + cmsys::SystemTools::GetFilenameName(*potentialDirsCompleteIt)); + if (dirName.compare(outputDirName) > 0) + { + output = *potentialDirsCompleteIt; + outputDirName = dirName; + } + } + + return output; +} + +std::vector cmGlobalGhsMultiGenerator::GetCompRootHardPaths() +{ + std::vector output; + cmSystemTools::Glob("C:/ghs", "comp_[^;]+", output); + for (std::vector::iterator outputIt = output.begin(); + outputIt != output.end(); ++outputIt) + { + *outputIt = "C:/ghs/" + *outputIt; + } + return output; +} + +std::vector cmGlobalGhsMultiGenerator::GetCompRootRegistry() +{ + std::vector output(2); + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_" + "MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\" + "Windows\\CurrentVersion\\Uninstall\\" + "GreenHillsSoftwared771f1b4;InstallLocation", + output[0]); + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_" + "MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\" + "Windows\\CurrentVersion\\Uninstall\\" + "GreenHillsSoftware9881cef6;InstallLocation", + output[1]); + return output; +} + +void cmGlobalGhsMultiGenerator::OpenBuildFileStream( + std::string const &filepath, cmGeneratedFileStream **filestream) +{ + // Get a stream where to generate things. + if (NULL == *filestream) + { + *filestream = new cmGeneratedFileStream(filepath.c_str()); + if (NULL != *filestream) + { + OpenBuildFileStream(*filestream); + } + } +} + +void cmGlobalGhsMultiGenerator::OpenBuildFileStream( + cmGeneratedFileStream *filestream) +{ + *filestream << "#!gbuild" << std::endl; +} + +void cmGlobalGhsMultiGenerator::OpenBuildFileStream() +{ + // Compute GHS MULTI's build file path. + std::string buildFilePath = + this->GetCMakeInstance()->GetHomeOutputDirectory(); + buildFilePath += "/"; + buildFilePath += "default"; + buildFilePath += FILE_EXTENSION; + + this->Open(std::string(""), buildFilePath, &this->TargetFolderBuildStreams); + OpenBuildFileStream(GetBuildFileStream()); + + char const *osDir = + this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR"); + if (NULL == osDir) + { + osDir = ""; + cmSystemTools::Error("GHS_OS_DIR cache variable must be set"); + } + else + { + this->GetCMakeInstance()->MarkCliAsUsed("GHS_OS_DIR"); + } + std::string fOSDir(this->trimQuotes(osDir)); + cmSystemTools::ReplaceString(fOSDir, "\\", "/"); + if (!fOSDir.empty() && ('c' == fOSDir[0] || 'C' == fOSDir[0])) + { + this->OSDirRelative = false; + } + else + { + this->OSDirRelative = true; + } + + char const *bspName = + this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME"); + if (NULL == bspName) + { + bspName = ""; + cmSystemTools::Error("GHS_BSP_NAME cache variable must be set"); + } + else + { + this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME"); + } + std::string fBspName(this->trimQuotes(bspName)); + cmSystemTools::ReplaceString(fBspName, "\\", "/"); + this->WriteMacros(); + this->WriteHighLevelDirectives(); + + GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, this->GetBuildFileStream()); + this->WriteDisclaimer(this->GetBuildFileStream()); + *this->GetBuildFileStream() << "# Top Level Project File" << std::endl; + if (!fBspName.empty()) + { + *this->GetBuildFileStream() << " -bsp " << fBspName << std::endl; + } + this->WriteCompilerOptions(fOSDir); +} + +void cmGlobalGhsMultiGenerator::CloseBuildFileStream( + cmGeneratedFileStream **filestream) +{ + if (filestream) + { + delete *filestream; + *filestream = NULL; + } + else + { + cmSystemTools::Error("Build file stream was not open."); + } +} + +void cmGlobalGhsMultiGenerator::Generate() +{ + this->cmGlobalGenerator::Generate(); + + if (!this->LocalGenerators.empty()) + { + this->OpenBuildFileStream(); + + // Build all the folder build files + for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) + { + cmLocalGhsMultiGenerator *lg = + static_cast(this->LocalGenerators[i]); + cmGeneratorTargetsType tgts = lg->GetMakefile()->GetGeneratorTargets(); + this->UpdateBuildFiles(&tgts); + } + } + + cmDeleteAll(TargetFolderBuildStreams); + this->TargetFolderBuildStreams.clear(); +} + +void cmGlobalGhsMultiGenerator::GenerateBuildCommand( + std::vector &makeCommand, const std::string &makeProgram, + const std::string & /*projectName*/, const std::string & /*projectDir*/, + const std::string &targetName, const std::string & /*config*/, + bool /*fast*/, bool /*verbose*/, + std::vector const &makeOptions) +{ + makeCommand.push_back( + this->SelectMakeProgram(makeProgram, this->GetGhsBuildCommand()) + ); + + makeCommand.insert(makeCommand.end(), + makeOptions.begin(), makeOptions.end()); + if (!targetName.empty()) + { + if (targetName == "clean") + { + makeCommand.push_back("-clean"); + } + else + { + makeCommand.push_back(targetName); + } + } +} + +void cmGlobalGhsMultiGenerator::WriteMacros() +{ + char const *ghsGpjMacros = + this->GetCMakeInstance()->GetCacheDefinition("GHS_GPJ_MACROS"); + if (NULL != ghsGpjMacros) + { + std::vector expandedList; + cmSystemTools::ExpandListArgument(std::string(ghsGpjMacros), expandedList); + for (std::vector::const_iterator expandedListI = + expandedList.begin(); + expandedListI != expandedList.end(); ++expandedListI) + { + *this->GetBuildFileStream() << "macro " << *expandedListI << std::endl; + } + } +} + +void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives() +{ + *this->GetBuildFileStream() << "primaryTarget=arm_integrity.tgt" + << std::endl; + char const *const customization = + this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION"); + if (NULL != customization && strlen(customization) > 0) + { + *this->GetBuildFileStream() << "customization=" + << trimQuotes(customization) + << std::endl; + this->GetCMakeInstance()->MarkCliAsUsed("GHS_CUSTOMIZATION"); + } +} + +void cmGlobalGhsMultiGenerator::WriteCompilerOptions(std::string const &fOSDir) +{ + *this->GetBuildFileStream() << " -os_dir=\"" << fOSDir << "\"" + << std::endl; + *this->GetBuildFileStream() << " --link_once_templates" << std::endl; +} + +void cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream *os) +{ + (*os) << "#" << std::endl + << "# CMAKE generated file: DO NOT EDIT!" << std::endl + << "# Generated by \"" << GetActualName() << "\"" + << " Generator, CMake Version " << cmVersion::GetMajorVersion() << "." + << cmVersion::GetMinorVersion() << std::endl + << "#" << std::endl; +} + +void cmGlobalGhsMultiGenerator::AddFilesUpToPath( + cmGeneratedFileStream *mainBuildFile, + std::map *targetFolderBuildStreams, + char const *homeOutputDirectory, std::string const &path, + GhsMultiGpj::Types projType, std::string const &relPath) +{ + std::string workingPath(path); + cmSystemTools::ConvertToUnixSlashes(workingPath); + std::vector splitPath = + cmSystemTools::SplitString(workingPath); + std::string workingRelPath(relPath); + cmSystemTools::ConvertToUnixSlashes(workingRelPath); + if (!workingRelPath.empty()) + { + workingRelPath += "/"; + } + std::string pathUpTo; + for (std::vector::const_iterator splitPathI = + splitPath.begin(); + splitPath.end() != splitPathI; ++splitPathI) + { + pathUpTo += *splitPathI; + if (targetFolderBuildStreams->end() == + targetFolderBuildStreams->find(pathUpTo)) + { + AddFilesUpToPathNewBuildFile( + mainBuildFile, targetFolderBuildStreams, homeOutputDirectory, + pathUpTo, splitPath.begin() == splitPathI, workingRelPath, projType); + } + AddFilesUpToPathAppendNextFile(targetFolderBuildStreams, pathUpTo, + splitPathI, splitPath.end(), projType); + pathUpTo += "/"; + } +} + +void cmGlobalGhsMultiGenerator::Open( + std::string const &mapKeyName, std::string const &fileName, + std::map *fileMap) +{ + if (fileMap->end() == fileMap->find(fileName)) + { + cmGeneratedFileStream *temp(new cmGeneratedFileStream); + temp->open(fileName.c_str()); + (*fileMap)[mapKeyName] = temp; + } +} + +void cmGlobalGhsMultiGenerator::AddFilesUpToPathNewBuildFile( + cmGeneratedFileStream *mainBuildFile, + std::map *targetFolderBuildStreams, + char const *homeOutputDirectory, std::string const &pathUpTo, + bool const isFirst, std::string const &relPath, + GhsMultiGpj::Types const projType) +{ + // create folders up to file path + std::string absPath = std::string(homeOutputDirectory) + "/" + relPath; + std::string newPath = absPath + pathUpTo; + if (!cmSystemTools::FileExists(newPath.c_str())) + { + cmSystemTools::MakeDirectory(newPath.c_str()); + } + + // Write out to filename for first time + std::string relFilename(GetFileNameFromPath(pathUpTo)); + std::string absFilename = absPath + relFilename; + Open(pathUpTo, absFilename, targetFolderBuildStreams); + OpenBuildFileStream((*targetFolderBuildStreams)[pathUpTo]); + GhsMultiGpj::WriteGpjTag(projType, (*targetFolderBuildStreams)[pathUpTo]); + WriteDisclaimer((*targetFolderBuildStreams)[pathUpTo]); + + // Add to main build file + if (isFirst) + { + *mainBuildFile << relFilename << " "; + GhsMultiGpj::WriteGpjTag(projType, mainBuildFile); + } +} + +void cmGlobalGhsMultiGenerator::AddFilesUpToPathAppendNextFile( + std::map *targetFolderBuildStreams, + std::string const &pathUpTo, + std::vector::const_iterator splitPathI, + std::vector::const_iterator end, + GhsMultiGpj::Types const projType) +{ + std::vector::const_iterator splitPathNextI = splitPathI + 1; + if (end != splitPathNextI && + targetFolderBuildStreams->end() == + targetFolderBuildStreams->find(pathUpTo + "/" + *splitPathNextI)) + { + std::string nextFilename(*splitPathNextI); + nextFilename = GetFileNameFromPath(nextFilename); + *(*targetFolderBuildStreams)[pathUpTo] << nextFilename << " "; + GhsMultiGpj::WriteGpjTag(projType, (*targetFolderBuildStreams)[pathUpTo]); + } +} + +std::string +cmGlobalGhsMultiGenerator::GetFileNameFromPath(std::string const &path) +{ + std::string output(path); + if (!path.empty()) + { + cmSystemTools::ConvertToUnixSlashes(output); + std::vector splitPath = cmSystemTools::SplitString(output); + output += "/" + splitPath.back() + FILE_EXTENSION; + } + return output; +} + +void cmGlobalGhsMultiGenerator::UpdateBuildFiles( + cmGeneratorTargetsType *tgts) +{ + for (cmGeneratorTargetsType::iterator tgtsI = tgts->begin(); + tgtsI != tgts->end(); ++tgtsI) + { + const cmTarget *tgt(tgtsI->first); + if (IsTgtForBuild(tgt)) + { + char const *rawFolderName = tgtsI->first->GetProperty("FOLDER"); + if (NULL == rawFolderName) + { + rawFolderName = ""; + } + std::string folderName(rawFolderName); + if (this->TargetFolderBuildStreams.end() == + this->TargetFolderBuildStreams.find(folderName)) + { + this->AddFilesUpToPath( + GetBuildFileStream(), &this->TargetFolderBuildStreams, + this->GetCMakeInstance()->GetHomeOutputDirectory(), folderName, + GhsMultiGpj::PROJECT); + } + std::vector splitPath = cmSystemTools::SplitString( + cmGhsMultiTargetGenerator::GetRelBuildFileName(tgt)); + std::string foldNameRelBuildFile(*(splitPath.end() - 2) + "/" + + splitPath.back()); + *this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile + << " "; + GhsMultiGpj::WriteGpjTag(cmGhsMultiTargetGenerator::GetGpjTag(tgt), + this->TargetFolderBuildStreams[folderName]); + } + } +} + +bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmTarget *tgt) +{ + const std::string config = + tgt->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); + std::vector tgtSources; + tgt->GetSourceFiles(tgtSources, config); + bool tgtInBuild = true; + char const *excludeFromAll = tgt->GetProperty("EXCLUDE_FROM_ALL"); + if (NULL != excludeFromAll && '1' == excludeFromAll[0] && + '\0' == excludeFromAll[1]) + { + tgtInBuild = false; + } + return !tgtSources.empty() && tgtInBuild; +} + +std::string cmGlobalGhsMultiGenerator::trimQuotes(std::string const &str) +{ + std::string result; + result.reserve(str.size()); + for (const char *ch = str.c_str(); *ch != '\0'; ++ch) + { + if (*ch != '"') + { + result += *ch; + } + } + return result; +} diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h new file mode 100644 index 0000000..b934c3a --- /dev/null +++ b/Source/cmGlobalGhsMultiGenerator.h @@ -0,0 +1,127 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Geoffrey Viola + + 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 cmGhsMultiGenerator_h +#define cmGhsMultiGenerator_h + +#include "cmGlobalGeneratorFactory.h" +#include "cmGlobalGenerator.h" +#include "cmGhsMultiGpj.h" + +class cmGeneratedFileStream; + +class cmGlobalGhsMultiGenerator : public cmGlobalGenerator +{ +public: + /// The default name of GHS MULTI's build file. Typically: monolith.gpj. + static const char *FILE_EXTENSION; + + cmGlobalGhsMultiGenerator(); + ~cmGlobalGhsMultiGenerator(); + + static cmGlobalGeneratorFactory *NewFactory() + { return new cmGlobalGeneratorSimpleFactory(); } + + ///! create the correct local generator + virtual cmLocalGenerator *CreateLocalGenerator(); + + /// @return the name of this generator. + static std::string GetActualName() { return "Green Hills MULTI"; } + ///! Get the name for this generator + virtual std::string GetName() const { return this->GetActualName(); } + + /// Overloaded methods. @see cmGlobalGenerator::GetDocumentation() + static void GetDocumentation(cmDocumentationEntry &entry); + + /** + * Try to determine system information such as shared library + * extension, pthreads, byte order etc. + */ + virtual void EnableLanguage(std::vector const &languages, + cmMakefile *, bool optional); + /* + * Determine what program to use for building the project. + */ + virtual void FindMakeProgram(cmMakefile *); + + cmGeneratedFileStream *GetBuildFileStream() + { + return this->TargetFolderBuildStreams[""]; + } + + static void OpenBuildFileStream(std::string const &filepath, + cmGeneratedFileStream **filestream); + static void OpenBuildFileStream(cmGeneratedFileStream *filestream); + static void CloseBuildFileStream(cmGeneratedFileStream **filestream); + /// Write the common disclaimer text at the top of each build file. + static void WriteDisclaimer(std::ostream *os); + std::vector GetLibDirs() { return this->LibDirs; } + + static void AddFilesUpToPath( + cmGeneratedFileStream *mainBuildFile, + std::map *targetFolderBuildStreams, + char const *homeOutputDirectory, std::string const &path, + GhsMultiGpj::Types projType, std::string const &relPath = ""); + static void Open(std::string const &mapKeyName, std::string const &fileName, + std::map *fileMap); + + static std::string trimQuotes(std::string const &str); + inline bool IsOSDirRelative() { return this->OSDirRelative; } + +protected: + virtual void Generate(); + virtual void GenerateBuildCommand( + std::vector &makeCommand, const std::string &makeProgram, + const std::string &projectName, const std::string &projectDir, + const std::string &targetName, const std::string &config, bool fast, + bool verbose, + std::vector const& makeOptions = std::vector() + ); + +private: + std::string const &GetGhsBuildCommand(); + std::string FindGhsBuildCommand(); + std::string GetCompRoot(); + std::vector GetCompRootHardPaths(); + std::vector GetCompRootRegistry(); + void OpenBuildFileStream(); + + void WriteMacros(); + void WriteHighLevelDirectives(); + void WriteCompilerOptions(std::string const &fOSDir); + + static void AddFilesUpToPathNewBuildFile( + cmGeneratedFileStream *mainBuildFile, + std::map *targetFolderBuildStreams, + char const *homeOutputDirectory, std::string const &pathUpTo, + bool isFirst, std::string const &relPath, GhsMultiGpj::Types projType); + static void AddFilesUpToPathAppendNextFile( + std::map *targetFolderBuildStreams, + std::string const &pathUpTo, + std::vector::const_iterator splitPathI, + std::vector::const_iterator end, + GhsMultiGpj::Types projType); + static std::string GetFileNameFromPath(std::string const &path); + void UpdateBuildFiles(cmGeneratorTargetsType *tgts); + bool IsTgtForBuild(const cmTarget *tgt); + + std::vector TargetSubProjects; + std::map TargetFolderBuildStreams; + + std::vector LibDirs; + + bool OSDirRelative; + bool GhsBuildCommandInitialized; + std::string GhsBuildCommand; + static const char *DEFAULT_MAKE_PROGRAM; +}; + +#endif diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index f74f1e0..2ade825 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -576,6 +576,7 @@ bool cmGlobalNinjaGenerator::UsingMinGW = false; // Implemented by: // cmGlobalUnixMakefileGenerator3 +// cmGlobalGhsMultiGenerator // cmGlobalVisualStudio10Generator // cmGlobalVisualStudio6Generator // cmGlobalVisualStudio7Generator diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx new file mode 100644 index 0000000..782fec4 --- /dev/null +++ b/Source/cmLocalGhsMultiGenerator.cxx @@ -0,0 +1,55 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Geoffrey Viola + + 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 "cmLocalGhsMultiGenerator.h" +#include "cmGlobalGhsMultiGenerator.h" +#include "cmGeneratorTarget.h" +#include "cmMakefile.h" +#include "cmGhsMultiTargetGenerator.h" +#include "cmGeneratedFileStream.h" + +cmLocalGhsMultiGenerator::cmLocalGhsMultiGenerator() +{ +} + +cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator() {} + +void cmLocalGhsMultiGenerator::Generate() +{ + cmGeneratorTargetsType tgts = this->GetMakefile()->GetGeneratorTargets(); + if (!tgts.empty()) + { + for (cmGeneratorTargetsType::iterator l = tgts.begin(); l != tgts.end(); + ++l) + { + cmGhsMultiTargetGenerator tg(l->second->Target); + tg.Generate(); + } + } +} + +// Implemented in: +// cmLocalGenerator. +// Used in: +// Source/cmMakefile.cxx +// Source/cmGlobalGenerator.cxx +void cmLocalGhsMultiGenerator::Configure() +{ + // Compute the path to use when referencing the current output + // directory from the top output directory. + this->HomeRelativeOutputPath = + this->Convert(this->Makefile->GetStartOutputDirectory(), HOME_OUTPUT); + if (this->HomeRelativeOutputPath == ".") + { + this->HomeRelativeOutputPath = ""; + } + this->cmLocalGenerator::Configure(); +} diff --git a/Source/cmLocalGhsMultiGenerator.h b/Source/cmLocalGhsMultiGenerator.h new file mode 100644 index 0000000..a8df3e7 --- /dev/null +++ b/Source/cmLocalGhsMultiGenerator.h @@ -0,0 +1,56 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Geoffrey Viola + + 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 cmLocalGhsMultiGenerator_h +#define cmLocalGhsMultiGenerator_h + +#include "cmLocalGenerator.h" + +class cmGeneratedFileStream; + +/** \class cmLocalGhsMultiGenerator + * \brief Write Green Hills MULTI project files. + * + * cmLocalGhsMultiGenerator produces a set of .gpj + * file for each target in its mirrored directory. + */ +class cmLocalGhsMultiGenerator : public cmLocalGenerator +{ +public: + cmLocalGhsMultiGenerator(); + + virtual ~cmLocalGhsMultiGenerator(); + + /// @returns the relative path between the HomeOutputDirectory and this + /// local generators StartOutputDirectory. + std::string GetHomeRelativeOutputPath() const + { + return this->HomeRelativeOutputPath; + } + + /** + * Generate the makefile for this directory. + */ + virtual void Generate(); + + /// Overloaded methods. @see cmLocalGenerator::Configure() + virtual void Configure(); + const char *GetBuildFileName() { return this->BuildFileName.c_str(); } + +protected: + virtual bool CustomCommandUseLocal() const { return true; } + +private: + std::string BuildFileName; + std::string HomeRelativeOutputPath; +}; + +#endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5c52a1a..bfe9aea 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -63,6 +63,7 @@ # include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h" # include "cmGlobalJOMMakefileGenerator.h" +# include "cmGlobalGhsMultiGenerator.h" # define CMAKE_HAVE_VS_GENERATORS # endif # include "cmGlobalMSYSMakefileGenerator.h" @@ -1840,6 +1841,8 @@ void cmake::AddDefaultGenerators() cmGlobalNMakeMakefileGenerator::NewFactory()); this->Generators.push_back( cmGlobalJOMMakefileGenerator::NewFactory()); + this->Generators.push_back( + cmGlobalGhsMultiGenerator::NewFactory()); # endif this->Generators.push_back( cmGlobalMSYSMakefileGenerator::NewFactory()); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index f80191b..83c919d 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1978,6 +1978,23 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() endif() + if (CMake_TEST_GreenHillsMULTI) + macro(add_test_GhsMulti name primaryTarget bspName) + add_test(NAME GhsMulti.${name} COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/GhsMulti" + "${CMake_BINARY_DIR}/Tests/GhsMulti/${name}" + --build-generator "Green Hills MULTI" + --build-project ReturnNum + --build-config $ + --build-options -DGHS_PRIMARY_TARGET=${primaryTarget} + -DGHS_BSP_NAME=${bspName} + ) + endmacro () + add_test_GhsMulti("arm_integrity_simarm" "arm_integrity.tgt" "simarm") + add_test_GhsMulti("arm64_integrity_simarm" "arm64_integrity.tgt" "simarm") + endif () + if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ") macro(add_test_VSNsightTegra name generator) add_test(NAME VSNsightTegra.${name} COMMAND ${CMAKE_CTEST_COMMAND} diff --git a/Tests/GhsMulti/CMakeLists.txt b/Tests/GhsMulti/CMakeLists.txt new file mode 100644 index 0000000..6e15ba9 --- /dev/null +++ b/Tests/GhsMulti/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.1) +project(ReturnNum) + +add_subdirectory(ReturnNum) diff --git a/Tests/GhsMulti/ReturnNum/App/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/App/CMakeLists.txt new file mode 100644 index 0000000..2adbd4e --- /dev/null +++ b/Tests/GhsMulti/ReturnNum/App/CMakeLists.txt @@ -0,0 +1,4 @@ +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Lib) +add_executable(App Main.c) +target_link_libraries(App Lib) +target_compile_options(App PUBLIC "-non_shared") diff --git a/Tests/GhsMulti/ReturnNum/App/Main.c b/Tests/GhsMulti/ReturnNum/App/Main.c new file mode 100644 index 0000000..1133834 --- /dev/null +++ b/Tests/GhsMulti/ReturnNum/App/Main.c @@ -0,0 +1,8 @@ +#include "HelperFun.h" + +int main(int argc, const char* argv[]) +{ + int out; + out = giveNum(); + return out; +} diff --git a/Tests/GhsMulti/ReturnNum/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/CMakeLists.txt new file mode 100644 index 0000000..7bcc5f9 --- /dev/null +++ b/Tests/GhsMulti/ReturnNum/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory(App) +add_subdirectory(Int) +add_subdirectory(Lib) diff --git a/Tests/GhsMulti/ReturnNum/Int/AppDD.int b/Tests/GhsMulti/ReturnNum/Int/AppDD.int new file mode 100644 index 0000000..9e22b5e --- /dev/null +++ b/Tests/GhsMulti/ReturnNum/Int/AppDD.int @@ -0,0 +1,12 @@ +# Input File for the Integrate utility for use with the INTEGRITY real-time +# operating system by Green Hills Software. +# Before editing this file, refer to the Integrate Reference Manual. + +Kernel + Filename DynamicDownload +EndKernel + +AddressSpace App + Filename "App/App.as" + Language C +EndAddressSpace diff --git a/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt new file mode 100644 index 0000000..44c5de1 --- /dev/null +++ b/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(AppDD AppDD.int Default.bsp) diff --git a/Tests/GhsMulti/ReturnNum/Int/Default.bsp b/Tests/GhsMulti/ReturnNum/Int/Default.bsp new file mode 100644 index 0000000..224ec29 --- /dev/null +++ b/Tests/GhsMulti/ReturnNum/Int/Default.bsp @@ -0,0 +1,35 @@ +# Target description File for the Integrate utility for use with the +# INTEGRITY real-time operating system by Green Hills Software. +# Before editing this file, refer to your Integrate documentation. +# default.bsp is appropriate for INTEGRITY applications which are +# fully linked with the kernel (for RAM or ROM) or dynamically downloaded. +# +# MinimumAddress must match the value of .ramend in the linker directives +# file used for the KernelSpace program - see default.ld for more info. +# The MaximumAddress used here allows memory mappings to be specified +# for up to the 16 MB mark in RAM. Intex will not permit programs +# that require more memory for its mappings. If the board has less +# memory, this number can be reduced by the user. + +Target + MinimumAddress .ramend + MaximumAddress .ramlimit + Clock StandardTick + EndClock + Clock HighResTimer + EndClock + IODevice "SerialDev0" + InitialKernelObjects 200 + DefaultStartIt false + DefaultMaxPriority 255 + DefaultPriority 127 + DefaultWeight 1 + DefaultMaxWeight 255 + DefaultHeapSize 0x10000 + LastVirtualAddress 0x3fffffff + PageSize 0x1000 + ArchitectedPageSize 0x1000 + ArchitectedPageSize 0x10000 + ArchitectedPageSize 0x100000 + DefaultMemoryRegionSize 0x20000 +EndTarget diff --git a/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt new file mode 100644 index 0000000..9c822da --- /dev/null +++ b/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt @@ -0,0 +1 @@ +add_library(Lib HelperFun.c HelperFun.h) \ No newline at end of file diff --git a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.c b/Tests/GhsMulti/ReturnNum/Lib/HelperFun.c new file mode 100644 index 0000000..d7515d7 --- /dev/null +++ b/Tests/GhsMulti/ReturnNum/Lib/HelperFun.c @@ -0,0 +1,4 @@ +int giveNum(void) +{ + return 1; +} diff --git a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.h b/Tests/GhsMulti/ReturnNum/Lib/HelperFun.h new file mode 100644 index 0000000..00971b0 --- /dev/null +++ b/Tests/GhsMulti/ReturnNum/Lib/HelperFun.h @@ -0,0 +1 @@ +int giveNum(void); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=051d8be17f1b36d52041bfe61856b926e36dfb8c commit 051d8be17f1b36d52041bfe61856b926e36dfb8c Author: Geoff Viola AuthorDate: Sun Mar 29 20:56:21 2015 -0600 Commit: Brad King CommitDate: Thu Apr 9 10:38:31 2015 -0400 cmLocalGenerator: Constify some cmTarget and cmGeneratorTarget arguments diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index e1998e4..81854f3 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2004,7 +2004,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries, //---------------------------------------------------------------------------- void cmLocalGenerator::AddArchitectureFlags(std::string& flags, - cmGeneratorTarget* target, + cmGeneratorTarget const* target, const std::string& lang, const std::string& config) { @@ -2191,7 +2191,7 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags, //---------------------------------------------------------------------------- void cmLocalGenerator:: -AddCompilerRequirementFlag(std::string &flags, cmTarget* target, +AddCompilerRequirementFlag(std::string &flags, cmTarget const* target, const std::string& lang) { if (lang.empty()) @@ -2313,7 +2313,8 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, } } -static void AddVisibilityCompileOption(std::string &flags, cmTarget* target, +static void AddVisibilityCompileOption(std::string &flags, + cmTarget const* target, cmLocalGenerator *lg, const std::string& lang) { @@ -2347,7 +2348,7 @@ static void AddVisibilityCompileOption(std::string &flags, cmTarget* target, } static void AddInlineVisibilityCompileOption(std::string &flags, - cmTarget* target, + cmTarget const* target, cmLocalGenerator *lg) { std::string compileOption @@ -2368,7 +2369,7 @@ static void AddInlineVisibilityCompileOption(std::string &flags, //---------------------------------------------------------------------------- void cmLocalGenerator -::AddVisibilityPresetFlags(std::string &flags, cmTarget* target, +::AddVisibilityPresetFlags(std::string &flags, cmTarget const* target, const std::string& lang) { int targetType = target->GetType(); @@ -2394,7 +2395,8 @@ void cmLocalGenerator } //---------------------------------------------------------------------------- -void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target, +void cmLocalGenerator::AddCMP0018Flags(std::string &flags, + cmTarget const* target, std::string const& lang, const std::string& config) { diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 6cdee42..a005f5f 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -138,18 +138,19 @@ public: std::vector& GetChildren() { return this->Children; } - void AddArchitectureFlags(std::string& flags, cmGeneratorTarget* target, + void AddArchitectureFlags(std::string& flags, + cmGeneratorTarget const* target, const std::string&lang, const std::string& config); void AddLanguageFlags(std::string& flags, const std::string& lang, const std::string& config); - void AddCMP0018Flags(std::string &flags, cmTarget* target, + void AddCMP0018Flags(std::string &flags, cmTarget const* target, std::string const& lang, const std::string& config); - void AddVisibilityPresetFlags(std::string &flags, cmTarget* target, + void AddVisibilityPresetFlags(std::string &flags, cmTarget const* target, const std::string& lang); void AddConfigVariableFlags(std::string& flags, const std::string& var, const std::string& config); - void AddCompilerRequirementFlag(std::string &flags, cmTarget* target, + void AddCompilerRequirementFlag(std::string &flags, cmTarget const* target, const std::string& lang); ///! Append flags to a string. virtual void AppendFlags(std::string& flags, const std::string& newFlags); ----------------------------------------------------------------------- Summary of changes: Help/generator/Green Hills MULTI.rst | 11 + Help/manual/cmake-generators.7.rst | 1 + Help/manual/cmake-variables.7.rst | 5 + .../variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst | 6 + .../CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst | 7 + .../CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst | 6 + .../CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst | 7 + Help/variable/CMAKE_MAKE_PROGRAM.rst | 4 + Help/variable/CMAKE_SYSTEM_PROCESSOR.rst | 2 + Help/variable/GHS-MULTI.rst | 4 + Modules/Compiler/GHS-C.cmake | 27 + Modules/Compiler/GHS-CXX.cmake | 31 + Modules/Compiler/GHS-DetermineCompiler.cmake | 6 + Modules/FindBoost.cmake | 5 +- Modules/Platform/GHS-MULTI-Initialize.cmake | 29 + Modules/Platform/GHS-MULTI.cmake | 27 + Source/CMakeLists.txt | 9 + Source/cmGhsMultiGpj.cxx | 41 ++ Source/cmGhsMultiGpj.h | 33 ++ Source/cmGhsMultiTargetGenerator.cxx | 614 ++++++++++++++++++++ Source/cmGhsMultiTargetGenerator.h | 119 ++++ Source/cmGlobalGhsMultiGenerator.cxx | 548 +++++++++++++++++ Source/cmGlobalGhsMultiGenerator.h | 127 ++++ Source/cmGlobalNinjaGenerator.cxx | 1 + Source/cmLocalGenerator.cxx | 14 +- Source/cmLocalGenerator.h | 9 +- Source/cmLocalGhsMultiGenerator.cxx | 55 ++ Source/cmLocalGhsMultiGenerator.h | 56 ++ Source/cmake.cxx | 3 + Tests/CMakeLists.txt | 17 + Tests/GhsMulti/CMakeLists.txt | 4 + Tests/GhsMulti/ReturnNum/App/CMakeLists.txt | 4 + Tests/GhsMulti/ReturnNum/App/Main.c | 8 + Tests/GhsMulti/ReturnNum/CMakeLists.txt | 3 + Tests/GhsMulti/ReturnNum/Int/AppDD.int | 12 + Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt | 1 + Tests/GhsMulti/ReturnNum/Int/Default.bsp | 35 ++ Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt | 1 + Tests/GhsMulti/ReturnNum/Lib/HelperFun.c | 4 + Tests/GhsMulti/ReturnNum/Lib/HelperFun.h | 1 + 40 files changed, 1886 insertions(+), 11 deletions(-) create mode 100644 Help/generator/Green Hills MULTI.rst create mode 100644 Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst create mode 100644 Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst create mode 100644 Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst create mode 100644 Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst create mode 100644 Help/variable/GHS-MULTI.rst create mode 100644 Modules/Compiler/GHS-C.cmake create mode 100644 Modules/Compiler/GHS-CXX.cmake create mode 100644 Modules/Compiler/GHS-DetermineCompiler.cmake create mode 100644 Modules/Platform/GHS-MULTI-Initialize.cmake create mode 100644 Modules/Platform/GHS-MULTI.cmake create mode 100644 Source/cmGhsMultiGpj.cxx create mode 100644 Source/cmGhsMultiGpj.h create mode 100644 Source/cmGhsMultiTargetGenerator.cxx create mode 100644 Source/cmGhsMultiTargetGenerator.h create mode 100644 Source/cmGlobalGhsMultiGenerator.cxx create mode 100644 Source/cmGlobalGhsMultiGenerator.h create mode 100644 Source/cmLocalGhsMultiGenerator.cxx create mode 100644 Source/cmLocalGhsMultiGenerator.h create mode 100644 Tests/GhsMulti/CMakeLists.txt create mode 100644 Tests/GhsMulti/ReturnNum/App/CMakeLists.txt create mode 100644 Tests/GhsMulti/ReturnNum/App/Main.c create mode 100644 Tests/GhsMulti/ReturnNum/CMakeLists.txt create mode 100644 Tests/GhsMulti/ReturnNum/Int/AppDD.int create mode 100644 Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt create mode 100644 Tests/GhsMulti/ReturnNum/Int/Default.bsp create mode 100644 Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt create mode 100644 Tests/GhsMulti/ReturnNum/Lib/HelperFun.c create mode 100644 Tests/GhsMulti/ReturnNum/Lib/HelperFun.h hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 14:16:28 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 14:16:28 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1681-ga319109 Message-ID: <20150409181628.4C20DADBE5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a319109ff49ce318236f3954bae79339689e27bf (commit) via 1f33b45d5daca380e0be0ecfc595eac881328f29 (commit) from 9c4af87283f734060777856febe72d2dc1a187dc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a319109ff49ce318236f3954bae79339689e27bf commit a319109ff49ce318236f3954bae79339689e27bf Merge: 9c4af87 1f33b45 Author: Brad King AuthorDate: Thu Apr 9 14:16:27 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 14:16:27 2015 -0400 Merge topic 'fix-libarchive-mktemp' into next 1f33b45d libarchive: Fix string concatentation in Windows mktemp implementation http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f33b45d5daca380e0be0ecfc595eac881328f29 commit 1f33b45d5daca380e0be0ecfc595eac881328f29 Author: Tim Kientzle AuthorDate: Thu Sep 25 18:51:57 2014 -0700 Commit: Brad King CommitDate: Thu Apr 9 14:08:43 2015 -0400 libarchive: Fix string concatentation in Windows mktemp implementation Port upstream LibArchive commit "compute string pointers after concatenation" (2014-09-25) and commit "Move variables to top of function for non-C99 compilers" (2014-11-15) to our CMake copy. Otherwise we may compute a pointer to memory that is about to be freed and then compute a bad size to give to CryptGenRandom. Inspired-by: Tim Kientzle diff --git a/Utilities/cmlibarchive/libarchive/archive_util.c b/Utilities/cmlibarchive/libarchive/archive_util.c index 96b88d8..d136498 100644 --- a/Utilities/cmlibarchive/libarchive/archive_util.c +++ b/Utilities/cmlibarchive/libarchive/archive_util.c @@ -249,6 +249,8 @@ __archive_errx(int retvalue, const char *msg) int __archive_mktemp(const char *tmpdir) { + static const wchar_t *prefix = L"libarchive_"; + static const wchar_t *suffix = L"XXXXXXXXXX"; static const wchar_t num[] = { L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9', L'A', L'B', L'C', L'D', L'E', L'F', @@ -323,10 +325,10 @@ __archive_mktemp(const char *tmpdir) /* * Create a temporary file. */ - archive_wstrcat(&temp_name, L"libarchive_"); - xp = temp_name.s + archive_strlen(&temp_name); - archive_wstrcat(&temp_name, L"XXXXXXXXXX"); + archive_wstrcat(&temp_name, prefix); + archive_wstrcat(&temp_name, suffix); ep = temp_name.s + archive_strlen(&temp_name); + xp = ep - wcslen(suffix); if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { ----------------------------------------------------------------------- Summary of changes: Utilities/cmlibarchive/libarchive/archive_util.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 14:19:33 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 14:19:33 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-700-gf941ed7 Message-ID: <20150409181933.48DDCADE1C@public.kitware.com> This is an automated email from 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 f941ed7a8f48665188ca355a97c926317ff586d3 (commit) via e5d336beb27ea06a0f5058d0ae87c7cd84b8b4b4 (commit) via a2df4a3f769a63822144c874660eb9461f233c22 (commit) from 48040c19d5f1bcec55a130fcf8f8d83db27291b4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f941ed7a8f48665188ca355a97c926317ff586d3 commit f941ed7a8f48665188ca355a97c926317ff586d3 Merge: 48040c1 e5d336b Author: Brad King AuthorDate: Thu Apr 9 14:19:29 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 14:19:29 2015 -0400 Merge topic 'fix-liblzma-optimize' e5d336be liblzma: Disable GNU 3.3 compiler optimizations a2df4a3f liblzma: Disable XL compiler optimizations altogether ----------------------------------------------------------------------- Summary of changes: Utilities/cmliblzma/CMakeLists.txt | 10 ++++++++++ .../cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c | 3 --- 2 files changed, 10 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 14:19:51 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 14:19:51 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1683-gb38bc48 Message-ID: <20150409181951.5D641ADE23@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b38bc48c51d327d90ba4bd59a0191ded7ae4026a (commit) via f941ed7a8f48665188ca355a97c926317ff586d3 (commit) from a319109ff49ce318236f3954bae79339689e27bf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b38bc48c51d327d90ba4bd59a0191ded7ae4026a commit b38bc48c51d327d90ba4bd59a0191ded7ae4026a Merge: a319109 f941ed7 Author: Brad King AuthorDate: Thu Apr 9 14:19:41 2015 -0400 Commit: Brad King CommitDate: Thu Apr 9 14:19:41 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 14:28:20 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 14:28:20 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1685-gd4f641f Message-ID: <20150409182820.D9B2DADFE9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d4f641f9b94ac64b26f3c3e06a2a66e6d3eb557a (commit) via ad194ae0b1d85e5e13f1c38a20d397dabccf80e9 (commit) from b38bc48c51d327d90ba4bd59a0191ded7ae4026a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4f641f9b94ac64b26f3c3e06a2a66e6d3eb557a commit d4f641f9b94ac64b26f3c3e06a2a66e6d3eb557a Merge: b38bc48 ad194ae Author: Brad King AuthorDate: Thu Apr 9 14:28:20 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 14:28:20 2015 -0400 Merge topic 'fix-libarchive-gnutar-large-ids' into next ad194ae0 libarchive: Use base-256 encoding for UID/GID like GNU tar does http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ad194ae0b1d85e5e13f1c38a20d397dabccf80e9 commit ad194ae0b1d85e5e13f1c38a20d397dabccf80e9 Author: Nils Gladitz AuthorDate: Wed Apr 8 19:58:08 2015 +0200 Commit: Brad King CommitDate: Thu Apr 9 14:27:16 2015 -0400 libarchive: Use base-256 encoding for UID/GID like GNU tar does diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c index 13942c1..647079d 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c @@ -644,18 +644,18 @@ archive_format_gnutar_header(struct archive_write *a, char h[512], format_octal(archive_entry_mode(entry) & 07777, h + GNUTAR_mode_offset, GNUTAR_mode_size); - /* TODO: How does GNU tar handle large UIDs? */ - if (format_octal(archive_entry_uid(entry), - h + GNUTAR_uid_offset, GNUTAR_uid_size)) { + /* GNU tar supports base-256 here, so should never overflow. */ + if (format_number(archive_entry_uid(entry), h + GNUTAR_uid_offset, + GNUTAR_uid_size, GNUTAR_uid_max_size)) { archive_set_error(&a->archive, ERANGE, "Numeric user ID %jd too large", (intmax_t)archive_entry_uid(entry)); ret = ARCHIVE_FAILED; } - /* TODO: How does GNU tar handle large GIDs? */ - if (format_octal(archive_entry_gid(entry), - h + GNUTAR_gid_offset, GNUTAR_gid_size)) { + /* GNU tar supports base-256 here, so should never overflow. */ + if (format_number(archive_entry_gid(entry), h + GNUTAR_gid_offset, + GNUTAR_gid_size, GNUTAR_gid_max_size)) { archive_set_error(&a->archive, ERANGE, "Numeric group ID %jd too large", (intmax_t)archive_entry_gid(entry)); ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 14:28:24 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 14:28:24 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-702-gbb89171 Message-ID: <20150409182824.7301CADFEA@public.kitware.com> This is an automated email from 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 bb891710cf7ba1ce8db059268ce4ee553c64966f (commit) via ad194ae0b1d85e5e13f1c38a20d397dabccf80e9 (commit) from f941ed7a8f48665188ca355a97c926317ff586d3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb891710cf7ba1ce8db059268ce4ee553c64966f commit bb891710cf7ba1ce8db059268ce4ee553c64966f Merge: f941ed7 ad194ae Author: Brad King AuthorDate: Thu Apr 9 14:28:23 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 14:28:23 2015 -0400 Merge topic 'fix-libarchive-gnutar-large-ids' ad194ae0 libarchive: Use base-256 encoding for UID/GID like GNU tar does ----------------------------------------------------------------------- Summary of changes: .../libarchive/archive_write_set_format_gnutar.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 14:28:38 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 14:28:38 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1687-g47efa34 Message-ID: <20150409182838.07E8DADFEF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 47efa34725e7f1fc79317dd13bcd2ce326fc91c4 (commit) via bb891710cf7ba1ce8db059268ce4ee553c64966f (commit) from d4f641f9b94ac64b26f3c3e06a2a66e6d3eb557a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=47efa34725e7f1fc79317dd13bcd2ce326fc91c4 commit 47efa34725e7f1fc79317dd13bcd2ce326fc91c4 Merge: d4f641f bb89171 Author: Brad King AuthorDate: Thu Apr 9 14:28:31 2015 -0400 Commit: Brad King CommitDate: Thu Apr 9 14:28:31 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 9 14:30:27 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 9 Apr 2015 14:30:27 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1692-gb97afb7 Message-ID: <20150409183027.33E6CAE048@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b97afb70bf378e783817763d9e1d0c7ed064f250 (commit) via e323918f813ede524ec68f6317a9b7ae75c86fad (commit) via c35319642ed4d32f7452c128cd745902c8fcaaec (commit) via dac0a260264f80df889871d888c759074e5fdf81 (commit) via e935be59d3b44eedb0ebf8b84179722933c058d1 (commit) from 47efa34725e7f1fc79317dd13bcd2ce326fc91c4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b97afb70bf378e783817763d9e1d0c7ed064f250 commit b97afb70bf378e783817763d9e1d0c7ed064f250 Merge: 47efa34 e323918 Author: Brad King AuthorDate: Thu Apr 9 14:30:25 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 14:30:25 2015 -0400 Merge topic 'tar-write-format' into next e323918f Tests: Consolidate, refactor and extend -E tar tests c3531964 CTestCoverageCollectGCOV: Write tar files intended for CDash in gnutar format dac0a260 cmake: Teach "-E tar" command a "--format=" option e935be59 Merge branch 'fix-libarchive-mktemp' into tar-write-format http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e323918f813ede524ec68f6317a9b7ae75c86fad commit e323918f813ede524ec68f6317a9b7ae75c86fad Author: Nils Gladitz AuthorDate: Tue Apr 7 19:40:33 2015 +0200 Commit: Brad King CommitDate: Thu Apr 9 14:29:18 2015 -0400 Tests: Consolidate, refactor and extend -E tar tests diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index f80191b..aa6a993 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -218,7 +218,6 @@ if(BUILD_TESTING) ADD_TEST_MACRO(FindModulesExecuteAll FindModulesExecuteAll) ADD_TEST_MACRO(StringFileTest StringFileTest) ADD_TEST_MACRO(TryCompile TryCompile) - ADD_TEST_MACRO(TarTest TarTest) ADD_TEST_MACRO(SystemInformation SystemInformation) ADD_TEST_MACRO(MathTest MathTest) ADD_TEST_MACRO(CompileFeatures CompileFeatures) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3709913..d7ac81d 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -200,6 +200,7 @@ add_RunCMake_test(target_link_libraries) add_RunCMake_test(target_compile_features) add_RunCMake_test(CheckModules) add_RunCMake_test(CommandLine) +add_RunCMake_test(CommandLineTar) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index e3942a8..f879ee6 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,17 +1,5 @@ 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") -run_cmake_command(E_tar-bad-format ${CMAKE_COMMAND} -E tar cvf bad.tar "--format=bad-format") - run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) run_cmake_command(build-no-generator diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/7zip-gz-result.txt similarity index 100% copy from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt copy to Tests/RunCMake/CommandLineTar/7zip-gz-result.txt diff --git a/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt b/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt new file mode 100644 index 0000000..2fad326 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt @@ -0,0 +1 @@ +CMake Error: Can not use compression flags with format: 7zip diff --git a/Tests/RunCMake/CommandLineTar/7zip.cmake b/Tests/RunCMake/CommandLineTar/7zip.cmake new file mode 100644 index 0000000..4bc6548 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/7zip.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.7z") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=7zip) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("377abcaf271c" LIMIT 6 HEX) diff --git a/Tests/RunCMake/CommandLineTar/CMakeLists.txt b/Tests/RunCMake/CommandLineTar/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake new file mode 100644 index 0000000..12635db --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake @@ -0,0 +1,28 @@ +include(RunCMake) + +function(external_command_test NAME) + run_cmake_command(${NAME} ${CMAKE_COMMAND} -E ${ARGN}) +endfunction() + +external_command_test(bad-opt1 tar cvf bad.tar --bad) +external_command_test(bad-mtime1 tar cvf bad.tar --mtime=bad .) +external_command_test(bad-from1 tar cvf bad.tar --files-from=bad) +external_command_test(bad-from2 tar cvf bad.tar --files-from=.) +external_command_test(bad-from3 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from3.txt) +external_command_test(bad-from4 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from4.txt) +external_command_test(bad-from5 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from5.txt) +external_command_test(end-opt1 tar cvf bad.tar -- --bad) +external_command_test(end-opt2 tar cvf bad.tar --) +external_command_test(mtime tar cvf bad.tar "--mtime=1970-01-01 00:00:00 UTC") +external_command_test(bad-format tar cvf bad.tar "--format=bad-format") +external_command_test(zip-bz2 tar cvjf bad.tar "--format=zip") +external_command_test(7zip-gz tar cvzf bad.tar "--format=7zip") + +run_cmake(7zip) +run_cmake(gnutar) +run_cmake(gnutar-gz) +run_cmake(pax) +run_cmake(pax-xz) +run_cmake(paxr) +run_cmake(paxr-bz2) +run_cmake(zip) diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt b/Tests/RunCMake/CommandLineTar/bad-format-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-format-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-format-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-format-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt b/Tests/RunCMake/CommandLineTar/bad-from1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt b/Tests/RunCMake/CommandLineTar/bad-from2-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from2-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from2-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from2-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt b/Tests/RunCMake/CommandLineTar/bad-from3-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from3-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt similarity index 67% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt index 147bd80..da32ad9 100644 --- a/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt +++ b/Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt @@ -1,2 +1,2 @@ -^CMake Error: -E tar --files-from='.*/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt' file invalid line: +^CMake Error: -E tar --files-from='.*/Tests/RunCMake/CommandLineTar/bad-from3.txt' file invalid line: -add-file=option-typo$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt b/Tests/RunCMake/CommandLineTar/bad-from3.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3.txt rename to Tests/RunCMake/CommandLineTar/bad-from3.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt b/Tests/RunCMake/CommandLineTar/bad-from4-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from4-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4.txt b/Tests/RunCMake/CommandLineTar/bad-from4.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4.txt rename to Tests/RunCMake/CommandLineTar/bad-from4.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt b/Tests/RunCMake/CommandLineTar/bad-from5-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from5-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5.txt b/Tests/RunCMake/CommandLineTar/bad-from5.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5.txt rename to Tests/RunCMake/CommandLineTar/bad-from5.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt b/Tests/RunCMake/CommandLineTar/bad-mtime1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-mtime1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-mtime1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-mtime1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt b/Tests/RunCMake/CommandLineTar/bad-opt1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-opt1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-opt1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-opt1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/end-opt1-result.txt similarity index 100% copy from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt copy to Tests/RunCMake/CommandLineTar/end-opt1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt b/Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt rename to Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt diff --git a/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake b/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake new file mode 100644 index 0000000..5f2674a --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.gz") + +set(COMPRESSION_FLAGS cvzf) +set(COMPRESSION_OPTIONS --format=gnutar) + +set(DECOMPRESSION_FLAGS xvzf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("1f8b" LIMIT 2 HEX) diff --git a/Tests/RunCMake/CommandLineTar/gnutar.cmake b/Tests/RunCMake/CommandLineTar/gnutar.cmake new file mode 100644 index 0000000..aaca596 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/gnutar.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=gnutar) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172202000" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/pax-xz.cmake b/Tests/RunCMake/CommandLineTar/pax-xz.cmake new file mode 100644 index 0000000..baf63d5 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/pax-xz.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.xz") + +set(COMPRESSION_FLAGS cvJf) +set(COMPRESSION_OPTIONS --format=pax) + +set(DECOMPRESSION_FLAGS xvJf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("fd377a585a00" LIMIT 6 HEX) diff --git a/Tests/RunCMake/CommandLineTar/pax.cmake b/Tests/RunCMake/CommandLineTar/pax.cmake new file mode 100644 index 0000000..60ed238 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/pax.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=pax) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake b/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake new file mode 100644 index 0000000..881a0af --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.bz2") + +set(COMPRESSION_FLAGS cvjf) +set(COMPRESSION_OPTIONS --format=paxr) + +set(DECOMPRESSION_FLAGS xvjf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("425a68" LIMIT 3 HEX) diff --git a/Tests/RunCMake/CommandLineTar/paxr.cmake b/Tests/RunCMake/CommandLineTar/paxr.cmake new file mode 100644 index 0000000..968a103 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/paxr.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=paxr) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/roundtrip.cmake b/Tests/RunCMake/CommandLineTar/roundtrip.cmake new file mode 100644 index 0000000..dc1c885 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/roundtrip.cmake @@ -0,0 +1,81 @@ +foreach(parameter OUTPUT_NAME COMPRESSION_FLAGS DECOMPRESSION_FLAGS) + if(NOT DEFINED ${parameter}) + message(FATAL_ERROR "missing required parameter ${parameter}") + endif() +endforeach() + +function(run_tar WORKING_DIRECTORY) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar ${ARGN} + WORKING_DIRECTORY ${WORKING_DIRECTORY} + RESULT_VARIABLE result + ) + + if(NOT result STREQUAL "0") + message(FATAL_ERROR "tar failed with arguments [${ARGN}] result [${result}]") + endif() +endfunction() + +set(COMPRESS_DIR compress_dir) +set(FULL_COMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${COMPRESS_DIR}) + +set(DECOMPRESS_DIR decompress_dir) +set(FULL_DECOMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${DECOMPRESS_DIR}) + +set(FULL_OUTPUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}) + +set(CHECK_FILES + "f1.txt" + "d1/f1.txt" + "d 2/f1.txt" + "d + 3/f1.txt" + "d_4/f1.txt" + "d-4/f1.txt" + "My Special Directory/f1.txt" +) + +foreach(file ${CHECK_FILES}) + configure_file(${CMAKE_CURRENT_LIST_FILE} ${FULL_COMPRESS_DIR}/${file} COPYONLY) +endforeach() + +if(UNIX) + execute_process(COMMAND ln -sf f1.txt ${FULL_COMPRESS_DIR}/d1/f2.txt) + list(APPEND CHECK_FILES "d1/f2.txt") +endif() + +file(REMOVE ${FULL_OUTPUT_NAME}) +file(REMOVE_RECURSE ${FULL_DECOMPRESS_DIR}) +file(MAKE_DIRECTORY ${FULL_DECOMPRESS_DIR}) + +run_tar(${CMAKE_CURRENT_BINARY_DIR} ${COMPRESSION_FLAGS} ${FULL_OUTPUT_NAME} ${COMPRESSION_OPTIONS} ${COMPRESS_DIR}) +run_tar(${FULL_DECOMPRESS_DIR} ${DECOMPRESSION_FLAGS} ${FULL_OUTPUT_NAME} ${DECOMPRESSION_OPTIONS}) + +foreach(file ${CHECK_FILES}) + set(input ${FULL_COMPRESS_DIR}/${file}) + set(output ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file}) + + if(NOT EXISTS ${input}) + message(SEND_ERROR "Cannot find input file ${output}") + endif() + + if(NOT EXISTS ${output}) + message(SEND_ERROR "Cannot find output file ${output}") + endif() + + file(MD5 ${input} input_md5) + file(MD5 ${output} output_md5) + + if(NOT input_md5 STREQUAL output_md5) + message(SEND_ERROR "Files \"${input}\" and \"${output}\" are different") + endif() +endforeach() + +function(check_magic EXPECTED) + file(READ ${FULL_OUTPUT_NAME} ACTUAL + ${ARGN} + ) + + if(NOT ACTUAL STREQUAL EXPECTED) + message(FATAL_ERROR + "Actual [${ACTUAL}] does not match expected [${EXPECTED}]") + endif() +endfunction() diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/zip-bz2-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt rename to Tests/RunCMake/CommandLineTar/zip-bz2-result.txt diff --git a/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt b/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt new file mode 100644 index 0000000..1134b4f --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt @@ -0,0 +1 @@ +CMake Error: Can not use compression flags with format: zip diff --git a/Tests/RunCMake/CommandLineTar/zip.cmake b/Tests/RunCMake/CommandLineTar/zip.cmake new file mode 100644 index 0000000..08e2fdb --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/zip.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.zip") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=zip) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("504b0304" LIMIT 4 HEX) diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt deleted file mode 100644 index bcc340b..0000000 --- a/Tests/TarTest/CMakeLists.txt +++ /dev/null @@ -1,69 +0,0 @@ -cmake_minimum_required (VERSION 2.6) -project(TarTest) - -# this is macro that we will be running -macro(EXEC_TAR_COMMAND DIR ARGS) - exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET) - if(${RET}) - message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"") - endif() -endmacro() - -# Create a directory structure -set(CHECK_FILES) -macro(COPY F1 F2) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY) - set(CHECK_FILES ${CHECK_FILES} "${F2}") -endmacro() -COPY("CMakeLists.txt" "f1.txt") -COPY("CMakeLists.txt" "d1/f1.txt") -COPY("CMakeLists.txt" "d 2/f1.txt") -COPY("CMakeLists.txt" "d + 3/f1.txt") -COPY("CMakeLists.txt" "d_4/f1.txt") -COPY("CMakeLists.txt" "d-4/f1.txt") -COPY("CMakeLists.txt" "My Special Directory/f1.txt") - -if(UNIX) - exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"") - set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") -endif() - -# cleanup first in case there are files left from previous runs -# if the umask is odd on the machine it might create files that -# are not automatically over written. These tests are run -# each time the configure step is run. -file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar") -file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz") -file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") - -make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") - - -# Run tests -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\" tar_dir") -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\" tar_dir") - -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar" "xvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\"") -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz" "xvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\"") - -macro(CHECK_DIR_STRUCTURE DIR) - foreach(file ${CHECK_FILES}) - set(sfile "${DIR}/${file}") - set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}") - if(NOT EXISTS "${sfile}") - message(SEND_ERROR "Cannot find file ${sfile}") - else() - exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret) - if(${ret}) - message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different") - endif() - endif() - endforeach() -endmacro() - -CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir") - -add_executable(TarTest TestTarExec.cxx) - diff --git a/Tests/TarTest/TestTarExec.cxx b/Tests/TarTest/TestTarExec.cxx deleted file mode 100644 index 86f2cd1..0000000 --- a/Tests/TarTest/TestTarExec.cxx +++ /dev/null @@ -1,5 +0,0 @@ -int main() -{ - return 0; -} - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c35319642ed4d32f7452c128cd745902c8fcaaec commit c35319642ed4d32f7452c128cd745902c8fcaaec Author: Nils Gladitz AuthorDate: Tue Apr 7 12:41:55 2015 +0200 Commit: Brad King CommitDate: Thu Apr 9 14:29:13 2015 -0400 CTestCoverageCollectGCOV: Write tar files intended for CDash in gnutar format PHP's PharData can not currently (PHP 5.6.4) extract paxr tar archives with long filenames. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 8659a69..6c74cf3 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -198,6 +198,7 @@ ${label_files} execute_process(COMMAND ${CMAKE_COMMAND} -E tar ${tar_opts} ${GCOV_TARBALL} "--mtime=1970-01-01 0:0:0 UTC" + "--format=gnutar" --files-from=${coverage_dir}/coverage_file_list.txt WORKING_DIRECTORY ${binary_dir}) endfunction() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dac0a260264f80df889871d888c759074e5fdf81 commit dac0a260264f80df889871d888c759074e5fdf81 Author: Nils Gladitz AuthorDate: Tue Apr 7 12:36:52 2015 +0200 Commit: Brad King CommitDate: Thu Apr 9 14:29:09 2015 -0400 cmake: Teach "-E tar" command a "--format=" option Allows specifying a libarchive defined archive format currently restricted to 7zip, gnutar, pax, paxr and zip. The default is "paxr" (pax restricted). diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index da41bbb..b2f7e9d 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -215,6 +215,10 @@ Available commands are: names start in ``-``. ``--mtime=`` Specify modification time recorded in tarball entries. + ``--format=`` + Specify the format of the archive to be created. + Supported formats are: ``7zip``, ``gnutar``, ``pax``, + ``paxr`` (restricted pax, default), and ``zip``. ``time [...]`` Run command and return elapsed time. diff --git a/Help/release/dev/tar-write-format.rst b/Help/release/dev/tar-write-format.rst new file mode 100644 index 0000000..004df21 --- /dev/null +++ b/Help/release/dev/tar-write-format.rst @@ -0,0 +1,6 @@ +tar-write-format +---------------- + +* The :manual:`cmake(1)` ``-E tar`` command learned a new + ``--format`` option to specify the archive format to + be written. diff --git a/Source/CPack/cmCPack7zGenerator.cxx b/Source/CPack/cmCPack7zGenerator.cxx index ce31ad4..2809e56 100644 --- a/Source/CPack/cmCPack7zGenerator.cxx +++ b/Source/CPack/cmCPack7zGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPack7zGenerator::cmCPack7zGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, - cmArchiveWrite::Type7Zip) + "7zip") { } diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 05b5cd9..58bd947 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -27,10 +27,10 @@ //---------------------------------------------------------------------- cmCPackArchiveGenerator::cmCPackArchiveGenerator(cmArchiveWrite::Compress t, - cmArchiveWrite::Type at) + std::string const& format) { this->Compress = t; - this->Archive = at; + this->ArchiveFormat = format; } //---------------------------------------------------------------------- @@ -108,7 +108,7 @@ if (!GenerateHeader(&gf)) \ << ">." << std::endl); \ return 0; \ } \ -cmArchiveWrite archive(gf,this->Compress, this->Archive); \ +cmArchiveWrite archive(gf,this->Compress, this->ArchiveFormat); \ if (!archive) \ { \ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " \ diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index 6411b1e..16e7632 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -31,7 +31,7 @@ public: /** * Construct generator */ - cmCPackArchiveGenerator(cmArchiveWrite::Compress, cmArchiveWrite::Type); + cmCPackArchiveGenerator(cmArchiveWrite::Compress, std::string const& format); virtual ~cmCPackArchiveGenerator(); // Used to add a header to the archive virtual int GenerateHeader(std::ostream* os); @@ -68,7 +68,7 @@ protected: int PackageComponentsAllInOne(); virtual const char* GetOutputExtension() = 0; cmArchiveWrite::Compress Compress; - cmArchiveWrite::Type Archive; + std::string ArchiveFormat; }; #endif diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx index 509c7f8..3fa2b64 100644 --- a/Source/CPack/cmCPackTGZGenerator.cxx +++ b/Source/CPack/cmCPackTGZGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTGZGenerator::cmCPackTGZGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressGZip, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTXZGenerator.cxx b/Source/CPack/cmCPackTXZGenerator.cxx index ecfc177..6d4ede1 100644 --- a/Source/CPack/cmCPackTXZGenerator.cxx +++ b/Source/CPack/cmCPackTXZGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTXZGenerator::cmCPackTXZGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx index ae73c37..9ff588b 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.cxx +++ b/Source/CPack/cmCPackTarBZip2Generator.cxx @@ -14,7 +14,7 @@ //---------------------------------------------------------------------- cmCPackTarBZip2Generator::cmCPackTarBZip2Generator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressBZip2, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx index df29408..1c8311b 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.cxx +++ b/Source/CPack/cmCPackTarCompressGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTarCompressGenerator::cmCPackTarCompressGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressCompress, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx index e6e4e77..7ef7729 100644 --- a/Source/CPack/cmCPackZIPGenerator.cxx +++ b/Source/CPack/cmCPackZIPGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackZIPGenerator::cmCPackZIPGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, - cmArchiveWrite::TypeZIP) + "zip") { } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index cf2fe82..72818f5 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -79,11 +79,12 @@ struct cmArchiveWrite::Callback }; //---------------------------------------------------------------------------- -cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): - Stream(os), - Archive(archive_write_new()), - Disk(archive_read_disk_new()), - Verbose(false) +cmArchiveWrite::cmArchiveWrite( + std::ostream& os, Compress c, std::string const& format): + Stream(os), + Archive(archive_write_new()), + Disk(archive_read_disk_new()), + Verbose(false) { switch (c) { @@ -141,35 +142,16 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): { this->Error = "archive_read_disk_set_standard_lookup: "; this->Error += cm_archive_error_string(this->Archive); - return;; + return; } #endif - switch (t) + + if(archive_write_set_format_by_name(this->Archive, format.c_str()) + != ARCHIVE_OK) { - case TypeZIP: - if(archive_write_set_format_zip(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_zip: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; - case TypeTAR: - if(archive_write_set_format_pax_restricted(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_pax_restricted: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; - case Type7Zip: - if(archive_write_set_format_7zip(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_7zip: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; + this->Error = "archive_write_set_format_by_name: "; + this->Error += cm_archive_error_string(this->Archive); + return; } // do not pad the last block!! diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 17357b4..794cb28 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -38,16 +38,10 @@ public: CompressXZ }; - /** Archive Type */ - enum Type - { - TypeTAR, - TypeZIP, - Type7Zip - }; - /** Construct with output stream to which to write archive. */ - cmArchiveWrite(std::ostream& os, Compress c = CompressNone, Type = TypeTAR); + cmArchiveWrite(std::ostream& os, Compress c = CompressNone, + std::string const& format = "paxr"); + ~cmArchiveWrite(); /** diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 5264123..95d05a6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1475,7 +1475,8 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, - bool verbose, std::string const& mtime) + bool verbose, std::string const& mtime, + std::string const& format) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1505,8 +1506,10 @@ bool cmSystemTools::CreateTar(const char* outFileName, compress = cmArchiveWrite::CompressNone; break; } + cmArchiveWrite a(fout, compress, - cmArchiveWrite::TypeTAR); + format.empty() ? "paxr" : format); + a.SetMTime(mtime); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index c59ae96..433ef46 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -395,7 +395,8 @@ public: static bool CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, bool verbose, - std::string const& mtime = std::string()); + std::string const& mtime = std::string(), + std::string const& format = 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/cmcmd.cxx b/Source/cmcmd.cxx index 9f2ea46..2ef04ef 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -703,10 +703,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) // Tar files else if (args[1] == "tar" && args.size() > 3) { + const char* knownFormats[] = + { + "7zip", + "gnutar", + "pax", + "paxr", + "zip" + }; + std::string flags = args[2]; std::string outFile = args[3]; std::vector files; std::string mtime; + std::string format; bool doing_options = true; for (std::string::size_type cc = 4; cc < args.size(); cc ++) { @@ -729,6 +739,19 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) return 1; } } + else if (cmHasLiteralPrefix(arg, "--format=")) + { + format = arg.substr(9); + bool isKnown = std::find(cmArrayBegin(knownFormats), + cmArrayEnd(knownFormats), format) != cmArrayEnd(knownFormats); + + if(!isKnown) + { + cmSystemTools::Error("Unknown -E tar --format= argument: ", + format.c_str()); + return 1; + } + } else { cmSystemTools::Error("Unknown option to -E tar: ", arg.c_str()); @@ -759,7 +782,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) compress = cmSystemTools::TarCompressGZip; ++nCompress; } - if ( nCompress > 1 ) + if ( (format == "7zip" || format == "zip") && nCompress > 0 ) + { + cmSystemTools::Error("Can not use compression flags with format: ", + format.c_str()); + return 1; + } + else 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"); @@ -781,7 +810,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, mtime) ) + outFile.c_str(), files, compress, verbose, mtime, format) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt new file mode 100644 index 0000000..fe9e2dc --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt @@ -0,0 +1 @@ +CMake Error: Unknown -E tar --format= argument: bad-format diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index e8b4584..e3942a8 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -10,6 +10,7 @@ run_cmake_command(E_tar-bad-from5 ${CMAKE_COMMAND} -E tar cvf bad.tar --files-f 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(E_tar-bad-format ${CMAKE_COMMAND} -E tar cvf bad.tar "--format=bad-format") run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e935be59d3b44eedb0ebf8b84179722933c058d1 commit e935be59d3b44eedb0ebf8b84179722933c058d1 Merge: bb89171 1f33b45 Author: Brad King AuthorDate: Thu Apr 9 14:29:01 2015 -0400 Commit: Brad King CommitDate: Thu Apr 9 14:29:01 2015 -0400 Merge branch 'fix-libarchive-mktemp' into tar-write-format ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From nilsgladitz at gmail.com Thu Apr 9 14:59:02 2015 From: nilsgladitz at gmail.com (Nils Gladitz) Date: Thu, 9 Apr 2015 14:59:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1694-g607638a Message-ID: <20150409185902.24C92ADE8C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 607638aacbc1f21c09df0d8a378217f45301984a (commit) via 90cc26d5f021f1e57b4025e62ba249448c5eb8ef (commit) from b97afb70bf378e783817763d9e1d0c7ed064f250 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=607638aacbc1f21c09df0d8a378217f45301984a commit 607638aacbc1f21c09df0d8a378217f45301984a Merge: b97afb7 90cc26d Author: Nils Gladitz AuthorDate: Thu Apr 9 14:59:00 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 9 14:59:00 2015 -0400 Merge topic 'c-locale-messages' into next 90cc26d5 CTest: Fix locale used for VCS updates http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=90cc26d5f021f1e57b4025e62ba249448c5eb8ef commit 90cc26d5f021f1e57b4025e62ba249448c5eb8ef Author: Nils Gladitz AuthorDate: Thu Apr 9 20:56:43 2015 +0200 Commit: Nils Gladitz CommitDate: Thu Apr 9 20:56:43 2015 +0200 CTest: Fix locale used for VCS updates 6a661f06030b85b4484733375bbb0aa23eca7446 fixed the locale used for message output but at the same time broke the locale used for filename encodings. This commit preserves LC_CTYPE in the presence of LC_ALL. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 04f6a81..7af6da3 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -159,6 +159,8 @@ set(SRCS cmCacheManager.cxx cmCacheManager.h "${CMAKE_CURRENT_BINARY_DIR}/cmCommands.cxx" + cmCLocaleEnvironmentScope.h + cmCLocaleEnvironmentScope.cxx cmCommands.h cmCommandArgumentLexer.cxx cmCommandArgumentParser.cxx diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index b9da8a0..10927e7 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -21,6 +21,7 @@ #include "cmGeneratedFileStream.h" #include "cmXMLParser.h" #include "cmXMLSafe.h" +#include "cmCLocaleEnvironmentScope.h" #include "cmCTestVC.h" #include "cmCTestCVS.h" @@ -66,46 +67,6 @@ static const char* cmCTestUpdateHandlerUpdateToString(int type) return cmCTestUpdateHandlerUpdateStrings[type]; } -class cmCTestUpdateHandlerLocale -{ -public: - cmCTestUpdateHandlerLocale(); - ~cmCTestUpdateHandlerLocale(); -private: - std::string saveLCAll; -}; - -cmCTestUpdateHandlerLocale::cmCTestUpdateHandlerLocale() -{ - const char* lcall = cmSystemTools::GetEnv("LC_ALL"); - if(lcall) - { - saveLCAll = lcall; - } - // if LC_ALL is not set to C, then - // set it, so that svn/cvs info will be in english ascii - if(! (lcall && strcmp(lcall, "C") == 0)) - { - cmSystemTools::PutEnv("LC_ALL=C"); - } -} - -cmCTestUpdateHandlerLocale::~cmCTestUpdateHandlerLocale() -{ - // restore the value of LC_ALL after running the version control - // commands - if(!saveLCAll.empty()) - { - std::string put = "LC_ALL="; - put += saveLCAll; - cmSystemTools::PutEnv(put); - } - else - { - cmSystemTools::UnsetEnv("LC_ALL"); - } -} - //---------------------------------------------------------------------- cmCTestUpdateHandler::cmCTestUpdateHandler() { @@ -194,7 +155,7 @@ int cmCTestUpdateHandler::DetermineType(const char* cmd, const char* type) int cmCTestUpdateHandler::ProcessHandler() { // Make sure VCS tool messages are in English so we can parse them. - cmCTestUpdateHandlerLocale fixLocale; + cmCLocaleEnvironmentScope fixLocale; static_cast(fixLocale); // Get source dir diff --git a/Source/cmCLocaleEnvironmentScope.cxx b/Source/cmCLocaleEnvironmentScope.cxx new file mode 100644 index 0000000..5792302 --- /dev/null +++ b/Source/cmCLocaleEnvironmentScope.cxx @@ -0,0 +1,67 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 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 "cmCLocaleEnvironmentScope.h" + +#include "cmSystemTools.h" + +#include + +cmCLocaleEnvironmentScope::cmCLocaleEnvironmentScope() +{ + this->SetEnv("LANGUAGE", ""); + this->SetEnv("LC_MESSAGES", "C"); + + std::string lcAll = this->GetEnv("LC_ALL"); + + if(!lcAll.empty()) + { + this->SetEnv("LC_ALL", ""); + this->SetEnv("LC_CTYPE", lcAll); + } +} + +std::string cmCLocaleEnvironmentScope::GetEnv(std::string const& key) +{ + const char* value = cmSystemTools::GetEnv(key); + return value ? value : std::string(); +} + +void cmCLocaleEnvironmentScope::SetEnv( + std::string const& key, std::string const& value) +{ + std::string oldValue = this->GetEnv(key); + + this->EnvironmentBackup.insert(std::make_pair(key, oldValue)); + + if(value.empty()) + { + cmSystemTools::UnsetEnv(key.c_str()); + } + else + { + std::stringstream tmp; + tmp << key << "=" << value; + cmSystemTools::PutEnv(tmp.str()); + } +} + +cmCLocaleEnvironmentScope::~cmCLocaleEnvironmentScope() +{ + for(backup_map_t::const_iterator i = this->EnvironmentBackup.begin(); + i != this->EnvironmentBackup.end(); ++i) + { + std::stringstream tmp; + tmp << i->first << "=" << i->second; + cmSystemTools::PutEnv(tmp.str()); + } +} diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h new file mode 100644 index 0000000..223aaae --- /dev/null +++ b/Source/cmCLocaleEnvironmentScope.h @@ -0,0 +1,33 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 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 cmCLocaleEnvironmentScope_h +#define cmCLocaleEnvironmentScope_h + +#include +#include + +class cmCLocaleEnvironmentScope +{ +public: + cmCLocaleEnvironmentScope(); + ~cmCLocaleEnvironmentScope(); + +private: + std::string GetEnv(std::string const& key); + void SetEnv(std::string const& key, std::string const& value); + + typedef std::map backup_map_t; + backup_map_t EnvironmentBackup; +}; + +#endif ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 2 + Source/CTest/cmCTestUpdateHandler.cxx | 43 +------------ Source/cmCLocaleEnvironmentScope.cxx | 67 ++++++++++++++++++++ Source/{cmLocale.h => cmCLocaleEnvironmentScope.h} | 30 +++++---- 4 files changed, 87 insertions(+), 55 deletions(-) create mode 100644 Source/cmCLocaleEnvironmentScope.cxx copy Source/{cmLocale.h => cmCLocaleEnvironmentScope.h} (52%) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Apr 10 00:01:08 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 10 Apr 2015 00:01:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-703-ga74d558 Message-ID: <20150410040108.6AE5FAD9F5@public.kitware.com> This is an automated email from 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 a74d558d1082f2bd380d7a03772972af2cd43e56 (commit) from bb891710cf7ba1ce8db059268ce4ee553c64966f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a74d558d1082f2bd380d7a03772972af2cd43e56 commit a74d558d1082f2bd380d7a03772972af2cd43e56 Author: Kitware Robot AuthorDate: Fri Apr 10 00:01:05 2015 -0400 Commit: Kitware Robot CommitDate: Fri Apr 10 00:01:05 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1e4302e..5266690 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150409) +set(CMake_VERSION_PATCH 20150410) #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 Apr 10 08:11:47 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 08:11:47 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1696-g23c3113 Message-ID: <20150410121147.E4F5FAE0DE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 23c3113c85a6c96d47a092c2a92b40fae63f2aff (commit) via 1f3bb59b691bf4d745e5c01b012c9d0b178bc34f (commit) from 607638aacbc1f21c09df0d8a378217f45301984a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23c3113c85a6c96d47a092c2a92b40fae63f2aff commit 23c3113c85a6c96d47a092c2a92b40fae63f2aff Merge: 607638a 1f3bb59 Author: Brad King AuthorDate: Fri Apr 10 08:11:45 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 08:11:45 2015 -0400 Merge topic 'suppress-osx-arch-linker-warning' into next 1f3bb59b CTestCustom: Suppress more OS X universal binary link arch warnings http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f3bb59b691bf4d745e5c01b012c9d0b178bc34f commit 1f3bb59b691bf4d745e5c01b012c9d0b178bc34f Author: Brad King AuthorDate: Fri Apr 10 08:11:21 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 08:11:21 2015 -0400 CTestCustom: Suppress more OS X universal binary link arch warnings diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 15f83ad..8a345b0 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -53,6 +53,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION "CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element" "cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast "ld: warning: directory not found for option .-(F|L)" + "ld: warning .*/libgcc.a archive's cputype" "ld: warning: ignoring file .*/libgcc.a, file was built for archive which is not the architecture being linked" "ld: warning: in .*/libgcc.a, file is not of required architecture" "warning.*This version of Mac OS X is unsupported" ----------------------------------------------------------------------- Summary of changes: CTestCustom.cmake.in | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 08:23:31 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 08:23:31 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1698-g3eca0b0 Message-ID: <20150410122331.3788FAE705@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3eca0b0fe2b29fba1195a43dfd6d987f72e1b97e (commit) via c97510187e1664af636b89140ed6e82ead1cf966 (commit) from 23c3113c85a6c96d47a092c2a92b40fae63f2aff (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3eca0b0fe2b29fba1195a43dfd6d987f72e1b97e commit 3eca0b0fe2b29fba1195a43dfd6d987f72e1b97e Merge: 23c3113 c975101 Author: Brad King AuthorDate: Fri Apr 10 08:23:30 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 08:23:30 2015 -0400 Merge topic 'add-GreenHills-MULTI-generator' into next c9751018 fixup! Add a 'Green Hills MULTI' generator on Windows http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c97510187e1664af636b89140ed6e82ead1cf966 commit c97510187e1664af636b89140ed6e82ead1cf966 Author: Brad King AuthorDate: Fri Apr 10 08:20:11 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 08:20:11 2015 -0400 fixup! Add a 'Green Hills MULTI' generator on Windows diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index e01c851..2637675 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -300,7 +300,7 @@ std::string cmGhsMultiTargetGenerator::GetDefines(const std::string &language, return i->second; } -void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::string const &config, +void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::string const &, const std::string &language) { //this->Target->GetCompileOptions(options, config, language); ----------------------------------------------------------------------- Summary of changes: Source/cmGhsMultiTargetGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 08:26:54 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 08:26:54 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1700-g3ffca24 Message-ID: <20150410122654.E98CEAEC43@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3ffca24da3e8fd79759910b9dc16bbc247d91971 (commit) via 96bbcf580ce7a900d6555b011b789e5064b24dbb (commit) from 3eca0b0fe2b29fba1195a43dfd6d987f72e1b97e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ffca24da3e8fd79759910b9dc16bbc247d91971 commit 3ffca24da3e8fd79759910b9dc16bbc247d91971 Merge: 3eca0b0 96bbcf5 Author: Brad King AuthorDate: Fri Apr 10 08:26:54 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 08:26:54 2015 -0400 Merge topic 'c-locale-messages' into next 96bbcf58 fixup! CTest: Fix locale used for VCS updates http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96bbcf580ce7a900d6555b011b789e5064b24dbb commit 96bbcf580ce7a900d6555b011b789e5064b24dbb Author: Brad King AuthorDate: Fri Apr 10 08:25:41 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 08:26:31 2015 -0400 fixup! CTest: Fix locale used for VCS updates We must include cmStandardIncludes.h first in every translation unit so large file support macros are defined consistently on AIX. diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h index 223aaae..b011741 100644 --- a/Source/cmCLocaleEnvironmentScope.h +++ b/Source/cmCLocaleEnvironmentScope.h @@ -13,8 +13,7 @@ #ifndef cmCLocaleEnvironmentScope_h #define cmCLocaleEnvironmentScope_h -#include -#include +#include "cmStandardIncludes.h" class cmCLocaleEnvironmentScope { ----------------------------------------------------------------------- Summary of changes: Source/cmCLocaleEnvironmentScope.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 08:31:00 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 08:31:00 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-705-g4411d1d Message-ID: <20150410123100.2DEFDAEE33@public.kitware.com> This is an automated email from 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 4411d1d779345f54c132209834daa49763cd1999 (commit) via 73dcba5181e6dd7937aa83958a54cabaea8c3576 (commit) from a74d558d1082f2bd380d7a03772972af2cd43e56 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4411d1d779345f54c132209834daa49763cd1999 commit 4411d1d779345f54c132209834daa49763cd1999 Merge: a74d558 73dcba5 Author: Brad King AuthorDate: Fri Apr 10 08:30:59 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 08:30:59 2015 -0400 Merge topic 'simplify-osx-install-prefix' 73dcba51 Simplify logic to compute install prefix in OS X CMake.app ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 08:31:02 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 08:31:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-707-g8b4c401 Message-ID: <20150410123102.3AA25AEE32@public.kitware.com> This is an automated email from 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 8b4c40155a4f7cf7e1f93b792a3e1e9678d284d7 (commit) via 1f33b45d5daca380e0be0ecfc595eac881328f29 (commit) from 4411d1d779345f54c132209834daa49763cd1999 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b4c40155a4f7cf7e1f93b792a3e1e9678d284d7 commit 8b4c40155a4f7cf7e1f93b792a3e1e9678d284d7 Merge: 4411d1d 1f33b45 Author: Brad King AuthorDate: Fri Apr 10 08:31:01 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 08:31:01 2015 -0400 Merge topic 'fix-libarchive-mktemp' 1f33b45d libarchive: Fix string concatentation in Windows mktemp implementation ----------------------------------------------------------------------- Summary of changes: Utilities/cmlibarchive/libarchive/archive_util.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 08:31:04 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 08:31:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-710-g1264c5b Message-ID: <20150410123104.6E63FAEE87@public.kitware.com> This is an automated email from 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 1264c5b2c485416128466510c42ab40a03eb0ca3 (commit) via 1b0c77a33d2e598c48bc8ad385cfd0586b8294e9 (commit) via 8313de2d5adf4514f0b3cccca747e78ca07d3ad3 (commit) from 8b4c40155a4f7cf7e1f93b792a3e1e9678d284d7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1264c5b2c485416128466510c42ab40a03eb0ca3 commit 1264c5b2c485416128466510c42ab40a03eb0ca3 Merge: 8b4c401 1b0c77a Author: Brad King AuthorDate: Fri Apr 10 08:31:03 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 08:31:03 2015 -0400 Merge topic 'FindCUDA.cmake/CUDA_SOURCE_FILE' 1b0c77a3 FindCUDA: Add specific cuda_language_flag instead of using nvcc. 8313de2d FindCUDA: Allow setting CUDA_SOURCE_PROPERTY_FORMAT for non-.cu files. ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 29 +++++++++++++++++++++-------- Modules/FindCUDA/run_nvcc.cmake | 2 ++ 2 files changed, 23 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 08:32:07 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 08:32:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1705-g2c8f0c1 Message-ID: <20150410123207.9C637AEEB5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2c8f0c1d160b7e6decb80f32ead492042e8b24d8 (commit) via 1264c5b2c485416128466510c42ab40a03eb0ca3 (commit) via 8b4c40155a4f7cf7e1f93b792a3e1e9678d284d7 (commit) via 4411d1d779345f54c132209834daa49763cd1999 (commit) via a74d558d1082f2bd380d7a03772972af2cd43e56 (commit) from 3ffca24da3e8fd79759910b9dc16bbc247d91971 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c8f0c1d160b7e6decb80f32ead492042e8b24d8 commit 2c8f0c1d160b7e6decb80f32ead492042e8b24d8 Merge: 3ffca24 1264c5b Author: Brad King AuthorDate: Fri Apr 10 08:31:58 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 08:31:58 2015 -0400 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 Apr 10 08:32:57 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 08:32:57 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1709-g7f53792 Message-ID: <20150410123257.C48ACAEF74@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7f53792ed2e089b7f46aa73558250996005ab059 (commit) via 6c4781baa9ea4cfb7b4de9ef91e58888286fab44 (commit) via fd04d87323749c15969982d9aa9b72059f33463b (commit) via d2cc580704fa4e608eae104ce5be211a229b2d64 (commit) from 2c8f0c1d160b7e6decb80f32ead492042e8b24d8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f53792ed2e089b7f46aa73558250996005ab059 commit 7f53792ed2e089b7f46aa73558250996005ab059 Merge: 2c8f0c1 6c4781b Author: Brad King AuthorDate: Fri Apr 10 08:32:55 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 08:32:55 2015 -0400 Merge topic 'tar-write-format' into next 6c4781ba Tests: Consolidate, refactor and extend -E tar tests fd04d873 CTestCoverageCollectGCOV: Write tar files intended for CDash in gnutar format d2cc5807 cmake: Teach "-E tar" command a "--format=" option http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c4781baa9ea4cfb7b4de9ef91e58888286fab44 commit 6c4781baa9ea4cfb7b4de9ef91e58888286fab44 Author: Nils Gladitz AuthorDate: Tue Apr 7 19:40:33 2015 +0200 Commit: Brad King CommitDate: Fri Apr 10 08:32:32 2015 -0400 Tests: Consolidate, refactor and extend -E tar tests diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index f80191b..aa6a993 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -218,7 +218,6 @@ if(BUILD_TESTING) ADD_TEST_MACRO(FindModulesExecuteAll FindModulesExecuteAll) ADD_TEST_MACRO(StringFileTest StringFileTest) ADD_TEST_MACRO(TryCompile TryCompile) - ADD_TEST_MACRO(TarTest TarTest) ADD_TEST_MACRO(SystemInformation SystemInformation) ADD_TEST_MACRO(MathTest MathTest) ADD_TEST_MACRO(CompileFeatures CompileFeatures) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3709913..d7ac81d 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -200,6 +200,7 @@ add_RunCMake_test(target_link_libraries) add_RunCMake_test(target_compile_features) add_RunCMake_test(CheckModules) add_RunCMake_test(CommandLine) +add_RunCMake_test(CommandLineTar) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index e3942a8..f879ee6 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,17 +1,5 @@ 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") -run_cmake_command(E_tar-bad-format ${CMAKE_COMMAND} -E tar cvf bad.tar "--format=bad-format") - run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) run_cmake_command(build-no-generator diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/7zip-gz-result.txt similarity index 100% copy from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt copy to Tests/RunCMake/CommandLineTar/7zip-gz-result.txt diff --git a/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt b/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt new file mode 100644 index 0000000..2fad326 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt @@ -0,0 +1 @@ +CMake Error: Can not use compression flags with format: 7zip diff --git a/Tests/RunCMake/CommandLineTar/7zip.cmake b/Tests/RunCMake/CommandLineTar/7zip.cmake new file mode 100644 index 0000000..4bc6548 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/7zip.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.7z") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=7zip) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("377abcaf271c" LIMIT 6 HEX) diff --git a/Tests/RunCMake/CommandLineTar/CMakeLists.txt b/Tests/RunCMake/CommandLineTar/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake new file mode 100644 index 0000000..12635db --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake @@ -0,0 +1,28 @@ +include(RunCMake) + +function(external_command_test NAME) + run_cmake_command(${NAME} ${CMAKE_COMMAND} -E ${ARGN}) +endfunction() + +external_command_test(bad-opt1 tar cvf bad.tar --bad) +external_command_test(bad-mtime1 tar cvf bad.tar --mtime=bad .) +external_command_test(bad-from1 tar cvf bad.tar --files-from=bad) +external_command_test(bad-from2 tar cvf bad.tar --files-from=.) +external_command_test(bad-from3 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from3.txt) +external_command_test(bad-from4 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from4.txt) +external_command_test(bad-from5 tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/bad-from5.txt) +external_command_test(end-opt1 tar cvf bad.tar -- --bad) +external_command_test(end-opt2 tar cvf bad.tar --) +external_command_test(mtime tar cvf bad.tar "--mtime=1970-01-01 00:00:00 UTC") +external_command_test(bad-format tar cvf bad.tar "--format=bad-format") +external_command_test(zip-bz2 tar cvjf bad.tar "--format=zip") +external_command_test(7zip-gz tar cvzf bad.tar "--format=7zip") + +run_cmake(7zip) +run_cmake(gnutar) +run_cmake(gnutar-gz) +run_cmake(pax) +run_cmake(pax-xz) +run_cmake(paxr) +run_cmake(paxr-bz2) +run_cmake(zip) diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt b/Tests/RunCMake/CommandLineTar/bad-format-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-format-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-format-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-format-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt b/Tests/RunCMake/CommandLineTar/bad-from1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt b/Tests/RunCMake/CommandLineTar/bad-from2-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from2-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from2-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from2-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt b/Tests/RunCMake/CommandLineTar/bad-from3-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from3-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt similarity index 67% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt index 147bd80..da32ad9 100644 --- a/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt +++ b/Tests/RunCMake/CommandLineTar/bad-from3-stderr.txt @@ -1,2 +1,2 @@ -^CMake Error: -E tar --files-from='.*/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt' file invalid line: +^CMake Error: -E tar --files-from='.*/Tests/RunCMake/CommandLineTar/bad-from3.txt' file invalid line: -add-file=option-typo$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt b/Tests/RunCMake/CommandLineTar/bad-from3.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from3.txt rename to Tests/RunCMake/CommandLineTar/bad-from3.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt b/Tests/RunCMake/CommandLineTar/bad-from4-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from4-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from4-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4.txt b/Tests/RunCMake/CommandLineTar/bad-from4.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from4.txt rename to Tests/RunCMake/CommandLineTar/bad-from4.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt b/Tests/RunCMake/CommandLineTar/bad-from5-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-from5-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-from5-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5.txt b/Tests/RunCMake/CommandLineTar/bad-from5.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-from5.txt rename to Tests/RunCMake/CommandLineTar/bad-from5.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt b/Tests/RunCMake/CommandLineTar/bad-mtime1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-mtime1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-mtime1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-mtime1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt b/Tests/RunCMake/CommandLineTar/bad-opt1-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt rename to Tests/RunCMake/CommandLineTar/bad-opt1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt b/Tests/RunCMake/CommandLineTar/bad-opt1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt rename to Tests/RunCMake/CommandLineTar/bad-opt1-stderr.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/end-opt1-result.txt similarity index 100% copy from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt copy to Tests/RunCMake/CommandLineTar/end-opt1-result.txt diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt b/Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt rename to Tests/RunCMake/CommandLineTar/end-opt1-stderr.txt diff --git a/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake b/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake new file mode 100644 index 0000000..5f2674a --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/gnutar-gz.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.gz") + +set(COMPRESSION_FLAGS cvzf) +set(COMPRESSION_OPTIONS --format=gnutar) + +set(DECOMPRESSION_FLAGS xvzf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("1f8b" LIMIT 2 HEX) diff --git a/Tests/RunCMake/CommandLineTar/gnutar.cmake b/Tests/RunCMake/CommandLineTar/gnutar.cmake new file mode 100644 index 0000000..aaca596 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/gnutar.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=gnutar) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172202000" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/pax-xz.cmake b/Tests/RunCMake/CommandLineTar/pax-xz.cmake new file mode 100644 index 0000000..baf63d5 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/pax-xz.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.xz") + +set(COMPRESSION_FLAGS cvJf) +set(COMPRESSION_OPTIONS --format=pax) + +set(DECOMPRESSION_FLAGS xvJf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("fd377a585a00" LIMIT 6 HEX) diff --git a/Tests/RunCMake/CommandLineTar/pax.cmake b/Tests/RunCMake/CommandLineTar/pax.cmake new file mode 100644 index 0000000..60ed238 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/pax.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=pax) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake b/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake new file mode 100644 index 0000000..881a0af --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/paxr-bz2.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar.bz2") + +set(COMPRESSION_FLAGS cvjf) +set(COMPRESSION_OPTIONS --format=paxr) + +set(DECOMPRESSION_FLAGS xvjf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("425a68" LIMIT 3 HEX) diff --git a/Tests/RunCMake/CommandLineTar/paxr.cmake b/Tests/RunCMake/CommandLineTar/paxr.cmake new file mode 100644 index 0000000..968a103 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/paxr.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=paxr) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/CommandLineTar/roundtrip.cmake b/Tests/RunCMake/CommandLineTar/roundtrip.cmake new file mode 100644 index 0000000..dc1c885 --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/roundtrip.cmake @@ -0,0 +1,81 @@ +foreach(parameter OUTPUT_NAME COMPRESSION_FLAGS DECOMPRESSION_FLAGS) + if(NOT DEFINED ${parameter}) + message(FATAL_ERROR "missing required parameter ${parameter}") + endif() +endforeach() + +function(run_tar WORKING_DIRECTORY) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar ${ARGN} + WORKING_DIRECTORY ${WORKING_DIRECTORY} + RESULT_VARIABLE result + ) + + if(NOT result STREQUAL "0") + message(FATAL_ERROR "tar failed with arguments [${ARGN}] result [${result}]") + endif() +endfunction() + +set(COMPRESS_DIR compress_dir) +set(FULL_COMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${COMPRESS_DIR}) + +set(DECOMPRESS_DIR decompress_dir) +set(FULL_DECOMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${DECOMPRESS_DIR}) + +set(FULL_OUTPUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}) + +set(CHECK_FILES + "f1.txt" + "d1/f1.txt" + "d 2/f1.txt" + "d + 3/f1.txt" + "d_4/f1.txt" + "d-4/f1.txt" + "My Special Directory/f1.txt" +) + +foreach(file ${CHECK_FILES}) + configure_file(${CMAKE_CURRENT_LIST_FILE} ${FULL_COMPRESS_DIR}/${file} COPYONLY) +endforeach() + +if(UNIX) + execute_process(COMMAND ln -sf f1.txt ${FULL_COMPRESS_DIR}/d1/f2.txt) + list(APPEND CHECK_FILES "d1/f2.txt") +endif() + +file(REMOVE ${FULL_OUTPUT_NAME}) +file(REMOVE_RECURSE ${FULL_DECOMPRESS_DIR}) +file(MAKE_DIRECTORY ${FULL_DECOMPRESS_DIR}) + +run_tar(${CMAKE_CURRENT_BINARY_DIR} ${COMPRESSION_FLAGS} ${FULL_OUTPUT_NAME} ${COMPRESSION_OPTIONS} ${COMPRESS_DIR}) +run_tar(${FULL_DECOMPRESS_DIR} ${DECOMPRESSION_FLAGS} ${FULL_OUTPUT_NAME} ${DECOMPRESSION_OPTIONS}) + +foreach(file ${CHECK_FILES}) + set(input ${FULL_COMPRESS_DIR}/${file}) + set(output ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file}) + + if(NOT EXISTS ${input}) + message(SEND_ERROR "Cannot find input file ${output}") + endif() + + if(NOT EXISTS ${output}) + message(SEND_ERROR "Cannot find output file ${output}") + endif() + + file(MD5 ${input} input_md5) + file(MD5 ${output} output_md5) + + if(NOT input_md5 STREQUAL output_md5) + message(SEND_ERROR "Files \"${input}\" and \"${output}\" are different") + endif() +endforeach() + +function(check_magic EXPECTED) + file(READ ${FULL_OUTPUT_NAME} ACTUAL + ${ARGN} + ) + + if(NOT ACTUAL STREQUAL EXPECTED) + message(FATAL_ERROR + "Actual [${ACTUAL}] does not match expected [${EXPECTED}]") + endif() +endfunction() diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLineTar/zip-bz2-result.txt similarity index 100% rename from Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt rename to Tests/RunCMake/CommandLineTar/zip-bz2-result.txt diff --git a/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt b/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt new file mode 100644 index 0000000..1134b4f --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt @@ -0,0 +1 @@ +CMake Error: Can not use compression flags with format: zip diff --git a/Tests/RunCMake/CommandLineTar/zip.cmake b/Tests/RunCMake/CommandLineTar/zip.cmake new file mode 100644 index 0000000..08e2fdb --- /dev/null +++ b/Tests/RunCMake/CommandLineTar/zip.cmake @@ -0,0 +1,10 @@ +set(OUTPUT_NAME "test.zip") + +set(COMPRESSION_FLAGS cvf) +set(COMPRESSION_OPTIONS --format=zip) + +set(DECOMPRESSION_FLAGS xvf) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("504b0304" LIMIT 4 HEX) diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt deleted file mode 100644 index bcc340b..0000000 --- a/Tests/TarTest/CMakeLists.txt +++ /dev/null @@ -1,69 +0,0 @@ -cmake_minimum_required (VERSION 2.6) -project(TarTest) - -# this is macro that we will be running -macro(EXEC_TAR_COMMAND DIR ARGS) - exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET) - if(${RET}) - message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"") - endif() -endmacro() - -# Create a directory structure -set(CHECK_FILES) -macro(COPY F1 F2) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY) - set(CHECK_FILES ${CHECK_FILES} "${F2}") -endmacro() -COPY("CMakeLists.txt" "f1.txt") -COPY("CMakeLists.txt" "d1/f1.txt") -COPY("CMakeLists.txt" "d 2/f1.txt") -COPY("CMakeLists.txt" "d + 3/f1.txt") -COPY("CMakeLists.txt" "d_4/f1.txt") -COPY("CMakeLists.txt" "d-4/f1.txt") -COPY("CMakeLists.txt" "My Special Directory/f1.txt") - -if(UNIX) - exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"") - set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") -endif() - -# cleanup first in case there are files left from previous runs -# if the umask is odd on the machine it might create files that -# are not automatically over written. These tests are run -# each time the configure step is run. -file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar") -file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz") -file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") - -make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") - - -# Run tests -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\" tar_dir") -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\" tar_dir") - -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar" "xvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\"") -EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz" "xvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\"") - -macro(CHECK_DIR_STRUCTURE DIR) - foreach(file ${CHECK_FILES}) - set(sfile "${DIR}/${file}") - set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}") - if(NOT EXISTS "${sfile}") - message(SEND_ERROR "Cannot find file ${sfile}") - else() - exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret) - if(${ret}) - message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different") - endif() - endif() - endforeach() -endmacro() - -CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir") - -add_executable(TarTest TestTarExec.cxx) - diff --git a/Tests/TarTest/TestTarExec.cxx b/Tests/TarTest/TestTarExec.cxx deleted file mode 100644 index 86f2cd1..0000000 --- a/Tests/TarTest/TestTarExec.cxx +++ /dev/null @@ -1,5 +0,0 @@ -int main() -{ - return 0; -} - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd04d87323749c15969982d9aa9b72059f33463b commit fd04d87323749c15969982d9aa9b72059f33463b Author: Nils Gladitz AuthorDate: Tue Apr 7 12:41:55 2015 +0200 Commit: Brad King CommitDate: Fri Apr 10 08:32:31 2015 -0400 CTestCoverageCollectGCOV: Write tar files intended for CDash in gnutar format PHP's PharData can not currently (PHP 5.6.4) extract paxr tar archives with long filenames. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 8659a69..6c74cf3 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -198,6 +198,7 @@ ${label_files} execute_process(COMMAND ${CMAKE_COMMAND} -E tar ${tar_opts} ${GCOV_TARBALL} "--mtime=1970-01-01 0:0:0 UTC" + "--format=gnutar" --files-from=${coverage_dir}/coverage_file_list.txt WORKING_DIRECTORY ${binary_dir}) endfunction() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d2cc580704fa4e608eae104ce5be211a229b2d64 commit d2cc580704fa4e608eae104ce5be211a229b2d64 Author: Nils Gladitz AuthorDate: Tue Apr 7 12:36:52 2015 +0200 Commit: Brad King CommitDate: Fri Apr 10 08:32:31 2015 -0400 cmake: Teach "-E tar" command a "--format=" option Allows specifying a libarchive defined archive format currently restricted to 7zip, gnutar, pax, paxr and zip. The default is "paxr" (pax restricted). diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index da41bbb..b2f7e9d 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -215,6 +215,10 @@ Available commands are: names start in ``-``. ``--mtime=`` Specify modification time recorded in tarball entries. + ``--format=`` + Specify the format of the archive to be created. + Supported formats are: ``7zip``, ``gnutar``, ``pax``, + ``paxr`` (restricted pax, default), and ``zip``. ``time [...]`` Run command and return elapsed time. diff --git a/Help/release/dev/tar-write-format.rst b/Help/release/dev/tar-write-format.rst new file mode 100644 index 0000000..004df21 --- /dev/null +++ b/Help/release/dev/tar-write-format.rst @@ -0,0 +1,6 @@ +tar-write-format +---------------- + +* The :manual:`cmake(1)` ``-E tar`` command learned a new + ``--format`` option to specify the archive format to + be written. diff --git a/Source/CPack/cmCPack7zGenerator.cxx b/Source/CPack/cmCPack7zGenerator.cxx index ce31ad4..2809e56 100644 --- a/Source/CPack/cmCPack7zGenerator.cxx +++ b/Source/CPack/cmCPack7zGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPack7zGenerator::cmCPack7zGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, - cmArchiveWrite::Type7Zip) + "7zip") { } diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 05b5cd9..58bd947 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -27,10 +27,10 @@ //---------------------------------------------------------------------- cmCPackArchiveGenerator::cmCPackArchiveGenerator(cmArchiveWrite::Compress t, - cmArchiveWrite::Type at) + std::string const& format) { this->Compress = t; - this->Archive = at; + this->ArchiveFormat = format; } //---------------------------------------------------------------------- @@ -108,7 +108,7 @@ if (!GenerateHeader(&gf)) \ << ">." << std::endl); \ return 0; \ } \ -cmArchiveWrite archive(gf,this->Compress, this->Archive); \ +cmArchiveWrite archive(gf,this->Compress, this->ArchiveFormat); \ if (!archive) \ { \ cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " \ diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index 6411b1e..16e7632 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -31,7 +31,7 @@ public: /** * Construct generator */ - cmCPackArchiveGenerator(cmArchiveWrite::Compress, cmArchiveWrite::Type); + cmCPackArchiveGenerator(cmArchiveWrite::Compress, std::string const& format); virtual ~cmCPackArchiveGenerator(); // Used to add a header to the archive virtual int GenerateHeader(std::ostream* os); @@ -68,7 +68,7 @@ protected: int PackageComponentsAllInOne(); virtual const char* GetOutputExtension() = 0; cmArchiveWrite::Compress Compress; - cmArchiveWrite::Type Archive; + std::string ArchiveFormat; }; #endif diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx index 509c7f8..3fa2b64 100644 --- a/Source/CPack/cmCPackTGZGenerator.cxx +++ b/Source/CPack/cmCPackTGZGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTGZGenerator::cmCPackTGZGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressGZip, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTXZGenerator.cxx b/Source/CPack/cmCPackTXZGenerator.cxx index ecfc177..6d4ede1 100644 --- a/Source/CPack/cmCPackTXZGenerator.cxx +++ b/Source/CPack/cmCPackTXZGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTXZGenerator::cmCPackTXZGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx index ae73c37..9ff588b 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.cxx +++ b/Source/CPack/cmCPackTarBZip2Generator.cxx @@ -14,7 +14,7 @@ //---------------------------------------------------------------------- cmCPackTarBZip2Generator::cmCPackTarBZip2Generator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressBZip2, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx index df29408..1c8311b 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.cxx +++ b/Source/CPack/cmCPackTarCompressGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackTarCompressGenerator::cmCPackTarCompressGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressCompress, - cmArchiveWrite::TypeTAR) + "paxr") { } diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx index e6e4e77..7ef7729 100644 --- a/Source/CPack/cmCPackZIPGenerator.cxx +++ b/Source/CPack/cmCPackZIPGenerator.cxx @@ -15,7 +15,7 @@ //---------------------------------------------------------------------- cmCPackZIPGenerator::cmCPackZIPGenerator() :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, - cmArchiveWrite::TypeZIP) + "zip") { } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index cf2fe82..72818f5 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -79,11 +79,12 @@ struct cmArchiveWrite::Callback }; //---------------------------------------------------------------------------- -cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): - Stream(os), - Archive(archive_write_new()), - Disk(archive_read_disk_new()), - Verbose(false) +cmArchiveWrite::cmArchiveWrite( + std::ostream& os, Compress c, std::string const& format): + Stream(os), + Archive(archive_write_new()), + Disk(archive_read_disk_new()), + Verbose(false) { switch (c) { @@ -141,35 +142,16 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c, Type t): { this->Error = "archive_read_disk_set_standard_lookup: "; this->Error += cm_archive_error_string(this->Archive); - return;; + return; } #endif - switch (t) + + if(archive_write_set_format_by_name(this->Archive, format.c_str()) + != ARCHIVE_OK) { - case TypeZIP: - if(archive_write_set_format_zip(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_zip: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; - case TypeTAR: - if(archive_write_set_format_pax_restricted(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_pax_restricted: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; - case Type7Zip: - if(archive_write_set_format_7zip(this->Archive) != ARCHIVE_OK) - { - this->Error = "archive_write_set_format_7zip: "; - this->Error += cm_archive_error_string(this->Archive); - return; - } - break; + this->Error = "archive_write_set_format_by_name: "; + this->Error += cm_archive_error_string(this->Archive); + return; } // do not pad the last block!! diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 17357b4..794cb28 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -38,16 +38,10 @@ public: CompressXZ }; - /** Archive Type */ - enum Type - { - TypeTAR, - TypeZIP, - Type7Zip - }; - /** Construct with output stream to which to write archive. */ - cmArchiveWrite(std::ostream& os, Compress c = CompressNone, Type = TypeTAR); + cmArchiveWrite(std::ostream& os, Compress c = CompressNone, + std::string const& format = "paxr"); + ~cmArchiveWrite(); /** diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 5264123..95d05a6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1475,7 +1475,8 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, - bool verbose, std::string const& mtime) + bool verbose, std::string const& mtime, + std::string const& format) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1505,8 +1506,10 @@ bool cmSystemTools::CreateTar(const char* outFileName, compress = cmArchiveWrite::CompressNone; break; } + cmArchiveWrite a(fout, compress, - cmArchiveWrite::TypeTAR); + format.empty() ? "paxr" : format); + a.SetMTime(mtime); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index c59ae96..433ef46 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -395,7 +395,8 @@ public: static bool CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, bool verbose, - std::string const& mtime = std::string()); + std::string const& mtime = std::string(), + std::string const& format = 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/cmcmd.cxx b/Source/cmcmd.cxx index 9f2ea46..2ef04ef 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -703,10 +703,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) // Tar files else if (args[1] == "tar" && args.size() > 3) { + const char* knownFormats[] = + { + "7zip", + "gnutar", + "pax", + "paxr", + "zip" + }; + std::string flags = args[2]; std::string outFile = args[3]; std::vector files; std::string mtime; + std::string format; bool doing_options = true; for (std::string::size_type cc = 4; cc < args.size(); cc ++) { @@ -729,6 +739,19 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) return 1; } } + else if (cmHasLiteralPrefix(arg, "--format=")) + { + format = arg.substr(9); + bool isKnown = std::find(cmArrayBegin(knownFormats), + cmArrayEnd(knownFormats), format) != cmArrayEnd(knownFormats); + + if(!isKnown) + { + cmSystemTools::Error("Unknown -E tar --format= argument: ", + format.c_str()); + return 1; + } + } else { cmSystemTools::Error("Unknown option to -E tar: ", arg.c_str()); @@ -759,7 +782,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) compress = cmSystemTools::TarCompressGZip; ++nCompress; } - if ( nCompress > 1 ) + if ( (format == "7zip" || format == "zip") && nCompress > 0 ) + { + cmSystemTools::Error("Can not use compression flags with format: ", + format.c_str()); + return 1; + } + else 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"); @@ -781,7 +810,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, mtime) ) + outFile.c_str(), files, compress, verbose, mtime, format) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-format-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt new file mode 100644 index 0000000..fe9e2dc --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-format-stderr.txt @@ -0,0 +1 @@ +CMake Error: Unknown -E tar --format= argument: bad-format diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index e8b4584..e3942a8 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -10,6 +10,7 @@ run_cmake_command(E_tar-bad-from5 ${CMAKE_COMMAND} -E tar cvf bad.tar --files-f 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(E_tar-bad-format ${CMAKE_COMMAND} -E tar cvf bad.tar "--format=bad-format") run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 08:33:01 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 08:33:01 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-714-g10859b9 Message-ID: <20150410123302.014F3AEF6A@public.kitware.com> This is an automated email from 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 10859b97ebbe610a829e3981958d7b4c0149f95a (commit) via 6c4781baa9ea4cfb7b4de9ef91e58888286fab44 (commit) via fd04d87323749c15969982d9aa9b72059f33463b (commit) via d2cc580704fa4e608eae104ce5be211a229b2d64 (commit) from 1264c5b2c485416128466510c42ab40a03eb0ca3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=10859b97ebbe610a829e3981958d7b4c0149f95a commit 10859b97ebbe610a829e3981958d7b4c0149f95a Merge: 1264c5b 6c4781b Author: Brad King AuthorDate: Fri Apr 10 08:33:00 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 08:33:00 2015 -0400 Merge topic 'tar-write-format' 6c4781ba Tests: Consolidate, refactor and extend -E tar tests fd04d873 CTestCoverageCollectGCOV: Write tar files intended for CDash in gnutar format d2cc5807 cmake: Teach "-E tar" command a "--format=" option ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake.1.rst | 4 + Help/release/dev/tar-write-format.rst | 6 ++ Modules/CTestCoverageCollectGCOV.cmake | 1 + Source/CPack/cmCPack7zGenerator.cxx | 2 +- Source/CPack/cmCPackArchiveGenerator.cxx | 6 +- Source/CPack/cmCPackArchiveGenerator.h | 4 +- Source/CPack/cmCPackTGZGenerator.cxx | 2 +- Source/CPack/cmCPackTXZGenerator.cxx | 2 +- Source/CPack/cmCPackTarBZip2Generator.cxx | 2 +- Source/CPack/cmCPackTarCompressGenerator.cxx | 2 +- Source/CPack/cmCPackZIPGenerator.cxx | 2 +- Source/cmArchiveWrite.cxx | 44 ++++------- Source/cmArchiveWrite.h | 12 +-- Source/cmSystemTools.cxx | 7 +- Source/cmSystemTools.h | 3 +- Source/cmcmd.cxx | 33 +++++++- Tests/CMakeLists.txt | 1 - Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 11 --- .../7zip-gz-result.txt} | 0 Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt | 1 + Tests/RunCMake/CommandLineTar/7zip.cmake | 10 +++ .../{CMP0054 => CommandLineTar}/CMakeLists.txt | 0 Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake | 28 +++++++ .../bad-format-result.txt} | 0 .../RunCMake/CommandLineTar/bad-format-stderr.txt | 3 +- .../bad-from1-result.txt} | 0 .../bad-from1-stderr.txt} | 0 .../bad-from2-result.txt} | 0 .../bad-from2-stderr.txt} | 0 .../bad-from3-result.txt} | 0 .../bad-from3-stderr.txt} | 2 +- .../bad-from3.txt} | 0 .../bad-from4-result.txt} | 0 .../bad-from4-stderr.txt} | 0 .../bad-from4.txt} | 0 .../bad-from5-result.txt} | 0 .../bad-from5-stderr.txt} | 0 .../bad-from5.txt} | 0 .../bad-mtime1-result.txt} | 0 .../bad-mtime1-stderr.txt} | 0 .../bad-opt1-result.txt} | 0 .../bad-opt1-stderr.txt} | 0 .../end-opt1-result.txt} | 0 .../end-opt1-stderr.txt} | 0 Tests/RunCMake/CommandLineTar/gnutar-gz.cmake | 10 +++ Tests/RunCMake/CommandLineTar/gnutar.cmake | 10 +++ Tests/RunCMake/CommandLineTar/pax-xz.cmake | 10 +++ Tests/RunCMake/CommandLineTar/pax.cmake | 10 +++ Tests/RunCMake/CommandLineTar/paxr-bz2.cmake | 10 +++ Tests/RunCMake/CommandLineTar/paxr.cmake | 10 +++ Tests/RunCMake/CommandLineTar/roundtrip.cmake | 81 ++++++++++++++++++++ .../zip-bz2-result.txt} | 0 Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt | 1 + Tests/RunCMake/CommandLineTar/zip.cmake | 10 +++ Tests/TarTest/CMakeLists.txt | 69 ----------------- Tests/TarTest/TestTarExec.cxx | 5 -- 57 files changed, 270 insertions(+), 145 deletions(-) create mode 100644 Help/release/dev/tar-write-format.rst rename Tests/RunCMake/{CommandLine/E_tar-bad-from1-result.txt => CommandLineTar/7zip-gz-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLineTar/7zip-gz-stderr.txt create mode 100644 Tests/RunCMake/CommandLineTar/7zip.cmake copy Tests/RunCMake/{CMP0054 => CommandLineTar}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/CommandLineTar/RunCMakeTest.cmake rename Tests/RunCMake/{CommandLine/E_tar-bad-from2-result.txt => CommandLineTar/bad-format-result.txt} (100%) copy Modules/Platform/Linux-PGI-Fortran.cmake => Tests/RunCMake/CommandLineTar/bad-format-stderr.txt (50%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from3-result.txt => CommandLineTar/bad-from1-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from1-stderr.txt => CommandLineTar/bad-from1-stderr.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from4-result.txt => CommandLineTar/bad-from2-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from2-stderr.txt => CommandLineTar/bad-from2-stderr.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from5-result.txt => CommandLineTar/bad-from3-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from3-stderr.txt => CommandLineTar/bad-from3-stderr.txt} (67%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from3.txt => CommandLineTar/bad-from3.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-mtime1-result.txt => CommandLineTar/bad-from4-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from4-stderr.txt => CommandLineTar/bad-from4-stderr.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from4.txt => CommandLineTar/bad-from4.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-opt1-result.txt => CommandLineTar/bad-from5-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from5-stderr.txt => CommandLineTar/bad-from5-stderr.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-from5.txt => CommandLineTar/bad-from5.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-end-opt1-result.txt => CommandLineTar/bad-mtime1-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-mtime1-stderr.txt => CommandLineTar/bad-mtime1-stderr.txt} (100%) copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLineTar/bad-opt1-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-bad-opt1-stderr.txt => CommandLineTar/bad-opt1-stderr.txt} (100%) copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLineTar/end-opt1-result.txt} (100%) rename Tests/RunCMake/{CommandLine/E_tar-end-opt1-stderr.txt => CommandLineTar/end-opt1-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CommandLineTar/gnutar-gz.cmake create mode 100644 Tests/RunCMake/CommandLineTar/gnutar.cmake create mode 100644 Tests/RunCMake/CommandLineTar/pax-xz.cmake create mode 100644 Tests/RunCMake/CommandLineTar/pax.cmake create mode 100644 Tests/RunCMake/CommandLineTar/paxr-bz2.cmake create mode 100644 Tests/RunCMake/CommandLineTar/paxr.cmake create mode 100644 Tests/RunCMake/CommandLineTar/roundtrip.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLineTar/zip-bz2-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLineTar/zip-bz2-stderr.txt create mode 100644 Tests/RunCMake/CommandLineTar/zip.cmake delete mode 100644 Tests/TarTest/CMakeLists.txt delete mode 100644 Tests/TarTest/TestTarExec.cxx hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 08:33:15 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 08:33:15 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1711-g679d434 Message-ID: <20150410123315.5C301AEF7B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 679d43443a904e71cf5880e5dee1dbbcdd921be9 (commit) via 10859b97ebbe610a829e3981958d7b4c0149f95a (commit) from 7f53792ed2e089b7f46aa73558250996005ab059 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=679d43443a904e71cf5880e5dee1dbbcdd921be9 commit 679d43443a904e71cf5880e5dee1dbbcdd921be9 Merge: 7f53792 10859b9 Author: Brad King AuthorDate: Fri Apr 10 08:33:09 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 08:33:09 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 12:48:17 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 12:48:17 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1713-gbcf878b Message-ID: <20150410164817.2DB1BAE882@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via bcf878b072063e3f8d3dcf7935deb4e2c7dc9319 (commit) via c9e9c31c53f69475aa080ad442492408217259b5 (commit) from 679d43443a904e71cf5880e5dee1dbbcdd921be9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bcf878b072063e3f8d3dcf7935deb4e2c7dc9319 commit bcf878b072063e3f8d3dcf7935deb4e2c7dc9319 Merge: 679d434 c9e9c31 Author: Brad King AuthorDate: Fri Apr 10 12:48:16 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 12:48:16 2015 -0400 Merge topic 'emulator-property' into next c9e9c31c Tests: Create pseudo_emulator output dir for Xcode 2.x http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9e9c31c53f69475aa080ad442492408217259b5 commit c9e9c31c53f69475aa080ad442492408217259b5 Author: Brad King AuthorDate: Fri Apr 10 12:42:49 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 12:42:49 2015 -0400 Tests: Create pseudo_emulator output dir for Xcode 2.x Apply the workardound from commit v2.8.2~598 (Create CMakeLibTests output dir for Xcode, 2009-12-09) to the pseudo_emulator tool. diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 977721d..0ffae0e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -230,3 +230,11 @@ endif() add_executable(pseudo_emulator pseudo_emulator.c) add_RunCMake_test(CrosscompilingEmulator -DPSEUDO_EMULATOR=$) +# Xcode 2.x forgets to create the output directory before linking +# the individual architectures. +if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") + add_custom_command( + TARGET pseudo_emulator + PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" + ) +endif() ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 12:49:00 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 12:49:00 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1715-g93adfcb Message-ID: <20150410164900.60913AE8BC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 93adfcb8d412f7e1c15571bf51c4372ed23bd2ce (commit) via b1987ddd6185ab458d7fbddf9dd1208574c648eb (commit) from bcf878b072063e3f8d3dcf7935deb4e2c7dc9319 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=93adfcb8d412f7e1c15571bf51c4372ed23bd2ce commit 93adfcb8d412f7e1c15571bf51c4372ed23bd2ce Merge: bcf878b b1987dd Author: Brad King AuthorDate: Fri Apr 10 12:48:58 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 12:48:58 2015 -0400 Merge topic 'move-command-line-tests' into next b1987ddd Tests: Move more command line tests into RunCMake.CommandLine http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b1987ddd6185ab458d7fbddf9dd1208574c648eb commit b1987ddd6185ab458d7fbddf9dd1208574c648eb Author: Brad King AuthorDate: Fri Apr 10 11:52:16 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 11:52:44 2015 -0400 Tests: Move more command line tests into RunCMake.CommandLine Port most CMakeTestBadCommandLines test cases to RunCMake.CommandLine and drop the former test. Add validation of expected results, which was not done by the old test. diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index aa6a993..1e60abe 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1095,21 +1095,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators") endif() - if(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines) - set(CTEST_RUN_CMakeTestBadCommandLines ON) - endif() - - if(CTEST_RUN_CMakeTestBadCommandLines) - add_test(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND} - -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines - -D gen=${CMAKE_GENERATOR} - -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} - -P ${CMake_SOURCE_DIR}/Tests/CMakeTestBadCommandLines/RunCMake.cmake - ) - list(APPEND TEST_BUILD_DIRS - "${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines") - endif() - if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) set(CTEST_RUN_CMakeTestMultipleConfigures ON) endif() diff --git a/Tests/CMakeTestBadCommandLines/RunCMake.cmake b/Tests/CMakeTestBadCommandLines/RunCMake.cmake deleted file mode 100644 index 08549cc..0000000 --- a/Tests/CMakeTestBadCommandLines/RunCMake.cmake +++ /dev/null @@ -1,79 +0,0 @@ -if(NOT DEFINED CMake_SOURCE_DIR) - message(FATAL_ERROR "CMake_SOURCE_DIR not defined") -endif() - -if(NOT DEFINED dir) - message(FATAL_ERROR "dir not defined") -endif() - -if(NOT DEFINED gen) - message(FATAL_ERROR "gen not defined") -endif() - -message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") - -# First setup a source tree to run CMake on. -# -execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMake_SOURCE_DIR}/Tests/CTestTest/SmallAndFast - ${dir}/Source -) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory - ${dir}/Build - ) - -function(RunCMakeWithArgs) - message(STATUS "info: running cmake with ARGN='${ARGN}'") - - execute_process(COMMAND ${CMAKE_COMMAND} ${ARGN} - RESULT_VARIABLE result - OUTPUT_VARIABLE stdout - ERROR_VARIABLE stderr - WORKING_DIRECTORY ${dir}/Build - ) - - message(STATUS "result='${result}'") - message(STATUS "stdout='${stdout}'") - message(STATUS "stderr='${stderr}'") - message(STATUS "") -endfunction() - -# Run cmake once with no errors to get a good build tree: -# -RunCMakeWithArgs(-G ${gen} ../Source) - -# Run cmake with args that produce some sort of problem to cover the error -# cases in cmake.cxx... -# -# (These are not good examples of cmake command lines. Do not copy and -# paste them elsewhere and expect them to work... See the cmake -# documentation or other real examples of usage instead.) -# -RunCMakeWithArgs() -RunCMakeWithArgs(-C) -RunCMakeWithArgs(-C nosuchcachefile.txt) -RunCMakeWithArgs(--check-stamp-file nostampfile) -RunCMakeWithArgs(--check-stamp-list nostamplist) -RunCMakeWithArgs(nosuchsubdir/CMakeCache.txt) -RunCMakeWithArgs(nosuchsubdir/CMakeLists.txt) -RunCMakeWithArgs(-D) -RunCMakeWithArgs(--debug-output .) -RunCMakeWithArgs(--debug-trycompile .) -RunCMakeWithArgs(-E) -RunCMakeWithArgs(-E create_symlink) -RunCMakeWithArgs(-E echo_append) -RunCMakeWithArgs(-E rename) -RunCMakeWithArgs(-E touch_nocreate) -RunCMakeWithArgs(-G) -RunCMakeWithArgs(--graphviz= ../Source) -RunCMakeWithArgs(--graphviz=g.dot .) -RunCMakeWithArgs(-P) -RunCMakeWithArgs(-P nosuchscriptfile.cmake) -RunCMakeWithArgs(--trace .) -RunCMakeWithArgs(-U) -RunCMakeWithArgs(-U nosuchvariable .) -RunCMakeWithArgs(-V) -RunCMakeWithArgs(-V .) -RunCMakeWithArgs(-Wno-dev .) -RunCMakeWithArgs(-Wdev .) diff --git a/Tests/RunCMake/CommandLine/C-no-arg-result.txt b/Tests/RunCMake/CommandLine/C-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/C-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt new file mode 100644 index 0000000..0570d8f --- /dev/null +++ b/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: -C must be followed by a file name. +CMake Error: Problem processing arguments. Aborting.$ diff --git a/Tests/RunCMake/CommandLine/C-no-file-result.txt b/Tests/RunCMake/CommandLine/C-no-file-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/C-no-file-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/C-no-file-stderr.txt b/Tests/RunCMake/CommandLine/C-no-file-stderr.txt new file mode 100644 index 0000000..5315f59 --- /dev/null +++ b/Tests/RunCMake/CommandLine/C-no-file-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: Error processing file: nosuchcachefile.txt +CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/C-no-file-build/nosuchcachefile.txt" does not exist. +Specify --help for usage, or press the help button on the CMake GUI.$ diff --git a/Tests/RunCMake/CommandLine/D-no-arg-result.txt b/Tests/RunCMake/CommandLine/D-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/D-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt new file mode 100644 index 0000000..5e43bca --- /dev/null +++ b/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: -D must be followed with VAR=VALUE. +CMake Error: Problem processing arguments. Aborting.$ diff --git a/Tests/RunCMake/CommandLine/E-no-arg-result.txt b/Tests/RunCMake/CommandLine/E-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt new file mode 100644 index 0000000..056ce05 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: cmake version .* +Usage: .* -E \[command\] \[arguments ...\] +Available commands: diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-result.txt b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt new file mode 100644 index 0000000..056ce05 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: cmake version .* +Usage: .* -E \[command\] \[arguments ...\] +Available commands: diff --git a/Tests/RunCMake/CommandLine/E_rename-no-arg-result.txt b/Tests/RunCMake/CommandLine/E_rename-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rename-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt new file mode 100644 index 0000000..056ce05 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: cmake version .* +Usage: .* -E \[command\] \[arguments ...\] +Available commands: diff --git a/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-result.txt b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt new file mode 100644 index 0000000..056ce05 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: cmake version .* +Usage: .* -E \[command\] \[arguments ...\] +Available commands: diff --git a/Tests/RunCMake/CommandLine/G_no-arg-result.txt b/Tests/RunCMake/CommandLine/G_no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/G_no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt b/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt new file mode 100644 index 0000000..56d23c2 --- /dev/null +++ b/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt @@ -0,0 +1 @@ +^CMake Error: No generator specified for -G$ diff --git a/Tests/RunCMake/CommandLine/NoArgs-stdout.txt b/Tests/RunCMake/CommandLine/NoArgs-stdout.txt new file mode 100644 index 0000000..1cd3469 --- /dev/null +++ b/Tests/RunCMake/CommandLine/NoArgs-stdout.txt @@ -0,0 +1,10 @@ +^Usage + + cmake \[options\] + cmake \[options\] + +Specify a source directory to \(re-\)generate a build system for it in the +current working directory. Specify an existing build directory to +re-generate its build system. + +Run 'cmake --help' for more information.$ diff --git a/Tests/RunCMake/CommandLine/P_no-arg-result.txt b/Tests/RunCMake/CommandLine/P_no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/P_no-arg-stderr.txt b/Tests/RunCMake/CommandLine/P_no-arg-stderr.txt new file mode 100644 index 0000000..8af3a53 --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_no-arg-stderr.txt @@ -0,0 +1 @@ +^CMake Error: No script specified for argument -P$ diff --git a/Tests/RunCMake/CommandLine/P_no-file-result.txt b/Tests/RunCMake/CommandLine/P_no-file-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_no-file-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/P_no-file-stderr.txt b/Tests/RunCMake/CommandLine/P_no-file-stderr.txt new file mode 100644 index 0000000..2e12399 --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_no-file-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Error processing file: nosuchscriptfile.cmake$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index f879ee6..77f4fda 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,5 +1,21 @@ include(RunCMake) +run_cmake_command(NoArgs ${CMAKE_COMMAND}) +run_cmake_command(C-no-arg ${CMAKE_COMMAND} -C) +run_cmake_command(C-no-file ${CMAKE_COMMAND} -C nosuchcachefile.txt) +run_cmake_command(cache-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeCache.txt) +run_cmake_command(lists-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeLists.txt) +run_cmake_command(D-no-arg ${CMAKE_COMMAND} -D) +run_cmake_command(U-no-arg ${CMAKE_COMMAND} -U) +run_cmake_command(E-no-arg ${CMAKE_COMMAND} -E) +run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append) +run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename) +run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate) + +run_cmake_command(G_no-arg ${CMAKE_COMMAND} -G) +run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P) +run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake) + run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) run_cmake_command(build-no-generator @@ -24,6 +40,9 @@ if(RunCMake_GENERATOR STREQUAL "Ninja") endif() if(UNIX) + run_cmake_command(E_create_symlink-no-arg + ${CMAKE_COMMAND} -E create_symlink + ) run_cmake_command(E_create_symlink-missing-dir ${CMAKE_COMMAND} -E create_symlink T missing-dir/L ) @@ -70,6 +89,26 @@ set(RunCMake_TEST_OPTIONS "-DFOO:STRING=-DBAR:BOOL=BAZ") run_cmake(D_typed_nested_cache) +set(RunCMake_TEST_OPTIONS -Wno-dev) +run_cmake(Wno-dev) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS -Wno-dev -Wdev) +run_cmake(Wdev) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS --debug-output) +run_cmake(debug-output) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS --trace) +run_cmake(trace) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS --debug-trycompile) +run_cmake(debug-trycompile) +unset(RunCMake_TEST_OPTIONS) + function(run_cmake_depends) set(RunCMake_TEST_SOURCE_DIR "${RunCMake_SOURCE_DIR}/cmake_depends") set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/cmake_depends-build") diff --git a/Tests/RunCMake/CommandLine/U-no-arg-result.txt b/Tests/RunCMake/CommandLine/U-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/U-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt new file mode 100644 index 0000000..c34ef94 --- /dev/null +++ b/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: -U must be followed with VAR. +CMake Error: Problem processing arguments. Aborting.$ diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt new file mode 100644 index 0000000..f427303 --- /dev/null +++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt @@ -0,0 +1,5 @@ +^CMake Warning \(dev\) at Wdev.cmake:1 \(message\): + Some Author Warning +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake b/Tests/RunCMake/CommandLine/Wdev.cmake new file mode 100644 index 0000000..0242086 --- /dev/null +++ b/Tests/RunCMake/CommandLine/Wdev.cmake @@ -0,0 +1 @@ +message(AUTHOR_WARNING "Some Author Warning") diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake b/Tests/RunCMake/CommandLine/Wno-dev.cmake new file mode 100644 index 0000000..0242086 --- /dev/null +++ b/Tests/RunCMake/CommandLine/Wno-dev.cmake @@ -0,0 +1 @@ +message(AUTHOR_WARNING "Some Author Warning") diff --git a/Tests/RunCMake/CommandLine/cache-no-file-result.txt b/Tests/RunCMake/CommandLine/cache-no-file-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-no-file-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/cache-no-file-stderr.txt b/Tests/RunCMake/CommandLine/cache-no-file-stderr.txt new file mode 100644 index 0000000..da3a0c3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-no-file-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/cache-no-file-build/nosuchsubdir" does not exist. +Specify --help for usage, or press the help button on the CMake GUI.$ diff --git a/Tests/RunCMake/CommandLine/debug-output-stdout.txt b/Tests/RunCMake/CommandLine/debug-output-stdout.txt new file mode 100644 index 0000000..96f2aae --- /dev/null +++ b/Tests/RunCMake/CommandLine/debug-output-stdout.txt @@ -0,0 +1 @@ +Running with debug output on. diff --git a/Tests/RunCMake/CommandLine/debug-output.cmake b/Tests/RunCMake/CommandLine/debug-output.cmake new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CommandLine/debug-trycompile.cmake b/Tests/RunCMake/CommandLine/debug-trycompile.cmake new file mode 100644 index 0000000..a3835a7 --- /dev/null +++ b/Tests/RunCMake/CommandLine/debug-trycompile.cmake @@ -0,0 +1,5 @@ +enable_language(C) +# Look for a source tree left by enable_language internal checks. +if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeTmp/CMakeLists.txt) + message(FATAL_ERROR "--debug-trycompile should leave the source behind") +endif() diff --git a/Tests/RunCMake/CommandLine/lists-no-file-result.txt b/Tests/RunCMake/CommandLine/lists-no-file-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/lists-no-file-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/lists-no-file-stderr.txt b/Tests/RunCMake/CommandLine/lists-no-file-stderr.txt new file mode 100644 index 0000000..3465e89 --- /dev/null +++ b/Tests/RunCMake/CommandLine/lists-no-file-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/lists-no-file-build/nosuchsubdir" does not exist. +Specify --help for usage, or press the help button on the CMake GUI.$ diff --git a/Tests/RunCMake/CommandLine/trace-stderr.txt b/Tests/RunCMake/CommandLine/trace-stderr.txt new file mode 100644 index 0000000..8e8ddfa --- /dev/null +++ b/Tests/RunCMake/CommandLine/trace-stderr.txt @@ -0,0 +1,2 @@ +^.*/Tests/RunCMake/CommandLine/CMakeLists.txt\(1\): cmake_minimum_required\(VERSION 3.0 \) +.*/Tests/RunCMake/CommandLine/CMakeLists.txt\(2\): project\(\${RunCMake_TEST} NONE \) diff --git a/Tests/RunCMake/CommandLine/trace.cmake b/Tests/RunCMake/CommandLine/trace.cmake new file mode 100644 index 0000000..e69de29 ----------------------------------------------------------------------- Summary of changes: Tests/CMakeLists.txt | 15 ---- Tests/CMakeTestBadCommandLines/RunCMake.cmake | 79 -------------------- .../C-no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/C-no-arg-stderr.txt | 2 + .../C-no-file-result.txt} | 0 Tests/RunCMake/CommandLine/C-no-file-stderr.txt | 3 + .../D-no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/D-no-arg-stderr.txt | 2 + .../E-no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/E-no-arg-stderr.txt | 3 + .../E_create_symlink-no-arg-result.txt} | 0 .../CommandLine/E_create_symlink-no-arg-stderr.txt | 3 + .../E_rename-no-arg-result.txt} | 0 .../CommandLine/E_rename-no-arg-stderr.txt | 3 + .../E_touch_nocreate-no-arg-result.txt} | 0 .../CommandLine/E_touch_nocreate-no-arg-stderr.txt | 3 + .../G_no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/G_no-arg-stderr.txt | 1 + Tests/RunCMake/CommandLine/NoArgs-stdout.txt | 10 +++ .../P_no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/P_no-arg-stderr.txt | 1 + .../P_no-file-result.txt} | 0 Tests/RunCMake/CommandLine/P_no-file-stderr.txt | 1 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 39 ++++++++++ .../U-no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/U-no-arg-stderr.txt | 2 + Tests/RunCMake/CommandLine/Wdev-stderr.txt | 5 ++ Tests/RunCMake/CommandLine/Wdev.cmake | 1 + Tests/RunCMake/CommandLine/Wno-dev.cmake | 1 + .../cache-no-file-result.txt} | 0 .../RunCMake/CommandLine/cache-no-file-stderr.txt | 2 + Tests/RunCMake/CommandLine/debug-output-stdout.txt | 1 + .../RunCMake/CommandLine/debug-output.cmake | 0 Tests/RunCMake/CommandLine/debug-trycompile.cmake | 5 ++ .../lists-no-file-result.txt} | 0 .../RunCMake/CommandLine/lists-no-file-stderr.txt | 2 + Tests/RunCMake/CommandLine/trace-stderr.txt | 2 + .../RunCMake/CommandLine/trace.cmake | 0 38 files changed, 92 insertions(+), 94 deletions(-) delete mode 100644 Tests/CMakeTestBadCommandLines/RunCMake.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/C-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/C-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/C-no-file-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/C-no-file-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/D-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/D-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_create_symlink-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_rename-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_touch_nocreate-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/G_no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/G_no-arg-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/NoArgs-stdout.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/P_no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/P_no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/P_no-file-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/P_no-file-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/U-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/U-no-arg-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/Wdev-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/Wdev.cmake create mode 100644 Tests/RunCMake/CommandLine/Wno-dev.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/cache-no-file-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/cache-no-file-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/debug-output-stdout.txt copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/debug-output.cmake (100%) create mode 100644 Tests/RunCMake/CommandLine/debug-trycompile.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/lists-no-file-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/lists-no-file-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/trace-stderr.txt copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/trace.cmake (100%) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 14:00:13 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 14:00:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1718-g5b7b3b5 Message-ID: <20150410180013.EE5AAAEB84@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5b7b3b57d97a831a27cc9f6dc2b5998a7780b6ca (commit) via 5472e7803520f98b396c7355b529e80f3a13df0c (commit) via 5c08e2559cf8ad5fc3cb220396016cf816a7b4b8 (commit) from 93adfcb8d412f7e1c15571bf51c4372ed23bd2ce (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5b7b3b57d97a831a27cc9f6dc2b5998a7780b6ca commit 5b7b3b57d97a831a27cc9f6dc2b5998a7780b6ca Merge: 93adfcb 5472e78 Author: Brad King AuthorDate: Fri Apr 10 14:00:13 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 14:00:13 2015 -0400 Merge topic 'custom-command-multiple-outputs' into next 5472e780 Makefile: Fix multiple custom command outputs with one missing 5c08e255 KWSys SystemTools: Teach Touch with !create to succeed on missing file http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5472e7803520f98b396c7355b529e80f3a13df0c commit 5472e7803520f98b396c7355b529e80f3a13df0c Author: Brad King AuthorDate: Fri Apr 10 13:03:34 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 13:59:59 2015 -0400 Makefile: Fix multiple custom command outputs with one missing The use of "cmake -E touch_nocreate" added in commit v3.2.1~4^2 (Makefile: Fix multiple custom command outputs regression, 2015-03-06) caused builds to fail when one of the outputs is intentionally not created. This was fixed by our parent commit by making touch_nocreate succeed when the file is missing. Add a test case covering it. For the Watcom WMake generator, check for the SYMBOLIC source file property separately on each output. The mark is needed on outputs that are not really created to tell 'wmake' not to complain that it is missing. The mark is also needed on outputs that are created or 'wmake' will not consider them out of date when they exist. Inspired-by: Ben Boeckel diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 4ece016..12b931a 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -767,7 +767,7 @@ cmMakefileTargetGenerator // Write the rule. this->WriteMakeRule(*this->BuildFileStream, 0, outputs, - depends, commands, false); + depends, commands); bool do_preprocess_rules = lang_has_preprocessor && this->LocalGenerator->GetCreatePreprocessedSourceRules(); @@ -989,18 +989,30 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules() } //---------------------------------------------------------------------------- -void cmMakefileTargetGenerator::WriteMakeRule( +bool cmMakefileTargetGenerator::WriteMakeRule( std::ostream& os, const char* comment, const std::vector& outputs, const std::vector& depends, const std::vector& commands, - bool symbolic, bool in_help) { + bool symbolic = false; if (outputs.size() == 0) { - return; + return symbolic; + } + + // Check whether we need to bother checking for a symbolic output. + bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark(); + + // Check whether the first output is marked as symbolic. + if(need_symbolic) + { + if(cmSourceFile* sf = this->Makefile->GetSource(outputs[0])) + { + symbolic = sf->GetPropertyAsBool("SYMBOLIC"); + } } // We always attach the actual commands to the first output. @@ -1010,7 +1022,7 @@ void cmMakefileTargetGenerator::WriteMakeRule( // For single outputs, we are done. if (outputs.size() == 1) { - return; + return symbolic; } // For multiple outputs, make the extra ones depend on the first one. @@ -1023,14 +1035,25 @@ void cmMakefileTargetGenerator::WriteMakeRule( std::string const out = this->Convert(*o, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::SHELL); std::vector output_commands; - if (!symbolic) + + bool o_symbolic = false; + if(need_symbolic) + { + if(cmSourceFile* sf = this->Makefile->GetSource(*o)) + { + o_symbolic = sf->GetPropertyAsBool("SYMBOLIC"); + } + } + symbolic = symbolic && o_symbolic; + + if (!o_symbolic) { output_commands.push_back("@$(CMAKE_COMMAND) -E touch_nocreate " + out); } this->LocalGenerator->WriteMakeRule(os, 0, *o, output_depends, - output_commands, symbolic, in_help); + output_commands, o_symbolic, in_help); - if (!symbolic) + if (!o_symbolic) { // At build time, remove the first output if this one does not exist // so that "make" will rerun the real commands that create this one. @@ -1038,6 +1061,7 @@ void cmMakefileTargetGenerator::WriteMakeRule( this->MultipleOutputPairs.insert(p); } } + return symbolic; } //---------------------------------------------------------------------------- @@ -1289,23 +1313,12 @@ void cmMakefileTargetGenerator std::vector depends; this->LocalGenerator->AppendCustomDepend(depends, ccg); - // Check whether we need to bother checking for a symbolic output. - bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark(); - // Write the rule. const std::vector& outputs = ccg.GetOutputs(); std::vector::const_iterator o = outputs.begin(); { - bool symbolic = false; - if(need_symbolic) - { - if(cmSourceFile* sf = this->Makefile->GetSource(*o)) - { - symbolic = sf->GetPropertyAsBool("SYMBOLIC"); - } - } - this->WriteMakeRule(*this->BuildFileStream, 0, outputs, - depends, commands, symbolic); + bool symbolic = this->WriteMakeRule(*this->BuildFileStream, 0, + outputs, depends, commands); // If the rule has changed make sure the output is rebuilt. if(!symbolic) diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index f62c51d..42c4f58 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -224,12 +224,11 @@ protected: typedef std::map MultipleOutputPairsType; MultipleOutputPairsType MultipleOutputPairs; - void WriteMakeRule(std::ostream& os, + bool WriteMakeRule(std::ostream& os, const char* comment, const std::vector& outputs, const std::vector& depends, const std::vector& commands, - bool symbolic, bool in_help = false); // Target name info. diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 78e9e17..0b1ff2c 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -66,6 +66,7 @@ set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_dep file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external original\n") file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in original\n") +file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp original\n") help_xcode_depends() @@ -191,6 +192,19 @@ else() "multi1-out2-copy.txt is missing") endif() +if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-out1.txt) + if(${BuildDepends_BINARY_DIR}/Project/multi2-out1.txt + IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt) + message(STATUS "multi2-out1.txt is newer than multi2-stamp.txt") + else() + message(SEND_ERROR "Project did not initially build properly: " + "multi2-out1.txt is not newer than multi2-stamp.txt") + endif() +else() + message(SEND_ERROR "Project did not initially build properly: " + "multi2-out1.txt is missing") +endif() + message("Waiting 3 seconds...") execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 3) @@ -217,6 +231,7 @@ endif() file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external changed\n") file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in changed\n") +file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp changed\n") help_xcode_depends() @@ -347,3 +362,16 @@ else() message(SEND_ERROR "Project did not rebuild properly: " "multi1-out2-copy.txt is missing") endif() + +if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-out1.txt) + if(${BuildDepends_BINARY_DIR}/Project/multi2-out1.txt + IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt) + message(STATUS "multi2-out1.txt is newer than multi2-stamp.txt") + else() + message(SEND_ERROR "Project did not rebuild properly: " + "multi2-out1.txt is not newer than multi2-stamp.txt") + endif() +else() + message(SEND_ERROR "Project did not rebuild properly: " + "multi2-out1.txt is missing") +endif() diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index cb9fbf8..9b2b5aa 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -164,3 +164,10 @@ add_custom_command( DEPENDS multi1-out2.txt ) add_custom_target(multi1 ALL DEPENDS multi1-out2-copy.txt) + +add_custom_command( + OUTPUT multi2-out1.txt multi2-out2.txt + COMMAND ${CMAKE_COMMAND} -E touch multi2-out1.txt + ) +set_property(SOURCE multi2-out1.txt multi2-out2.txt PROPERTY SYMBOLIC 1) +add_custom_target(multi2 ALL DEPENDS multi2-out1.txt) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c08e2559cf8ad5fc3cb220396016cf816a7b4b8 commit 5c08e2559cf8ad5fc3cb220396016cf816a7b4b8 Author: Brad King AuthorDate: Fri Apr 10 11:07:50 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 12:51:10 2015 -0400 KWSys SystemTools: Teach Touch with !create to succeed on missing file diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index b03e7b0..b9b65a0 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1215,15 +1215,22 @@ bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path) bool SystemTools::Touch(const kwsys_stl::string& filename, bool create) { - if(create && !SystemTools::FileExists(filename)) + if (!SystemTools::FileExists(filename)) { - FILE* file = Fopen(filename, "a+b"); - if(file) + if(create) + { + FILE* file = Fopen(filename, "a+b"); + if(file) + { + fclose(file); + return true; + } + return false; + } + else { - fclose(file); return true; } - return false; } #if defined(_WIN32) && !defined(__CYGWIN__) HANDLE h = CreateFileW( ----------------------------------------------------------------------- Summary of changes: Source/cmMakefileTargetGenerator.cxx | 55 ++++++++++++++++++----------- Source/cmMakefileTargetGenerator.h | 3 +- Source/kwsys/SystemTools.cxx | 17 ++++++--- Tests/BuildDepends/CMakeLists.txt | 28 +++++++++++++++ Tests/BuildDepends/Project/CMakeLists.txt | 7 ++++ 5 files changed, 82 insertions(+), 28 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 14:20:50 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 14:20:50 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1720-ge9afa5e Message-ID: <20150410182050.16DAEAE554@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e9afa5e5c5e62c7a7936aab438bb5afd4463461a (commit) via 2ed9d8d75b8ddd4e6115e243711e0c553a9a2650 (commit) from 5b7b3b57d97a831a27cc9f6dc2b5998a7780b6ca (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e9afa5e5c5e62c7a7936aab438bb5afd4463461a commit e9afa5e5c5e62c7a7936aab438bb5afd4463461a Merge: 5b7b3b5 2ed9d8d Author: Brad King AuthorDate: Fri Apr 10 14:20:49 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 14:20:49 2015 -0400 Merge topic 'custom-command-multiple-outputs' into next 2ed9d8d7 fixup! Makefile: Fix multiple custom command outputs with one missing http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ed9d8d75b8ddd4e6115e243711e0c553a9a2650 commit 2ed9d8d75b8ddd4e6115e243711e0c553a9a2650 Author: Brad King AuthorDate: Fri Apr 10 14:20:31 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 14:20:31 2015 -0400 fixup! Makefile: Fix multiple custom command outputs with one missing diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 12b931a..ea11c79 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1315,8 +1315,6 @@ void cmMakefileTargetGenerator // Write the rule. const std::vector& outputs = ccg.GetOutputs(); - std::vector::const_iterator o = outputs.begin(); - { bool symbolic = this->WriteMakeRule(*this->BuildFileStream, 0, outputs, depends, commands); @@ -1325,7 +1323,6 @@ void cmMakefileTargetGenerator { this->GlobalGenerator->AddRuleHash(ccg.GetOutputs(), content.str()); } - } // Setup implicit dependency scanning. for(cmCustomCommand::ImplicitDependsList::const_iterator ----------------------------------------------------------------------- Summary of changes: Source/cmMakefileTargetGenerator.cxx | 3 --- 1 file changed, 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 14:55:33 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 14:55:33 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1722-gac895eb Message-ID: <20150410185533.9F037AEA1C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ac895eb1956eb72844cb669341307de0a8256f37 (commit) via 4e107ff0b866b918959a9c7a0c792795ade4896e (commit) from e9afa5e5c5e62c7a7936aab438bb5afd4463461a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac895eb1956eb72844cb669341307de0a8256f37 commit ac895eb1956eb72844cb669341307de0a8256f37 Merge: e9afa5e 4e107ff Author: Brad King AuthorDate: Fri Apr 10 14:55:32 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 14:55:32 2015 -0400 Merge topic 'move-command-line-tests' into next 4e107ff0 fixup! Tests: Move more command line tests into RunCMake.CommandLine http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e107ff0b866b918959a9c7a0c792795ade4896e commit 4e107ff0b866b918959a9c7a0c792795ade4896e Author: Brad King AuthorDate: Fri Apr 10 14:52:20 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 14:53:04 2015 -0400 fixup! Tests: Move more command line tests into RunCMake.CommandLine diff --git a/Tests/RunCMake/CommandLine/G_bad-arg-result.txt b/Tests/RunCMake/CommandLine/G_bad-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/G_bad-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt b/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt new file mode 100644 index 0000000..511208f --- /dev/null +++ b/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Could not create named generator NoSuchGenerator$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 77f4fda..f047baf 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -13,6 +13,7 @@ run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename) run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate) run_cmake_command(G_no-arg ${CMAKE_COMMAND} -G) +run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -G NoSuchGenerator) run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P) run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake) ----------------------------------------------------------------------- Summary of changes: .../CMP0004-NEW-result.txt => CommandLine/G_bad-arg-result.txt} | 0 Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt | 1 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 1 + 3 files changed, 2 insertions(+) copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/G_bad-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 14:57:01 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 14:57:01 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1724-g27d475c Message-ID: <20150410185701.7B0DFAEAAF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 27d475ce6dec85fe6c3ce108cc859608fd1bd3ac (commit) via 4e039a9a9814fd13142ae2c9876420ddf2414b8e (commit) from ac895eb1956eb72844cb669341307de0a8256f37 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27d475ce6dec85fe6c3ce108cc859608fd1bd3ac commit 27d475ce6dec85fe6c3ce108cc859608fd1bd3ac Merge: ac895eb 4e039a9 Author: Brad King AuthorDate: Fri Apr 10 14:57:00 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 14:57:00 2015 -0400 Merge topic 'move-command-line-tests' into next 4e039a9a Tests: Move more command line tests into RunCMake.CommandLine http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e039a9a9814fd13142ae2c9876420ddf2414b8e commit 4e039a9a9814fd13142ae2c9876420ddf2414b8e Author: Brad King AuthorDate: Fri Apr 10 11:52:16 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 14:56:41 2015 -0400 Tests: Move more command line tests into RunCMake.CommandLine Port most CMakeTestBadCommandLines test cases to RunCMake.CommandLine and drop the former test. Add validation of expected results, which was not done by the old test. diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index aa6a993..1e60abe 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1095,21 +1095,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators") endif() - if(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines) - set(CTEST_RUN_CMakeTestBadCommandLines ON) - endif() - - if(CTEST_RUN_CMakeTestBadCommandLines) - add_test(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND} - -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines - -D gen=${CMAKE_GENERATOR} - -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} - -P ${CMake_SOURCE_DIR}/Tests/CMakeTestBadCommandLines/RunCMake.cmake - ) - list(APPEND TEST_BUILD_DIRS - "${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines") - endif() - if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) set(CTEST_RUN_CMakeTestMultipleConfigures ON) endif() diff --git a/Tests/CMakeTestBadCommandLines/RunCMake.cmake b/Tests/CMakeTestBadCommandLines/RunCMake.cmake deleted file mode 100644 index 08549cc..0000000 --- a/Tests/CMakeTestBadCommandLines/RunCMake.cmake +++ /dev/null @@ -1,79 +0,0 @@ -if(NOT DEFINED CMake_SOURCE_DIR) - message(FATAL_ERROR "CMake_SOURCE_DIR not defined") -endif() - -if(NOT DEFINED dir) - message(FATAL_ERROR "dir not defined") -endif() - -if(NOT DEFINED gen) - message(FATAL_ERROR "gen not defined") -endif() - -message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") - -# First setup a source tree to run CMake on. -# -execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMake_SOURCE_DIR}/Tests/CTestTest/SmallAndFast - ${dir}/Source -) - -execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory - ${dir}/Build - ) - -function(RunCMakeWithArgs) - message(STATUS "info: running cmake with ARGN='${ARGN}'") - - execute_process(COMMAND ${CMAKE_COMMAND} ${ARGN} - RESULT_VARIABLE result - OUTPUT_VARIABLE stdout - ERROR_VARIABLE stderr - WORKING_DIRECTORY ${dir}/Build - ) - - message(STATUS "result='${result}'") - message(STATUS "stdout='${stdout}'") - message(STATUS "stderr='${stderr}'") - message(STATUS "") -endfunction() - -# Run cmake once with no errors to get a good build tree: -# -RunCMakeWithArgs(-G ${gen} ../Source) - -# Run cmake with args that produce some sort of problem to cover the error -# cases in cmake.cxx... -# -# (These are not good examples of cmake command lines. Do not copy and -# paste them elsewhere and expect them to work... See the cmake -# documentation or other real examples of usage instead.) -# -RunCMakeWithArgs() -RunCMakeWithArgs(-C) -RunCMakeWithArgs(-C nosuchcachefile.txt) -RunCMakeWithArgs(--check-stamp-file nostampfile) -RunCMakeWithArgs(--check-stamp-list nostamplist) -RunCMakeWithArgs(nosuchsubdir/CMakeCache.txt) -RunCMakeWithArgs(nosuchsubdir/CMakeLists.txt) -RunCMakeWithArgs(-D) -RunCMakeWithArgs(--debug-output .) -RunCMakeWithArgs(--debug-trycompile .) -RunCMakeWithArgs(-E) -RunCMakeWithArgs(-E create_symlink) -RunCMakeWithArgs(-E echo_append) -RunCMakeWithArgs(-E rename) -RunCMakeWithArgs(-E touch_nocreate) -RunCMakeWithArgs(-G) -RunCMakeWithArgs(--graphviz= ../Source) -RunCMakeWithArgs(--graphviz=g.dot .) -RunCMakeWithArgs(-P) -RunCMakeWithArgs(-P nosuchscriptfile.cmake) -RunCMakeWithArgs(--trace .) -RunCMakeWithArgs(-U) -RunCMakeWithArgs(-U nosuchvariable .) -RunCMakeWithArgs(-V) -RunCMakeWithArgs(-V .) -RunCMakeWithArgs(-Wno-dev .) -RunCMakeWithArgs(-Wdev .) diff --git a/Tests/RunCMake/CommandLine/C-no-arg-result.txt b/Tests/RunCMake/CommandLine/C-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/C-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt new file mode 100644 index 0000000..0570d8f --- /dev/null +++ b/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: -C must be followed by a file name. +CMake Error: Problem processing arguments. Aborting.$ diff --git a/Tests/RunCMake/CommandLine/C-no-file-result.txt b/Tests/RunCMake/CommandLine/C-no-file-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/C-no-file-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/C-no-file-stderr.txt b/Tests/RunCMake/CommandLine/C-no-file-stderr.txt new file mode 100644 index 0000000..5315f59 --- /dev/null +++ b/Tests/RunCMake/CommandLine/C-no-file-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: Error processing file: nosuchcachefile.txt +CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/C-no-file-build/nosuchcachefile.txt" does not exist. +Specify --help for usage, or press the help button on the CMake GUI.$ diff --git a/Tests/RunCMake/CommandLine/D-no-arg-result.txt b/Tests/RunCMake/CommandLine/D-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/D-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt new file mode 100644 index 0000000..5e43bca --- /dev/null +++ b/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: -D must be followed with VAR=VALUE. +CMake Error: Problem processing arguments. Aborting.$ diff --git a/Tests/RunCMake/CommandLine/E-no-arg-result.txt b/Tests/RunCMake/CommandLine/E-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt new file mode 100644 index 0000000..056ce05 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: cmake version .* +Usage: .* -E \[command\] \[arguments ...\] +Available commands: diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-result.txt b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt new file mode 100644 index 0000000..056ce05 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: cmake version .* +Usage: .* -E \[command\] \[arguments ...\] +Available commands: diff --git a/Tests/RunCMake/CommandLine/E_rename-no-arg-result.txt b/Tests/RunCMake/CommandLine/E_rename-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rename-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt new file mode 100644 index 0000000..056ce05 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: cmake version .* +Usage: .* -E \[command\] \[arguments ...\] +Available commands: diff --git a/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-result.txt b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt new file mode 100644 index 0000000..056ce05 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: cmake version .* +Usage: .* -E \[command\] \[arguments ...\] +Available commands: diff --git a/Tests/RunCMake/CommandLine/G_bad-arg-result.txt b/Tests/RunCMake/CommandLine/G_bad-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/G_bad-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt b/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt new file mode 100644 index 0000000..511208f --- /dev/null +++ b/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Could not create named generator NoSuchGenerator$ diff --git a/Tests/RunCMake/CommandLine/G_no-arg-result.txt b/Tests/RunCMake/CommandLine/G_no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/G_no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt b/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt new file mode 100644 index 0000000..56d23c2 --- /dev/null +++ b/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt @@ -0,0 +1 @@ +^CMake Error: No generator specified for -G$ diff --git a/Tests/RunCMake/CommandLine/NoArgs-stdout.txt b/Tests/RunCMake/CommandLine/NoArgs-stdout.txt new file mode 100644 index 0000000..1cd3469 --- /dev/null +++ b/Tests/RunCMake/CommandLine/NoArgs-stdout.txt @@ -0,0 +1,10 @@ +^Usage + + cmake \[options\] + cmake \[options\] + +Specify a source directory to \(re-\)generate a build system for it in the +current working directory. Specify an existing build directory to +re-generate its build system. + +Run 'cmake --help' for more information.$ diff --git a/Tests/RunCMake/CommandLine/P_no-arg-result.txt b/Tests/RunCMake/CommandLine/P_no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/P_no-arg-stderr.txt b/Tests/RunCMake/CommandLine/P_no-arg-stderr.txt new file mode 100644 index 0000000..8af3a53 --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_no-arg-stderr.txt @@ -0,0 +1 @@ +^CMake Error: No script specified for argument -P$ diff --git a/Tests/RunCMake/CommandLine/P_no-file-result.txt b/Tests/RunCMake/CommandLine/P_no-file-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_no-file-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/P_no-file-stderr.txt b/Tests/RunCMake/CommandLine/P_no-file-stderr.txt new file mode 100644 index 0000000..2e12399 --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_no-file-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Error processing file: nosuchscriptfile.cmake$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index f879ee6..f047baf 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,5 +1,22 @@ include(RunCMake) +run_cmake_command(NoArgs ${CMAKE_COMMAND}) +run_cmake_command(C-no-arg ${CMAKE_COMMAND} -C) +run_cmake_command(C-no-file ${CMAKE_COMMAND} -C nosuchcachefile.txt) +run_cmake_command(cache-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeCache.txt) +run_cmake_command(lists-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeLists.txt) +run_cmake_command(D-no-arg ${CMAKE_COMMAND} -D) +run_cmake_command(U-no-arg ${CMAKE_COMMAND} -U) +run_cmake_command(E-no-arg ${CMAKE_COMMAND} -E) +run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append) +run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename) +run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate) + +run_cmake_command(G_no-arg ${CMAKE_COMMAND} -G) +run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -G NoSuchGenerator) +run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P) +run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake) + run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) run_cmake_command(build-no-generator @@ -24,6 +41,9 @@ if(RunCMake_GENERATOR STREQUAL "Ninja") endif() if(UNIX) + run_cmake_command(E_create_symlink-no-arg + ${CMAKE_COMMAND} -E create_symlink + ) run_cmake_command(E_create_symlink-missing-dir ${CMAKE_COMMAND} -E create_symlink T missing-dir/L ) @@ -70,6 +90,26 @@ set(RunCMake_TEST_OPTIONS "-DFOO:STRING=-DBAR:BOOL=BAZ") run_cmake(D_typed_nested_cache) +set(RunCMake_TEST_OPTIONS -Wno-dev) +run_cmake(Wno-dev) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS -Wno-dev -Wdev) +run_cmake(Wdev) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS --debug-output) +run_cmake(debug-output) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS --trace) +run_cmake(trace) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS --debug-trycompile) +run_cmake(debug-trycompile) +unset(RunCMake_TEST_OPTIONS) + function(run_cmake_depends) set(RunCMake_TEST_SOURCE_DIR "${RunCMake_SOURCE_DIR}/cmake_depends") set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/cmake_depends-build") diff --git a/Tests/RunCMake/CommandLine/U-no-arg-result.txt b/Tests/RunCMake/CommandLine/U-no-arg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/U-no-arg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt new file mode 100644 index 0000000..c34ef94 --- /dev/null +++ b/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: -U must be followed with VAR. +CMake Error: Problem processing arguments. Aborting.$ diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt new file mode 100644 index 0000000..f427303 --- /dev/null +++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt @@ -0,0 +1,5 @@ +^CMake Warning \(dev\) at Wdev.cmake:1 \(message\): + Some Author Warning +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake b/Tests/RunCMake/CommandLine/Wdev.cmake new file mode 100644 index 0000000..0242086 --- /dev/null +++ b/Tests/RunCMake/CommandLine/Wdev.cmake @@ -0,0 +1 @@ +message(AUTHOR_WARNING "Some Author Warning") diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake b/Tests/RunCMake/CommandLine/Wno-dev.cmake new file mode 100644 index 0000000..0242086 --- /dev/null +++ b/Tests/RunCMake/CommandLine/Wno-dev.cmake @@ -0,0 +1 @@ +message(AUTHOR_WARNING "Some Author Warning") diff --git a/Tests/RunCMake/CommandLine/cache-no-file-result.txt b/Tests/RunCMake/CommandLine/cache-no-file-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-no-file-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/cache-no-file-stderr.txt b/Tests/RunCMake/CommandLine/cache-no-file-stderr.txt new file mode 100644 index 0000000..da3a0c3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cache-no-file-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/cache-no-file-build/nosuchsubdir" does not exist. +Specify --help for usage, or press the help button on the CMake GUI.$ diff --git a/Tests/RunCMake/CommandLine/debug-output-stdout.txt b/Tests/RunCMake/CommandLine/debug-output-stdout.txt new file mode 100644 index 0000000..96f2aae --- /dev/null +++ b/Tests/RunCMake/CommandLine/debug-output-stdout.txt @@ -0,0 +1 @@ +Running with debug output on. diff --git a/Tests/RunCMake/CommandLine/debug-output.cmake b/Tests/RunCMake/CommandLine/debug-output.cmake new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CommandLine/debug-trycompile.cmake b/Tests/RunCMake/CommandLine/debug-trycompile.cmake new file mode 100644 index 0000000..a3835a7 --- /dev/null +++ b/Tests/RunCMake/CommandLine/debug-trycompile.cmake @@ -0,0 +1,5 @@ +enable_language(C) +# Look for a source tree left by enable_language internal checks. +if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeTmp/CMakeLists.txt) + message(FATAL_ERROR "--debug-trycompile should leave the source behind") +endif() diff --git a/Tests/RunCMake/CommandLine/lists-no-file-result.txt b/Tests/RunCMake/CommandLine/lists-no-file-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/lists-no-file-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/lists-no-file-stderr.txt b/Tests/RunCMake/CommandLine/lists-no-file-stderr.txt new file mode 100644 index 0000000..3465e89 --- /dev/null +++ b/Tests/RunCMake/CommandLine/lists-no-file-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/lists-no-file-build/nosuchsubdir" does not exist. +Specify --help for usage, or press the help button on the CMake GUI.$ diff --git a/Tests/RunCMake/CommandLine/trace-stderr.txt b/Tests/RunCMake/CommandLine/trace-stderr.txt new file mode 100644 index 0000000..8e8ddfa --- /dev/null +++ b/Tests/RunCMake/CommandLine/trace-stderr.txt @@ -0,0 +1,2 @@ +^.*/Tests/RunCMake/CommandLine/CMakeLists.txt\(1\): cmake_minimum_required\(VERSION 3.0 \) +.*/Tests/RunCMake/CommandLine/CMakeLists.txt\(2\): project\(\${RunCMake_TEST} NONE \) diff --git a/Tests/RunCMake/CommandLine/trace.cmake b/Tests/RunCMake/CommandLine/trace.cmake new file mode 100644 index 0000000..e69de29 ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 14:59:21 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 14:59:21 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1726-gf9b2ab2 Message-ID: <20150410185921.2DD9DAEAEE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f9b2ab214fb8041b3c8741e72f73a7bc360d3727 (commit) via d4e3882abbf16e862743ffe20af3f183b1806956 (commit) from 27d475ce6dec85fe6c3ce108cc859608fd1bd3ac (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f9b2ab214fb8041b3c8741e72f73a7bc360d3727 commit f9b2ab214fb8041b3c8741e72f73a7bc360d3727 Merge: 27d475c d4e3882 Author: Brad King AuthorDate: Fri Apr 10 14:59:20 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 14:59:20 2015 -0400 Merge topic 'cmake-G-print-generators' into next d4e3882a cmake: Provide guidance when an invalid -G option is given diff --cc Source/cmake.h index bbeb95d,0715d74..c8d46b6 --- a/Source/cmake.h +++ b/Source/cmake.h @@@ -480,9 -475,10 +480,12 @@@ private std::vector DebugConfigs; InstalledFilesMap InstalledFiles; + cmState* State; + void UpdateConversionPathTable(); + + // Print a list of valid generators to stderr. + void PrintGeneratorList(); }; #define CMAKE_STANDARD_OPTIONS_TABLE \ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4e3882abbf16e862743ffe20af3f183b1806956 commit d4e3882abbf16e862743ffe20af3f183b1806956 Author: Gerald Combs AuthorDate: Sun Mar 29 11:28:30 2015 -0700 Commit: Brad King CommitDate: Fri Apr 10 14:57:06 2015 -0400 cmake: Provide guidance when an invalid -G option is given Print a list of generators if no generator or an invalid one is supplied. Signed-off-by: Gerald Combs diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 8c17536..4f34755 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -138,6 +138,8 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os) return this->PrintHelpListVariables(os); case cmDocumentation::ListPolicies: return this->PrintHelpListPolicies(os); + case cmDocumentation::ListGenerators: + return this->PrintHelpListGenerators(os); case cmDocumentation::Version: return this->PrintVersion(os); case cmDocumentation::OldCustomModules: @@ -817,6 +819,19 @@ bool cmDocumentation::PrintHelpListPolicies(std::ostream& os) } //---------------------------------------------------------------------------- +bool cmDocumentation::PrintHelpListGenerators(std::ostream& os) +{ + std::map::iterator si; + si = this->AllSections.find("Generators"); + if(si != this->AllSections.end()) + { + this->Formatter.SetIndent(" "); + this->Formatter.PrintSection(os, *si->second); + } + return true; +} + +//---------------------------------------------------------------------------- bool cmDocumentation::PrintHelpOneVariable(std::ostream& os) { std::string vname = cmSystemTools::HelpFileName(this->CurrentArgument); diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index b72b5fe..8854c36 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -117,6 +117,7 @@ private: bool PrintHelpListProperties(std::ostream& os); bool PrintHelpListVariables(std::ostream& os); bool PrintHelpListPolicies(std::ostream& os); + bool PrintHelpListGenerators(std::ostream& os); bool PrintOldCustomModules(std::ostream& os); const char* GetNameString() const; diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index 59513cc..6e19b7d 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -26,8 +26,8 @@ public: /** Types of help provided. */ enum Type { - None, Version, Usage, Help, Full, ListManuals, - ListCommands, ListModules, ListProperties, ListVariables, ListPolicies, + None, Version, Usage, Help, Full, ListManuals, ListCommands, + ListModules, ListProperties, ListVariables, ListPolicies, ListGenerators, OneManual, OneCommand, OneModule, OneProperty, OneVariable, OnePolicy, OldCustomModules }; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7595155..6d75e29 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -818,6 +818,7 @@ void cmake::SetArgs(const std::vector& args, if(i >= args.size()) { cmSystemTools::Error("No generator specified for -G"); + this->PrintGeneratorList(); return; } value = args[i]; @@ -828,6 +829,7 @@ void cmake::SetArgs(const std::vector& args, { cmSystemTools::Error("Could not create named generator ", value.c_str()); + this->PrintGeneratorList(); } else { @@ -1961,6 +1963,16 @@ void cmake::GetGeneratorDocumentation(std::vector& v) } } +void cmake::PrintGeneratorList() +{ + cmDocumentation doc; + std::vector generators; + this->GetGeneratorDocumentation(generators); + doc.AppendSection("Generators",generators); + std::cerr << "\n"; + doc.PrintDocumentation(cmDocumentation::ListGenerators, std::cerr); +} + void cmake::UpdateConversionPathTable() { // Update the path conversion table with any specified file: @@ -2438,6 +2450,7 @@ int cmake::GetSystemInformation(std::vector& args) if(i >= args.size()) { cmSystemTools::Error("No generator specified for -G"); + this->PrintGeneratorList(); return -1; } value = args[i]; @@ -2448,6 +2461,7 @@ int cmake::GetSystemInformation(std::vector& args) { cmSystemTools::Error("Could not create named generator ", value.c_str()); + this->PrintGeneratorList(); } else { diff --git a/Source/cmake.h b/Source/cmake.h index 3acf4a8..0715d74 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -476,6 +476,9 @@ private: InstalledFilesMap InstalledFiles; void UpdateConversionPathTable(); + + // Print a list of valid generators to stderr. + void PrintGeneratorList(); }; #define CMAKE_STANDARD_OPTIONS_TABLE \ diff --git a/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt b/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt index 511208f..07f2b52 100644 --- a/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt +++ b/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt @@ -1 +1,3 @@ -^CMake Error: Could not create named generator NoSuchGenerator$ +^CMake Error: Could not create named generator NoSuchGenerator + +Generators diff --git a/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt b/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt index 56d23c2..2f491a2 100644 --- a/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt +++ b/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt @@ -1 +1,3 @@ -^CMake Error: No generator specified for -G$ +^CMake Error: No generator specified for -G + +Generators ----------------------------------------------------------------------- Summary of changes: Source/cmDocumentation.cxx | 15 +++++++++++++++ Source/cmDocumentation.h | 1 + Source/cmDocumentationFormatter.h | 4 ++-- Source/cmake.cxx | 14 ++++++++++++++ Source/cmake.h | 3 +++ Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt | 4 +++- Tests/RunCMake/CommandLine/G_no-arg-stderr.txt | 4 +++- 7 files changed, 41 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 15:14:29 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 15:14:29 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1728-gfb490a0 Message-ID: <20150410191429.AA8FAAE2A1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fb490a0931b759dac420a178747f93e0c56b35c5 (commit) via 68a8dff804d3e1e4b4b47d850a1cca5a13393c70 (commit) from f9b2ab214fb8041b3c8741e72f73a7bc360d3727 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fb490a0931b759dac420a178747f93e0c56b35c5 commit fb490a0931b759dac420a178747f93e0c56b35c5 Merge: f9b2ab2 68a8dff Author: Brad King AuthorDate: Fri Apr 10 15:14:28 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 15:14:28 2015 -0400 Merge topic 'cmake-G-print-generators' into next 68a8dff8 fixup! cmake: Provide guidance when an invalid -G option is given http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68a8dff804d3e1e4b4b47d850a1cca5a13393c70 commit 68a8dff804d3e1e4b4b47d850a1cca5a13393c70 Author: Brad King AuthorDate: Fri Apr 10 15:14:09 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 15:14:09 2015 -0400 fixup! cmake: Provide guidance when an invalid -G option is given diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 6d75e29..3654aa7 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1965,12 +1965,14 @@ void cmake::GetGeneratorDocumentation(std::vector& v) void cmake::PrintGeneratorList() { +#ifdef CMAKE_BUILD_WITH_CMAKE cmDocumentation doc; std::vector generators; this->GetGeneratorDocumentation(generators); doc.AppendSection("Generators",generators); std::cerr << "\n"; doc.PrintDocumentation(cmDocumentation::ListGenerators, std::cerr); +#endif } void cmake::UpdateConversionPathTable() ----------------------------------------------------------------------- Summary of changes: Source/cmake.cxx | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 15:14:48 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 15:14:48 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1730-g35db5e8 Message-ID: <20150410191448.992CBAE2F0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 35db5e8519ba4a6859d61c7861d06e8516bb7e0f (commit) via 588dcb33b7ff089a84ce5cbacf2696b4a3646b42 (commit) from fb490a0931b759dac420a178747f93e0c56b35c5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=35db5e8519ba4a6859d61c7861d06e8516bb7e0f commit 35db5e8519ba4a6859d61c7861d06e8516bb7e0f Merge: fb490a0 588dcb3 Author: Brad King AuthorDate: Fri Apr 10 15:14:47 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 15:14:47 2015 -0400 Merge topic 'cmake-G-print-generators' into next 588dcb33 cmake: Provide guidance when an invalid -G option is given http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=588dcb33b7ff089a84ce5cbacf2696b4a3646b42 commit 588dcb33b7ff089a84ce5cbacf2696b4a3646b42 Author: Gerald Combs AuthorDate: Sun Mar 29 11:28:30 2015 -0700 Commit: Brad King CommitDate: Fri Apr 10 15:14:34 2015 -0400 cmake: Provide guidance when an invalid -G option is given Print a list of generators if no generator or an invalid one is supplied. Signed-off-by: Gerald Combs diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 8c17536..4f34755 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -138,6 +138,8 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os) return this->PrintHelpListVariables(os); case cmDocumentation::ListPolicies: return this->PrintHelpListPolicies(os); + case cmDocumentation::ListGenerators: + return this->PrintHelpListGenerators(os); case cmDocumentation::Version: return this->PrintVersion(os); case cmDocumentation::OldCustomModules: @@ -817,6 +819,19 @@ bool cmDocumentation::PrintHelpListPolicies(std::ostream& os) } //---------------------------------------------------------------------------- +bool cmDocumentation::PrintHelpListGenerators(std::ostream& os) +{ + std::map::iterator si; + si = this->AllSections.find("Generators"); + if(si != this->AllSections.end()) + { + this->Formatter.SetIndent(" "); + this->Formatter.PrintSection(os, *si->second); + } + return true; +} + +//---------------------------------------------------------------------------- bool cmDocumentation::PrintHelpOneVariable(std::ostream& os) { std::string vname = cmSystemTools::HelpFileName(this->CurrentArgument); diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index b72b5fe..8854c36 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -117,6 +117,7 @@ private: bool PrintHelpListProperties(std::ostream& os); bool PrintHelpListVariables(std::ostream& os); bool PrintHelpListPolicies(std::ostream& os); + bool PrintHelpListGenerators(std::ostream& os); bool PrintOldCustomModules(std::ostream& os); const char* GetNameString() const; diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index 59513cc..6e19b7d 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -26,8 +26,8 @@ public: /** Types of help provided. */ enum Type { - None, Version, Usage, Help, Full, ListManuals, - ListCommands, ListModules, ListProperties, ListVariables, ListPolicies, + None, Version, Usage, Help, Full, ListManuals, ListCommands, + ListModules, ListProperties, ListVariables, ListPolicies, ListGenerators, OneManual, OneCommand, OneModule, OneProperty, OneVariable, OnePolicy, OldCustomModules }; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7595155..3654aa7 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -818,6 +818,7 @@ void cmake::SetArgs(const std::vector& args, if(i >= args.size()) { cmSystemTools::Error("No generator specified for -G"); + this->PrintGeneratorList(); return; } value = args[i]; @@ -828,6 +829,7 @@ void cmake::SetArgs(const std::vector& args, { cmSystemTools::Error("Could not create named generator ", value.c_str()); + this->PrintGeneratorList(); } else { @@ -1961,6 +1963,18 @@ void cmake::GetGeneratorDocumentation(std::vector& v) } } +void cmake::PrintGeneratorList() +{ +#ifdef CMAKE_BUILD_WITH_CMAKE + cmDocumentation doc; + std::vector generators; + this->GetGeneratorDocumentation(generators); + doc.AppendSection("Generators",generators); + std::cerr << "\n"; + doc.PrintDocumentation(cmDocumentation::ListGenerators, std::cerr); +#endif +} + void cmake::UpdateConversionPathTable() { // Update the path conversion table with any specified file: @@ -2438,6 +2452,7 @@ int cmake::GetSystemInformation(std::vector& args) if(i >= args.size()) { cmSystemTools::Error("No generator specified for -G"); + this->PrintGeneratorList(); return -1; } value = args[i]; @@ -2448,6 +2463,7 @@ int cmake::GetSystemInformation(std::vector& args) { cmSystemTools::Error("Could not create named generator ", value.c_str()); + this->PrintGeneratorList(); } else { diff --git a/Source/cmake.h b/Source/cmake.h index 3acf4a8..0715d74 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -476,6 +476,9 @@ private: InstalledFilesMap InstalledFiles; void UpdateConversionPathTable(); + + // Print a list of valid generators to stderr. + void PrintGeneratorList(); }; #define CMAKE_STANDARD_OPTIONS_TABLE \ diff --git a/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt b/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt index 511208f..07f2b52 100644 --- a/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt +++ b/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt @@ -1 +1,3 @@ -^CMake Error: Could not create named generator NoSuchGenerator$ +^CMake Error: Could not create named generator NoSuchGenerator + +Generators diff --git a/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt b/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt index 56d23c2..2f491a2 100644 --- a/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt +++ b/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt @@ -1 +1,3 @@ -^CMake Error: No generator specified for -G$ +^CMake Error: No generator specified for -G + +Generators ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 10 16:27:07 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 10 Apr 2015 16:27:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1732-g5c86b23 Message-ID: <20150410202707.0765EAEBE4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5c86b23872900b30ed05b566f4d90b48e3c2873e (commit) via 5ee33f5b153921b8e9d8e91e3f92d0ee01a3fc9a (commit) from 35db5e8519ba4a6859d61c7861d06e8516bb7e0f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c86b23872900b30ed05b566f4d90b48e3c2873e commit 5c86b23872900b30ed05b566f4d90b48e3c2873e Merge: 35db5e8 5ee33f5 Author: Brad King AuthorDate: Fri Apr 10 16:27:06 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 10 16:27:06 2015 -0400 Merge topic 'custom-command-multiple-outputs' into next 5ee33f5b fixup! Makefile: Fix multiple custom command outputs with one missing http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ee33f5b153921b8e9d8e91e3f92d0ee01a3fc9a commit 5ee33f5b153921b8e9d8e91e3f92d0ee01a3fc9a Author: Brad King AuthorDate: Fri Apr 10 16:22:44 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 16:22:44 2015 -0400 fixup! Makefile: Fix multiple custom command outputs with one missing diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 0b1ff2c..2be59b6 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -42,6 +42,11 @@ list(APPEND _cmake_options "-DTEST_LINK_DEPENDS=${TEST_LINK_DEPENDS}") list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1") +if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^6789]|[6789][0-9])") + set(TEST_MULTI3 1) + list(APPEND _cmake_options "-DTEST_MULTI3=1") +endif() + file(MAKE_DIRECTORY ${BuildDepends_BINARY_DIR}/Project) message("Creating Project/foo.cxx") write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx @@ -67,6 +72,7 @@ set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_dep file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external original\n") file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in original\n") file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp original\n") +file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt "multi3-stamp original\n") help_xcode_depends() @@ -192,17 +198,32 @@ else() "multi1-out2-copy.txt is missing") endif() -if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-out1.txt) - if(${BuildDepends_BINARY_DIR}/Project/multi2-out1.txt +if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt) + if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt) - message(STATUS "multi2-out1.txt is newer than multi2-stamp.txt") + message(STATUS "multi2-real.txt is newer than multi2-stamp.txt") else() message(SEND_ERROR "Project did not initially build properly: " - "multi2-out1.txt is not newer than multi2-stamp.txt") + "multi2-real.txt is not newer than multi2-stamp.txt") endif() else() message(SEND_ERROR "Project did not initially build properly: " - "multi2-out1.txt is missing") + "multi2-real.txt is missing") +endif() + +if(TEST_MULTI3) + if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt) + if(${BuildDepends_BINARY_DIR}/Project/multi3-real.txt + IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt) + message(STATUS "multi3-real.txt is newer than multi3-stamp.txt") + else() + message(SEND_ERROR "Project did not initially build properly: " + "multi3-real.txt is not newer than multi3-stamp.txt") + endif() + else() + message(SEND_ERROR "Project did not initially build properly: " + "multi3-real.txt is missing") + endif() endif() message("Waiting 3 seconds...") @@ -232,6 +253,7 @@ endif() file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external changed\n") file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in changed\n") file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp changed\n") +file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt "multi3-stamp changed\n") help_xcode_depends() @@ -363,15 +385,30 @@ else() "multi1-out2-copy.txt is missing") endif() -if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-out1.txt) - if(${BuildDepends_BINARY_DIR}/Project/multi2-out1.txt +if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt) + if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt) - message(STATUS "multi2-out1.txt is newer than multi2-stamp.txt") + message(STATUS "multi2-real.txt is newer than multi2-stamp.txt") else() message(SEND_ERROR "Project did not rebuild properly: " - "multi2-out1.txt is not newer than multi2-stamp.txt") + "multi2-real.txt is not newer than multi2-stamp.txt") endif() else() message(SEND_ERROR "Project did not rebuild properly: " - "multi2-out1.txt is missing") + "multi2-real.txt is missing") +endif() + +if(TEST_MULTI3) + if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt) + if(${BuildDepends_BINARY_DIR}/Project/multi3-real.txt + IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt) + message(STATUS "multi3-real.txt is newer than multi3-stamp.txt") + else() + message(SEND_ERROR "Project did not rebuild properly: " + "multi3-real.txt is not newer than multi3-stamp.txt") + endif() + else() + message(SEND_ERROR "Project did not rebuild properly: " + "multi3-real.txt is missing") + endif() endif() diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index 9b2b5aa..0db39c5 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -165,9 +165,20 @@ add_custom_command( ) add_custom_target(multi1 ALL DEPENDS multi1-out2-copy.txt) +# Test having the first output never created. add_custom_command( - OUTPUT multi2-out1.txt multi2-out2.txt - COMMAND ${CMAKE_COMMAND} -E touch multi2-out1.txt + OUTPUT multi2-dummy.txt multi2-real.txt + COMMAND ${CMAKE_COMMAND} -E touch multi2-real.txt ) -set_property(SOURCE multi2-out1.txt multi2-out2.txt PROPERTY SYMBOLIC 1) -add_custom_target(multi2 ALL DEPENDS multi2-out1.txt) +set_property(SOURCE multi2-real.txt multi2-dummy.txt PROPERTY SYMBOLIC 1) +add_custom_target(multi2 ALL DEPENDS multi2-real.txt) + +if(TEST_MULTI3) + # Test having the second output never created. Does not work with msbuild. + add_custom_command( + OUTPUT multi3-real.txt multi3-dummy.txt + COMMAND ${CMAKE_COMMAND} -E touch multi3-real.txt + ) + set_property(SOURCE multi3-real.txt multi3-dummy.txt PROPERTY SYMBOLIC 1) + add_custom_target(multi3 ALL DEPENDS multi3-real.txt) +endif() ----------------------------------------------------------------------- Summary of changes: Tests/BuildDepends/CMakeLists.txt | 57 ++++++++++++++++++++++++----- Tests/BuildDepends/Project/CMakeLists.txt | 19 ++++++++-- 2 files changed, 62 insertions(+), 14 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Apr 11 00:01:16 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 11 Apr 2015 00:01:16 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-715-g18b58b6 Message-ID: <20150411040116.A3F7FAEAB6@public.kitware.com> This is an automated email from 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 18b58b618ccfb3b3fc56935b64a8fa2139b8398a (commit) from 10859b97ebbe610a829e3981958d7b4c0149f95a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18b58b618ccfb3b3fc56935b64a8fa2139b8398a commit 18b58b618ccfb3b3fc56935b64a8fa2139b8398a Author: Kitware Robot AuthorDate: Sat Apr 11 00:01:13 2015 -0400 Commit: Kitware Robot CommitDate: Sat Apr 11 00:01:13 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 5266690..6de0439 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150410) +set(CMake_VERSION_PATCH 20150411) #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 Apr 11 10:52:30 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 11 Apr 2015 10:52:30 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1734-gbe2570d Message-ID: <20150411145230.39881AE92C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via be2570d2726ced4c5f62f63d098a5c363afd9dd2 (commit) via 60fdb9ad9768e9e08f435fe548d554a858330c8e (commit) from 5c86b23872900b30ed05b566f4d90b48e3c2873e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=be2570d2726ced4c5f62f63d098a5c363afd9dd2 commit be2570d2726ced4c5f62f63d098a5c363afd9dd2 Merge: 5c86b23 60fdb9a Author: Stephen Kelly AuthorDate: Sat Apr 11 10:52:29 2015 -0400 Commit: CMake Topic Stage CommitDate: Sat Apr 11 10:52:29 2015 -0400 Merge topic 'introduce-cmState' into next 60fdb9ad fixup! Introduce cmState class. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60fdb9ad9768e9e08f435fe548d554a858330c8e commit 60fdb9ad9768e9e08f435fe548d554a858330c8e Author: Stephen Kelly AuthorDate: Sat Apr 11 16:52:07 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 11 16:52:07 2015 +0200 fixup! Introduce cmState class. diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 739beb6..7602f63 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -1,4 +1,14 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Stephen Kelly + 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 "cmState.h" #include "cmake.h" diff --git a/Source/cmState.h b/Source/cmState.h index 9f19f8e..f2e8ef5 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -1,4 +1,14 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Stephen Kelly + 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 cmState_h #define cmState_h ----------------------------------------------------------------------- Summary of changes: Source/cmState.cxx | 10 ++++++++++ Source/cmState.h | 10 ++++++++++ 2 files changed, 20 insertions(+) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Apr 12 00:01:05 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 12 Apr 2015 00:01:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-716-ge9e417b Message-ID: <20150412040105.CDFC5AEA26@public.kitware.com> This is an automated email from 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 e9e417b57c85c6901f729c350dca0b01628016f0 (commit) from 18b58b618ccfb3b3fc56935b64a8fa2139b8398a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e9e417b57c85c6901f729c350dca0b01628016f0 commit e9e417b57c85c6901f729c350dca0b01628016f0 Author: Kitware Robot AuthorDate: Sun Apr 12 00:01:04 2015 -0400 Commit: Kitware Robot CommitDate: Sun Apr 12 00:01:04 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 6de0439..349c954 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150411) +set(CMake_VERSION_PATCH 20150412) #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 Apr 12 14:11:33 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 12 Apr 2015 14:11:33 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1759-gb0c18ba Message-ID: <20150412181133.47182AD8B1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b0c18ba6de66445ba3d416fc62e6dc924ad380cf (commit) via 11633c74f2c50beb7dfb13f652fccfd825296c4c (commit) via d43cb8c314cac91d82fa6f14fc372bd98a59f064 (commit) via 3f17e61518cdea542c98b7ff7a4673b796f20d10 (commit) via 7f4f707f887e3995e5b181620e4748d91a9735c7 (commit) via bdd2251b47a15372f2ff5e93d40ecc3ba332525e (commit) via fa5209354b84e7e9afb05fa377080afa8d6b58d6 (commit) via 5a290149c1e7613eb6bfc6c0f20d4620f5ab2971 (commit) via ac11b599f4ec4d753745ba47b921e10d3ae24703 (commit) via 57dd094eded03a94402b6eecf7027325bd7b5136 (commit) via 6deb43e6c836a61536c3d6e36ca16b51013e9134 (commit) via ecdb1b3bba991c13f3f61c7b00a80b8dd97567b2 (commit) via 04b307b961a34c00f72d9031817ce4f918288701 (commit) via 0f1f324b0dd7147850f923ab266873bd8a4a4353 (commit) via 275185ac2b30b655b53100a129f5d7518ed943ad (commit) via c57f086a81c487fa88c36a785865d27b81e3cb8d (commit) via 23368c9b83cd62724e94d345e3af940b3cda8762 (commit) via 14c70b8c580c519ca38bcd9ba5ca8fc9e7629068 (commit) via 6ed19e615bada326c38a2b27d9378959503094ae (commit) via ade20b433b2ce1cf176bc727a8ed9c47a5f6537e (commit) via 6fb306ea3bbe04b8e4dde8f13eec3e6bdfe35086 (commit) via 7450a2c6ed601dc94f2de410661065554ff8ce12 (commit) via 8c13d7709bb2a254e5927d3df1346d8264ba1bd5 (commit) via 55ecd818f6bf70590d61584a87aae7bba992e26d (commit) via 18b58b618ccfb3b3fc56935b64a8fa2139b8398a (commit) from be2570d2726ced4c5f62f63d098a5c363afd9dd2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0c18ba6de66445ba3d416fc62e6dc924ad380cf commit b0c18ba6de66445ba3d416fc62e6dc924ad380cf Merge: be2570d 11633c7 Author: Stephen Kelly AuthorDate: Sun Apr 12 14:11:30 2015 -0400 Commit: CMake Topic Stage CommitDate: Sun Apr 12 14:11:30 2015 -0400 Merge topic 'cmake-cleanups' into next 11633c74 cmake: Remove confusing duplication. d43cb8c3 cmMakefile: Remove unused method. 3f17e615 cmMakefile: Remove bad comment. 7f4f707f cmMakefile: Internalize setting of CMakeInstance on Properties. bdd2251b cmMakefile: Out-of-line Home directory accessors. fa520935 cmake: Out-of-line Home and Start directory methods. 5a290149 cmake: Fix variable name bugs. ac11b599 cmake: Simplify command clean up loop. 57dd094e Use vector, not list for cmCommand storage. 6deb43e6 Remove some files which do not need to be in BootstrapCommands. ecdb1b3b Add some missing includes. 04b307b9 cmake: Simplify CommandExists method. 0f1f324b cmake: Rename oddly named variables. 275185ac cmake: Constify GetCommand method. c57f086a cmake: Don't lower-case a string needlessly. 23368c9b cmake: Use make_pair instead of Foo::value_type. ... diff --cc Source/cmake.h index c8d46b6,87b771d..e80cc1c --- a/Source/cmake.h +++ b/Source/cmake.h @@@ -477,15 -447,9 +452,14 @@@ private bool DebugTryCompile; cmFileTimeComparison* FileComparison; std::string GraphVizFile; - std::vector DebugConfigs; InstalledFilesMap InstalledFiles; + cmState* State; + void UpdateConversionPathTable(); + + // Print a list of valid generators to stderr. + void PrintGeneratorList(); }; #define CMAKE_STANDARD_OPTIONS_TABLE \ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=11633c74f2c50beb7dfb13f652fccfd825296c4c commit 11633c74f2c50beb7dfb13f652fccfd825296c4c Author: Stephen Kelly AuthorDate: Sun Apr 12 19:22:09 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:10:52 2015 +0200 cmake: Remove confusing duplication. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2efd080..a347072 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -832,12 +832,8 @@ void cmake::SetArgs(const std::vector& args, { this->SetHomeOutputDirectory (cmSystemTools::GetCurrentWorkingDirectory()); - this->SetStartOutputDirectory - (cmSystemTools::GetCurrentWorkingDirectory()); this->SetHomeDirectory (cmSystemTools::GetCurrentWorkingDirectory()); - this->SetStartDirectory - (cmSystemTools::GetCurrentWorkingDirectory()); } this->SetStartDirectory(this->GetHomeDirectory()); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d43cb8c314cac91d82fa6f14fc372bd98a59f064 commit d43cb8c314cac91d82fa6f14fc372bd98a59f064 Author: Stephen Kelly AuthorDate: Sun Apr 12 18:34:12 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:10:52 2015 +0200 cmMakefile: Remove unused method. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ec0a165..35fdd0c 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1676,33 +1676,6 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) } } -void cmMakefile::AddSubDirectory(const std::string& sub, - bool excludeFromAll) -{ - // the source path must be made full if it isn't already - std::string srcPath = sub; - if (!cmSystemTools::FileIsFullPath(srcPath.c_str())) - { - srcPath = this->GetCurrentDirectory(); - srcPath += "/"; - srcPath += sub; - } - - // binary path must be made full if it isn't already - std::string binPath = sub; - if (!cmSystemTools::FileIsFullPath(binPath.c_str())) - { - binPath = this->GetCurrentOutputDirectory(); - binPath += "/"; - binPath += sub; - } - - - this->AddSubDirectory(srcPath, binPath, - excludeFromAll, false); -} - - void cmMakefile::AddSubDirectory(const std::string& srcPath, const std::string& binPath, bool excludeFromAll, diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 823acb1..b78f921 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -281,7 +281,6 @@ public: /** * Add a subdirectory to the build. */ - void AddSubDirectory(const std::string&, bool excludeFromAll=false); void AddSubDirectory(const std::string& fullSrcDir, const std::string& fullBinDir, bool excludeFromAll, http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f17e61518cdea542c98b7ff7a4673b796f20d10 commit 3f17e61518cdea542c98b7ff7a4673b796f20d10 Author: Stephen Kelly AuthorDate: Sun Apr 12 18:47:24 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:10:52 2015 +0200 cmMakefile: Remove bad comment. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 35be1b7..ec0a165 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1658,7 +1658,6 @@ void cmMakefile::InitializeFromParent() void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) { - // copy our variables from the child makefile lg2->GetMakefile()->InitializeFromParent(); lg2->GetMakefile()->MakeStartDirectoriesCurrent(); if (this->GetCMakeInstance()->GetDebugOutput()) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f4f707f887e3995e5b181620e4748d91a9735c7 commit 7f4f707f887e3995e5b181620e4748d91a9735c7 Author: Stephen Kelly AuthorDate: Sun Apr 12 20:10:48 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:10:48 2015 +0200 cmMakefile: Internalize setting of CMakeInstance on Properties. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index e1998e4..c143bce 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -252,7 +252,6 @@ void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg) this->Makefile->SetLocalGenerator(this); // setup the home directories - this->Makefile->GetProperties().SetCMakeInstance(gg->GetCMakeInstance()); this->Makefile->SetHomeDirectory( gg->GetCMakeInstance()->GetHomeDirectory()); this->Makefile->SetHomeOutputDirectory( diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index dea9e46..35be1b7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -741,6 +741,7 @@ void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg) this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$"); #endif + this->Properties.SetCMakeInstance(this->GetCMakeInstance()); this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused(); this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars(); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bdd2251b47a15372f2ff5e93d40ecc3ba332525e commit bdd2251b47a15372f2ff5e93d40ecc3ba332525e Author: Stephen Kelly AuthorDate: Sun Apr 12 20:10:45 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:10:45 2015 +0200 cmMakefile: Out-of-line Home directory accessors. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 34b4621..dea9e46 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3461,6 +3461,11 @@ cmMakefile::LexicalPushPop::~LexicalPushPop() this->Makefile->PopFunctionBlockerBarrier(this->ReportError); } +const char* cmMakefile::GetHomeDirectory() const +{ + return this->cmHomeDirectory.c_str(); +} + void cmMakefile::SetHomeDirectory(const std::string& dir) { this->cmHomeDirectory = dir; @@ -3472,6 +3477,11 @@ void cmMakefile::SetHomeDirectory(const std::string& dir) } } +const char* cmMakefile::GetHomeOutputDirectory() const +{ + return this->HomeOutputDirectory.c_str(); +} + void cmMakefile::SetHomeOutputDirectory(const std::string& lib) { this->HomeOutputDirectory = lib; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5209891..823acb1 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -438,15 +438,9 @@ public: * and going up until it reaches the HomeDirectory. */ void SetHomeDirectory(const std::string& dir); - const char* GetHomeDirectory() const - { - return this->cmHomeDirectory.c_str(); - } + const char* GetHomeDirectory() const; void SetHomeOutputDirectory(const std::string& lib); - const char* GetHomeOutputDirectory() const - { - return this->HomeOutputDirectory.c_str(); - } + const char* GetHomeOutputDirectory() const; //@} /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fa5209354b84e7e9afb05fa377080afa8d6b58d6 commit fa5209354b84e7e9afb05fa377080afa8d6b58d6 Author: Stephen Kelly AuthorDate: Sun Apr 12 20:10:40 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:10:40 2015 +0200 cmake: Out-of-line Home and Start directory methods. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 92c320c..2efd080 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1101,12 +1101,44 @@ void cmake::SetHomeDirectory(const std::string& dir) cmSystemTools::ConvertToUnixSlashes(this->cmHomeDirectory); } +const char* cmake::GetHomeDirectory() const +{ + return this->cmHomeDirectory.c_str(); +} + void cmake::SetHomeOutputDirectory(const std::string& dir) { this->HomeOutputDirectory = dir; cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory); } +const char* cmake::GetHomeOutputDirectory() const +{ + return this->HomeOutputDirectory.c_str(); +} + +const char* cmake::GetStartDirectory() const +{ + return this->cmStartDirectory.c_str(); +} + +void cmake::SetStartDirectory(const std::string& dir) +{ + this->cmStartDirectory = dir; + cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory); +} + +const char* cmake::GetStartOutputDirectory() const +{ + return this->StartOutputDirectory.c_str(); +} + +void cmake::SetStartOutputDirectory(const std::string& dir) +{ + this->StartOutputDirectory = dir; + cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); +} + void cmake::SetGlobalGenerator(cmGlobalGenerator *gg) { if(!gg) diff --git a/Source/cmake.h b/Source/cmake.h index 26ee8fe..87b771d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -113,15 +113,9 @@ class cmake * and going up until it reaches the HomeDirectory. */ void SetHomeDirectory(const std::string& dir); - const char* GetHomeDirectory() const - { - return this->cmHomeDirectory.c_str(); - } + const char* GetHomeDirectory() const; void SetHomeOutputDirectory(const std::string& dir); - const char* GetHomeOutputDirectory() const - { - return this->HomeOutputDirectory.c_str(); - } + const char* GetHomeOutputDirectory() const; //@} //@{ @@ -132,24 +126,10 @@ class cmake * recursing up the tree starting at the StartDirectory and going up until * it reaches the HomeDirectory. */ - void SetStartDirectory(const std::string& dir) - { - this->cmStartDirectory = dir; - cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory); - } - const char* GetStartDirectory() const - { - return this->cmStartDirectory.c_str(); - } - void SetStartOutputDirectory(const std::string& dir) - { - this->StartOutputDirectory = dir; - cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); - } - const char* GetStartOutputDirectory() const - { - return this->StartOutputDirectory.c_str(); - } + void SetStartDirectory(const std::string& dir); + const char* GetStartDirectory() const; + void SetStartOutputDirectory(const std::string& dir); + const char* GetStartOutputDirectory() const; //@} /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5a290149c1e7613eb6bfc6c0f20d4620f5ab2971 commit 5a290149c1e7613eb6bfc6c0f20d4620f5ab2971 Author: Stephen Kelly AuthorDate: Sun Apr 12 19:32:48 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:09:48 2015 +0200 cmake: Fix variable name bugs. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e61cc63..92c320c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1101,9 +1101,9 @@ void cmake::SetHomeDirectory(const std::string& dir) cmSystemTools::ConvertToUnixSlashes(this->cmHomeDirectory); } -void cmake::SetHomeOutputDirectory(const std::string& lib) +void cmake::SetHomeOutputDirectory(const std::string& dir) { - this->HomeOutputDirectory = lib; + this->HomeOutputDirectory = dir; cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory); } diff --git a/Source/cmake.h b/Source/cmake.h index c436c77..26ee8fe 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -117,7 +117,7 @@ class cmake { return this->cmHomeDirectory.c_str(); } - void SetHomeOutputDirectory(const std::string& lib); + void SetHomeOutputDirectory(const std::string& dir); const char* GetHomeOutputDirectory() const { return this->HomeOutputDirectory.c_str(); @@ -141,9 +141,9 @@ class cmake { return this->cmStartDirectory.c_str(); } - void SetStartOutputDirectory(const std::string& lib) + void SetStartOutputDirectory(const std::string& dir) { - this->StartOutputDirectory = lib; + this->StartOutputDirectory = dir; cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); } const char* GetStartOutputDirectory() const http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac11b599f4ec4d753745ba47b921e10d3ae24703 commit ac11b599f4ec4d753745ba47b921e10d3ae24703 Author: Stephen Kelly AuthorDate: Sun Apr 12 10:48:17 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:09:47 2015 +0200 cmake: Simplify command clean up loop. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 1d067a5..e61cc63 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -197,27 +197,16 @@ void cmake::InitializeProperties() void cmake::CleanupCommandsAndMacros() { this->InitializeProperties(); - std::vector commands; for(RegisteredCommandsMap::iterator j = this->Commands.begin(); j != this->Commands.end(); ++j) { - if ( !j->second->IsA("cmMacroHelperCommand") && - !j->second->IsA("cmFunctionHelperCommand")) - { - commands.push_back(j->second); - } - else + if (j->second->IsA("cmMacroHelperCommand") || + j->second->IsA("cmFunctionHelperCommand")) { delete j->second; + this->Commands.erase(j); } } - this->Commands.clear(); - std::vector::iterator it; - for ( it = commands.begin(); it != commands.end(); - ++ it ) - { - this->Commands[cmSystemTools::LowerCase((*it)->GetName())] = *it; - } } bool cmake::CommandExists(const std::string& name) const http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57dd094eded03a94402b6eecf7027325bd7b5136 commit 57dd094eded03a94402b6eecf7027325bd7b5136 Author: Stephen Kelly AuthorDate: Sun Apr 12 02:44:41 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:09:47 2015 +0200 Use vector, not list for cmCommand storage. diff --git a/Source/cmBootstrapCommands1.cxx b/Source/cmBootstrapCommands1.cxx index 1b0abf4..1184514 100644 --- a/Source/cmBootstrapCommands1.cxx +++ b/Source/cmBootstrapCommands1.cxx @@ -55,7 +55,7 @@ #include "cmPathLabel.cxx" #include "cmSearchPath.cxx" -void GetBootstrapCommands1(std::list& commands) +void GetBootstrapCommands1(std::vector& commands) { commands.push_back(new cmAddCustomCommandCommand); commands.push_back(new cmAddCustomTargetCommand); diff --git a/Source/cmBootstrapCommands2.cxx b/Source/cmBootstrapCommands2.cxx index e292a3a..e522d8c 100644 --- a/Source/cmBootstrapCommands2.cxx +++ b/Source/cmBootstrapCommands2.cxx @@ -59,7 +59,7 @@ #include "cmUnsetCommand.cxx" #include "cmWhileCommand.cxx" -void GetBootstrapCommands2(std::list& commands) +void GetBootstrapCommands2(std::vector& commands) { commands.push_back(new cmGetCMakePropertyCommand); commands.push_back(new cmGetDirectoryPropertyCommand); diff --git a/Source/cmCommands.cxx.in b/Source/cmCommands.cxx.in index f0745d7..e23bbd1 100644 --- a/Source/cmCommands.cxx.in +++ b/Source/cmCommands.cxx.in @@ -13,7 +13,7 @@ @COMMAND_INCLUDES@ -void GetPredefinedCommands(std::list& commands) +void GetPredefinedCommands(std::vector& commands) { @NEW_COMMANDS@ } diff --git a/Source/cmCommands.h b/Source/cmCommands.h index e902853..7a94423 100644 --- a/Source/cmCommands.h +++ b/Source/cmCommands.h @@ -13,7 +13,7 @@ #define cmCommands_h #include "cmStandardIncludes.h" -#include +#include class cmCommand; /** @@ -23,9 +23,9 @@ class cmCommand; * It is up to the caller to delete the commands created by this * call. */ -void GetBootstrapCommands1(std::list& commands); -void GetBootstrapCommands2(std::list& commands); -void GetPredefinedCommands(std::list& commands); +void GetBootstrapCommands1(std::vector& commands); +void GetBootstrapCommands2(std::vector& commands); +void GetPredefinedCommands(std::vector& commands); #endif diff --git a/Source/cmCommandsForBootstrap.cxx b/Source/cmCommandsForBootstrap.cxx index 15b664e..5f397a1 100644 --- a/Source/cmCommandsForBootstrap.cxx +++ b/Source/cmCommandsForBootstrap.cxx @@ -11,6 +11,6 @@ ============================================================================*/ #include "cmCommands.h" -void GetPredefinedCommands(std::list&) +void GetPredefinedCommands(std::vector&) { } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f624214..1d067a5 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1804,11 +1804,11 @@ const char* cmake::GetCacheDefinition(const std::string& name) const void cmake::AddDefaultCommands() { - std::list commands; + std::vector commands; GetBootstrapCommands1(commands); GetBootstrapCommands2(commands); GetPredefinedCommands(commands); - for(std::list::iterator i = commands.begin(); + for(std::vector::iterator i = commands.begin(); i != commands.end(); ++i) { this->AddCommand(*i); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6deb43e6c836a61536c3d6e36ca16b51013e9134 commit 6deb43e6c836a61536c3d6e36ca16b51013e9134 Author: Stephen Kelly AuthorDate: Sun Apr 12 20:09:31 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:09:31 2015 +0200 Remove some files which do not need to be in BootstrapCommands. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 04f6a81..868e8b9 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -219,6 +219,8 @@ set(SRCS cmExportSet.cxx cmExportSetMap.h cmExportSetMap.cxx + cmExternalMakefileProjectGenerator.cxx + cmExternalMakefileProjectGenerator.h cmExtraCodeBlocksGenerator.cxx cmExtraCodeBlocksGenerator.h cmExtraCodeLiteGenerator.cxx @@ -244,6 +246,8 @@ set(SRCS cmGeneratorExpressionContext.h cmGeneratorExpressionDAGChecker.cxx cmGeneratorExpressionDAGChecker.h + cmGeneratorExpressionEvaluationFile.cxx + cmGeneratorExpressionEvaluationFile.h cmGeneratorExpressionEvaluator.cxx cmGeneratorExpressionEvaluator.h cmGeneratorExpressionLexer.cxx diff --git a/Source/cmBootstrapCommands1.cxx b/Source/cmBootstrapCommands1.cxx index 4274d85..1b0abf4 100644 --- a/Source/cmBootstrapCommands1.cxx +++ b/Source/cmBootstrapCommands1.cxx @@ -42,7 +42,6 @@ #include "cmEndWhileCommand.cxx" #include "cmExecProgramCommand.cxx" #include "cmExecuteProcessCommand.cxx" -#include "cmExternalMakefileProjectGenerator.cxx" #include "cmFindBase.cxx" #include "cmFindCommon.cxx" #include "cmFileCommand.cxx" diff --git a/Source/cmBootstrapCommands2.cxx b/Source/cmBootstrapCommands2.cxx index 5675295..e292a3a 100644 --- a/Source/cmBootstrapCommands2.cxx +++ b/Source/cmBootstrapCommands2.cxx @@ -16,7 +16,6 @@ #include "cmCommands.h" #include "cmConditionEvaluator.cxx" #include "cmExpandedCommandArgument.cxx" -#include "cmGeneratorExpressionEvaluationFile.cxx" #include "cmGetCMakePropertyCommand.cxx" #include "cmGetDirectoryPropertyCommand.cxx" #include "cmGetFilenameComponentCommand.cxx" diff --git a/bootstrap b/bootstrap index 4239802..c7c6613 100755 --- a/bootstrap +++ b/bootstrap @@ -264,7 +264,8 @@ CMAKE_CXX_SOURCES="\ cmExportTryCompileFileGenerator \ cmExportSet \ cmExportSetMap \ - cmInstallDirectoryGenerator \ + cmExternalMakefileProjectGenerator \ + cmGeneratorExpressionEvaluationFile \ cmGeneratedFileStream \ cmGeneratorTarget \ cmGeneratorExpressionContext \ @@ -275,6 +276,7 @@ CMAKE_CXX_SOURCES="\ cmGeneratorExpressionParser \ cmGeneratorExpression \ cmGlobalGenerator \ + cmInstallDirectoryGenerator \ cmLocalGenerator \ cmInstalledFile \ cmInstallGenerator \ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecdb1b3bba991c13f3f61c7b00a80b8dd97567b2 commit ecdb1b3bba991c13f3f61c7b00a80b8dd97567b2 Author: Stephen Kelly AuthorDate: Sun Apr 12 20:09:25 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:09:25 2015 +0200 Add some missing includes. diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 93e3ac4..6ac0def 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -15,6 +15,8 @@ #include "cmHexFileConverter.h" #include "cmInstallType.h" #include "cmFileTimeComparison.h" +#include "cmLocalGenerator.h" +#include "cmGlobalGenerator.h" #include "cmCryptoHash.h" #include "cmAlgorithms.h" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=04b307b961a34c00f72d9031817ce4f918288701 commit 04b307b961a34c00f72d9031817ce4f918288701 Author: Stephen Kelly AuthorDate: Sat Apr 11 12:33:27 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:49 2015 +0200 cmake: Simplify CommandExists method. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f22989d..f624214 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -222,8 +222,7 @@ void cmake::CleanupCommandsAndMacros() bool cmake::CommandExists(const std::string& name) const { - std::string sName = cmSystemTools::LowerCase(name); - return (this->Commands.find(sName) != this->Commands.end()); + return this->GetCommand(name) ? true : false; } cmCommand *cmake::GetCommand(const std::string& name) const http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f1f324b0dd7147850f923ab266873bd8a4a4353 commit 0f1f324b0dd7147850f923ab266873bd8a4a4353 Author: Stephen Kelly AuthorDate: Sat Apr 11 12:45:12 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:49 2015 +0200 cmake: Rename oddly named variables. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index b27fefa..f22989d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -228,14 +228,14 @@ bool cmake::CommandExists(const std::string& name) const cmCommand *cmake::GetCommand(const std::string& name) const { - cmCommand* rm = 0; + cmCommand* command = 0; std::string sName = cmSystemTools::LowerCase(name); RegisteredCommandsMap::const_iterator pos = this->Commands.find(sName); if (pos != this->Commands.end()) { - rm = (*pos).second; + command = (*pos).second; } - return rm; + return command; } void cmake::RenameCommand(const std::string& oldName, @@ -273,9 +273,9 @@ void cmake::RemoveCommand(const std::string& name) } } -void cmake::AddCommand(cmCommand* wg) +void cmake::AddCommand(cmCommand* command) { - std::string name = cmSystemTools::LowerCase(wg->GetName()); + std::string name = cmSystemTools::LowerCase(command->GetName()); // if the command already exists, free the old one RegisteredCommandsMap::iterator pos = this->Commands.find(name); if (pos != this->Commands.end()) @@ -283,7 +283,7 @@ void cmake::AddCommand(cmCommand* wg) delete pos->second; this->Commands.erase(pos); } - this->Commands.insert(std::make_pair(name, wg)); + this->Commands.insert(std::make_pair(name, command)); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=275185ac2b30b655b53100a129f5d7518ed943ad commit 275185ac2b30b655b53100a129f5d7518ed943ad Author: Stephen Kelly AuthorDate: Sat Apr 11 12:44:18 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:49 2015 +0200 cmake: Constify GetCommand method. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 8868ef6..b27fefa 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -226,11 +226,11 @@ bool cmake::CommandExists(const std::string& name) const return (this->Commands.find(sName) != this->Commands.end()); } -cmCommand *cmake::GetCommand(const std::string& name) +cmCommand *cmake::GetCommand(const std::string& name) const { cmCommand* rm = 0; std::string sName = cmSystemTools::LowerCase(name); - RegisteredCommandsMap::iterator pos = this->Commands.find(sName); + RegisteredCommandsMap::const_iterator pos = this->Commands.find(sName); if (pos != this->Commands.end()) { rm = (*pos).second; diff --git a/Source/cmake.h b/Source/cmake.h index a9f791d..c436c77 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -247,7 +247,7 @@ class cmake /** * Get a command by its name */ - cmCommand *GetCommand(const std::string& name); + cmCommand *GetCommand(const std::string& name) const; /** Check if a command exists. */ bool CommandExists(const std::string& name) const; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c57f086a81c487fa88c36a785865d27b81e3cb8d commit c57f086a81c487fa88c36a785865d27b81e3cb8d Author: Stephen Kelly AuthorDate: Sat Apr 11 12:36:58 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:48 2015 +0200 cmake: Don't lower-case a string needlessly. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 8e09485..8868ef6 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -243,12 +243,12 @@ void cmake::RenameCommand(const std::string& oldName, { // if the command already exists, free the old one std::string sOldName = cmSystemTools::LowerCase(oldName); - std::string sNewName = cmSystemTools::LowerCase(newName); RegisteredCommandsMap::iterator pos = this->Commands.find(sOldName); if ( pos == this->Commands.end() ) { return; } + std::string sNewName = cmSystemTools::LowerCase(newName); cmCommand* cmd = pos->second; pos = this->Commands.find(sNewName); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23368c9b83cd62724e94d345e3af940b3cda8762 commit 23368c9b83cd62724e94d345e3af940b3cda8762 Author: Stephen Kelly AuthorDate: Sat Apr 11 12:32:00 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:48 2015 +0200 cmake: Use make_pair instead of Foo::value_type. It works with all supported compilers. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 0cbb299..8e09485 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -257,7 +257,7 @@ void cmake::RenameCommand(const std::string& oldName, delete pos->second; this->Commands.erase(pos); } - this->Commands.insert(RegisteredCommandsMap::value_type(sNewName, cmd)); + this->Commands.insert(std::make_pair(sNewName, cmd)); pos = this->Commands.find(sOldName); this->Commands.erase(pos); } @@ -283,7 +283,7 @@ void cmake::AddCommand(cmCommand* wg) delete pos->second; this->Commands.erase(pos); } - this->Commands.insert( RegisteredCommandsMap::value_type(name, wg)); + this->Commands.insert(std::make_pair(name, wg)); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14c70b8c580c519ca38bcd9ba5ca8fc9e7629068 commit 14c70b8c580c519ca38bcd9ba5ca8fc9e7629068 Author: Stephen Kelly AuthorDate: Sat Apr 11 12:12:14 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:48 2015 +0200 cmake: out-of-line try compile state methods. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index cf81ea4..0cbb299 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1935,6 +1935,16 @@ void cmake::UpdateProgress(const char *msg, float prog) } } +bool cmake::GetIsInTryCompile() const +{ + return this->InTryCompile; +} + +void cmake::SetIsInTryCompile(bool b) +{ + this->InTryCompile = b; +} + void cmake::GetGeneratorDocumentation(std::vector& v) { for(RegisteredGeneratorsVector::const_iterator i = diff --git a/Source/cmake.h b/Source/cmake.h index 0c3de65..a9f791d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -257,10 +257,8 @@ class cmake bool directoriesSetBefore = false); ///! Is this cmake running as a result of a TRY_COMPILE command - bool GetIsInTryCompile() { return this->InTryCompile; } - - ///! Is this cmake running as a result of a TRY_COMPILE command - void SetIsInTryCompile(bool i) { this->InTryCompile = i; } + bool GetIsInTryCompile() const; + void SetIsInTryCompile(bool b); ///! Parse command line arguments that might set cache values bool SetCacheArgs(const std::vector&); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ed19e615bada326c38a2b27d9378959503094ae commit 6ed19e615bada326c38a2b27d9378959503094ae Author: Stephen Kelly AuthorDate: Sat Apr 11 12:09:15 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:47 2015 +0200 cmake: Remove duplicate condition. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bef8904..cf81ea4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1530,11 +1530,7 @@ int cmake::ActualConfigure() if (!this->InTryCompile) { this->GlobalGenerator->ClearEnabledLanguages(); - } - // Truncate log files - if (!this->InTryCompile) - { this->TruncateOutputLog("CMakeOutput.log"); this->TruncateOutputLog("CMakeError.log"); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ade20b433b2ce1cf176bc727a8ed9c47a5f6537e commit ade20b433b2ce1cf176bc727a8ed9c47a5f6537e Author: Stephen Kelly AuthorDate: Sat Apr 11 12:04:05 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:47 2015 +0200 cmake: Remove DebugConfigs member. It adds needless complexity to global property handling. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 85e5165..745a84c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1157,7 +1157,7 @@ cmTarget::LinkLibraryType cmTarget::ComputeLinkType( } // Get the list of configurations considered to be DEBUG. - std::vector const& debugConfigs = + std::vector debugConfigs = this->Makefile->GetCMakeInstance()->GetDebugConfigs(); // Check if any entry in the list matches this configuration. @@ -1216,7 +1216,7 @@ std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value, } // Get the list of configurations considered to be DEBUG. - std::vector const& debugConfigs = + std::vector debugConfigs = this->Makefile->GetCMakeInstance()->GetDebugConfigs(); std::string configString = "$"; diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 75c94c5..9be7d46 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -467,7 +467,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, } // Get the list of configurations considered to be DEBUG. - std::vector const& debugConfigs = + std::vector debugConfigs = this->Makefile->GetCMakeInstance()->GetDebugConfigs(); std::string prop; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index d2331cb..bef8904 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2283,24 +2283,12 @@ bool cmake::IsPropertyChained(const std::string& name, void cmake::SetProperty(const std::string& prop, const char* value) { - // Special hook to invalidate cached value. - if(prop == "DEBUG_CONFIGURATIONS") - { - this->DebugConfigs.clear(); - } - this->Properties.SetProperty(prop, value, cmProperty::GLOBAL); } void cmake::AppendProperty(const std::string& prop, const char* value, bool asString) { - // Special hook to invalidate cached value. - if(prop == "DEBUG_CONFIGURATIONS") - { - this->DebugConfigs.clear(); - } - this->Properties.AppendProperty(prop, value, cmProperty::GLOBAL, asString); } @@ -2758,27 +2746,24 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, } //---------------------------------------------------------------------------- -std::vector const& cmake::GetDebugConfigs() +std::vector cmake::GetDebugConfigs() { - // Compute on-demand. - if(this->DebugConfigs.empty()) + std::vector configs; + if(const char* config_list = this->GetProperty("DEBUG_CONFIGURATIONS")) { - if(const char* config_list = this->GetProperty("DEBUG_CONFIGURATIONS")) - { - // Expand the specified list and convert to upper-case. - cmSystemTools::ExpandListArgument(config_list, this->DebugConfigs); - std::transform(this->DebugConfigs.begin(), - this->DebugConfigs.end(), - this->DebugConfigs.begin(), - cmSystemTools::UpperCase); - } - // If no configurations were specified, use a default list. - if(this->DebugConfigs.empty()) - { - this->DebugConfigs.push_back("DEBUG"); - } + // Expand the specified list and convert to upper-case. + cmSystemTools::ExpandListArgument(config_list, configs); + std::transform(configs.begin(), + configs.end(), + configs.begin(), + cmSystemTools::UpperCase); + } + // If no configurations were specified, use a default list. + if(configs.empty()) + { + configs.push_back("DEBUG"); } - return this->DebugConfigs; + return configs; } diff --git a/Source/cmake.h b/Source/cmake.h index d2d3a85..0c3de65 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -359,7 +359,7 @@ class cmake /** Get the list of configurations (in upper case) considered to be debugging configurations.*/ - std::vector const& GetDebugConfigs(); + std::vector GetDebugConfigs(); void SetCMakeEditCommand(std::string const& s) { this->CMakeEditCommand = s; } @@ -469,7 +469,6 @@ private: bool DebugTryCompile; cmFileTimeComparison* FileComparison; std::string GraphVizFile; - std::vector DebugConfigs; InstalledFilesMap InstalledFiles; void UpdateConversionPathTable(); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6fb306ea3bbe04b8e4dde8f13eec3e6bdfe35086 commit 6fb306ea3bbe04b8e4dde8f13eec3e6bdfe35086 Author: Stephen Kelly AuthorDate: Sat Apr 11 11:31:43 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:46 2015 +0200 Test expected value of DEBUG_CONFIGURATIONS global property. diff --git a/Tests/RunCMake/get_property/DebugConfigurations-stderr.txt b/Tests/RunCMake/get_property/DebugConfigurations-stderr.txt new file mode 100644 index 0000000..b295604 --- /dev/null +++ b/Tests/RunCMake/get_property/DebugConfigurations-stderr.txt @@ -0,0 +1,11 @@ +CONFIGS: +IFACE1:\$<\$:external1> +CONFIGS:EXTRA +IFACE1:\$<\$:external1> +IFACE1:\$<\$:external1>;\$<\$:external2> +CONFIGS:NEW;CONFIGS +IFACE1:\$<\$:external1>;\$<\$:external2> +IFACE1:\$<\$:external1>;\$<\$:external2>;\$<\$,\$>:external3> +CONFIGS:NEW;CONFIGS;EXTRA +IFACE1:\$<\$:external1>;\$<\$:external2>;\$<\$,\$>:external3> +IFACE1:\$<\$:external1>;\$<\$:external2>;\$<\$,\$>:external3>;\$<\$,\$,\$>:external4> diff --git a/Tests/RunCMake/get_property/DebugConfigurations.cmake b/Tests/RunCMake/get_property/DebugConfigurations.cmake new file mode 100644 index 0000000..534beaf --- /dev/null +++ b/Tests/RunCMake/get_property/DebugConfigurations.cmake @@ -0,0 +1,41 @@ + +enable_language(CXX) + +get_property(configs GLOBAL PROPERTY DEBUG_CONFIGURATIONS) +message("CONFIGS:${configs}") + +add_library(iface1 INTERFACE) +target_link_libraries(iface1 INTERFACE debug external1) + +get_property(tgt_iface TARGET iface1 PROPERTY INTERFACE_LINK_LIBRARIES) +message("IFACE1:${tgt_iface}") + +set_property(GLOBAL APPEND PROPERTY DEBUG_CONFIGURATIONS EXTRA) +get_property(configs GLOBAL PROPERTY DEBUG_CONFIGURATIONS) +message("CONFIGS:${configs}") + +get_property(tgt_iface TARGET iface1 PROPERTY INTERFACE_LINK_LIBRARIES) +message("IFACE1:${tgt_iface}") +target_link_libraries(iface1 INTERFACE debug external2) +get_property(tgt_iface TARGET iface1 PROPERTY INTERFACE_LINK_LIBRARIES) +message("IFACE1:${tgt_iface}") + +set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS NEW CONFIGS) +get_property(configs GLOBAL PROPERTY DEBUG_CONFIGURATIONS) +message("CONFIGS:${configs}") + +get_property(tgt_iface TARGET iface1 PROPERTY INTERFACE_LINK_LIBRARIES) +message("IFACE1:${tgt_iface}") +target_link_libraries(iface1 INTERFACE debug external3) +get_property(tgt_iface TARGET iface1 PROPERTY INTERFACE_LINK_LIBRARIES) +message("IFACE1:${tgt_iface}") + +set_property(GLOBAL APPEND PROPERTY DEBUG_CONFIGURATIONS EXTRA) +get_property(configs GLOBAL PROPERTY DEBUG_CONFIGURATIONS) +message("CONFIGS:${configs}") + +get_property(tgt_iface TARGET iface1 PROPERTY INTERFACE_LINK_LIBRARIES) +message("IFACE1:${tgt_iface}") +target_link_libraries(iface1 INTERFACE debug external4) +get_property(tgt_iface TARGET iface1 PROPERTY INTERFACE_LINK_LIBRARIES) +message("IFACE1:${tgt_iface}") diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake index 1964824..e420b5b 100644 --- a/Tests/RunCMake/get_property/RunCMakeTest.cmake +++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake @@ -7,3 +7,4 @@ run_cmake(install_properties) run_cmake(source_properties) run_cmake(target_properties) run_cmake(test_properties) +run_cmake(DebugConfigurations) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7450a2c6ed601dc94f2de410661065554ff8ce12 commit 7450a2c6ed601dc94f2de410661065554ff8ce12 Author: Stephen Kelly AuthorDate: Sat Apr 11 14:16:47 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:46 2015 +0200 cmake: Remove method with no external users. Port internal users to access the member. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 99c12d6..d2331cb 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -290,9 +290,9 @@ void cmake::AddCommand(cmCommand* wg) void cmake::RemoveUnscriptableCommands() { std::vector unscriptableCommands; - cmake::RegisteredCommandsMap* commands = this->GetCommands(); - for (cmake::RegisteredCommandsMap::const_iterator pos = commands->begin(); - pos != commands->end(); + for (cmake::RegisteredCommandsMap::const_iterator + pos = this->Commands.begin(); + pos != this->Commands.end(); ++pos) { if (!pos->second->IsScriptable()) @@ -2323,8 +2323,8 @@ const char *cmake::GetProperty(const std::string& prop, else if ( prop == "COMMANDS" ) { cmake::RegisteredCommandsMap::iterator cmds - = this->GetCommands()->begin(); - for (unsigned int cc=0 ; cmds != this->GetCommands()->end(); ++ cmds ) + = this->Commands.begin(); + for (unsigned int cc=0 ; cmds != this->Commands.end(); ++ cmds ) { if ( cc > 0 ) { diff --git a/Source/cmake.h b/Source/cmake.h index 3acf4a8..d2d3a85 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -249,9 +249,6 @@ class cmake */ cmCommand *GetCommand(const std::string& name); - /** Get list of all commands */ - RegisteredCommandsMap* GetCommands() { return &this->Commands; } - /** Check if a command exists. */ bool CommandExists(const std::string& name) const; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c13d7709bb2a254e5927d3df1346d8264ba1bd5 commit 8c13d7709bb2a254e5927d3df1346d8264ba1bd5 Author: Stephen Kelly AuthorDate: Mon Apr 6 18:35:49 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:45 2015 +0200 cmake: Don't set the CMakeInstance on the Properties member. There is no need, as global properties have nowhere to chain up to. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7595155..99c12d6 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -187,7 +187,6 @@ cmake::~cmake() void cmake::InitializeProperties() { this->Properties.clear(); - this->Properties.SetCMakeInstance(this); this->PropertyDefinitions.clear(); // initialize properties http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55ecd818f6bf70590d61584a87aae7bba992e26d commit 55ecd818f6bf70590d61584a87aae7bba992e26d Author: Stephen Kelly AuthorDate: Sun Apr 12 20:08:42 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 20:08:42 2015 +0200 cmGlobalGenerator: Store languages as vector, not map. The second component of the map is never used. diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 35394b8..6a6a503 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -968,7 +968,13 @@ void cmGlobalGenerator::SetLanguageEnabled(const std::string& l, void cmGlobalGenerator::SetLanguageEnabledFlag(const std::string& l, cmMakefile* mf) { - this->LanguageEnabled[l] = true; + std::vector::iterator it = + std::lower_bound(this->LanguageEnabled.begin(), + this->LanguageEnabled.end(), l); + if (it == this->LanguageEnabled.end() || *it != l) + { + this->LanguageEnabled.insert(it, l); + } // Fill the language-to-extension map with the current variable // settings to make sure it is available for the try_compile() @@ -1079,7 +1085,8 @@ bool cmGlobalGenerator::IgnoreFile(const char* ext) const bool cmGlobalGenerator::GetLanguageEnabled(const std::string& l) const { - return (this->LanguageEnabled.find(l)!= this->LanguageEnabled.end()); + return std::binary_search(this->LanguageEnabled.begin(), + this->LanguageEnabled.end(), l); } void cmGlobalGenerator::ClearEnabledLanguages() @@ -1958,11 +1965,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, void cmGlobalGenerator::GetEnabledLanguages(std::vector& lang) const { - for(std::map::const_iterator i = - this->LanguageEnabled.begin(); i != this->LanguageEnabled.end(); ++i) - { - lang.push_back(i->first); - } + lang = this->LanguageEnabled; } int cmGlobalGenerator::GetLinkerPreference(const std::string& lang) const diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 5b9ddee..ce3f037 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -441,7 +441,7 @@ private: // If you add a new map here, make sure it is copied // in EnableLanguagesFromGenerator std::map IgnoreExtensions; - std::map LanguageEnabled; + std::vector LanguageEnabled; std::set LanguagesReady; // Ready for try_compile std::map OutputExtensions; std::map LanguageToOutputExtension; ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 4 + Source/CMakeVersion.cmake | 2 +- Source/cmBootstrapCommands1.cxx | 3 +- Source/cmBootstrapCommands2.cxx | 3 +- Source/cmCommands.cxx.in | 2 +- Source/cmCommands.h | 8 +- Source/cmCommandsForBootstrap.cxx | 2 +- Source/cmFileCommand.cxx | 2 + Source/cmGlobalGenerator.cxx | 17 ++- Source/cmGlobalGenerator.h | 2 +- Source/cmLocalGenerator.cxx | 1 - Source/cmMakefile.cxx | 39 ++--- Source/cmMakefile.h | 11 +- Source/cmTarget.cxx | 4 +- Source/cmTargetLinkLibrariesCommand.cxx | 2 +- Source/cmake.cxx | 154 ++++++++++---------- Source/cmake.h | 48 ++---- .../get_property/DebugConfigurations-stderr.txt | 11 ++ .../get_property/DebugConfigurations.cmake | 41 ++++++ Tests/RunCMake/get_property/RunCMakeTest.cmake | 1 + bootstrap | 4 +- 21 files changed, 189 insertions(+), 172 deletions(-) create mode 100644 Tests/RunCMake/get_property/DebugConfigurations-stderr.txt create mode 100644 Tests/RunCMake/get_property/DebugConfigurations.cmake hooks/post-receive -- CMake From steveire at gmail.com Sun Apr 12 15:53:10 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 12 Apr 2015 15:53:10 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1761-gece47ef Message-ID: <20150412195310.C438EAEE0D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ece47efcfadae336402a9e58f99534aa243d12c5 (commit) via d824a01b0f2e48cda0c33a8b927489747e33c5e3 (commit) from b0c18ba6de66445ba3d416fc62e6dc924ad380cf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ece47efcfadae336402a9e58f99534aa243d12c5 commit ece47efcfadae336402a9e58f99534aa243d12c5 Merge: b0c18ba d824a01 Author: Stephen Kelly AuthorDate: Sun Apr 12 15:53:10 2015 -0400 Commit: CMake Topic Stage CommitDate: Sun Apr 12 15:53:10 2015 -0400 Merge topic 'cmake-cleanups' into next d824a01b Revert "cmake: Simplify command clean up loop." http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d824a01b0f2e48cda0c33a8b927489747e33c5e3 commit d824a01b0f2e48cda0c33a8b927489747e33c5e3 Author: Stephen Kelly AuthorDate: Sun Apr 12 21:50:04 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 21:50:04 2015 +0200 Revert "cmake: Simplify command clean up loop." This reverts commit ac11b599f4ec4d753745ba47b921e10d3ae24703. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a347072..7ccd76a 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -197,16 +197,27 @@ void cmake::InitializeProperties() void cmake::CleanupCommandsAndMacros() { this->InitializeProperties(); + std::vector commands; for(RegisteredCommandsMap::iterator j = this->Commands.begin(); j != this->Commands.end(); ++j) { - if (j->second->IsA("cmMacroHelperCommand") || - j->second->IsA("cmFunctionHelperCommand")) + if ( !j->second->IsA("cmMacroHelperCommand") && + !j->second->IsA("cmFunctionHelperCommand")) + { + commands.push_back(j->second); + } + else { delete j->second; - this->Commands.erase(j); } } + this->Commands.clear(); + std::vector::iterator it; + for ( it = commands.begin(); it != commands.end(); + ++ it ) + { + this->Commands[cmSystemTools::LowerCase((*it)->GetName())] = *it; + } } bool cmake::CommandExists(const std::string& name) const ----------------------------------------------------------------------- Summary of changes: Source/cmake.cxx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Apr 12 17:11:04 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 12 Apr 2015 17:11:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1769-gcb1ea87 Message-ID: <20150412211104.85834AD708@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via cb1ea87c8d8bff131594cd7837a078079ba36286 (commit) via 07d44d638bca028d2a76fb1ffdc1f1542184243c (commit) via ea819b29f8735ca09242cc646a7b25e933bc913c (commit) via 6ad86c7fc4167561c7c13c28482a5fea0fe9d70b (commit) via fca2b542b43546c64aa2c474b810890e52bd0ea4 (commit) via 7bb4e3db069e06fe2eac053e329ffb9f1ea322bf (commit) via 6241253a4b20e74625b855b1e0d5220c8e7282b1 (commit) via 0ee3ccb3b0a25264e8302a150eee297dd40affde (commit) from ece47efcfadae336402a9e58f99534aa243d12c5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb1ea87c8d8bff131594cd7837a078079ba36286 commit cb1ea87c8d8bff131594cd7837a078079ba36286 Merge: ece47ef 07d44d6 Author: Stephen Kelly AuthorDate: Sun Apr 12 17:11:03 2015 -0400 Commit: CMake Topic Stage CommitDate: Sun Apr 12 17:11:03 2015 -0400 Merge topic 'cmake-cleanups' into next 07d44d63 cmake: Remove confusing duplication. ea819b29 cmMakefile: Remove unused method. 6ad86c7f cmMakefile: Remove bad comment. fca2b542 cmMakefile: Internalize setting of CMakeInstance on Properties. 7bb4e3db cmMakefile: Out-of-line Home directory accessors. 6241253a cmake: Out-of-line Home and Start directory methods. 0ee3ccb3 cmake: Fix variable name bugs. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=07d44d638bca028d2a76fb1ffdc1f1542184243c commit 07d44d638bca028d2a76fb1ffdc1f1542184243c Author: Stephen Kelly AuthorDate: Sun Apr 12 19:22:09 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 23:10:45 2015 +0200 cmake: Remove confusing duplication. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index ec05a0e..7ccd76a 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -843,12 +843,8 @@ void cmake::SetArgs(const std::vector& args, { this->SetHomeOutputDirectory (cmSystemTools::GetCurrentWorkingDirectory()); - this->SetStartOutputDirectory - (cmSystemTools::GetCurrentWorkingDirectory()); this->SetHomeDirectory (cmSystemTools::GetCurrentWorkingDirectory()); - this->SetStartDirectory - (cmSystemTools::GetCurrentWorkingDirectory()); } this->SetStartDirectory(this->GetHomeDirectory()); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea819b29f8735ca09242cc646a7b25e933bc913c commit ea819b29f8735ca09242cc646a7b25e933bc913c Author: Stephen Kelly AuthorDate: Sun Apr 12 18:34:12 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 23:10:45 2015 +0200 cmMakefile: Remove unused method. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ec0a165..35fdd0c 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1676,33 +1676,6 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) } } -void cmMakefile::AddSubDirectory(const std::string& sub, - bool excludeFromAll) -{ - // the source path must be made full if it isn't already - std::string srcPath = sub; - if (!cmSystemTools::FileIsFullPath(srcPath.c_str())) - { - srcPath = this->GetCurrentDirectory(); - srcPath += "/"; - srcPath += sub; - } - - // binary path must be made full if it isn't already - std::string binPath = sub; - if (!cmSystemTools::FileIsFullPath(binPath.c_str())) - { - binPath = this->GetCurrentOutputDirectory(); - binPath += "/"; - binPath += sub; - } - - - this->AddSubDirectory(srcPath, binPath, - excludeFromAll, false); -} - - void cmMakefile::AddSubDirectory(const std::string& srcPath, const std::string& binPath, bool excludeFromAll, diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 823acb1..b78f921 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -281,7 +281,6 @@ public: /** * Add a subdirectory to the build. */ - void AddSubDirectory(const std::string&, bool excludeFromAll=false); void AddSubDirectory(const std::string& fullSrcDir, const std::string& fullBinDir, bool excludeFromAll, http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ad86c7fc4167561c7c13c28482a5fea0fe9d70b commit 6ad86c7fc4167561c7c13c28482a5fea0fe9d70b Author: Stephen Kelly AuthorDate: Sun Apr 12 18:47:24 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 23:10:45 2015 +0200 cmMakefile: Remove bad comment. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 35be1b7..ec0a165 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1658,7 +1658,6 @@ void cmMakefile::InitializeFromParent() void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) { - // copy our variables from the child makefile lg2->GetMakefile()->InitializeFromParent(); lg2->GetMakefile()->MakeStartDirectoriesCurrent(); if (this->GetCMakeInstance()->GetDebugOutput()) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fca2b542b43546c64aa2c474b810890e52bd0ea4 commit fca2b542b43546c64aa2c474b810890e52bd0ea4 Author: Stephen Kelly AuthorDate: Sun Apr 12 20:10:48 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 23:10:45 2015 +0200 cmMakefile: Internalize setting of CMakeInstance on Properties. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index e1998e4..c143bce 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -252,7 +252,6 @@ void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg) this->Makefile->SetLocalGenerator(this); // setup the home directories - this->Makefile->GetProperties().SetCMakeInstance(gg->GetCMakeInstance()); this->Makefile->SetHomeDirectory( gg->GetCMakeInstance()->GetHomeDirectory()); this->Makefile->SetHomeOutputDirectory( diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index dea9e46..35be1b7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -741,6 +741,7 @@ void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg) this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$"); #endif + this->Properties.SetCMakeInstance(this->GetCMakeInstance()); this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused(); this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars(); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7bb4e3db069e06fe2eac053e329ffb9f1ea322bf commit 7bb4e3db069e06fe2eac053e329ffb9f1ea322bf Author: Stephen Kelly AuthorDate: Sun Apr 12 20:10:45 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 23:10:44 2015 +0200 cmMakefile: Out-of-line Home directory accessors. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 34b4621..dea9e46 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3461,6 +3461,11 @@ cmMakefile::LexicalPushPop::~LexicalPushPop() this->Makefile->PopFunctionBlockerBarrier(this->ReportError); } +const char* cmMakefile::GetHomeDirectory() const +{ + return this->cmHomeDirectory.c_str(); +} + void cmMakefile::SetHomeDirectory(const std::string& dir) { this->cmHomeDirectory = dir; @@ -3472,6 +3477,11 @@ void cmMakefile::SetHomeDirectory(const std::string& dir) } } +const char* cmMakefile::GetHomeOutputDirectory() const +{ + return this->HomeOutputDirectory.c_str(); +} + void cmMakefile::SetHomeOutputDirectory(const std::string& lib) { this->HomeOutputDirectory = lib; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5209891..823acb1 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -438,15 +438,9 @@ public: * and going up until it reaches the HomeDirectory. */ void SetHomeDirectory(const std::string& dir); - const char* GetHomeDirectory() const - { - return this->cmHomeDirectory.c_str(); - } + const char* GetHomeDirectory() const; void SetHomeOutputDirectory(const std::string& lib); - const char* GetHomeOutputDirectory() const - { - return this->HomeOutputDirectory.c_str(); - } + const char* GetHomeOutputDirectory() const; //@} /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6241253a4b20e74625b855b1e0d5220c8e7282b1 commit 6241253a4b20e74625b855b1e0d5220c8e7282b1 Author: Stephen Kelly AuthorDate: Sun Apr 12 20:10:40 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 23:10:44 2015 +0200 cmake: Out-of-line Home and Start directory methods. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f182ad2..ec05a0e 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1112,12 +1112,44 @@ void cmake::SetHomeDirectory(const std::string& dir) cmSystemTools::ConvertToUnixSlashes(this->cmHomeDirectory); } +const char* cmake::GetHomeDirectory() const +{ + return this->cmHomeDirectory.c_str(); +} + void cmake::SetHomeOutputDirectory(const std::string& dir) { this->HomeOutputDirectory = dir; cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory); } +const char* cmake::GetHomeOutputDirectory() const +{ + return this->HomeOutputDirectory.c_str(); +} + +const char* cmake::GetStartDirectory() const +{ + return this->cmStartDirectory.c_str(); +} + +void cmake::SetStartDirectory(const std::string& dir) +{ + this->cmStartDirectory = dir; + cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory); +} + +const char* cmake::GetStartOutputDirectory() const +{ + return this->StartOutputDirectory.c_str(); +} + +void cmake::SetStartOutputDirectory(const std::string& dir) +{ + this->StartOutputDirectory = dir; + cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); +} + void cmake::SetGlobalGenerator(cmGlobalGenerator *gg) { if(!gg) diff --git a/Source/cmake.h b/Source/cmake.h index 26ee8fe..87b771d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -113,15 +113,9 @@ class cmake * and going up until it reaches the HomeDirectory. */ void SetHomeDirectory(const std::string& dir); - const char* GetHomeDirectory() const - { - return this->cmHomeDirectory.c_str(); - } + const char* GetHomeDirectory() const; void SetHomeOutputDirectory(const std::string& dir); - const char* GetHomeOutputDirectory() const - { - return this->HomeOutputDirectory.c_str(); - } + const char* GetHomeOutputDirectory() const; //@} //@{ @@ -132,24 +126,10 @@ class cmake * recursing up the tree starting at the StartDirectory and going up until * it reaches the HomeDirectory. */ - void SetStartDirectory(const std::string& dir) - { - this->cmStartDirectory = dir; - cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory); - } - const char* GetStartDirectory() const - { - return this->cmStartDirectory.c_str(); - } - void SetStartOutputDirectory(const std::string& dir) - { - this->StartOutputDirectory = dir; - cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); - } - const char* GetStartOutputDirectory() const - { - return this->StartOutputDirectory.c_str(); - } + void SetStartDirectory(const std::string& dir); + const char* GetStartDirectory() const; + void SetStartOutputDirectory(const std::string& dir); + const char* GetStartOutputDirectory() const; //@} /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0ee3ccb3b0a25264e8302a150eee297dd40affde commit 0ee3ccb3b0a25264e8302a150eee297dd40affde Author: Stephen Kelly AuthorDate: Sun Apr 12 19:32:48 2015 +0200 Commit: Stephen Kelly CommitDate: Sun Apr 12 23:10:44 2015 +0200 cmake: Fix variable name bugs. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 1d067a5..f182ad2 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1112,9 +1112,9 @@ void cmake::SetHomeDirectory(const std::string& dir) cmSystemTools::ConvertToUnixSlashes(this->cmHomeDirectory); } -void cmake::SetHomeOutputDirectory(const std::string& lib) +void cmake::SetHomeOutputDirectory(const std::string& dir) { - this->HomeOutputDirectory = lib; + this->HomeOutputDirectory = dir; cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory); } diff --git a/Source/cmake.h b/Source/cmake.h index c436c77..26ee8fe 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -117,7 +117,7 @@ class cmake { return this->cmHomeDirectory.c_str(); } - void SetHomeOutputDirectory(const std::string& lib); + void SetHomeOutputDirectory(const std::string& dir); const char* GetHomeOutputDirectory() const { return this->HomeOutputDirectory.c_str(); @@ -141,9 +141,9 @@ class cmake { return this->cmStartDirectory.c_str(); } - void SetStartOutputDirectory(const std::string& lib) + void SetStartOutputDirectory(const std::string& dir) { - this->StartOutputDirectory = lib; + this->StartOutputDirectory = dir; cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); } const char* GetStartOutputDirectory() const ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Mon Apr 13 00:01:06 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 13 Apr 2015 00:01:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-717-g74c8b92 Message-ID: <20150413040106.3AB8EAF0BF@public.kitware.com> This is an automated email from 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 74c8b9284469dcc8b5a1e7fe23dae1bdc7aad468 (commit) from e9e417b57c85c6901f729c350dca0b01628016f0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74c8b9284469dcc8b5a1e7fe23dae1bdc7aad468 commit 74c8b9284469dcc8b5a1e7fe23dae1bdc7aad468 Author: Kitware Robot AuthorDate: Mon Apr 13 00:01:04 2015 -0400 Commit: Kitware Robot CommitDate: Mon Apr 13 00:01:04 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 349c954..f91acbe 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150412) +set(CMake_VERSION_PATCH 20150413) #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 Apr 13 09:00:10 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:00:10 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1771-g988be7f Message-ID: <20150413130010.94739AF0CC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 988be7f9330adab2357f5fe018ea98715afa7c1a (commit) via a198839a7b110a47d76d47e342b1c63f908e6878 (commit) from cb1ea87c8d8bff131594cd7837a078079ba36286 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=988be7f9330adab2357f5fe018ea98715afa7c1a commit 988be7f9330adab2357f5fe018ea98715afa7c1a Merge: cb1ea87 a198839 Author: Brad King AuthorDate: Mon Apr 13 09:00:09 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:00:09 2015 -0400 Merge topic 'c-locale-messages' into next a198839a CTest: Fix locale used for VCS updates http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a198839a7b110a47d76d47e342b1c63f908e6878 commit a198839a7b110a47d76d47e342b1c63f908e6878 Author: Nils Gladitz AuthorDate: Thu Apr 9 20:56:43 2015 +0200 Commit: Brad King CommitDate: Mon Apr 13 08:59:34 2015 -0400 CTest: Fix locale used for VCS updates 6a661f06030b85b4484733375bbb0aa23eca7446 fixed the locale used for message output but at the same time broke the locale used for filename encodings. This commit preserves LC_CTYPE in the presence of LC_ALL. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 04f6a81..7af6da3 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -159,6 +159,8 @@ set(SRCS cmCacheManager.cxx cmCacheManager.h "${CMAKE_CURRENT_BINARY_DIR}/cmCommands.cxx" + cmCLocaleEnvironmentScope.h + cmCLocaleEnvironmentScope.cxx cmCommands.h cmCommandArgumentLexer.cxx cmCommandArgumentParser.cxx diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index b9da8a0..10927e7 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -21,6 +21,7 @@ #include "cmGeneratedFileStream.h" #include "cmXMLParser.h" #include "cmXMLSafe.h" +#include "cmCLocaleEnvironmentScope.h" #include "cmCTestVC.h" #include "cmCTestCVS.h" @@ -66,46 +67,6 @@ static const char* cmCTestUpdateHandlerUpdateToString(int type) return cmCTestUpdateHandlerUpdateStrings[type]; } -class cmCTestUpdateHandlerLocale -{ -public: - cmCTestUpdateHandlerLocale(); - ~cmCTestUpdateHandlerLocale(); -private: - std::string saveLCAll; -}; - -cmCTestUpdateHandlerLocale::cmCTestUpdateHandlerLocale() -{ - const char* lcall = cmSystemTools::GetEnv("LC_ALL"); - if(lcall) - { - saveLCAll = lcall; - } - // if LC_ALL is not set to C, then - // set it, so that svn/cvs info will be in english ascii - if(! (lcall && strcmp(lcall, "C") == 0)) - { - cmSystemTools::PutEnv("LC_ALL=C"); - } -} - -cmCTestUpdateHandlerLocale::~cmCTestUpdateHandlerLocale() -{ - // restore the value of LC_ALL after running the version control - // commands - if(!saveLCAll.empty()) - { - std::string put = "LC_ALL="; - put += saveLCAll; - cmSystemTools::PutEnv(put); - } - else - { - cmSystemTools::UnsetEnv("LC_ALL"); - } -} - //---------------------------------------------------------------------- cmCTestUpdateHandler::cmCTestUpdateHandler() { @@ -194,7 +155,7 @@ int cmCTestUpdateHandler::DetermineType(const char* cmd, const char* type) int cmCTestUpdateHandler::ProcessHandler() { // Make sure VCS tool messages are in English so we can parse them. - cmCTestUpdateHandlerLocale fixLocale; + cmCLocaleEnvironmentScope fixLocale; static_cast(fixLocale); // Get source dir diff --git a/Source/cmCLocaleEnvironmentScope.cxx b/Source/cmCLocaleEnvironmentScope.cxx new file mode 100644 index 0000000..5792302 --- /dev/null +++ b/Source/cmCLocaleEnvironmentScope.cxx @@ -0,0 +1,67 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 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 "cmCLocaleEnvironmentScope.h" + +#include "cmSystemTools.h" + +#include + +cmCLocaleEnvironmentScope::cmCLocaleEnvironmentScope() +{ + this->SetEnv("LANGUAGE", ""); + this->SetEnv("LC_MESSAGES", "C"); + + std::string lcAll = this->GetEnv("LC_ALL"); + + if(!lcAll.empty()) + { + this->SetEnv("LC_ALL", ""); + this->SetEnv("LC_CTYPE", lcAll); + } +} + +std::string cmCLocaleEnvironmentScope::GetEnv(std::string const& key) +{ + const char* value = cmSystemTools::GetEnv(key); + return value ? value : std::string(); +} + +void cmCLocaleEnvironmentScope::SetEnv( + std::string const& key, std::string const& value) +{ + std::string oldValue = this->GetEnv(key); + + this->EnvironmentBackup.insert(std::make_pair(key, oldValue)); + + if(value.empty()) + { + cmSystemTools::UnsetEnv(key.c_str()); + } + else + { + std::stringstream tmp; + tmp << key << "=" << value; + cmSystemTools::PutEnv(tmp.str()); + } +} + +cmCLocaleEnvironmentScope::~cmCLocaleEnvironmentScope() +{ + for(backup_map_t::const_iterator i = this->EnvironmentBackup.begin(); + i != this->EnvironmentBackup.end(); ++i) + { + std::stringstream tmp; + tmp << i->first << "=" << i->second; + cmSystemTools::PutEnv(tmp.str()); + } +} diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h new file mode 100644 index 0000000..b011741 --- /dev/null +++ b/Source/cmCLocaleEnvironmentScope.h @@ -0,0 +1,32 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 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 cmCLocaleEnvironmentScope_h +#define cmCLocaleEnvironmentScope_h + +#include "cmStandardIncludes.h" + +class cmCLocaleEnvironmentScope +{ +public: + cmCLocaleEnvironmentScope(); + ~cmCLocaleEnvironmentScope(); + +private: + std::string GetEnv(std::string const& key); + void SetEnv(std::string const& key, std::string const& value); + + typedef std::map backup_map_t; + backup_map_t EnvironmentBackup; +}; + +#endif ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:01:01 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:01:01 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1773-gd6395c5 Message-ID: <20150413130101.DAF3BAF108@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d6395c5a8902923cbb7cb63f6101141822d119cf (commit) via 9660a3cceae12ebb3cdc49484dcef590a12eb33c (commit) from 988be7f9330adab2357f5fe018ea98715afa7c1a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d6395c5a8902923cbb7cb63f6101141822d119cf commit d6395c5a8902923cbb7cb63f6101141822d119cf Merge: 988be7f 9660a3c Author: Brad King AuthorDate: Mon Apr 13 09:01:01 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:01:01 2015 -0400 Merge topic 'custom-command-multiple-outputs' into next 9660a3cc Makefile: Fix multiple custom command outputs with one missing http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9660a3cceae12ebb3cdc49484dcef590a12eb33c commit 9660a3cceae12ebb3cdc49484dcef590a12eb33c Author: Brad King AuthorDate: Fri Apr 10 13:03:34 2015 -0400 Commit: Brad King CommitDate: Fri Apr 10 16:27:42 2015 -0400 Makefile: Fix multiple custom command outputs with one missing The use of "cmake -E touch_nocreate" added in commit v3.2.1~4^2 (Makefile: Fix multiple custom command outputs regression, 2015-03-06) caused builds to fail when one of the outputs is intentionally not created. This was fixed by our parent commit by making touch_nocreate succeed when the file is missing. Add a test case covering it. For the Watcom WMake generator, check for the SYMBOLIC source file property separately on each output. The mark is needed on outputs that are not really created to tell 'wmake' not to complain that it is missing. The mark is also needed on outputs that are created or 'wmake' will not consider them out of date when they exist. Inspired-by: Ben Boeckel diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 4ece016..ea11c79 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -767,7 +767,7 @@ cmMakefileTargetGenerator // Write the rule. this->WriteMakeRule(*this->BuildFileStream, 0, outputs, - depends, commands, false); + depends, commands); bool do_preprocess_rules = lang_has_preprocessor && this->LocalGenerator->GetCreatePreprocessedSourceRules(); @@ -989,18 +989,30 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules() } //---------------------------------------------------------------------------- -void cmMakefileTargetGenerator::WriteMakeRule( +bool cmMakefileTargetGenerator::WriteMakeRule( std::ostream& os, const char* comment, const std::vector& outputs, const std::vector& depends, const std::vector& commands, - bool symbolic, bool in_help) { + bool symbolic = false; if (outputs.size() == 0) { - return; + return symbolic; + } + + // Check whether we need to bother checking for a symbolic output. + bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark(); + + // Check whether the first output is marked as symbolic. + if(need_symbolic) + { + if(cmSourceFile* sf = this->Makefile->GetSource(outputs[0])) + { + symbolic = sf->GetPropertyAsBool("SYMBOLIC"); + } } // We always attach the actual commands to the first output. @@ -1010,7 +1022,7 @@ void cmMakefileTargetGenerator::WriteMakeRule( // For single outputs, we are done. if (outputs.size() == 1) { - return; + return symbolic; } // For multiple outputs, make the extra ones depend on the first one. @@ -1023,14 +1035,25 @@ void cmMakefileTargetGenerator::WriteMakeRule( std::string const out = this->Convert(*o, cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::SHELL); std::vector output_commands; - if (!symbolic) + + bool o_symbolic = false; + if(need_symbolic) + { + if(cmSourceFile* sf = this->Makefile->GetSource(*o)) + { + o_symbolic = sf->GetPropertyAsBool("SYMBOLIC"); + } + } + symbolic = symbolic && o_symbolic; + + if (!o_symbolic) { output_commands.push_back("@$(CMAKE_COMMAND) -E touch_nocreate " + out); } this->LocalGenerator->WriteMakeRule(os, 0, *o, output_depends, - output_commands, symbolic, in_help); + output_commands, o_symbolic, in_help); - if (!symbolic) + if (!o_symbolic) { // At build time, remove the first output if this one does not exist // so that "make" will rerun the real commands that create this one. @@ -1038,6 +1061,7 @@ void cmMakefileTargetGenerator::WriteMakeRule( this->MultipleOutputPairs.insert(p); } } + return symbolic; } //---------------------------------------------------------------------------- @@ -1289,30 +1313,16 @@ void cmMakefileTargetGenerator std::vector depends; this->LocalGenerator->AppendCustomDepend(depends, ccg); - // Check whether we need to bother checking for a symbolic output. - bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark(); - // Write the rule. const std::vector& outputs = ccg.GetOutputs(); - std::vector::const_iterator o = outputs.begin(); - { - bool symbolic = false; - if(need_symbolic) - { - if(cmSourceFile* sf = this->Makefile->GetSource(*o)) - { - symbolic = sf->GetPropertyAsBool("SYMBOLIC"); - } - } - this->WriteMakeRule(*this->BuildFileStream, 0, outputs, - depends, commands, symbolic); + bool symbolic = this->WriteMakeRule(*this->BuildFileStream, 0, + outputs, depends, commands); // If the rule has changed make sure the output is rebuilt. if(!symbolic) { this->GlobalGenerator->AddRuleHash(ccg.GetOutputs(), content.str()); } - } // Setup implicit dependency scanning. for(cmCustomCommand::ImplicitDependsList::const_iterator diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index f62c51d..42c4f58 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -224,12 +224,11 @@ protected: typedef std::map MultipleOutputPairsType; MultipleOutputPairsType MultipleOutputPairs; - void WriteMakeRule(std::ostream& os, + bool WriteMakeRule(std::ostream& os, const char* comment, const std::vector& outputs, const std::vector& depends, const std::vector& commands, - bool symbolic, bool in_help = false); // Target name info. diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 78e9e17..2be59b6 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -42,6 +42,11 @@ list(APPEND _cmake_options "-DTEST_LINK_DEPENDS=${TEST_LINK_DEPENDS}") list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1") +if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^6789]|[6789][0-9])") + set(TEST_MULTI3 1) + list(APPEND _cmake_options "-DTEST_MULTI3=1") +endif() + file(MAKE_DIRECTORY ${BuildDepends_BINARY_DIR}/Project) message("Creating Project/foo.cxx") write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx @@ -66,6 +71,8 @@ set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_dep file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external original\n") file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in original\n") +file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp original\n") +file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt "multi3-stamp original\n") help_xcode_depends() @@ -191,6 +198,34 @@ else() "multi1-out2-copy.txt is missing") endif() +if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt) + if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt + IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt) + message(STATUS "multi2-real.txt is newer than multi2-stamp.txt") + else() + message(SEND_ERROR "Project did not initially build properly: " + "multi2-real.txt is not newer than multi2-stamp.txt") + endif() +else() + message(SEND_ERROR "Project did not initially build properly: " + "multi2-real.txt is missing") +endif() + +if(TEST_MULTI3) + if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt) + if(${BuildDepends_BINARY_DIR}/Project/multi3-real.txt + IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt) + message(STATUS "multi3-real.txt is newer than multi3-stamp.txt") + else() + message(SEND_ERROR "Project did not initially build properly: " + "multi3-real.txt is not newer than multi3-stamp.txt") + endif() + else() + message(SEND_ERROR "Project did not initially build properly: " + "multi3-real.txt is missing") + endif() +endif() + message("Waiting 3 seconds...") execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 3) @@ -217,6 +252,8 @@ endif() file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external changed\n") file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in changed\n") +file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp changed\n") +file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt "multi3-stamp changed\n") help_xcode_depends() @@ -347,3 +384,31 @@ else() message(SEND_ERROR "Project did not rebuild properly: " "multi1-out2-copy.txt is missing") endif() + +if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt) + if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt + IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt) + message(STATUS "multi2-real.txt is newer than multi2-stamp.txt") + else() + message(SEND_ERROR "Project did not rebuild properly: " + "multi2-real.txt is not newer than multi2-stamp.txt") + endif() +else() + message(SEND_ERROR "Project did not rebuild properly: " + "multi2-real.txt is missing") +endif() + +if(TEST_MULTI3) + if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt) + if(${BuildDepends_BINARY_DIR}/Project/multi3-real.txt + IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt) + message(STATUS "multi3-real.txt is newer than multi3-stamp.txt") + else() + message(SEND_ERROR "Project did not rebuild properly: " + "multi3-real.txt is not newer than multi3-stamp.txt") + endif() + else() + message(SEND_ERROR "Project did not rebuild properly: " + "multi3-real.txt is missing") + endif() +endif() diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index cb9fbf8..0db39c5 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -164,3 +164,21 @@ add_custom_command( DEPENDS multi1-out2.txt ) add_custom_target(multi1 ALL DEPENDS multi1-out2-copy.txt) + +# Test having the first output never created. +add_custom_command( + OUTPUT multi2-dummy.txt multi2-real.txt + COMMAND ${CMAKE_COMMAND} -E touch multi2-real.txt + ) +set_property(SOURCE multi2-real.txt multi2-dummy.txt PROPERTY SYMBOLIC 1) +add_custom_target(multi2 ALL DEPENDS multi2-real.txt) + +if(TEST_MULTI3) + # Test having the second output never created. Does not work with msbuild. + add_custom_command( + OUTPUT multi3-real.txt multi3-dummy.txt + COMMAND ${CMAKE_COMMAND} -E touch multi3-real.txt + ) + set_property(SOURCE multi3-real.txt multi3-dummy.txt PROPERTY SYMBOLIC 1) + add_custom_target(multi3 ALL DEPENDS multi3-real.txt) +endif() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:02:39 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:02:39 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1776-g0e339f2 Message-ID: <20150413130239.5A12AAF15C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0e339f22ca26e53a6c7f6b9bbe270eba498a8b0e (commit) via e538858349527efc1cf3ebcfb824b114964262df (commit) via d34d5a370ec656aab6f980218d74002789fedfff (commit) from d6395c5a8902923cbb7cb63f6101141822d119cf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e339f22ca26e53a6c7f6b9bbe270eba498a8b0e commit 0e339f22ca26e53a6c7f6b9bbe270eba498a8b0e Merge: d6395c5 e538858 Author: Brad King AuthorDate: Mon Apr 13 09:02:38 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:02:38 2015 -0400 Merge topic 'update-kwsys' into next e5388583 Merge branch 'upstream-kwsys' into update-kwsys d34d5a37 KWSys 2015-04-10 (69bccf2e) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e538858349527efc1cf3ebcfb824b114964262df commit e538858349527efc1cf3ebcfb824b114964262df Merge: 10859b9 d34d5a3 Author: Brad King AuthorDate: Mon Apr 13 09:01:59 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 09:01:59 2015 -0400 Merge branch 'upstream-kwsys' into update-kwsys http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d34d5a370ec656aab6f980218d74002789fedfff commit d34d5a370ec656aab6f980218d74002789fedfff Author: KWSys Robot AuthorDate: Fri Apr 10 08:55:18 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 09:01:55 2015 -0400 KWSys 2015-04-10 (69bccf2e) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 69bccf2e | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 9367a33b..69bccf2e Brad King (1): 69bccf2e SystemTools: Teach Touch with !create to succeed on missing file Change-Id: I4af502542578b6a16ca4ddffb03553a046378e56 diff --git a/SystemTools.cxx b/SystemTools.cxx index 8a481d6..6c4a7a6 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -1260,15 +1260,22 @@ bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path) bool SystemTools::Touch(const kwsys_stl::string& filename, bool create) { - if(create && !SystemTools::FileExists(filename)) + if (!SystemTools::FileExists(filename)) { - FILE* file = Fopen(filename, "a+b"); - if(file) + if(create) + { + FILE* file = Fopen(filename, "a+b"); + if(file) + { + fclose(file); + return true; + } + return false; + } + else { - fclose(file); return true; } - return false; } #if defined(_WIN32) && !defined(__CYGWIN__) HANDLE h = CreateFileW( ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:05:07 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:05:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-720-g2cf5415 Message-ID: <20150413130507.6BC59AF1E7@public.kitware.com> This is an automated email from 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 2cf5415d9f6e94da3f64502a57fed957d3516fc3 (commit) via e538858349527efc1cf3ebcfb824b114964262df (commit) via d34d5a370ec656aab6f980218d74002789fedfff (commit) from 74c8b9284469dcc8b5a1e7fe23dae1bdc7aad468 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2cf5415d9f6e94da3f64502a57fed957d3516fc3 commit 2cf5415d9f6e94da3f64502a57fed957d3516fc3 Merge: 74c8b92 e538858 Author: Brad King AuthorDate: Mon Apr 13 09:05:06 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:05:06 2015 -0400 Merge topic 'update-kwsys' e5388583 Merge branch 'upstream-kwsys' into update-kwsys d34d5a37 KWSys 2015-04-10 (69bccf2e) ----------------------------------------------------------------------- Summary of changes: Source/kwsys/SystemTools.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:05:09 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:05:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-723-g9a101b6 Message-ID: <20150413130509.8A3D8AF1F9@public.kitware.com> This is an automated email from 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 9a101b6754d058d9175c172391ca1b3bfa34fbe3 (commit) via 1f3bb59b691bf4d745e5c01b012c9d0b178bc34f (commit) via fd5cbbe0008c53ebfd666fe34be958d5b5456880 (commit) from 2cf5415d9f6e94da3f64502a57fed957d3516fc3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a101b6754d058d9175c172391ca1b3bfa34fbe3 commit 9a101b6754d058d9175c172391ca1b3bfa34fbe3 Merge: 2cf5415 1f3bb59 Author: Brad King AuthorDate: Mon Apr 13 09:05:08 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:05:08 2015 -0400 Merge topic 'suppress-osx-arch-linker-warning' 1f3bb59b CTestCustom: Suppress more OS X universal binary link arch warnings fd5cbbe0 CTestCustom: Suppress more OS X universal binary link arch warnings ----------------------------------------------------------------------- Summary of changes: CTestCustom.cmake.in | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:05:11 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:05:11 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-725-g9d1ba6d Message-ID: <20150413130511.7BE02AF1FC@public.kitware.com> This is an automated email from 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 9d1ba6d0f53a4ccf169431ceb9eb68cc098aa32a (commit) via c9e9c31c53f69475aa080ad442492408217259b5 (commit) from 9a101b6754d058d9175c172391ca1b3bfa34fbe3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d1ba6d0f53a4ccf169431ceb9eb68cc098aa32a commit 9d1ba6d0f53a4ccf169431ceb9eb68cc098aa32a Merge: 9a101b6 c9e9c31 Author: Brad King AuthorDate: Mon Apr 13 09:05:10 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:05:10 2015 -0400 Merge topic 'emulator-property' c9e9c31c Tests: Create pseudo_emulator output dir for Xcode 2.x ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:05:13 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:05:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-727-gbf5028f Message-ID: <20150413130513.9CA83AF231@public.kitware.com> This is an automated email from 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 bf5028f88dda612fbc63217cbd9ab06674fefacb (commit) via a198839a7b110a47d76d47e342b1c63f908e6878 (commit) from 9d1ba6d0f53a4ccf169431ceb9eb68cc098aa32a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf5028f88dda612fbc63217cbd9ab06674fefacb commit bf5028f88dda612fbc63217cbd9ab06674fefacb Merge: 9d1ba6d a198839 Author: Brad King AuthorDate: Mon Apr 13 09:05:12 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:05:12 2015 -0400 Merge topic 'c-locale-messages' a198839a CTest: Fix locale used for VCS updates ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 2 + Source/CTest/cmCTestUpdateHandler.cxx | 43 +------------- Source/cmCLocaleEnvironmentScope.cxx | 67 ++++++++++++++++++++++ Source/{cmCurl.h => cmCLocaleEnvironmentScope.h} | 23 ++++++-- 4 files changed, 88 insertions(+), 47 deletions(-) create mode 100644 Source/cmCLocaleEnvironmentScope.cxx copy Source/{cmCurl.h => cmCLocaleEnvironmentScope.h} (54%) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:05:15 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:05:15 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-729-g341b895 Message-ID: <20150413130515.D3420AF1F9@public.kitware.com> This is an automated email from 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 341b8953b1730f192f849640b4deeef404583df3 (commit) via 4e039a9a9814fd13142ae2c9876420ddf2414b8e (commit) from bf5028f88dda612fbc63217cbd9ab06674fefacb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=341b8953b1730f192f849640b4deeef404583df3 commit 341b8953b1730f192f849640b4deeef404583df3 Merge: bf5028f 4e039a9 Author: Brad King AuthorDate: Mon Apr 13 09:05:14 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:05:14 2015 -0400 Merge topic 'move-command-line-tests' 4e039a9a Tests: Move more command line tests into RunCMake.CommandLine ----------------------------------------------------------------------- Summary of changes: Tests/CMakeLists.txt | 15 ---- Tests/CMakeTestBadCommandLines/RunCMake.cmake | 79 -------------------- .../C-no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/C-no-arg-stderr.txt | 2 + .../C-no-file-result.txt} | 0 Tests/RunCMake/CommandLine/C-no-file-stderr.txt | 3 + .../D-no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/D-no-arg-stderr.txt | 2 + .../E-no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/E-no-arg-stderr.txt | 3 + .../E_create_symlink-no-arg-result.txt} | 0 .../CommandLine/E_create_symlink-no-arg-stderr.txt | 3 + .../E_rename-no-arg-result.txt} | 0 .../CommandLine/E_rename-no-arg-stderr.txt | 3 + .../E_touch_nocreate-no-arg-result.txt} | 0 .../CommandLine/E_touch_nocreate-no-arg-stderr.txt | 3 + .../G_bad-arg-result.txt} | 0 Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt | 1 + .../G_no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/G_no-arg-stderr.txt | 1 + Tests/RunCMake/CommandLine/NoArgs-stdout.txt | 10 +++ .../P_no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/P_no-arg-stderr.txt | 1 + .../P_no-file-result.txt} | 0 Tests/RunCMake/CommandLine/P_no-file-stderr.txt | 1 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 40 ++++++++++ .../U-no-arg-result.txt} | 0 Tests/RunCMake/CommandLine/U-no-arg-stderr.txt | 2 + Tests/RunCMake/CommandLine/Wdev-stderr.txt | 5 ++ Tests/RunCMake/CommandLine/Wdev.cmake | 1 + Tests/RunCMake/CommandLine/Wno-dev.cmake | 1 + .../cache-no-file-result.txt} | 0 .../RunCMake/CommandLine/cache-no-file-stderr.txt | 2 + Tests/RunCMake/CommandLine/debug-output-stdout.txt | 1 + .../RunCMake/CommandLine/debug-output.cmake | 0 Tests/RunCMake/CommandLine/debug-trycompile.cmake | 5 ++ .../lists-no-file-result.txt} | 0 .../RunCMake/CommandLine/lists-no-file-stderr.txt | 2 + Tests/RunCMake/CommandLine/trace-stderr.txt | 2 + .../RunCMake/CommandLine/trace.cmake | 0 40 files changed, 94 insertions(+), 94 deletions(-) delete mode 100644 Tests/CMakeTestBadCommandLines/RunCMake.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/C-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/C-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/C-no-file-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/C-no-file-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/D-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/D-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_create_symlink-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_rename-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_touch_nocreate-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/G_bad-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/G_no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/G_no-arg-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/NoArgs-stdout.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/P_no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/P_no-arg-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/P_no-file-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/P_no-file-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/U-no-arg-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/U-no-arg-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/Wdev-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/Wdev.cmake create mode 100644 Tests/RunCMake/CommandLine/Wno-dev.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/cache-no-file-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/cache-no-file-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/debug-output-stdout.txt copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/debug-output.cmake (100%) create mode 100644 Tests/RunCMake/CommandLine/debug-trycompile.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/lists-no-file-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/lists-no-file-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/trace-stderr.txt copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/trace.cmake (100%) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:05:17 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:05:17 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-731-g1862b39 Message-ID: <20150413130517.9F883AF237@public.kitware.com> This is an automated email from 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 1862b39868b5a0c256d0256ac7c71e52e59e7155 (commit) via 588dcb33b7ff089a84ce5cbacf2696b4a3646b42 (commit) from 341b8953b1730f192f849640b4deeef404583df3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1862b39868b5a0c256d0256ac7c71e52e59e7155 commit 1862b39868b5a0c256d0256ac7c71e52e59e7155 Merge: 341b895 588dcb3 Author: Brad King AuthorDate: Mon Apr 13 09:05:16 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:05:16 2015 -0400 Merge topic 'cmake-G-print-generators' 588dcb33 cmake: Provide guidance when an invalid -G option is given ----------------------------------------------------------------------- Summary of changes: Source/cmDocumentation.cxx | 15 +++++++++++++++ Source/cmDocumentation.h | 1 + Source/cmDocumentationFormatter.h | 4 ++-- Source/cmake.cxx | 16 ++++++++++++++++ Source/cmake.h | 3 +++ Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt | 4 +++- Tests/RunCMake/CommandLine/G_no-arg-stderr.txt | 4 +++- 7 files changed, 43 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:05:34 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:05:34 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1785-gbbc8d0e Message-ID: <20150413130534.CA7C7AF232@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via bbc8d0e1d4dee7f2dc08b602a47c920fd5067592 (commit) via 1862b39868b5a0c256d0256ac7c71e52e59e7155 (commit) via 341b8953b1730f192f849640b4deeef404583df3 (commit) via bf5028f88dda612fbc63217cbd9ab06674fefacb (commit) via 9d1ba6d0f53a4ccf169431ceb9eb68cc098aa32a (commit) via 9a101b6754d058d9175c172391ca1b3bfa34fbe3 (commit) via 2cf5415d9f6e94da3f64502a57fed957d3516fc3 (commit) via 74c8b9284469dcc8b5a1e7fe23dae1bdc7aad468 (commit) via e9e417b57c85c6901f729c350dca0b01628016f0 (commit) from 0e339f22ca26e53a6c7f6b9bbe270eba498a8b0e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bbc8d0e1d4dee7f2dc08b602a47c920fd5067592 commit bbc8d0e1d4dee7f2dc08b602a47c920fd5067592 Merge: 0e339f2 1862b39 Author: Brad King AuthorDate: Mon Apr 13 09:05:26 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 09:05:26 2015 -0400 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 Apr 13 09:06:08 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:06:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-734-ge0adfe6 Message-ID: <20150413130608.56C19AF247@public.kitware.com> This is an automated email from 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 e0adfe61122da9387d450e4647da26865483d680 (commit) via 9660a3cceae12ebb3cdc49484dcef590a12eb33c (commit) via 5c08e2559cf8ad5fc3cb220396016cf816a7b4b8 (commit) from 1862b39868b5a0c256d0256ac7c71e52e59e7155 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0adfe61122da9387d450e4647da26865483d680 commit e0adfe61122da9387d450e4647da26865483d680 Merge: 1862b39 9660a3c Author: Brad King AuthorDate: Mon Apr 13 09:06:07 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:06:07 2015 -0400 Merge topic 'custom-command-multiple-outputs' 9660a3cc Makefile: Fix multiple custom command outputs with one missing 5c08e255 KWSys SystemTools: Teach Touch with !create to succeed on missing file ----------------------------------------------------------------------- Summary of changes: Source/cmMakefileTargetGenerator.cxx | 58 ++++++++++++++----------- Source/cmMakefileTargetGenerator.h | 3 +- Tests/BuildDepends/CMakeLists.txt | 65 +++++++++++++++++++++++++++++ Tests/BuildDepends/Project/CMakeLists.txt | 18 ++++++++ 4 files changed, 118 insertions(+), 26 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:06:20 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:06:20 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1787-gc61b061 Message-ID: <20150413130620.5D800AF246@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c61b06167b1e14dc5d1fb7e9ce38e8857beca770 (commit) via e0adfe61122da9387d450e4647da26865483d680 (commit) from bbc8d0e1d4dee7f2dc08b602a47c920fd5067592 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c61b06167b1e14dc5d1fb7e9ce38e8857beca770 commit c61b06167b1e14dc5d1fb7e9ce38e8857beca770 Merge: bbc8d0e e0adfe6 Author: Brad King AuthorDate: Mon Apr 13 09:06:13 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 09:06:13 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:08:58 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:08:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-744-gcec6e3e Message-ID: <20150413130858.2BA1AAF75B@public.kitware.com> This is an automated email from 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 cec6e3e9eb9861a3a1a0fd7a3972fa36dd6b9996 (commit) via 74337b87acd837b9631f44b4df3027fe83ee9b42 (commit) via 0740677b9c67cfe8d26c9cf4cbddb8410d7f920a (commit) via 048c6d19253759b1a4405813afc4272c28721c05 (commit) via 0af4b40b6efee388251a9ee5ee22e9cfa90af7fe (commit) via d8126d3784c149f1738865cc239a34fdd29ec442 (commit) via 50806a1e26e536bb5cff1d3f1768211a867de8cf (commit) via 94d3988c3f75e41b750092a76c01713dc25d33fd (commit) via d449ec2f28ff5791a53e694a766cea75f5e1bb44 (commit) via dc311f5f9dc38b0368e5c0dd11854bb66d6f2093 (commit) from e0adfe61122da9387d450e4647da26865483d680 (commit) Those revisions listed 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 Apr 13 09:08:58 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:08:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1798-g7462524 Message-ID: <20150413130858.50049AF75B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7462524df06369511fffb845556eeed59624bb75 (commit) via cec6e3e9eb9861a3a1a0fd7a3972fa36dd6b9996 (commit) via 74337b87acd837b9631f44b4df3027fe83ee9b42 (commit) via 0740677b9c67cfe8d26c9cf4cbddb8410d7f920a (commit) via 048c6d19253759b1a4405813afc4272c28721c05 (commit) via 0af4b40b6efee388251a9ee5ee22e9cfa90af7fe (commit) via d8126d3784c149f1738865cc239a34fdd29ec442 (commit) via 50806a1e26e536bb5cff1d3f1768211a867de8cf (commit) via 94d3988c3f75e41b750092a76c01713dc25d33fd (commit) via d449ec2f28ff5791a53e694a766cea75f5e1bb44 (commit) via dc311f5f9dc38b0368e5c0dd11854bb66d6f2093 (commit) from c61b06167b1e14dc5d1fb7e9ce38e8857beca770 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7462524df06369511fffb845556eeed59624bb75 commit 7462524df06369511fffb845556eeed59624bb75 Merge: c61b061 cec6e3e Author: Brad King AuthorDate: Mon Apr 13 09:08:22 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 09:08:22 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:08:58 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:08:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.2.1-16-g74337b8 Message-ID: <20150413130858.6637CAF75C@public.kitware.com> This is an automated email from 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 74337b87acd837b9631f44b4df3027fe83ee9b42 (commit) via 9660a3cceae12ebb3cdc49484dcef590a12eb33c (commit) via 5c08e2559cf8ad5fc3cb220396016cf816a7b4b8 (commit) via 0740677b9c67cfe8d26c9cf4cbddb8410d7f920a (commit) via 048c6d19253759b1a4405813afc4272c28721c05 (commit) via 0af4b40b6efee388251a9ee5ee22e9cfa90af7fe (commit) via d8126d3784c149f1738865cc239a34fdd29ec442 (commit) via 1f33b45d5daca380e0be0ecfc595eac881328f29 (commit) via 50806a1e26e536bb5cff1d3f1768211a867de8cf (commit) via af61d6cb60a38069fb82f54bd7f2eb2b798bf4dc (commit) via 94d3988c3f75e41b750092a76c01713dc25d33fd (commit) via 4a2ff2b7f27e569032f6c5881e17cb053b32ccc7 (commit) via d449ec2f28ff5791a53e694a766cea75f5e1bb44 (commit) via dc311f5f9dc38b0368e5c0dd11854bb66d6f2093 (commit) via dcf298008f60fa00ddcb225b7a474317ad4d317f (commit) via 1f289095f908fddd64152c5686bec25eecbc66d6 (commit) from 732d8a467ab8a295b1bbf580f865980f8a1a9b29 (commit) Those revisions listed 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/FindMFC.cmake | 2 +- Source/cmFileLockUnix.cxx | 4 ++ Source/cmFileLockWin32.cxx | 3 + Source/cmMakefileTargetGenerator.cxx | 58 +++++++++++-------- Source/cmMakefileTargetGenerator.h | 3 +- Source/kwsys/SystemTools.cxx | 17 ++++-- Tests/BuildDepends/CMakeLists.txt | 65 ++++++++++++++++++++++ Tests/BuildDepends/Project/CMakeLists.txt | 18 ++++++ Utilities/cmcurl/CMakeLists.txt | 10 +++- Utilities/cmlibarchive/libarchive/archive_util.c | 8 ++- Utilities/cmliblzma/CMakeLists.txt | 10 ++++ Utilities/cmliblzma/config.h.in | 8 ++- 12 files changed, 168 insertions(+), 38 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:34:38 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:34:38 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1801-g5d39d49 Message-ID: <20150413133438.60754AF742@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5d39d4938f497130b59a9a8caeeb130ed7851cec (commit) via e53dcaa537215ba3f7c33a4e46adb4d605596889 (commit) via 91d5261b58e97107fca610a868fbc283cbb8c856 (commit) from 7462524df06369511fffb845556eeed59624bb75 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d39d4938f497130b59a9a8caeeb130ed7851cec commit 5d39d4938f497130b59a9a8caeeb130ed7851cec Merge: 7462524 e53dcaa Author: Brad King AuthorDate: Mon Apr 13 09:34:37 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:34:37 2015 -0400 Merge topic 'test-release' into next e53dcaa5 Merge branch 'release' into test-release 91d5261b CMake 3.2.2 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e53dcaa537215ba3f7c33a4e46adb4d605596889 commit e53dcaa537215ba3f7c33a4e46adb4d605596889 Merge: cec6e3e 91d5261 Author: Brad King AuthorDate: Mon Apr 13 09:10:12 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 09:10:12 2015 -0400 Merge branch 'release' into test-release http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91d5261b58e97107fca610a868fbc283cbb8c856 commit 91d5261b58e97107fca610a868fbc283cbb8c856 Author: Brad King AuthorDate: Mon Apr 13 09:09:42 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 09:09:42 2015 -0400 CMake 3.2.2 diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8e7ccd1..27bebc8 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 1) +set(CMake_VERSION_PATCH 2) #set(CMake_VERSION_RC 0) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:37:02 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:37:02 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1803-g1442548 Message-ID: <20150413133702.6DEDBAF86A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 14425486989dc3a724c3ff126725e10de7479751 (commit) via bb2a42aeca46c993f1a8790aadfa0e86d5e30f9b (commit) from 5d39d4938f497130b59a9a8caeeb130ed7851cec (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14425486989dc3a724c3ff126725e10de7479751 commit 14425486989dc3a724c3ff126725e10de7479751 Merge: 5d39d49 bb2a42a Author: Brad King AuthorDate: Mon Apr 13 09:37:01 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:37:01 2015 -0400 Merge topic 'FindMatlab-test-timeout' into next bb2a42ae Tests: Increasing the stability of the FindMatlab.basic_checks test http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb2a42aeca46c993f1a8790aadfa0e86d5e30f9b commit bb2a42aeca46c993f1a8790aadfa0e86d5e30f9b Author: Raffi Enficiaud AuthorDate: Fri Apr 10 22:52:16 2015 +0200 Commit: Brad King CommitDate: Mon Apr 13 09:36:13 2015 -0400 Tests: Increasing the stability of the FindMatlab.basic_checks test Increase the timeout to tolerate longer network delays. diff --git a/Tests/FindMatlab/basic_checks/CMakeLists.txt b/Tests/FindMatlab/basic_checks/CMakeLists.txt index acf71ea..bf54427 100644 --- a/Tests/FindMatlab/basic_checks/CMakeLists.txt +++ b/Tests/FindMatlab/basic_checks/CMakeLists.txt @@ -24,7 +24,7 @@ matlab_add_mex( matlab_add_unit_test( NAME ${PROJECT_NAME}_matlabtest-1 - TIMEOUT 30 + TIMEOUT 90 UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake_matlab_unit_tests1.m ADDITIONAL_PATH $ ) ----------------------------------------------------------------------- Summary of changes: Tests/FindMatlab/basic_checks/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 09:55:23 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 09:55:23 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1807-g823bac3 Message-ID: <20150413135523.9D4FFAF000@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 823bac306c688aa043e7d9c4ef8ecceb74e8c322 (commit) via a0477826da917e86fdb47b0fea68f742b6dacaf3 (commit) via 44000501b2e9662496362a8ff27e3aed6f0e8232 (commit) via c2e650bf93d6735ea4997afffffd509f2b06d80b (commit) from 14425486989dc3a724c3ff126725e10de7479751 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=823bac306c688aa043e7d9c4ef8ecceb74e8c322 commit 823bac306c688aa043e7d9c4ef8ecceb74e8c322 Merge: 1442548 a047782 Author: Brad King AuthorDate: Mon Apr 13 09:55:22 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 09:55:22 2015 -0400 Merge topic 'add-GreenHills-MULTI-generator' into next a0477826 Help: Add notes for topic 'add-GreenHills-MULTI-generator' 44000501 GHS: Note that generator is experimental c2e650bf GHS: removed hard coded flag and cleaned cmds http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0477826da917e86fdb47b0fea68f742b6dacaf3 commit a0477826da917e86fdb47b0fea68f742b6dacaf3 Author: Brad King AuthorDate: Mon Apr 13 09:51:46 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 09:54:52 2015 -0400 Help: Add notes for topic 'add-GreenHills-MULTI-generator' diff --git a/Help/release/dev/add-GreenHills-MULTI-generator.rst b/Help/release/dev/add-GreenHills-MULTI-generator.rst new file mode 100644 index 0000000..b4c5c5a --- /dev/null +++ b/Help/release/dev/add-GreenHills-MULTI-generator.rst @@ -0,0 +1,8 @@ +add-GreenHills-MULTI-generator +------------------------------ + +* A new experimental :generator:`Green Hills MULTI` generator was + added on Windows. `Green Hills MULTI`_ is an IDE for embedded + real-time systems. + +.. _`Green Hills MULTI`: http://www.ghs.com/products/MULTI_IDE.html http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44000501b2e9662496362a8ff27e3aed6f0e8232 commit 44000501b2e9662496362a8ff27e3aed6f0e8232 Author: Brad King AuthorDate: Mon Apr 13 09:51:38 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 09:54:51 2015 -0400 GHS: Note that generator is experimental diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst index 79695f1..d317f87 100644 --- a/Help/generator/Green Hills MULTI.rst +++ b/Help/generator/Green Hills MULTI.rst @@ -9,3 +9,8 @@ Customizations are available through the following cache variables: * ``GHS_CUSTOMIZATION`` * ``GHS_GPJ_MACROS`` * ``GHS_OS_DIR`` + +.. note:: + This generator is deemed experimental as of CMake |release|. + Future versions of CMake may make breaking changes as the + generator matures. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c2e650bf93d6735ea4997afffffd509f2b06d80b commit c2e650bf93d6735ea4997afffffd509f2b06d80b Author: Geoff Viola AuthorDate: Sun Apr 12 14:46:44 2015 -0600 Commit: Brad King CommitDate: Mon Apr 13 09:47:12 2015 -0400 GHS: removed hard coded flag and cleaned cmds diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 2637675..0a116ac 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -260,8 +260,11 @@ void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const &config, this->LocalGenerator->AddVisibilityPresetFlags(flags, this->Target, lang); // Append old-style preprocessor definition flags. - this->LocalGenerator->AppendFlags(flags, + if (std::string(" ") != std::string(this->Makefile->GetDefineFlags())) + { + this->LocalGenerator->AppendFlags(flags, this->Makefile->GetDefineFlags()); + } // Add target-specific flags. this->LocalGenerator->AddCompileOptions(flags, this->Target, lang, config); @@ -303,43 +306,16 @@ std::string cmGhsMultiTargetGenerator::GetDefines(const std::string &language, void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::string const &, const std::string &language) { - //this->Target->GetCompileOptions(options, config, language); - static std::string const startFilePropName("-startfile_dir="); - bool hasStartfileDirProp = false; std::map::iterator flagsByLangI = this->FlagsByLanguage.find(language); if (flagsByLangI != this->FlagsByLanguage.end()) { - std::vector flags = - cmSystemTools::SplitString(flagsByLangI->second, ' '); - for (std::vector::const_iterator flagsI = flags.begin(); - flagsI != flags.end(); ++flagsI) + if (!flagsByLangI->second.empty()) { - std::string flag = *flagsI; - if (" " != flag) - { - if (this->DDOption != flag) - { - if (flag.length() >= startFilePropName.length() && - startFilePropName == flag.substr(0, startFilePropName.length())) - { - hasStartfileDirProp = true; - } - cmSystemTools::ConvertToUnixSlashes(flag); - *this->GetFolderBuildStreams() << " " << flag << std::endl; - } - } + *this->GetFolderBuildStreams() << " " << flagsByLangI->second + << std::endl; } } - - // If this property is relative, make it relative to the root lists file - if (!hasStartfileDirProp && this->GetGlobalGenerator()->IsOSDirRelative()) - { - *this->GetFolderBuildStreams() << " " << startFilePropName << "\"" - << this->Makefile->GetHomeOutputDirectory() - << "/$(__LIBS_DIR_BASE)/$(__BSP_NAME)\"" - << std::endl; - } } void cmGhsMultiTargetGenerator::WriteCompilerDefinitions( @@ -434,12 +410,16 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper( for (cmCustomCommandLine::const_iterator commandLineI = command.begin(); commandLineI != command.end(); ++commandLineI) { + std::string subCommandE = + this->LocalGenerator->EscapeForShell(*commandLineI, true); if (!command.empty()) { *this->GetFolderBuildStreams() << (command.begin() == commandLineI ? "'" : " "); + //Need to double escape backslashes + cmSystemTools::ReplaceString(subCommandE, "\\", "\\\\"); } - *this->GetFolderBuildStreams() << *commandLineI; + *this->GetFolderBuildStreams() << subCommandE; } if (!command.empty()) { diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 8850595..d522c60 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -359,7 +359,6 @@ void cmGlobalGhsMultiGenerator::WriteCompilerOptions(std::string const &fOSDir) { *this->GetBuildFileStream() << " -os_dir=\"" << fOSDir << "\"" << std::endl; - *this->GetBuildFileStream() << " --link_once_templates" << std::endl; } void cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream *os) ----------------------------------------------------------------------- Summary of changes: Help/generator/Green Hills MULTI.rst | 5 +++ .../release/dev/add-GreenHills-MULTI-generator.rst | 8 ++++ Source/cmGhsMultiTargetGenerator.cxx | 44 ++++++-------------- Source/cmGlobalGhsMultiGenerator.cxx | 1 - 4 files changed, 25 insertions(+), 33 deletions(-) create mode 100644 Help/release/dev/add-GreenHills-MULTI-generator.rst hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 11:38:21 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 11:38:21 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-767-g92d6179 Message-ID: <20150413153821.AACC0AF5C6@public.kitware.com> This is an automated email from 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 92d61798937e42ecb7ae3d1be8b2b4ab7ce15fcb (commit) via 07d44d638bca028d2a76fb1ffdc1f1542184243c (commit) via ea819b29f8735ca09242cc646a7b25e933bc913c (commit) via 6ad86c7fc4167561c7c13c28482a5fea0fe9d70b (commit) via fca2b542b43546c64aa2c474b810890e52bd0ea4 (commit) via 7bb4e3db069e06fe2eac053e329ffb9f1ea322bf (commit) via 6241253a4b20e74625b855b1e0d5220c8e7282b1 (commit) via 0ee3ccb3b0a25264e8302a150eee297dd40affde (commit) via 57dd094eded03a94402b6eecf7027325bd7b5136 (commit) via 6deb43e6c836a61536c3d6e36ca16b51013e9134 (commit) via ecdb1b3bba991c13f3f61c7b00a80b8dd97567b2 (commit) via 04b307b961a34c00f72d9031817ce4f918288701 (commit) via 0f1f324b0dd7147850f923ab266873bd8a4a4353 (commit) via 275185ac2b30b655b53100a129f5d7518ed943ad (commit) via c57f086a81c487fa88c36a785865d27b81e3cb8d (commit) via 23368c9b83cd62724e94d345e3af940b3cda8762 (commit) via 14c70b8c580c519ca38bcd9ba5ca8fc9e7629068 (commit) via 6ed19e615bada326c38a2b27d9378959503094ae (commit) via ade20b433b2ce1cf176bc727a8ed9c47a5f6537e (commit) via 6fb306ea3bbe04b8e4dde8f13eec3e6bdfe35086 (commit) via 7450a2c6ed601dc94f2de410661065554ff8ce12 (commit) via 8c13d7709bb2a254e5927d3df1346d8264ba1bd5 (commit) via 55ecd818f6bf70590d61584a87aae7bba992e26d (commit) from cec6e3e9eb9861a3a1a0fd7a3972fa36dd6b9996 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92d61798937e42ecb7ae3d1be8b2b4ab7ce15fcb commit 92d61798937e42ecb7ae3d1be8b2b4ab7ce15fcb Merge: cec6e3e 07d44d6 Author: Brad King AuthorDate: Mon Apr 13 11:38:20 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 11:38:20 2015 -0400 Merge topic 'cmake-cleanups' 07d44d63 cmake: Remove confusing duplication. ea819b29 cmMakefile: Remove unused method. 6ad86c7f cmMakefile: Remove bad comment. fca2b542 cmMakefile: Internalize setting of CMakeInstance on Properties. 7bb4e3db cmMakefile: Out-of-line Home directory accessors. 6241253a cmake: Out-of-line Home and Start directory methods. 0ee3ccb3 cmake: Fix variable name bugs. 57dd094e Use vector, not list for cmCommand storage. 6deb43e6 Remove some files which do not need to be in BootstrapCommands. ecdb1b3b Add some missing includes. 04b307b9 cmake: Simplify CommandExists method. 0f1f324b cmake: Rename oddly named variables. 275185ac cmake: Constify GetCommand method. c57f086a cmake: Don't lower-case a string needlessly. 23368c9b cmake: Use make_pair instead of Foo::value_type. 14c70b8c cmake: out-of-line try compile state methods. ... ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 4 + Source/cmBootstrapCommands1.cxx | 3 +- Source/cmBootstrapCommands2.cxx | 3 +- Source/cmCommands.cxx.in | 2 +- Source/cmCommands.h | 8 +- Source/cmCommandsForBootstrap.cxx | 2 +- Source/cmFileCommand.cxx | 2 + Source/cmGlobalGenerator.cxx | 17 ++- Source/cmGlobalGenerator.h | 2 +- Source/cmLocalGenerator.cxx | 1 - Source/cmMakefile.cxx | 39 ++---- Source/cmMakefile.h | 11 +- Source/cmTarget.cxx | 4 +- Source/cmTargetLinkLibrariesCommand.cxx | 2 +- Source/cmake.cxx | 137 +++++++++++--------- Source/cmake.h | 48 ++----- .../get_property/DebugConfigurations-stderr.txt | 11 ++ .../get_property/DebugConfigurations.cmake | 41 ++++++ Tests/RunCMake/get_property/RunCMakeTest.cmake | 1 + bootstrap | 4 +- 20 files changed, 185 insertions(+), 157 deletions(-) create mode 100644 Tests/RunCMake/get_property/DebugConfigurations-stderr.txt create mode 100644 Tests/RunCMake/get_property/DebugConfigurations.cmake hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 11:38:35 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 11:38:35 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1809-ga5aadf8 Message-ID: <20150413153835.DA290AF5DA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a5aadf8e869824867a5b9a219b3a09fac31fd40e (commit) via 92d61798937e42ecb7ae3d1be8b2b4ab7ce15fcb (commit) from 823bac306c688aa043e7d9c4ef8ecceb74e8c322 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5aadf8e869824867a5b9a219b3a09fac31fd40e commit a5aadf8e869824867a5b9a219b3a09fac31fd40e Merge: 823bac3 92d6179 Author: Brad King AuthorDate: Mon Apr 13 11:38:28 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 11:38:28 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 11:45:00 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 11:45:00 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1814-g44ce162 Message-ID: <20150413154500.851DDAE568@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 44ce162b1ecf6f8da5b167b5bb942b646196ea4b (commit) via f081c5bdddcfcaaf5bee7b918fe5c7ff01faae35 (commit) via f71fdf0ec8289ada5b32b784bc2f6f617538ce0b (commit) via ff7169a03c2ae2e7a0440c1f2921b7ce6b2e486c (commit) via a6b1ad1309d14668e572da7937a2a8dda9e1f669 (commit) from a5aadf8e869824867a5b9a219b3a09fac31fd40e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44ce162b1ecf6f8da5b167b5bb942b646196ea4b commit 44ce162b1ecf6f8da5b167b5bb942b646196ea4b Merge: a5aadf8 f081c5b Author: Brad King AuthorDate: Mon Apr 13 11:44:58 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 11:44:58 2015 -0400 Merge topic 'introduce-cmState' into next f081c5bd cmState: Move CacheEntryType enum from cmCacheManager. f71fdf0e cmMakefile: Remove unused CacheManager accessor. ff7169a0 Port to cmState. a6b1ad13 Introduce cmState class. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f081c5bdddcfcaaf5bee7b918fe5c7ff01faae35 commit f081c5bdddcfcaaf5bee7b918fe5c7ff01faae35 Author: Stephen Kelly AuthorDate: Tue Apr 7 22:45:54 2015 +0200 Commit: Brad King CommitDate: Mon Apr 13 11:44:16 2015 -0400 cmState: Move CacheEntryType enum from cmCacheManager. diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx index fd15b99..29d9cb2 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.cxx +++ b/Source/CursesDialog/cmCursesBoolWidget.cxx @@ -16,7 +16,7 @@ cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::BOOL; + this->Type = cmState::BOOL; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 4eb8e6c..7e09242 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -55,7 +55,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( assert(value); switch (cm->GetState()->GetCacheEntryType(key)) { - case cmCacheManager::BOOL: + case cmState::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); if (cmSystemTools::IsOn(value)) { @@ -66,15 +66,15 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( static_cast(this->Entry)->SetValueAsBool(false); } break; - case cmCacheManager::PATH: + case cmState::PATH: this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1); static_cast(this->Entry)->SetString(value); break; - case cmCacheManager::FILEPATH: + case cmState::FILEPATH: this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1); static_cast(this->Entry)->SetString(value); break; - case cmCacheManager::STRING: + case cmState::STRING: { const char* stringsProp = cm->GetState() ->GetCacheEntryProperty(key, "STRINGS"); @@ -99,7 +99,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } break; } - case cmCacheManager::UNINITIALIZED: + case cmState::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", key.c_str()); break; diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index dc4ee4af..f280897 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -12,7 +12,6 @@ #ifndef cmCursesCacheEntryComposite_h #define cmCursesCacheEntryComposite_h -#include "../cmCacheManager.h" #include "cmCursesLabelWidget.h" class cmCursesCacheEntryComposite diff --git a/Source/CursesDialog/cmCursesDummyWidget.cxx b/Source/CursesDialog/cmCursesDummyWidget.cxx index 60086a5..9801e4d 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.cxx +++ b/Source/CursesDialog/cmCursesDummyWidget.cxx @@ -15,7 +15,7 @@ cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::INTERNAL; + this->Type = cmState::INTERNAL; } diff --git a/Source/CursesDialog/cmCursesFilePathWidget.cxx b/Source/CursesDialog/cmCursesFilePathWidget.cxx index 01db014..51ed670 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.cxx +++ b/Source/CursesDialog/cmCursesFilePathWidget.cxx @@ -15,6 +15,6 @@ cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, int left, int top) : cmCursesPathWidget(width, height, left, top) { - this->Type = cmCacheManager::FILEPATH; + this->Type = cmState::FILEPATH; } diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index b067743..be17a9f 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmVersion.h" #include "../cmake.h" @@ -118,11 +117,11 @@ void cmCursesMainForm::InitializeUI() for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() + cmState::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); - if (t != cmCacheManager::INTERNAL && - t != cmCacheManager::STATIC && - t != cmCacheManager::UNINITIALIZED) + if (t != cmState::INTERNAL && + t != cmState::STATIC && + t != cmState::UNINITIALIZED) { ++count; } @@ -148,11 +147,11 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() + cmState::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); - if (t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED ) + if (t == cmState::INTERNAL || + t == cmState::STATIC || + t == cmState::UNINITIALIZED ) { continue; } @@ -172,11 +171,11 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() + cmState::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); - if (t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED ) + if (t == cmState::INTERNAL || + t == cmState::STATIC || + t == cmState::UNINITIALIZED ) { continue; } @@ -294,9 +293,9 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) cmCursesWidget* cw = reinterpret_cast (field_userptr(currentField)); // If in edit mode, get out of it - if ( cw->GetType() == cmCacheManager::STRING || - cw->GetType() == cmCacheManager::PATH || - cw->GetType() == cmCacheManager::FILEPATH ) + if ( cw->GetType() == cmState::STRING || + cw->GetType() == cmState::PATH || + cw->GetType() == cmState::FILEPATH ) { cmCursesStringWidget* sw = static_cast(cw); sw->SetInEdit(false); @@ -823,7 +822,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() std::string newValue = (*this->Entries)[i]->Entry->GetValue(); std::string fixedOldValue; std::string fixedNewValue; - cmCacheManager::CacheEntryType t = + cmState::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(cacheKey); this->FixValue(t, oldValue, fixedOldValue); @@ -841,15 +840,15 @@ void cmCursesMainForm::FillCacheManagerFromUI() } } -void cmCursesMainForm::FixValue(cmCacheManager::CacheEntryType type, +void cmCursesMainForm::FixValue(cmState::CacheEntryType type, const std::string& in, std::string& out) const { out = in.substr(0,in.find_last_not_of(" ")+1); - if(type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH) + if(type == cmState::PATH || type == cmState::FILEPATH) { cmSystemTools::ConvertToUnixSlashes(out); } - if(type == cmCacheManager::BOOL) + if(type == cmState::BOOL) { if(cmSystemTools::IsOff(out.c_str())) { diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 6455252..255c823 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -113,7 +113,7 @@ protected: // cache. void FillCacheManagerFromUI(); // Fix formatting of values to a consistent form. - void FixValue(cmCacheManager::CacheEntryType type, + void FixValue(cmState::CacheEntryType type, const std::string& in, std::string& out) const; // Re-post the existing fields. Used to toggle between // normal and advanced modes. Render() should be called diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx index 2f4b59e..30110a4 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.cxx +++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx @@ -21,7 +21,7 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left, int top) : cmCursesWidget(width, height, left, top) { - this->Type = cmCacheManager::BOOL; // this is a bit of a hack + this->Type = cmState::BOOL; // this is a bit of a hack // there is no option type, and string type causes ccmake to cast // the widget into a string widget at some point. BOOL is safe for // now. diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx index 89e2238..6116823 100644 --- a/Source/CursesDialog/cmCursesPathWidget.cxx +++ b/Source/CursesDialog/cmCursesPathWidget.cxx @@ -18,7 +18,7 @@ cmCursesPathWidget::cmCursesPathWidget(int width, int height, int left, int top) : cmCursesStringWidget(width, height, left, top) { - this->Type = cmCacheManager::PATH; + this->Type = cmState::PATH; this->Cycle = false; this->CurrentIndex = 0; } @@ -59,7 +59,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w) } std::vector dirs; - cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmCacheManager::PATH?-1:0)); + cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmState::PATH?-1:0)); if ( this->CurrentIndex < dirs.size() ) { cstr = dirs[this->CurrentIndex]; diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index d25022d..acf262f 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -22,7 +22,7 @@ cmCursesStringWidget::cmCursesStringWidget(int width, int height, cmCursesWidget(width, height, left, top) { this->InEdit = false; - this->Type = cmCacheManager::STRING; + this->Type = cmState::STRING; set_field_fore(this->Field, A_NORMAL); set_field_back(this->Field, A_STANDOUT); field_opts_off(this->Field, O_STATIC); diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h index 7d82864..7bbdff1 100644 --- a/Source/CursesDialog/cmCursesWidget.h +++ b/Source/CursesDialog/cmCursesWidget.h @@ -12,7 +12,7 @@ #ifndef cmCursesWidget_h #define cmCursesWidget_h -#include "../cmCacheManager.h" +#include "../cmState.h" #include "cmCursesStandardIncludes.h" class cmCursesMainForm; @@ -46,7 +46,7 @@ public: /** * Get the type of the widget (STRING, PATH etc...) */ - cmCacheManager::CacheEntryType GetType() + cmState::CacheEntryType GetType() { return this->Type; } /** @@ -77,7 +77,7 @@ protected: cmCursesWidget(const cmCursesWidget& from); void operator=(const cmCursesWidget&); - cmCacheManager::CacheEntryType Type; + cmState::CacheEntryType Type; std::string Value; FIELD* Field; // The page in the main form this widget is in diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 775c11c..6524350 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -200,9 +200,9 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = state->GetCacheEntryType(*it); - if(t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC) + cmState::CacheEntryType t = state->GetCacheEntryType(*it); + if(t == cmState::INTERNAL || + t == cmState::STATIC) { continue; } @@ -249,28 +249,28 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toBool() ? "ON" : "OFF", s.Help.toLocal8Bit().data(), - cmCacheManager::BOOL); + cmState::BOOL); } else if(s.Type == QCMakeProperty::STRING) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::STRING); + cmState::STRING); } else if(s.Type == QCMakeProperty::PATH) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::PATH); + cmState::PATH); } else if(s.Type == QCMakeProperty::FILEPATH) { this->CMakeInstance->AddCacheEntry(s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(), s.Help.toLocal8Bit().data(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); } } @@ -286,10 +286,10 @@ QCMakePropertyList QCMake::properties() const for (std::vector::const_iterator i = cacheKeys.begin(); i != cacheKeys.end(); ++i) { - cmCacheManager::CacheEntryType t = state->GetCacheEntryType(*i); - if(t == cmCacheManager::INTERNAL || - t == cmCacheManager::STATIC || - t == cmCacheManager::UNINITIALIZED) + cmState::CacheEntryType t = state->GetCacheEntryType(*i); + if(t == cmState::INTERNAL || + t == cmState::STATIC || + t == cmState::UNINITIALIZED) { continue; } @@ -302,20 +302,20 @@ QCMakePropertyList QCMake::properties() const state->GetCacheEntryProperty(*i, "HELPSTRING")); prop.Value = QString::fromLocal8Bit(cachedValue); prop.Advanced = state->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); - if(t == cmCacheManager::BOOL) + if(t == cmState::BOOL) { prop.Type = QCMakeProperty::BOOL; prop.Value = cmSystemTools::IsOn(cachedValue); } - else if(t == cmCacheManager::PATH) + else if(t == cmState::PATH) { prop.Type = QCMakeProperty::PATH; } - else if(t == cmCacheManager::FILEPATH) + else if(t == cmState::FILEPATH) { prop.Type = QCMakeProperty::FILEPATH; } - else if(t == cmCacheManager::STRING) + else if(t == cmState::STRING) { prop.Type = QCMakeProperty::STRING; const char* stringsProperty = diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 5d32437..cdca792 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -147,6 +147,6 @@ bool cmBuildCommand makecommand.c_str(), "Command used to build entire project " "from the command line.", - cmCacheManager::STRING); + cmState::STRING); return true; } diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 171ed0f..2a06574 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -39,7 +39,7 @@ bool cmBuildNameCommand this->Makefile->AddCacheDefinition(args[0], cv.c_str(), "Name of build.", - cmCacheManager::STRING); + cmState::STRING); } return true; } @@ -74,7 +74,7 @@ bool cmBuildNameCommand this->Makefile->AddCacheDefinition(args[0], buildname.c_str(), "Name of build.", - cmCacheManager::STRING); + cmState::STRING); return true; } diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 987a7b1..5ae7d4c 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -87,27 +87,27 @@ void CCONV cmAddCacheDefinition(void *arg, const char* name, { case CM_CACHE_BOOL: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::BOOL); + cmState::BOOL); break; case CM_CACHE_PATH: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::PATH); + cmState::PATH); break; case CM_CACHE_FILEPATH: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::FILEPATH); + cmState::FILEPATH); break; case CM_CACHE_STRING: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::STRING); + cmState::STRING); break; case CM_CACHE_INTERNAL: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::INTERNAL); + cmState::INTERNAL); break; case CM_CACHE_STATIC: mf->AddCacheDefinition(name,value,doc, - cmCacheManager::STATIC); + cmState::STATIC); break; } } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 1db057b..6715638 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2279,7 +2279,7 @@ bool cmCTest::AddVariableDefinition(const std::string &arg) { std::string name; std::string value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmState::CacheEntryType type = cmState::UNINITIALIZED; if (cmake::ParseCacheEntry(arg, name, value, type)) { diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 5387d0c..289d0dc 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -22,17 +22,6 @@ #include #include -const char* cmCacheManagerTypes[] = -{ "BOOL", - "PATH", - "FILEPATH", - "STRING", - "INTERNAL", - "STATIC", - "UNINITIALIZED", - 0 -}; - cmCacheManager::cmCacheManager(cmake* cm) { this->CacheMajorVersion = 0; @@ -40,41 +29,6 @@ cmCacheManager::cmCacheManager(cmake* cm) this->CMakeInstance = cm; } -const char* cmCacheManager::TypeToString(cmCacheManager::CacheEntryType type) -{ - if ( type > 6 ) - { - return cmCacheManagerTypes[6]; - } - return cmCacheManagerTypes[type]; -} - -cmCacheManager::CacheEntryType cmCacheManager::StringToType(const char* s) -{ - int i = 0; - while(cmCacheManagerTypes[i]) - { - if(strcmp(s, cmCacheManagerTypes[i]) == 0) - { - return static_cast(i); - } - ++i; - } - return STRING; -} - -bool cmCacheManager::IsType(const char* s) -{ - for(int i=0; cmCacheManagerTypes[i]; ++i) - { - if(strcmp(s, cmCacheManagerTypes[i]) == 0) - { - return true; - } - } - return false; -} - bool cmCacheManager::LoadCache(const std::string& path) { std::set emptySet; @@ -122,7 +76,7 @@ static bool ParseEntryWithoutType(const std::string& entry, bool cmCacheManager::ParseEntry(const std::string& entry, std::string& var, std::string& value, - CacheEntryType& type) + cmState::CacheEntryType& type) { // input line is: key:type=value static cmsys::RegularExpression reg( @@ -134,14 +88,14 @@ bool cmCacheManager::ParseEntry(const std::string& entry, if(regQuoted.find(entry)) { var = regQuoted.match(1); - type = cmCacheManager::StringToType(regQuoted.match(2).c_str()); + type = cmState::StringToCacheEntryType(regQuoted.match(2).c_str()); value = regQuoted.match(3); flag = true; } else if (reg.find(entry)) { var = reg.match(1); - type = cmCacheManager::StringToType(reg.match(2).c_str()); + type = cmState::StringToCacheEntryType(reg.match(2).c_str()); value = reg.match(3); flag = true; } @@ -250,7 +204,7 @@ bool cmCacheManager::LoadCache(const std::string& path, // If the entry is not internal to the cache being loaded // or if it is in the list of internal entries to be // imported, load it. - if ( internal || (e.Type != INTERNAL) || + if ( internal || (e.Type != cmState::INTERNAL) || (includes.find(entryKey) != includes.end()) ) { // If we are loading the cache from another project, @@ -258,7 +212,7 @@ bool cmCacheManager::LoadCache(const std::string& path, // not visible in the gui if (!internal) { - e.Type = INTERNAL; + e.Type = cmState::INTERNAL; helpString = "DO NOT EDIT, "; helpString += entryKey; helpString += " loaded from external file. " @@ -306,10 +260,10 @@ bool cmCacheManager::LoadCache(const std::string& path, // Set as version 0.0 this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", "0", "Minor version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmState::INTERNAL); this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", "0", "Major version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmState::INTERNAL); } // check to make sure the cache directory has not @@ -351,7 +305,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, CacheEntry& e) { // All property entries are internal. - if(e.Type != cmCacheManager::INTERNAL) + if(e.Type != cmState::INTERNAL) { return false; } @@ -370,7 +324,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, // Create an entry and store the property. CacheEntry& ne = this->Cache[key]; ne.Properties.SetCMakeInstance(this->CMakeInstance); - ne.Type = cmCacheManager::UNINITIALIZED; + ne.Type = cmState::UNINITIALIZED; ne.SetProperty(*p, e.Value.c_str()); } else @@ -427,15 +381,15 @@ bool cmCacheManager::SaveCache(const std::string& path) sprintf(temp, "%d", cmVersion::GetMinorVersion()); this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp, "Minor version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmState::INTERNAL); sprintf(temp, "%d", cmVersion::GetMajorVersion()); this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", temp, "Major version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmState::INTERNAL); sprintf(temp, "%d", cmVersion::GetPatchVersion()); this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION", temp, "Patch version of cmake used to create the " - "current loaded cache", cmCacheManager::INTERNAL); + "current loaded cache", cmState::INTERNAL); // Let us store the current working directory so that if somebody // Copies it, he will not be surprised @@ -450,7 +404,7 @@ bool cmCacheManager::SaveCache(const std::string& path) cmSystemTools::ConvertToUnixSlashes(currentcwd); this->AddCacheEntry("CMAKE_CACHEFILE_DIR", currentcwd.c_str(), "This is the directory where this CMakeCache.txt" - " was created", cmCacheManager::INTERNAL); + " was created", cmState::INTERNAL); fout << "# This is the CMakeCache file.\n" << "# For build in directory: " << currentcwd << "\n"; @@ -484,7 +438,7 @@ bool cmCacheManager::SaveCache(const std::string& path) this->Cache.begin(); i != this->Cache.end(); ++i) { const CacheEntry& ce = (*i).second; - CacheEntryType t = ce.Type; + cmState::CacheEntryType t = ce.Type; if(!ce.Initialized) { /* @@ -493,7 +447,7 @@ bool cmCacheManager::SaveCache(const std::string& path) "\" is uninitialized"); */ } - else if(t != INTERNAL) + else if(t != cmState::INTERNAL) { // Format is key:type=value if(const char* help = ce.GetProperty("HELPSTRING")) @@ -505,7 +459,7 @@ bool cmCacheManager::SaveCache(const std::string& path) cmCacheManager::OutputHelpString(fout, "Missing description"); } this->OutputKey(fout, i->first); - fout << ":" << cmCacheManagerTypes[t] << "="; + fout << ":" << cmState::CacheEntryTypeToString(t) << "="; this->OutputValue(fout, ce.Value); fout << "\n\n"; } @@ -525,9 +479,9 @@ bool cmCacheManager::SaveCache(const std::string& path) continue; } - CacheEntryType t = i.GetType(); + cmState::CacheEntryType t = i.GetType(); this->WritePropertyEntries(fout, i); - if(t == cmCacheManager::INTERNAL) + if(t == cmState::INTERNAL) { // Format is key:type=value if(const char* help = i.GetProperty("HELPSTRING")) @@ -535,7 +489,7 @@ bool cmCacheManager::SaveCache(const std::string& path) this->OutputHelpString(fout, help); } this->OutputKey(fout, i.GetName()); - fout << ":" << cmCacheManagerTypes[t] << "="; + fout << ":" << cmState::CacheEntryTypeToString(t) << "="; this->OutputValue(fout, i.GetValue()); fout << "\n"; } @@ -677,7 +631,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const for(std::map::const_iterator i = this->Cache.begin(); i != this->Cache.end(); ++i) { - if((*i).second.Type != INTERNAL) + if((*i).second.Type != cmState::INTERNAL) { out << (*i).first << " = " << (*i).second.Value << std::endl; @@ -693,7 +647,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const void cmCacheManager::AddCacheEntry(const std::string& key, const char* value, const char* helpString, - CacheEntryType type) + cmState::CacheEntryType type) { CacheEntry& e = this->Cache[key]; e.Properties.SetCMakeInstance(this->CMakeInstance); @@ -708,7 +662,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key, } e.Type = type; // make sure we only use unix style paths - if(type == FILEPATH || type == PATH) + if(type == cmState::FILEPATH || type == cmState::PATH) { if(e.Value.find(';') != e.Value.npos) { @@ -789,7 +743,7 @@ cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const { if(prop == "TYPE") { - return cmCacheManagerTypes[this->Type]; + return cmState::CacheEntryTypeToString(this->Type); } else if(prop == "VALUE") { @@ -806,7 +760,7 @@ void cmCacheManager::CacheEntry::SetProperty(const std::string& prop, { if(prop == "TYPE") { - this->Type = cmCacheManager::StringToType(value? value : "STRING"); + this->Type = cmState::StringToCacheEntryType(value? value : "STRING"); } else if(prop == "VALUE") { @@ -825,7 +779,7 @@ void cmCacheManager::CacheEntry::AppendProperty(const std::string& prop, { if(prop == "TYPE") { - this->Type = cmCacheManager::StringToType(value? value : "STRING"); + this->Type = cmState::StringToCacheEntryType(value? value : "STRING"); } else if(prop == "VALUE") { diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 00ae334..8462259 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -14,6 +14,8 @@ #include "cmStandardIncludes.h" #include "cmPropertyMap.h" +#include "cmState.h" + class cmMakefile; class cmMarkAsAdvancedCommand; class cmake; @@ -30,21 +32,22 @@ public: cmCacheManager(cmake* cm); class CacheIterator; friend class cmCacheManager::CacheIterator; - enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, - UNINITIALIZED }; private: struct CacheEntry { std::string Value; - CacheEntryType Type; + cmState::CacheEntryType Type; cmPropertyMap Properties; const char* GetProperty(const std::string&) const; void SetProperty(const std::string& property, const char* value); void AppendProperty(const std::string& property, const char* value, bool asString=false); bool Initialized; - CacheEntry() : Value(""), Type(UNINITIALIZED), Initialized(false) + CacheEntry() + : Value(""), + Type(cmState::UNINITIALIZED), + Initialized(false) {} }; @@ -68,8 +71,10 @@ public: const char* GetValue() const { return this->GetEntry().Value.c_str(); } bool GetValueAsBool() const; void SetValue(const char*); - CacheEntryType GetType() const { return this->GetEntry().Type; } - void SetType(CacheEntryType ty) { this->GetEntry().Type = ty; } + cmState::CacheEntryType GetType() const + { return this->GetEntry().Type; } + void SetType(cmState::CacheEntryType ty) + { this->GetEntry().Type = ty; } bool Initialized() { return this->GetEntry().Initialized; } cmCacheManager &Container; std::map::iterator Position; @@ -94,17 +99,6 @@ public: return CacheIterator(*this); } - /** - * Types for the cache entries. These are useful as - * hints for a cache editor program. Path should bring - * up a file chooser, BOOL a check box, and STRING a - * text entry box, FILEPATH is a full path to a file which - * can be different than just a path input - */ - static CacheEntryType StringToType(const char*); - static const char* TypeToString(CacheEntryType); - static bool IsType(const char*); - ///! Load a cache for given makefile. Loads from path/CMakeCache.txt. bool LoadCache(const std::string& path); bool LoadCache(const std::string& path, bool internal, @@ -134,7 +128,7 @@ public: static bool ParseEntry(const std::string& entry, std::string& var, std::string& value, - CacheEntryType& type); + cmState::CacheEntryType& type); ///! Get a value from the cache given a key const char* GetInitializedCacheValue(const std::string& key) const; @@ -155,7 +149,7 @@ public: return this->GetCacheIterator(key.c_str()).GetProperty(propName); } - CacheEntryType GetCacheEntryType(std::string const& key) + cmState::CacheEntryType GetCacheEntryType(std::string const& key) { return this->GetCacheIterator(key.c_str()).GetType(); } @@ -223,7 +217,8 @@ public: protected: ///! Add an entry into the cache void AddCacheEntry(const std::string& key, const char* value, - const char* helpString, CacheEntryType type); + const char* helpString, + cmState::CacheEntryType type); ///! Get a cache entry object for a key CacheEntry *GetCacheEntry(const std::string& key); diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 59efa52..56a884c 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmCoreTryCompile.h" #include "cmake.h" -#include "cmCacheManager.h" #include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmAlgorithms.h" @@ -527,7 +526,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) this->Makefile->AddCacheDefinition(argv[0], (res == 0 ? "TRUE" : "FALSE"), "Result of TRY_COMPILE", - cmCacheManager::INTERNAL); + cmState::INTERNAL); if (!outputVariable.empty()) { diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 6750769..35b70e8 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -222,7 +222,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, // in the cache valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), - cacheEntryName.c_str(), cmCacheManager::STRING, + cacheEntryName.c_str(), cmState::STRING, true); mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } @@ -243,7 +243,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, { valueToUse = envVarValue; mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(), - cacheEntryName.c_str(), cmCacheManager::STRING, + cacheEntryName.c_str(), cmState::STRING, true); mf->GetCMakeInstance()->SaveCache(mf->GetHomeOutputDirectory()); } diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index f10d545..add06a7 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -378,7 +378,7 @@ bool cmFindBase::CheckForVariableInCache() // original value. Tell the subclass implementations to do // this. if(cached && state->GetCacheEntryType(this->VariableName) - == cmCacheManager::UNINITIALIZED) + == cmState::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; } diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index c499f61..ef8340b 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindLibraryCommand.h" -#include "cmCacheManager.h" #include #include @@ -39,7 +38,7 @@ bool cmFindLibraryCommand { this->Makefile->AddCacheDefinition(this->VariableName, "", this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); } return true; } @@ -72,14 +71,14 @@ bool cmFindLibraryCommand this->Makefile->AddCacheDefinition(this->VariableName, library.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); return true; } std::string notfound = this->VariableName + "-NOTFOUND"; this->Makefile->AddCacheDefinition(this->VariableName, notfound.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); return true; } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 4d7fd60..b32f5fd 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -947,7 +947,7 @@ bool cmFindPackageCommand::FindConfig() // We force the value since we do not get here if it was already set. this->Makefile->AddCacheDefinition(this->Variable, init.c_str(), help.c_str(), - cmCacheManager::PATH, true); + cmState::PATH, true); return found; } diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 49fbf45..1f3d1a4 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindPathCommand.h" -#include "cmCacheManager.h" #include @@ -41,7 +40,7 @@ bool cmFindPathCommand this->VariableName, "", this->VariableDocumentation.c_str(), (this->IncludeFileInPath ? - cmCacheManager::FILEPATH :cmCacheManager::PATH) + cmState::FILEPATH :cmState::PATH) ); } return true; @@ -54,7 +53,7 @@ bool cmFindPathCommand (this->VariableName, result.c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? - cmCacheManager::FILEPATH :cmCacheManager::PATH); + cmState::FILEPATH :cmState::PATH); return true; } this->Makefile->AddCacheDefinition @@ -62,7 +61,7 @@ bool cmFindPathCommand (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), (this->IncludeFileInPath) ? - cmCacheManager::FILEPATH :cmCacheManager::PATH); + cmState::FILEPATH :cmState::PATH); return true; } diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 4ee419c..fbd9fd3 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmFindProgramCommand.h" -#include "cmCacheManager.h" #include #if defined(__APPLE__) @@ -37,7 +36,7 @@ bool cmFindProgramCommand { this->Makefile->AddCacheDefinition(this->VariableName, "", this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); } return true; } @@ -49,14 +48,14 @@ bool cmFindProgramCommand this->Makefile->AddCacheDefinition(this->VariableName, result.c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); return true; } this->Makefile->AddCacheDefinition(this->VariableName, (this->VariableName + "-NOTFOUND").c_str(), this->VariableDocumentation.c_str(), - cmCacheManager::FILEPATH); + cmState::FILEPATH); return true; } diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 9aceb39..6947a7f 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -117,13 +117,13 @@ bool cmGetFilenameComponentCommand { this->Makefile->AddCacheDefinition (storeArgs, programArgs.c_str(), - "", args[2] == "PATH" ? cmCacheManager::FILEPATH - : cmCacheManager::STRING); + "", args[2] == "PATH" ? cmState::FILEPATH + : cmState::STRING); } this->Makefile->AddCacheDefinition (args[0], result.c_str(), "", - args[2] == "PATH" ? cmCacheManager::FILEPATH - : cmCacheManager::STRING); + args[2] == "PATH" ? cmState::FILEPATH + : cmState::STRING); } else { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f6ec643..4a93446 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -311,7 +311,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) makeProgram += saveFile; mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", makeProgram.c_str(), "make program", - cmCacheManager::FILEPATH); + cmState::FILEPATH); } } @@ -1116,7 +1116,7 @@ void cmGlobalGenerator::Configure() sprintf(num,"%d",static_cast(this->LocalGenerators.size())); this->GetCMakeInstance()->AddCacheEntry ("CMAKE_NUMBER_OF_LOCAL_GENERATORS", num, - "number of local generators", cmCacheManager::INTERNAL); + "number of local generators", cmState::INTERNAL); // check for link libraries and include directories containing "NOTFOUND" // and for infinite loops @@ -1894,7 +1894,7 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen, gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM"); this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make, "make program", - cmCacheManager::FILEPATH); + cmState::FILEPATH); // copy the enabled languages this->LanguageEnabled = gen->LanguageEnabled; this->LanguagesReady = gen->LanguagesReady; diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 7648813..22d633c 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -97,7 +97,7 @@ std::string cmGlobalUnixMakefileGenerator3::GetEditCacheCommand() const { cm->AddCacheEntry ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(), - "Path to cache edit program executable.", cmCacheManager::INTERNAL); + "Path to cache edit program executable.", cmState::INTERNAL); } } const char* edit_cmd = cm->GetCacheDefinition("CMAKE_EDIT_COMMAND"); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 0e0e63a..6a3a145 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -89,7 +89,7 @@ void cmGlobalVisualStudio7Generator "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmState::STRING); } // Create list of configurations requested by user's cache, if any. @@ -109,7 +109,7 @@ void cmGlobalVisualStudio7Generator mf->AddCacheDefinition ("CMAKE_MSVCIDE_RUN_PATH", extraPath, "Saved environment variable CMAKE_MSVCIDE_RUN_PATH", - cmCacheManager::STATIC); + cmState::STATIC); } } @@ -335,7 +335,7 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmState::STRING); } void cmGlobalVisualStudio7Generator::Generate() @@ -970,7 +970,7 @@ void cmGlobalVisualStudio7Generator::CreateGUID(const std::string& name) ret = cmSystemTools::UpperCase(ret); this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), ret.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } std::vector *cmGlobalVisualStudio7Generator::GetConfigurations() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0561a05..7488386 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -285,7 +285,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vectorconst& "Semicolon separated list of supported configuration types, " "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " "anything else will be ignored.", - cmCacheManager::STRING); + cmState::STRING); } } mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); @@ -2754,7 +2754,7 @@ std::string cmGlobalXCodeGenerator::GetOrCreateId(const std::string& name, } this->CMakeInstance->AddCacheEntry(guidStoreName.c_str(), - id.c_str(), "Stored Xcode object GUID", cmCacheManager::INTERNAL); + id.c_str(), "Stored Xcode object GUID", cmState::INTERNAL); return id; } diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index d40d8fe..1e7258a 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -73,7 +73,7 @@ bool cmIncludeExternalMSProjectCommand std::string guidVariable = utility_name + "_GUID_CMAKE"; this->Makefile->GetCMakeInstance()->AddCacheEntry( guidVariable.c_str(), customGuid.c_str(), - "Stored GUID", cmCacheManager::INTERNAL); + "Stored GUID", cmState::INTERNAL); } // Create a target instance for this utility. diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index e2ae901..6ade535 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -172,7 +172,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) // Check one line of the cache file. std::string var; std::string value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmState::CacheEntryType type = cmState::UNINITIALIZED; if(cmake::ParseCacheEntry(line, var, value, type)) { // Found a real entry. See if this one was requested. diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index aa70ab9..2b67562 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -118,7 +118,7 @@ void cmLocalVisualStudio10Generator AddCacheEntry(guidStoreName.c_str(), parser.GUID.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index c4abeb2..884212b 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -16,7 +16,6 @@ #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmSourceFile.h" -#include "cmCacheManager.h" #include "cmGeneratorTarget.h" #include "cmCustomCommandGenerator.h" #include "cmake.h" @@ -2331,7 +2330,7 @@ void cmLocalVisualStudio7Generator::ReadAndStoreExternalGUID( AddCacheEntry(guidStoreName.c_str(), parser.GUID.c_str(), "Stored GUID", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 94e4695..6aa5224 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -18,7 +18,6 @@ #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmCommands.h" -#include "cmCacheManager.h" #include "cmState.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" @@ -1806,7 +1805,7 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value) void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmCacheManager::CacheEntryType type, + cmState::CacheEntryType type, bool force) { bool haveVal = value ? true : false; @@ -1815,7 +1814,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, this->GetState()->GetInitializedCacheValue(name); if(existingValue && (this->GetState()->GetCacheEntryType(name) - == cmCacheManager::UNINITIALIZED)) + == cmState::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in @@ -1824,7 +1823,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, val = existingValue; haveVal = true; } - if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) + if ( type == cmState::PATH || type == cmState::FILEPATH ) { std::vector::size_type cc; std::vector files; @@ -3617,7 +3616,7 @@ int cmMakefile::TryCompile(const std::string& srcdir, // Add this before the user-provided CMake arguments in case // one of the arguments is -DCMAKE_BUILD_TYPE=... cm.AddCacheEntry("CMAKE_BUILD_TYPE", config, - "Build configuration", cmCacheManager::STRING); + "Build configuration", cmState::STRING); } } // if cmake args were provided then pass them in @@ -3656,12 +3655,12 @@ int cmMakefile::TryCompile(const std::string& srcdir, if(this->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "TRUE", "", cmCacheManager::INTERNAL); + "TRUE", "", cmState::INTERNAL); } else { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "FALSE", "", cmCacheManager::INTERNAL); + "FALSE", "", cmState::INTERNAL); } if (cm.Configure() != 0) { @@ -4914,7 +4913,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, "For backwards compatibility, what version of CMake " "commands and " "syntax should this version of CMake try to support.", - cmCacheManager::STRING); + cmState::STRING); } } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index fad31d1..da92ad7 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -22,6 +22,7 @@ #include "cmGeneratorTarget.h" #include "cmExpandedCommandArgument.h" #include "cmake.h" +#include "cmState.h" #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmSourceGroup.h" @@ -305,7 +306,7 @@ public: ///! Add a definition to this makefile and the global cmake cache. void AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmCacheManager::CacheEntryType type, + cmState::CacheEntryType type, bool force = false); /** diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 66f1ebc..10d30f3 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -39,7 +39,7 @@ bool cmMarkAsAdvancedCommand cmState* state = this->Makefile->GetState(); if (!state->GetCacheEntryValue(variable)) { - state->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); + state->AddCacheEntry(variable, 0, 0, cmState::UNINITIALIZED); overwrite = true; } if (!state->GetCacheEntryValue(variable)) diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 6c090de..92be5f1 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -46,7 +46,7 @@ bool cmOptionCommand const char* existingValue = state->GetCacheEntryValue(args[0]); if(existingValue) { - if (state->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) + if (state->GetCacheEntryType(args[0]) != cmState::UNINITIALIZED) { state->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; @@ -59,6 +59,6 @@ bool cmOptionCommand } bool init = cmSystemTools::IsOn(initialValue.c_str()); this->Makefile->AddCacheDefinition(args[0], init? "ON":"OFF", - args[1].c_str(), cmCacheManager::BOOL); + args[1].c_str(), cmState::BOOL); return true; } diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 61c0133..601dc54 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -30,11 +30,11 @@ bool cmProjectCommand this->Makefile->AddCacheDefinition (bindir, this->Makefile->GetCurrentOutputDirectory(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmState::STATIC); this->Makefile->AddCacheDefinition (srcdir, this->Makefile->GetCurrentDirectory(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmState::STATIC); bindir = "PROJECT_BINARY_DIR"; srcdir = "PROJECT_SOURCE_DIR"; @@ -59,7 +59,7 @@ bool cmProjectCommand this->Makefile->AddCacheDefinition ("CMAKE_PROJECT_NAME", args[0].c_str(), - "Value Computed by CMake", cmCacheManager::STATIC); + "Value Computed by CMake", cmState::STATIC); } bool haveVersion = false; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index c636d53..bf9f42c 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -79,8 +79,8 @@ bool cmSetCommand bool cache = false; // optional bool force = false; // optional bool parentScope = false; - cmCacheManager::CacheEntryType type - = cmCacheManager::STRING; // required if cache + cmState::CacheEntryType type + = cmState::STRING; // required if cache const char* docstring = 0; // required if cache unsigned int ignoreLastArgs = 0; @@ -131,7 +131,7 @@ bool cmSetCommand if(cache) { std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0); - type = cmCacheManager::StringToType(args[cacheStart+1].c_str()); + type = cmState::StringToCacheEntryType(args[cacheStart+1].c_str()); docstring = args[cacheStart+2].c_str(); } @@ -139,13 +139,13 @@ bool cmSetCommand cmState* state = this->Makefile->GetState(); const char* existingValue = state->GetCacheEntryValue(variable); if(existingValue && - (state->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) + (state->GetCacheEntryType(variable) != cmState::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal // then leave now without setting any definitions in the cache // or the makefile - if(cache && type != cmCacheManager::INTERNAL && !force) + if(cache && type != cmState::INTERNAL && !force) { return true; } diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 08de585..bb94a72 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -14,7 +14,6 @@ #include "cmSetTestsPropertiesCommand.h" #include "cmSetSourceFilesPropertiesCommand.h" -#include "cmCacheManager.h" //---------------------------------------------------------------------------- cmSetPropertyCommand::cmSetPropertyCommand() @@ -426,7 +425,7 @@ bool cmSetPropertyCommand::HandleCacheMode() } else if(this->PropertyName == "TYPE") { - if(!cmCacheManager::IsType(this->PropertyValue.c_str())) + if(!cmState::IsCacheEntryType(this->PropertyValue.c_str())) { std::ostringstream e; e << "given invalid CACHE entry TYPE \"" << this->PropertyValue << "\""; diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 927888b..20a61a0 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -88,7 +88,7 @@ bool cmSiteNameCommand AddCacheDefinition(args[0], siteName.c_str(), "Name of the computer/site where compile is being run", - cmCacheManager::STRING); + cmState::STRING); return true; } diff --git a/Source/cmState.cxx b/Source/cmState.cxx index f5e3752..7602f63 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -12,26 +12,59 @@ #include "cmState.h" #include "cmake.h" +#include "cmCacheManager.h" cmState::cmState(cmake* cm) : CMakeInstance(cm) { } -cmCacheManager::CacheEntryType -cmState::StringToCacheEntryType(const char* s) + +const char* cmCacheEntryTypes[] = +{ "BOOL", + "PATH", + "FILEPATH", + "STRING", + "INTERNAL", + "STATIC", + "UNINITIALIZED", + 0 +}; + +const char* +cmState::CacheEntryTypeToString(cmState::CacheEntryType type) { - return cmCacheManager::StringToType(s); + if ( type > 6 ) + { + return cmCacheEntryTypes[6]; + } + return cmCacheEntryTypes[type]; } -const char* -cmState::CacheEntryTypeToString(cmCacheManager::CacheEntryType t) +cmState::CacheEntryType +cmState::StringToCacheEntryType(const char* s) { - return cmCacheManager::TypeToString(t); + int i = 0; + while(cmCacheEntryTypes[i]) + { + if(strcmp(s, cmCacheEntryTypes[i]) == 0) + { + return static_cast(i); + } + ++i; + } + return STRING; } bool cmState::IsCacheEntryType(std::string const& key) { - return cmCacheManager::IsType(key.c_str()); + for(int i=0; cmCacheEntryTypes[i]; ++i) + { + if(strcmp(key.c_str(), cmCacheEntryTypes[i]) == 0) + { + return true; + } + } + return false; } std::vector cmState::GetCacheEntryKeys() const @@ -64,7 +97,7 @@ cmState::GetInitializedCacheValue(std::string const& key) const return this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue(key); } -cmCacheManager::CacheEntryType +cmState::CacheEntryType cmState::GetCacheEntryType(std::string const& key) const { cmCacheManager::CacheIterator it = @@ -117,7 +150,7 @@ bool cmState::GetCacheEntryPropertyAsBool(std::string const& key, void cmState::AddCacheEntry(const std::string& key, const char* value, const char* helpString, - cmCacheManager::CacheEntryType type) + cmState::CacheEntryType type) { this->CMakeInstance->GetCacheManager()->AddCacheEntry(key, value, helpString, type); diff --git a/Source/cmState.h b/Source/cmState.h index 06b0ec6..f2e8ef5 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -12,7 +12,7 @@ #ifndef cmState_h #define cmState_h -#include "cmCacheManager.h" +#include "cmStandardIncludes.h" class cmake; @@ -21,21 +21,21 @@ class cmState public: cmState(cmake* cm); - static cmCacheManager::CacheEntryType StringToCacheEntryType(const char*); - static const char* CacheEntryTypeToString(cmCacheManager::CacheEntryType); + enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, + UNINITIALIZED }; + static CacheEntryType StringToCacheEntryType(const char*); + static const char* CacheEntryTypeToString(CacheEntryType); static bool IsCacheEntryType(std::string const& key); std::vector GetCacheEntryKeys() const; const char* GetCacheEntryValue(std::string const& key) const; const char* GetInitializedCacheValue(std::string const& key) const; - cmCacheManager::CacheEntryType - GetCacheEntryType(std::string const& key) const; + CacheEntryType GetCacheEntryType(std::string const& key) const; void SetCacheEntryValue(std::string const& key, std::string const& value); void SetCacheValue(std::string const& key, std::string const& value); void AddCacheEntry(const std::string& key, const char* value, - const char* helpString, - cmCacheManager::CacheEntryType type); + const char* helpString, CacheEntryType type); void RemoveCacheEntry(std::string const& key); void SetCacheEntryProperty(std::string const& key, diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b3d1155..1702a7d 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1181,7 +1181,7 @@ void cmTarget::ClearDependencyInformation( cmMakefile& mf, if (this->RecordDependencies) { mf.AddCacheDefinition(depname, "", - "Dependencies for target", cmCacheManager::STATIC); + "Dependencies for target", cmState::STATIC); } else { @@ -1369,7 +1369,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, dependencies += ";"; mf.AddCacheDefinition( targetEntry, dependencies.c_str(), "Dependencies for the target", - cmCacheManager::STATIC ); + cmState::STATIC ); } } diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 3f766ab..bcc4a83 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmTryRunCommand.h" -#include "cmCacheManager.h" #include "cmTryCompileCommand.h" #include @@ -217,7 +216,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs, } this->Makefile->AddCacheDefinition(this->RunResultVariable, retChar, "Result of TRY_RUN", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } /* This is only used when cross compiling. Instead of running the @@ -262,7 +261,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->Makefile->AddCacheDefinition(this->RunResultVariable, "PLEASE_FILL_OUT-FAILED_TO_RUN", comment.c_str(), - cmCacheManager::STRING); + cmState::STRING); cmState* state = this->Makefile->GetState(); const char* existingValue @@ -290,7 +289,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, this->Makefile->AddCacheDefinition(internalRunOutputName, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), - cmCacheManager::STRING); + cmState::STRING); cmState* state = this->Makefile->GetState(); const char* existing = state->GetCacheEntryValue(internalRunOutputName); diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 2799a9b..10122e9 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmUtilitySourceCommand.h" +#include "cmCacheManager.h" + // cmUtilitySourceCommand bool cmUtilitySourceCommand ::InitialPass(std::vector const& args, cmExecutionStatus &) @@ -118,14 +120,14 @@ bool cmUtilitySourceCommand this->Makefile->AddCacheDefinition(cacheEntry, utilityExecutable.c_str(), "Path to an internal program.", - cmCacheManager::FILEPATH); + cmState::FILEPATH); // add a value into the cache that maps from the // full path to the name of the project cmSystemTools::ConvertToUnixSlashes(utilityExecutable); this->Makefile->AddCacheDefinition(utilityExecutable, utilityName.c_str(), "Executable to project name.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); return true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a337b2c..b1eea98 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -338,7 +338,7 @@ bool cmake::SetCacheArgs(const std::vector& args) } } std::string var, value; - cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + cmState::CacheEntryType type = cmState::UNINITIALIZED; if(cmCacheManager::ParseEntry(entry, var, value, type)) { // The value is transformed if it is a filepath for example, so @@ -409,8 +409,8 @@ bool cmake::SetCacheArgs(const std::vector& args) for (std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = this->State->GetCacheEntryType(*it); - if(t != cmCacheManager::STATIC) + cmState::CacheEntryType t = this->State->GetCacheEntryType(*it); + if(t != cmState::STATIC) { if (regex.find(it->c_str())) { @@ -975,14 +975,14 @@ int cmake::AddCMakePaths() // Save the value in the cache this->CacheManager->AddCacheEntry ("CMAKE_COMMAND", cmSystemTools::GetCMakeCommand().c_str(), - "Path to CMake executable.", cmCacheManager::INTERNAL); + "Path to CMake executable.", cmState::INTERNAL); #ifdef CMAKE_BUILD_WITH_CMAKE this->CacheManager->AddCacheEntry ("CMAKE_CTEST_COMMAND", cmSystemTools::GetCTestCommand().c_str(), - "Path to ctest program executable.", cmCacheManager::INTERNAL); + "Path to ctest program executable.", cmState::INTERNAL); this->CacheManager->AddCacheEntry ("CMAKE_CPACK_COMMAND", cmSystemTools::GetCPackCommand().c_str(), - "Path to cpack program executable.", cmCacheManager::INTERNAL); + "Path to cpack program executable.", cmState::INTERNAL); #endif if(!cmSystemTools::FileExists( (cmSystemTools::GetCMakeRoot()+"/Modules/CMake.cmake").c_str())) @@ -996,7 +996,7 @@ int cmake::AddCMakePaths() } this->CacheManager->AddCacheEntry ("CMAKE_ROOT", cmSystemTools::GetCMakeRoot().c_str(), - "Path to CMake installation.", cmCacheManager::INTERNAL); + "Path to CMake installation.", cmState::INTERNAL); return 1; } @@ -1238,7 +1238,7 @@ struct SaveCacheEntry std::string key; std::string value; std::string help; - cmCacheManager::CacheEntryType type; + cmState::CacheEntryType type; }; int cmake::HandleDeleteCacheVariables(const std::string& var) @@ -1311,7 +1311,7 @@ int cmake::Configure() AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE", "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } else { @@ -1319,7 +1319,7 @@ int cmake::Configure() AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE", "Suppress Warnings that are meant for" " the author of the CMakeLists.txt files.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } } int ret = this->ActualConfigure(); @@ -1355,7 +1355,7 @@ int cmake::ActualConfigure() this->GetHomeDirectory(), "Start directory with the top level CMakeLists.txt file for this " "project", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } // no generator specified on the command line @@ -1464,11 +1464,11 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName().c_str(), "Name of generator.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); this->CacheManager->AddCacheEntry("CMAKE_EXTRA_GENERATOR", this->GlobalGenerator->GetExtraGeneratorName().c_str(), "Name of external makefile project generator.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } if(const char* platformName = @@ -1496,7 +1496,7 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_PLATFORM", this->GeneratorPlatform.c_str(), "Name of generator platform.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } if(const char* tsName = @@ -1524,7 +1524,7 @@ int cmake::ActualConfigure() this->CacheManager->AddCacheEntry("CMAKE_GENERATOR_TOOLSET", this->GeneratorToolset.c_str(), "Name of generator toolset.", - cmCacheManager::INTERNAL); + cmState::INTERNAL); } // reset any system configuration information, except for when we are @@ -1562,7 +1562,7 @@ int cmake::ActualConfigure() this->State->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", - cmCacheManager::PATH); + cmState::PATH); } if(!this->State ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) @@ -1570,7 +1570,7 @@ int cmake::ActualConfigure() this->State->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", "Single output directory for building all executables.", - cmCacheManager::PATH); + cmState::PATH); } } if(!this->State @@ -1579,7 +1579,7 @@ int cmake::ActualConfigure() this->State->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", - cmCacheManager::BOOL); + cmState::BOOL); if (!this->State->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", "ADVANCED")) { @@ -1804,7 +1804,7 @@ void cmake::AddCacheEntry(const std::string& key, const char* value, { this->CacheManager->AddCacheEntry(key, value, helpString, - cmCacheManager::CacheEntryType(type)); + cmState::CacheEntryType(type)); } const char* cmake::GetCacheDefinition(const std::string& name) const @@ -1876,7 +1876,7 @@ void cmake::AddDefaultGenerators() bool cmake::ParseCacheEntry(const std::string& entry, std::string& var, std::string& value, - cmCacheManager::CacheEntryType& type) + cmState::CacheEntryType& type) { return cmCacheManager::ParseEntry(entry, var, value, type); } diff --git a/Source/cmake.h b/Source/cmake.h index 0b24ed6..bbeb95d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -19,6 +19,7 @@ #include "cmPropertyMap.h" #include "cmInstalledFile.h" #include "cmCacheManager.h" +#include "cmState.h" class cmGlobalGeneratorFactory; class cmGlobalGenerator; @@ -178,7 +179,7 @@ class cmake static bool ParseCacheEntry(const std::string& entry, std::string& var, std::string& value, - cmCacheManager::CacheEntryType& type); + cmState::CacheEntryType& type); int LoadCache(); bool LoadCache(const std::string& path); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index f678c6a..c8cf2d4 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -19,7 +19,6 @@ #include "cmake.h" #include "cmcmd.h" #include "cmState.h" -#include "cmCacheManager.h" #include "cmListFileCache.h" #include "cmSourceFile.h" #include "cmGlobalGenerator.h" @@ -330,15 +329,13 @@ int do_cmake(int ac, char const* const* av) if ( list_cached || list_all_cached ) { std::cout << "-- Cache values" << std::endl; - std::vector keys = - cm.GetState()->GetCacheEntryKeys(); + std::vector keys = cm.GetState()->GetCacheEntryKeys(); for (std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) { - cmCacheManager::CacheEntryType t = - cm.GetState()->GetCacheEntryType(*it); - if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && - t != cmCacheManager::UNINITIALIZED ) + cmState::CacheEntryType t = cm.GetState()->GetCacheEntryType(*it); + if (t != cmState::INTERNAL && t != cmState::STATIC && + t != cmState::UNINITIALIZED) { const char* advancedProp = cm.GetState()->GetCacheEntryProperty(*it, "ADVANCED"); @@ -351,7 +348,7 @@ int do_cmake(int ac, char const* const* av) "HELPSTRING") << std::endl; } std::cout << *it << ":" << - cmCacheManager::TypeToString(t) + cmState::CacheEntryTypeToString(t) << "=" << cm.GetState()->GetCacheEntryValue(*it) << std::endl; if ( list_help ) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f71fdf0ec8289ada5b32b784bc2f6f617538ce0b commit f71fdf0ec8289ada5b32b784bc2f6f617538ce0b Author: Stephen Kelly AuthorDate: Tue Apr 7 22:36:13 2015 +0200 Commit: Brad King CommitDate: Mon Apr 13 11:44:15 2015 -0400 cmMakefile: Remove unused CacheManager accessor. Remove unneeded friend declarations from cmCacheManager. diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 64c7c0d..00ae334 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -248,10 +248,8 @@ private: CacheEntryMap Cache; // Only cmake and cmMakefile should be able to add cache values // the commands should never use the cmCacheManager directly - friend class cmMakefile; // allow access to add cache values friend class cmState; // allow access to add cache values friend class cmake; // allow access to add cache values - friend class cmMarkAsAdvancedCommand; // allow access to add cache values }; #endif diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ca50bc7..94e4695 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3735,11 +3735,6 @@ void cmMakefile::GetListOfMacros(std::string& macros) const macros = cmJoin(this->MacrosList, ";"); } -cmCacheManager *cmMakefile::GetCacheManager() const -{ - return this->GetCMakeInstance()->GetCacheManager(); -} - cmState *cmMakefile::GetState() const { return this->GetCMakeInstance()->GetState(); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 49bab4c..fad31d1 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -12,7 +12,6 @@ #ifndef cmMakefile_h #define cmMakefile_h -#include "cmCacheManager.h" #include "cmExecutionStatus.h" #include "cmListFileCache.h" #include "cmPolicies.h" @@ -765,7 +764,6 @@ public: ///enabled. void EnableLanguage(std::vectorconst& languages, bool optional); - cmCacheManager *GetCacheManager() const; cmState *GetState() const; /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff7169a03c2ae2e7a0440c1f2921b7ce6b2e486c commit ff7169a03c2ae2e7a0440c1f2921b7ce6b2e486c Author: Stephen Kelly AuthorDate: Mon Apr 6 10:52:45 2015 +0200 Commit: Brad King CommitDate: Mon Apr 13 11:44:15 2015 -0400 Port to cmState. diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 3d92a2d..e013f81 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmake.h" #include "../cmDocumentation.h" diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 4f028c4..4eb8e6c 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -19,6 +19,7 @@ #include "cmCursesDummyWidget.h" #include "../cmSystemTools.h" #include "../cmake.h" +#include "../cmState.h" #include @@ -50,9 +51,9 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( } this->Entry = 0; - const char* value = cm->GetCacheManager()->GetCacheEntryValue(key); + const char* value = cm->GetState()->GetCacheEntryValue(key); assert(value); - switch (cm->GetCacheManager()->GetCacheEntryType(key)) + switch (cm->GetState()->GetCacheEntryType(key)) { case cmCacheManager::BOOL: this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); @@ -75,7 +76,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( break; case cmCacheManager::STRING: { - const char* stringsProp = cm->GetCacheManager() + const char* stringsProp = cm->GetState() ->GetCacheEntryProperty(key, "STRINGS"); if(stringsProp) { diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 057f8f3..67e4aab 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -9,7 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "../cmCacheManager.h" #include "../cmSystemTools.h" #include "../cmake.h" #include "../cmVersion.h" diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 833d540..b067743 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -23,6 +23,7 @@ #include "cmCursesCacheEntryComposite.h" #include "cmCursesLongMessageForm.h" #include "cmAlgorithms.h" +#include "cmState.h" inline int ctrl(int z) @@ -107,17 +108,17 @@ void cmCursesMainForm::InitializeUI() // which contain labels, entries and new entry markers std::vector* newEntries = new std::vector; - newEntries->reserve(this->CMakeInstance->GetCacheManager()->GetSize()); + std::vector cacheKeys = + this->CMakeInstance->GetState()->GetCacheEntryKeys(); + newEntries->reserve(cacheKeys.size()); // Count non-internal and non-static entries int count=0; - std::vector cacheKeys = - this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys(); for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); if (t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && @@ -147,7 +148,7 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); if (t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || @@ -171,7 +172,7 @@ void cmCursesMainForm::InitializeUI() it != cacheKeys.end(); ++it) { std::string key = *it; - cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager() + cmCacheManager::CacheEntryType t = this->CMakeInstance->GetState() ->GetCacheEntryType(*it); if (t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || @@ -225,10 +226,10 @@ void cmCursesMainForm::RePost() for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -257,10 +258,10 @@ void cmCursesMainForm::RePost() for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -329,10 +330,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -352,10 +353,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height) for (it = this->Entries->begin(); it != this->Entries->end(); ++it) { const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryValue((*it)->GetValue()); bool advanced = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED"); if (!existingValue || (!this->AdvancedMode && advanced)) { @@ -516,10 +517,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) // Get the help string of the current entry // and add it to the help string const char* existingValue = - this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField); + this->CMakeInstance->GetState()->GetCacheEntryValue(curField); if (existingValue) { - const char* hs = this->CMakeInstance->GetCacheManager() + const char* hs = this->CMakeInstance->GetState() ->GetCacheEntryProperty(curField, "HELPSTRING"); if ( hs ) { @@ -814,7 +815,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() for(size_t i=0; i < size; i++) { std::string cacheKey = (*this->Entries)[i]->Key; - const char* existingValue = this->CMakeInstance->GetCacheManager() + const char* existingValue = this->CMakeInstance->GetState() ->GetCacheEntryValue(cacheKey); if (existingValue) { @@ -823,7 +824,7 @@ void cmCursesMainForm::FillCacheManagerFromUI() std::string fixedOldValue; std::string fixedNewValue; cmCacheManager::CacheEntryType t = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryType(cacheKey); this->FixValue(t, oldValue, fixedOldValue); this->FixValue(t, newValue, fixedNewValue); @@ -831,9 +832,9 @@ void cmCursesMainForm::FillCacheManagerFromUI() if(!(fixedOldValue == fixedNewValue)) { // The user has changed the value. Mark it as modified. - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true); - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->SetCacheEntryValue(cacheKey, fixedNewValue); } } @@ -1046,11 +1047,11 @@ void cmCursesMainForm::HandleInput() const char* helpString = 0; const char* existingValue = - this->CMakeInstance->GetCacheManager() + this->CMakeInstance->GetState() ->GetCacheEntryValue(curField); if (existingValue) { - helpString = this->CMakeInstance->GetCacheManager() + helpString = this->CMakeInstance->GetState() ->GetCacheEntryProperty(curField, "HELPSTRING"); } if (helpString) @@ -1161,7 +1162,7 @@ void cmCursesMainForm::HandleInput() field_userptr(this->Fields[findex-2])); if ( lbl ) { - this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(lbl->GetValue()); + this->CMakeInstance->GetState()->RemoveCacheEntry(lbl->GetValue()); std::string nextVal; if (nextCur) diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 08d53ce..775c11c 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -16,7 +16,7 @@ #include #include "cmake.h" -#include "cmCacheManager.h" +#include "cmState.h" #include "cmSystemTools.h" #include "cmExternalMakefileProjectGenerator.h" @@ -94,7 +94,7 @@ void QCMake::setBinaryDirectory(const QString& _dir) { this->BinaryDirectory = QDir::fromNativeSeparators(dir); emit this->binaryDirChanged(this->BinaryDirectory); - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); + cmState* state = this->CMakeInstance->GetState(); this->setGenerator(QString()); if(!this->CMakeInstance->LoadCache( this->BinaryDirectory.toLocal8Bit().data())) @@ -110,15 +110,15 @@ void QCMake::setBinaryDirectory(const QString& _dir) QCMakePropertyList props = this->properties(); emit this->propertiesChanged(props); - const char* homeDir = cachem->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + const char* homeDir = state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (homeDir) { setSourceDirectory(QString::fromLocal8Bit(homeDir)); } - const char* gen = cachem->GetCacheEntryValue("CMAKE_GENERATOR"); + const char* gen = state->GetCacheEntryValue("CMAKE_GENERATOR"); if (gen) { - const char* extraGen = cachem + const char* extraGen = state ->GetInitializedCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: CreateFullGeneratorName(gen, extraGen? extraGen : ""); @@ -195,12 +195,12 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) QStringList toremove; // set the value of properties - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - std::vector cacheKeys = cachem->GetCacheEntryKeys(); + cmState* state = this->CMakeInstance->GetState(); + std::vector cacheKeys = state->GetCacheEntryKeys(); for(std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*it); + cmCacheManager::CacheEntryType t = state->GetCacheEntryType(*it); if(t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC) { @@ -219,11 +219,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) prop = props[idx]; if(prop.Value.type() == QVariant::Bool) { - cachem->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); + state->SetCacheEntryValue(*it, prop.Value.toBool() ? "ON" : "OFF"); } else { - cachem->SetCacheEntryValue(*it, + state->SetCacheEntryValue(*it, prop.Value.toString().toLocal8Bit().data()); } props.removeAt(idx); @@ -236,7 +236,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) { this->CMakeInstance->UnwatchUnusedCli(s.toLocal8Bit().data()); - cachem->RemoveCacheEntry(s.toLocal8Bit().data()); + state->RemoveCacheEntry(s.toLocal8Bit().data()); } // add some new properites @@ -281,12 +281,12 @@ QCMakePropertyList QCMake::properties() const { QCMakePropertyList ret; - cmCacheManager *cachem = this->CMakeInstance->GetCacheManager(); - std::vector cacheKeys = cachem->GetCacheEntryKeys(); + cmState* state = this->CMakeInstance->GetState(); + std::vector cacheKeys = state->GetCacheEntryKeys(); for (std::vector::const_iterator i = cacheKeys.begin(); i != cacheKeys.end(); ++i) { - cmCacheManager::CacheEntryType t = cachem->GetCacheEntryType(*i); + cmCacheManager::CacheEntryType t = state->GetCacheEntryType(*i); if(t == cmCacheManager::INTERNAL || t == cmCacheManager::STATIC || t == cmCacheManager::UNINITIALIZED) @@ -294,14 +294,14 @@ QCMakePropertyList QCMake::properties() const continue; } - const char* cachedValue = cachem->GetCacheEntryValue(*i); + const char* cachedValue = state->GetCacheEntryValue(*i); QCMakeProperty prop; prop.Key = QString::fromLocal8Bit(i->c_str()); prop.Help = QString::fromLocal8Bit( - cachem->GetCacheEntryProperty(*i, "HELPSTRING")); + state->GetCacheEntryProperty(*i, "HELPSTRING")); prop.Value = QString::fromLocal8Bit(cachedValue); - prop.Advanced = cachem->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); + prop.Advanced = state->GetCacheEntryPropertyAsBool(*i, "ADVANCED"); if(t == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; @@ -319,7 +319,7 @@ QCMakePropertyList QCMake::properties() const { prop.Type = QCMakeProperty::STRING; const char* stringsProperty = - cachem->GetCacheEntryProperty(*i, "STRINGS"); + state->GetCacheEntryProperty(*i, "STRINGS"); if (stringsProperty) { prop.Strings = QString::fromLocal8Bit(stringsProperty).split(";"); diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 99bf5f5..0d1c86d 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -13,6 +13,7 @@ #include "cmSystemTools.h" #include "cmMakefile.h" +#include "cmState.h" #include "cmCommandArgumentLexer.h" @@ -90,7 +91,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } if ( strcmp(key, "CACHE") == 0 ) { - if(const char* c = this->Makefile->GetCacheManager() + if(const char* c = this->Makefile->GetState() ->GetInitializedCacheValue(var)) { if(this->EscapeQuotes) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 0d32e4b..6750769 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -16,6 +16,7 @@ #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" +#include "cmState.h" #include "cmTarget.h" #include "cmSourceFile.h" @@ -205,7 +206,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout, std::string cacheEntryName = "CMAKE_ECLIPSE_ENVVAR_"; cacheEntryName += envVar; - const char* cacheValue = mf->GetCacheManager()->GetInitializedCacheValue( + const char* cacheValue = mf->GetState()->GetInitializedCacheValue( cacheEntryName); // now we have both, decide which one to use diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index cc08052..f10d545 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -12,6 +12,7 @@ #include "cmFindBase.h" #include "cmAlgorithms.h" +#include "cmState.h" cmFindBase::cmFindBase() { @@ -366,8 +367,8 @@ bool cmFindBase::CheckForVariableInCache() if(const char* cacheValue = this->Makefile->GetDefinition(this->VariableName)) { - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* cacheEntry = manager->GetCacheEntryValue(this->VariableName); + cmState* state = this->Makefile->GetState(); + const char* cacheEntry = state->GetCacheEntryValue(this->VariableName); bool found = !cmSystemTools::IsNOTFOUND(cacheValue); bool cached = cacheEntry ? true : false; if(found) @@ -376,7 +377,7 @@ bool cmFindBase::CheckForVariableInCache() // type we should add the type and docstring but keep the // original value. Tell the subclass implementations to do // this. - if(cached && manager->GetCacheEntryType(this->VariableName) + if(cached && state->GetCacheEntryType(this->VariableName) == cmCacheManager::UNINITIALIZED) { this->AlreadyInCacheWithoutMetaInfo = true; @@ -385,7 +386,7 @@ bool cmFindBase::CheckForVariableInCache() } else if(cached) { - const char* hs = manager->GetCacheEntryProperty(this->VariableName, + const char* hs = state->GetCacheEntryProperty(this->VariableName, "HELPSTRING"); this->VariableDocumentation = hs?hs:"(none)"; } diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 0e6e0c2..80edbcd 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -12,6 +12,7 @@ #include "cmGetPropertyCommand.h" #include "cmake.h" +#include "cmState.h" #include "cmTest.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" @@ -391,9 +392,9 @@ bool cmGetPropertyCommand::HandleCacheMode() } const char* value = 0; - if(this->Makefile->GetCacheManager()->GetCacheEntryValue(this->Name)) + if(this->Makefile->GetState()->GetCacheEntryValue(this->Name)) { - value = this->Makefile->GetCacheManager() + value = this->Makefile->GetState() ->GetCacheEntryProperty(this->Name, this->PropertyName); } this->StoreResult(value); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 35394b8..f6ec643 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -20,6 +20,7 @@ #include "cmLocalGenerator.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmake.h" +#include "cmState.h" #include "cmMakefile.h" #include "cmQtAutoGenerators.h" #include "cmSourceFile.h" @@ -179,7 +180,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, return; } const char* cname = this->GetCMakeInstance()-> - GetCacheManager()->GetInitializedCacheValue(langComp); + GetState()->GetInitializedCacheValue(langComp); std::string changeVars; if(cname && !optional) { @@ -1537,7 +1538,7 @@ void cmGlobalGenerator::CheckLocalGenerators() std::map notFoundMap; // std::set notFoundMap; // after it is all done do a ConfigureFinalPass - cmCacheManager* manager = this->GetCMakeInstance()->GetCacheManager(); + cmState* state = this->GetCMakeInstance()->GetState(); for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { this->LocalGenerators[i]->ConfigureFinalPass(); @@ -1559,7 +1560,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(lib->first.c_str())) { std::string varName = lib->first.substr(0, lib->first.size()-9); - if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + if(state->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1590,7 +1591,7 @@ void cmGlobalGenerator::CheckLocalGenerators() cmSystemTools::IsNOTFOUND(incDir->c_str())) { std::string varName = incDir->substr(0, incDir->size()-9); - if(manager->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) + if(state->GetCacheEntryPropertyAsBool(varName, "ADVANCED")) { varName += " (ADVANCED)"; } @@ -1637,7 +1638,7 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir, // and there is a good chance that the try compile stuff will // take the bulk of the time, so try and guess some progress // by getting closer and closer to 100 without actually getting there. - if (!this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue + if (!this->CMakeInstance->GetState()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS")) { // If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set @@ -1835,7 +1836,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg) // update progress // estimate how many lg there will be const char *numGenC = - this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue + this->CMakeInstance->GetState()->GetInitializedCacheValue ("CMAKE_NUMBER_OF_LOCAL_GENERATORS"); if (!numGenC) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index fefa648..ca50bc7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1812,9 +1812,9 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; const char* existingValue = - this->GetCacheManager()->GetInitializedCacheValue(name); + this->GetState()->GetInitializedCacheValue(name); if(existingValue - && (this->GetCacheManager()->GetCacheEntryType(name) + && (this->GetState()->GetCacheEntryType(name) == cmCacheManager::UNINITIALIZED)) { // if this is not a force, then use the value from the cache @@ -1843,14 +1843,14 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, nvalue += files[cc]; } - this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = this->GetCacheManager()->GetInitializedCacheValue(name); + this->GetState()->AddCacheEntry(name, nvalue.c_str(), doc, type); + val = this->GetState()->GetInitializedCacheValue(name); haveVal = true; } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, - doc, type); + this->GetState()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -1977,7 +1977,7 @@ void cmMakefile::RemoveDefinition(const std::string& name) void cmMakefile::RemoveCacheDefinition(const std::string& name) { - this->GetCacheManager()->RemoveCacheEntry(name); + this->GetState()->RemoveCacheEntry(name); } void cmMakefile::SetProjectName(const char* p) @@ -2434,7 +2434,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const this->Internal->VarUsageStack.top().insert(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetState()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE if(cmVariableWatch* vv = this->GetVariableWatch()) @@ -2459,7 +2459,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const const char* def = this->Internal->VarStack.top().Get(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetState()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); @@ -2501,7 +2501,7 @@ std::vector cmMakefile res.insert(res.end(), definitions.begin(), definitions.end()); } std::vector cacheKeys = - this->GetCacheManager()->GetCacheEntryKeys(); + this->GetState()->GetCacheEntryKeys(); res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); std::sort(res.begin(), res.end()); @@ -2802,6 +2802,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( openstack.push(t_lookup()); cmake::MessageType mtype = cmake::LOG; + cmState* state = this->GetCMakeInstance()->GetState(); + do { char inc = *in; @@ -2835,8 +2837,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( value = cmSystemTools::GetEnv(lookup.c_str()); break; case CACHE: - value = this->GetCacheManager() - ->GetInitializedCacheValue(lookup); + value = state->GetCacheEntryValue(lookup); break; } // Get the string we're meant to append to. @@ -4908,7 +4909,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, if(id == cmPolicies::CMP0001 && (status == cmPolicies::WARN || status == cmPolicies::OLD)) { - if(!(this->GetCacheManager() + if(!(this->GetState() ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) { // Set it to 2.4 because that is the last version where the diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index cc094b1..66f1ebc 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -36,20 +36,20 @@ bool cmMarkAsAdvancedCommand for(; i < args.size(); ++i) { std::string variable = args[i]; - cmCacheManager* manager = this->Makefile->GetCacheManager(); - if (!manager->GetCacheEntryValue(variable)) + cmState* state = this->Makefile->GetState(); + if (!state->GetCacheEntryValue(variable)) { - manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); + state->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); overwrite = true; } - if (!manager->GetCacheEntryValue(variable)) + if (!state->GetCacheEntryValue(variable)) { cmSystemTools::Error("This should never happen..."); return false; } - if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) + if (!state->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) { - manager->SetCacheEntryProperty(variable, "ADVANCED", value); + state->SetCacheEntryProperty(variable, "ADVANCED", value); } } return true; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index baf5b1e..6c090de 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -42,13 +42,13 @@ bool cmOptionCommand std::string initialValue = "Off"; // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(args[0]); + cmState* state = this->Makefile->GetState(); + const char* existingValue = state->GetCacheEntryValue(args[0]); if(existingValue) { - if (manager->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) + if (state->GetCacheEntryType(args[0]) != cmCacheManager::UNINITIALIZED) { - manager->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); + state->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); return true; } initialValue = existingValue; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index e17474b..c636d53 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -136,10 +136,10 @@ bool cmSetCommand } // see if this is already in the cache - cmCacheManager* manager = this->Makefile->GetCacheManager(); - const char* existingValue = manager->GetCacheEntryValue(variable); + cmState* state = this->Makefile->GetState(); + const char* existingValue = state->GetCacheEntryValue(variable); if(existingValue && - (manager->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) + (state->GetCacheEntryType(variable) != cmCacheManager::UNINITIALIZED)) { // if the set is trying to CACHE the value but the value // is already in the cache and the type is not internal diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 77f9fb9..08de585 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -453,7 +453,7 @@ bool cmSetPropertyCommand::HandleCacheMode() cmMakefile* mf = this->GetMakefile(); cmake* cm = mf->GetCMakeInstance(); const char* existingValue - = cm->GetCacheManager()->GetCacheEntryValue(*ni); + = cm->GetState()->GetCacheEntryValue(*ni); if(existingValue) { if(!this->HandleCacheEntry(*ni)) @@ -479,20 +479,19 @@ bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey) // Set or append the property. const char* name = this->PropertyName.c_str(); const char* value = this->PropertyValue.c_str(); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmState* state = this->Makefile->GetState(); if (this->Remove) { - manager->RemoveCacheEntryProperty(cacheKey, name); - return true; + state->RemoveCacheEntryProperty(cacheKey, name); } if(this->AppendMode) { - manager->AppendCacheEntryProperty(cacheKey, name, value, - this->AppendAsString); + state->AppendCacheEntryProperty(cacheKey, name, value, + this->AppendAsString); } else { - manager->SetCacheEntryProperty(cacheKey, name, value); + state->SetCacheEntryProperty(cacheKey, name, value); } return true; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 911ade8..3f766ab 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -264,12 +264,12 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, comment.c_str(), cmCacheManager::STRING); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmState* state = this->Makefile->GetState(); const char* existingValue - = manager->GetCacheEntryValue(this->RunResultVariable); + = state->GetCacheEntryValue(this->RunResultVariable); if (existingValue) { - manager->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); + state->SetCacheEntryProperty(this->RunResultVariable, "ADVANCED", "1"); } error = true; @@ -291,13 +291,13 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs, "PLEASE_FILL_OUT-NOTFOUND", comment.c_str(), cmCacheManager::STRING); - cmCacheManager* manager = this->Makefile->GetCacheManager(); + cmState* state = this->Makefile->GetState(); const char* existing = - manager->GetCacheEntryValue(internalRunOutputName); + state->GetCacheEntryValue(internalRunOutputName); if (existing) { - manager->SetCacheEntryProperty(internalRunOutputName, - "ADVANCED", "1"); + state->SetCacheEntryProperty(internalRunOutputName, + "ADVANCED", "1"); } error = true; diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index dd2a682..1d33db1 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -10,7 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmVariableRequiresCommand.h" -#include "cmCacheManager.h" +#include "cmState.h" // cmLibraryCommand bool cmVariableRequiresCommand @@ -34,6 +34,7 @@ bool cmVariableRequiresCommand bool requirementsMet = true; std::string notSet; bool hasAdvanced = false; + cmState* state = this->Makefile->GetState(); for(unsigned int i = 2; i < args.size(); ++i) { if(!this->Makefile->IsOn(args[i])) @@ -41,9 +42,8 @@ bool cmVariableRequiresCommand requirementsMet = false; notSet += args[i]; notSet += "\n"; - cmCacheManager* manager = this->Makefile->GetCacheManager(); - if(manager->GetCacheEntryValue(args[i]) && - manager->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) + if(state->GetCacheEntryValue(args[i]) && + state->GetCacheEntryPropertyAsBool(args[i], "ADVANCED")) { hasAdvanced = true; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index c419edc..a337b2c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -348,22 +348,20 @@ bool cmake::SetCacheArgs(const std::vector& args) std::string cachedValue; if(this->WarnUnusedCli) { - if(const char *v = this->CacheManager - ->GetInitializedCacheValue(var)) + if(const char *v = this->State->GetInitializedCacheValue(var)) { haveValue = true; cachedValue = v; } } - this->CacheManager->AddCacheEntry(var, value.c_str(), + this->State->AddCacheEntry(var, value.c_str(), "No help, variable specified on the command line.", type); if(this->WarnUnusedCli) { if (!haveValue || - cachedValue != this->CacheManager - ->GetInitializedCacheValue(var)) + cachedValue != this->State->GetInitializedCacheValue(var)) { this->WatchUnusedCli(var); } @@ -407,13 +405,11 @@ bool cmake::SetCacheArgs(const std::vector& args) cmsys::Glob::PatternToRegex(entryPattern, true, true).c_str()); //go through all cache entries and collect the vars which will be removed std::vector entriesToDelete; - std::vector cacheKeys = - this->CacheManager->GetCacheEntryKeys(); + std::vector cacheKeys = this->State->GetCacheEntryKeys(); for (std::vector::const_iterator it = cacheKeys.begin(); it != cacheKeys.end(); ++it) { - cmCacheManager::CacheEntryType t = - this->CacheManager->GetCacheEntryType(*it); + cmCacheManager::CacheEntryType t = this->State->GetCacheEntryType(*it); if(t != cmCacheManager::STATIC) { if (regex.find(it->c_str())) @@ -429,7 +425,7 @@ bool cmake::SetCacheArgs(const std::vector& args) currentEntry != entriesToDelete.end(); ++currentEntry) { - this->CacheManager->RemoveCacheEntry(*currentEntry); + this->State->RemoveCacheEntry(*currentEntry); } } else if(arg.find("-C",0) == 0) @@ -925,7 +921,7 @@ void cmake::SetDirectoriesFromFile(const char* arg) if(this->LoadCache(cachePath)) { const char* existingValue = - this->CacheManager->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); + this->State->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (existingValue) { this->SetHomeOutputDirectory(cachePath); @@ -1255,7 +1251,6 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) { return 0; } - cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator(); std::vector saved; std::ostringstream warning; warning @@ -1271,10 +1266,13 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) i++; save.value = *i; warning << *i << "\n"; - if(ci.Find(save.key)) + const char* existingValue = + this->CacheManager->GetCacheEntryValue(save.key); + if(existingValue) { - save.type = ci.GetType(); - if(const char* help = ci.GetProperty("HELPSTRING")) + save.type = this->CacheManager->GetCacheEntryType(save.key); + if(const char* help = + this->CacheManager->GetCacheEntryProperty(save.key, "HELPSTRING")) { save.help = help; } @@ -1556,49 +1554,51 @@ int cmake::ActualConfigure() // project requires compatibility with CMake 2.4. We detect this // here by looking for the old CMAKE_BACKWARDS_COMPATIBILITY // variable created when CMP0001 is not set to NEW. - if(this->GetCacheManager() + if(this->State ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { - if(!this->CacheManager->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) + if(!this->State->GetInitializedCacheValue("LIBRARY_OUTPUT_PATH")) { - this->CacheManager->AddCacheEntry + this->State->AddCacheEntry ("LIBRARY_OUTPUT_PATH", "", "Single output directory for building all libraries.", cmCacheManager::PATH); } - if(!this->CacheManager + if(!this->State ->GetInitializedCacheValue("EXECUTABLE_OUTPUT_PATH")) { - this->CacheManager->AddCacheEntry + this->State->AddCacheEntry ("EXECUTABLE_OUTPUT_PATH", "", "Single output directory for building all executables.", cmCacheManager::PATH); } } - if(!this->CacheManager + if(!this->State ->GetInitializedCacheValue("CMAKE_USE_RELATIVE_PATHS")) { - this->CacheManager->AddCacheEntry + this->State->AddCacheEntry ("CMAKE_USE_RELATIVE_PATHS", "OFF", "If true, cmake will use relative paths in makefiles and projects.", cmCacheManager::BOOL); - if (!this->CacheManager->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED")) + if (!this->State->GetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED")) { - this->CacheManager->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", - "ADVANCED", "1"); + this->State->SetCacheEntryProperty("CMAKE_USE_RELATIVE_PATHS", + "ADVANCED", "1"); } } - if(cmSystemTools::GetFatalErrorOccured() && - (!this->CacheManager->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM") || - cmSystemTools::IsOff(this->CacheManager-> - GetInitializedCacheValue("CMAKE_MAKE_PROGRAM")))) + if(cmSystemTools::GetFatalErrorOccured()) { - // We must have a bad generator selection. Wipe the cache entry so the - // user can select another. - this->CacheManager->RemoveCacheEntry("CMAKE_GENERATOR"); - this->CacheManager->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR"); + const char* makeProgram = + this->State->GetInitializedCacheValue("CMAKE_MAKE_PROGRAM"); + if (!makeProgram || cmSystemTools::IsOff(makeProgram)) + { + // We must have a bad generator selection. Wipe the cache entry so the + // user can select another. + this->State->RemoveCacheEntry("CMAKE_GENERATOR"); + this->State->RemoveCacheEntry("CMAKE_EXTRA_GENERATOR"); + } } cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); @@ -2204,7 +2204,7 @@ void cmake::TruncateOutputLog(const char* fname) { return; } - if ( !this->CacheManager->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR") ) + if (!this->State->GetInitializedCacheValue("CMAKE_CACHEFILE_DIR")) { cmSystemTools::RemoveFile(fullPath); return; @@ -2321,8 +2321,7 @@ const char *cmake::GetProperty(const std::string& prop, std::string output = ""; if ( prop == "CACHE_VARIABLES" ) { - std::vector cacheKeys = - this->CacheManager->GetCacheEntryKeys(); + std::vector cacheKeys = this->State->GetCacheEntryKeys(); this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); } else if ( prop == "COMMANDS" ) @@ -2475,7 +2474,7 @@ int cmake::GetSystemInformation(std::vector& args) // we have to find the module directory, so we can copy the files this->AddCMakePaths(); std::string modulesPath = - this->CacheManager->GetInitializedCacheValue("CMAKE_ROOT"); + this->State->GetInitializedCacheValue("CMAKE_ROOT"); modulesPath += "/Modules"; std::string inFile = modulesPath; inFile += "/SystemInformation.cmake"; @@ -2685,7 +2684,7 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, if(t == cmake::AUTHOR_WARNING) { // Allow suppression of these warnings. - const char* suppress = this->CacheManager->GetCacheEntryValue( + const char* suppress = this->State->GetCacheEntryValue( "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"); if(suppress && cmSystemTools::IsOn(suppress)) { @@ -2806,7 +2805,7 @@ int cmake::Build(const std::string& dir, return 1; } const char* cachedGenerator = - this->CacheManager->GetCacheEntryValue("CMAKE_GENERATOR"); + this->State->GetCacheEntryValue("CMAKE_GENERATOR"); if(!cachedGenerator) { std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n"; @@ -2823,7 +2822,7 @@ int cmake::Build(const std::string& dir, std::string output; std::string projName; const char* cachedProjectName = - this->CacheManager->GetCacheEntryValue("CMAKE_PROJECT_NAME"); + this->State->GetCacheEntryValue("CMAKE_PROJECT_NAME"); if(!cachedProjectName) { std::cerr << "Error: could not find CMAKE_PROJECT_NAME in Cache\n"; @@ -2832,7 +2831,7 @@ int cmake::Build(const std::string& dir, projName = cachedProjectName; bool verbose = false; const char* cachedVerbose = - this->CacheManager->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); + this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"); if(cachedVerbose) { verbose = cmSystemTools::IsOn(cachedVerbose); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 3b518be..f678c6a 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -18,6 +18,7 @@ #include "cmake.h" #include "cmcmd.h" +#include "cmState.h" #include "cmCacheManager.h" #include "cmListFileCache.h" #include "cmSourceFile.h" @@ -330,28 +331,28 @@ int do_cmake(int ac, char const* const* av) { std::cout << "-- Cache values" << std::endl; std::vector keys = - cm.GetCacheManager()->GetCacheEntryKeys(); + cm.GetState()->GetCacheEntryKeys(); for (std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) { cmCacheManager::CacheEntryType t = - cm.GetCacheManager()->GetCacheEntryType(*it); + cm.GetState()->GetCacheEntryType(*it); if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC && t != cmCacheManager::UNINITIALIZED ) { const char* advancedProp = - cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED"); + cm.GetState()->GetCacheEntryProperty(*it, "ADVANCED"); if ( list_all_cached || !advancedProp) { if ( list_help ) { std::cout << "// " - << cm.GetCacheManager()->GetCacheEntryProperty(*it, + << cm.GetState()->GetCacheEntryProperty(*it, "HELPSTRING") << std::endl; } std::cout << *it << ":" << cmCacheManager::TypeToString(t) - << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it) + << "=" << cm.GetState()->GetCacheEntryValue(*it) << std::endl; if ( list_help ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6b1ad1309d14668e572da7937a2a8dda9e1f669 commit a6b1ad1309d14668e572da7937a2a8dda9e1f669 Author: Stephen Kelly AuthorDate: Sat Apr 4 21:20:12 2015 +0200 Commit: Brad King CommitDate: Mon Apr 13 11:44:14 2015 -0400 Introduce cmState class. At this point, it is an interface to the cache. It will be extended to be a universal interface for access to and manipulation of configuration-time data (defintions, properties on targets, directories, source files etc). This will allow porting all command implementations away from the cmMakefile and cmTarget classes, and result in something more-purely related to configuration-time processing of cmake commands. That should serve at least the following goals: * Split the CMake implementation more definitively into three stages: Configuration, computation and generation, and be able to implement each optimally for memory access patterns etc. * Make better IDE integration possible by making more configuration data available. * Make it possiblte to use a smaller library than CMakeLib.a in cpack and ctest, resulting in smaller executables. * Make it possible to run the configure step multiple times in the same CMake run (#14539). Manage its lifetime in the cmake class, and add a convenience accessor to cmMakefile. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 04f6a81..c847bc8 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -323,6 +323,8 @@ set(SRCS cmSourceFileLocation.h cmSourceGroup.cxx cmSourceGroup.h + cmState.cxx + cmState.h cmSystemTools.cxx cmSystemTools.h cmTarget.cxx diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 3b02fa6..64c7c0d 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -249,6 +249,7 @@ private: // Only cmake and cmMakefile should be able to add cache values // the commands should never use the cmCacheManager directly friend class cmMakefile; // allow access to add cache values + friend class cmState; // allow access to add cache values friend class cmake; // allow access to add cache values friend class cmMarkAsAdvancedCommand; // allow access to add cache values }; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 34b4621..fefa648 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -19,6 +19,7 @@ #include "cmLocalGenerator.h" #include "cmCommands.h" #include "cmCacheManager.h" +#include "cmState.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" #include "cmCommandArgumentParserHelper.h" @@ -3738,6 +3739,11 @@ cmCacheManager *cmMakefile::GetCacheManager() const return this->GetCMakeInstance()->GetCacheManager(); } +cmState *cmMakefile::GetState() const +{ + return this->GetCMakeInstance()->GetState(); +} + void cmMakefile::DisplayStatus(const char* message, float s) const { cmake* cm = this->GetLocalGenerator()->GetGlobalGenerator() diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5209891..49bab4c 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -766,6 +766,7 @@ public: void EnableLanguage(std::vectorconst& languages, bool optional); cmCacheManager *GetCacheManager() const; + cmState *GetState() const; /** * Get the variable watch. This is used to determine when certain variables diff --git a/Source/cmState.cxx b/Source/cmState.cxx new file mode 100644 index 0000000..f5e3752 --- /dev/null +++ b/Source/cmState.cxx @@ -0,0 +1,147 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Stephen Kelly + + 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 "cmState.h" + +#include "cmake.h" + +cmState::cmState(cmake* cm) + : CMakeInstance(cm) +{ +} +cmCacheManager::CacheEntryType +cmState::StringToCacheEntryType(const char* s) +{ + return cmCacheManager::StringToType(s); +} + +const char* +cmState::CacheEntryTypeToString(cmCacheManager::CacheEntryType t) +{ + return cmCacheManager::TypeToString(t); +} + +bool cmState::IsCacheEntryType(std::string const& key) +{ + return cmCacheManager::IsType(key.c_str()); +} + +std::vector cmState::GetCacheEntryKeys() const +{ + std::vector definitions; + definitions.reserve(this->CMakeInstance->GetCacheManager()->GetSize()); + cmCacheManager::CacheIterator cit = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + definitions.push_back(cit.GetName()); + } + return definitions; +} + +const char* cmState::GetCacheEntryValue(std::string const& key) const +{ + cmCacheManager::CacheEntry* e = this->CMakeInstance->GetCacheManager() + ->GetCacheEntry(key); + if (!e) + { + return 0; + } + return e->Value.c_str(); +} + +const char* +cmState::GetInitializedCacheValue(std::string const& key) const +{ + return this->CMakeInstance->GetCacheManager()->GetInitializedCacheValue(key); +} + +cmCacheManager::CacheEntryType +cmState::GetCacheEntryType(std::string const& key) const +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + return it.GetType(); +} + +void cmState::SetCacheEntryValue(std::string const& key, + std::string const& value) +{ + this->CMakeInstance->GetCacheManager()->SetCacheEntryValue(key, value); +} + +void cmState::SetCacheEntryProperty(std::string const& key, + std::string const& propertyName, + std::string const& value) +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + it.SetProperty(propertyName, value.c_str()); +} + +void cmState::SetCacheEntryBoolProperty(std::string const& key, + std::string const& propertyName, + bool value) +{ + cmCacheManager::CacheIterator it = + this->CMakeInstance->GetCacheManager()->GetCacheIterator(key.c_str()); + it.SetProperty(propertyName, value); +} + +const char* cmState::GetCacheEntryProperty(std::string const& key, + std::string const& propertyName) +{ + cmCacheManager::CacheIterator it = this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()); + if (!it.PropertyExists(propertyName)) + { + return 0; + } + return it.GetProperty(propertyName); +} + +bool cmState::GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propertyName) +{ + return this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).GetPropertyAsBool(propertyName); +} + +void cmState::AddCacheEntry(const std::string& key, const char* value, + const char* helpString, + cmCacheManager::CacheEntryType type) +{ + this->CMakeInstance->GetCacheManager()->AddCacheEntry(key, value, + helpString, type); +} + +void cmState::RemoveCacheEntry(std::string const& key) +{ + this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(key); +} + +void cmState::AppendCacheEntryProperty(const std::string& key, + const std::string& property, + const std::string& value, + bool asString) +{ + this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).AppendProperty(property, + value.c_str(), + asString); +} + +void cmState::RemoveCacheEntryProperty(std::string const& key, + std::string const& propertyName) +{ + this->CMakeInstance->GetCacheManager() + ->GetCacheIterator(key.c_str()).SetProperty(propertyName, (void*)0); +} diff --git a/Source/cmState.h b/Source/cmState.h new file mode 100644 index 0000000..06b0ec6 --- /dev/null +++ b/Source/cmState.h @@ -0,0 +1,62 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Stephen Kelly + + 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 cmState_h +#define cmState_h + +#include "cmCacheManager.h" + +class cmake; + +class cmState +{ +public: + cmState(cmake* cm); + + static cmCacheManager::CacheEntryType StringToCacheEntryType(const char*); + static const char* CacheEntryTypeToString(cmCacheManager::CacheEntryType); + static bool IsCacheEntryType(std::string const& key); + + std::vector GetCacheEntryKeys() const; + const char* GetCacheEntryValue(std::string const& key) const; + const char* GetInitializedCacheValue(std::string const& key) const; + cmCacheManager::CacheEntryType + GetCacheEntryType(std::string const& key) const; + void SetCacheEntryValue(std::string const& key, std::string const& value); + void SetCacheValue(std::string const& key, std::string const& value); + + void AddCacheEntry(const std::string& key, const char* value, + const char* helpString, + cmCacheManager::CacheEntryType type); + void RemoveCacheEntry(std::string const& key); + + void SetCacheEntryProperty(std::string const& key, + std::string const& propertyName, + std::string const& value); + void SetCacheEntryBoolProperty(std::string const& key, + std::string const& propertyName, + bool value); + const char* GetCacheEntryProperty(std::string const& key, + std::string const& propertyName); + bool GetCacheEntryPropertyAsBool(std::string const& key, + std::string const& propertyName); + void AppendCacheEntryProperty(std::string const& key, + const std::string& property, + const std::string& value, + bool asString = false); + void RemoveCacheEntryProperty(std::string const& key, + std::string const& propertyName); + +private: + cmake* CMakeInstance; +}; + +#endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 64b332c..c419edc 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -21,6 +21,7 @@ #include "cmTest.h" #include "cmDocumentationFormatter.h" #include "cmAlgorithms.h" +#include "cmState.h" #if defined(CMAKE_BUILD_WITH_CMAKE) # include "cmGraphVizWriter.h" @@ -133,6 +134,8 @@ cmake::cmake() this->FileComparison = new cmFileTimeComparison; this->Policies = new cmPolicies(); + this->State = new cmState(this); + this->InitializeProperties(); #ifdef __APPLE__ @@ -171,6 +174,7 @@ cmake::~cmake() { delete this->CacheManager; delete this->Policies; + delete this->State; if (this->GlobalGenerator) { delete this->GlobalGenerator; diff --git a/Source/cmake.h b/Source/cmake.h index 3acf4a8..0b24ed6 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -32,6 +32,7 @@ class cmDocumentationSection; class cmPolicies; class cmTarget; class cmGeneratedFileStream; +class cmState; /** \brief Represents a cmake invocation. * @@ -387,6 +388,9 @@ class cmake void UnwatchUnusedCli(const std::string& var); void WatchUnusedCli(const std::string& var); + + cmState* GetState() const { return this->State; } + protected: void RunCheckForUnusedVariables(); void InitializeProperties(); @@ -475,6 +479,8 @@ private: std::vector DebugConfigs; InstalledFilesMap InstalledFiles; + cmState* State; + void UpdateConversionPathTable(); }; diff --git a/bootstrap b/bootstrap index 4239802..69855b4 100755 --- a/bootstrap +++ b/bootstrap @@ -285,6 +285,7 @@ CMAKE_CXX_SOURCES="\ cmScriptGenerator \ cmSourceFile \ cmSourceFileLocation \ + cmState \ cmSystemTools \ cmTestGenerator \ cmVersion \ ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 11:45:04 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 11:45:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-772-g62c5e6f Message-ID: <20150413154504.8EE4BAE56F@public.kitware.com> This is an automated email from 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 62c5e6f1a19df0043a0e9aaba6cf7247f76a5cc3 (commit) via f081c5bdddcfcaaf5bee7b918fe5c7ff01faae35 (commit) via f71fdf0ec8289ada5b32b784bc2f6f617538ce0b (commit) via ff7169a03c2ae2e7a0440c1f2921b7ce6b2e486c (commit) via a6b1ad1309d14668e572da7937a2a8dda9e1f669 (commit) from 92d61798937e42ecb7ae3d1be8b2b4ab7ce15fcb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=62c5e6f1a19df0043a0e9aaba6cf7247f76a5cc3 commit 62c5e6f1a19df0043a0e9aaba6cf7247f76a5cc3 Merge: 92d6179 f081c5b Author: Brad King AuthorDate: Mon Apr 13 11:45:02 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 11:45:02 2015 -0400 Merge topic 'introduce-cmState' f081c5bd cmState: Move CacheEntryType enum from cmCacheManager. f71fdf0e cmMakefile: Remove unused CacheManager accessor. ff7169a0 Port to cmState. a6b1ad13 Introduce cmState class. diff --cc Source/cmake.h index 4c2ad29,bbeb95d..e80cc1c --- a/Source/cmake.h +++ b/Source/cmake.h @@@ -447,12 -477,12 +452,14 @@@ private bool DebugTryCompile; cmFileTimeComparison* FileComparison; std::string GraphVizFile; - std::vector DebugConfigs; InstalledFilesMap InstalledFiles; + cmState* State; + void UpdateConversionPathTable(); + + // Print a list of valid generators to stderr. + void PrintGeneratorList(); }; #define CMAKE_STANDARD_OPTIONS_TABLE \ ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 2 + Source/CursesDialog/ccmake.cxx | 1 - Source/CursesDialog/cmCursesBoolWidget.cxx | 2 +- .../CursesDialog/cmCursesCacheEntryComposite.cxx | 17 +- Source/CursesDialog/cmCursesCacheEntryComposite.h | 1 - Source/CursesDialog/cmCursesDummyWidget.cxx | 2 +- Source/CursesDialog/cmCursesFilePathWidget.cxx | 2 +- Source/CursesDialog/cmCursesLongMessageForm.cxx | 1 - Source/CursesDialog/cmCursesMainForm.cxx | 80 ++++----- Source/CursesDialog/cmCursesMainForm.h | 2 +- Source/CursesDialog/cmCursesOptionsWidget.cxx | 2 +- Source/CursesDialog/cmCursesPathWidget.cxx | 4 +- Source/CursesDialog/cmCursesStringWidget.cxx | 2 +- Source/CursesDialog/cmCursesWidget.h | 6 +- Source/QtDialog/QCMake.cxx | 62 +++---- Source/cmBuildCommand.cxx | 2 +- Source/cmBuildNameCommand.cxx | 4 +- Source/cmCPluginAPI.cxx | 12 +- Source/cmCTest.cxx | 2 +- Source/cmCacheManager.cxx | 96 +++-------- Source/cmCacheManager.h | 38 ++--- Source/cmCommandArgumentParserHelper.cxx | 3 +- Source/cmCoreTryCompile.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 7 +- Source/cmFindBase.cxx | 11 +- Source/cmFindLibraryCommand.cxx | 7 +- Source/cmFindPackageCommand.cxx | 2 +- Source/cmFindPathCommand.cxx | 7 +- Source/cmFindProgramCommand.cxx | 7 +- Source/cmGetFilenameComponentCommand.cxx | 8 +- Source/cmGetPropertyCommand.cxx | 5 +- Source/cmGlobalGenerator.cxx | 19 ++- Source/cmGlobalUnixMakefileGenerator3.cxx | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 8 +- Source/cmGlobalXCodeGenerator.cxx | 4 +- Source/cmIncludeExternalMSProjectCommand.cxx | 2 +- Source/cmLoadCacheCommand.cxx | 2 +- Source/cmLocalVisualStudio10Generator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 3 +- Source/cmMakefile.cxx | 47 ++--- Source/cmMakefile.h | 6 +- Source/cmMarkAsAdvancedCommand.cxx | 12 +- Source/cmOptionCommand.cxx | 10 +- Source/cmProjectCommand.cxx | 6 +- Source/cmSetCommand.cxx | 14 +- Source/cmSetPropertyCommand.cxx | 16 +- Source/cmSiteNameCommand.cxx | 2 +- Source/cmState.cxx | 180 ++++++++++++++++++++ Source/cmState.h | 62 +++++++ Source/cmTarget.cxx | 4 +- Source/cmTryRunCommand.cxx | 21 ++- Source/cmUtilitySourceCommand.cxx | 6 +- Source/cmVariableRequiresCommand.cxx | 8 +- Source/cmake.cxx | 125 +++++++------- Source/cmake.h | 9 +- Source/cmakemain.cxx | 20 +-- bootstrap | 1 + 57 files changed, 595 insertions(+), 396 deletions(-) create mode 100644 Source/cmState.cxx create mode 100644 Source/cmState.h hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 11:45:19 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 11:45:19 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1816-g12a641c Message-ID: <20150413154519.ADF9AAE568@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 12a641ce5a8432f09a2e641288ba5581efcd168f (commit) via 62c5e6f1a19df0043a0e9aaba6cf7247f76a5cc3 (commit) from 44ce162b1ecf6f8da5b167b5bb942b646196ea4b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12a641ce5a8432f09a2e641288ba5581efcd168f commit 12a641ce5a8432f09a2e641288ba5581efcd168f Merge: 44ce162 62c5e6f Author: Brad King AuthorDate: Mon Apr 13 11:45:13 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 11:45:13 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 13:01:36 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 13:01:36 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1818-gfd6b5d8 Message-ID: <20150413170136.569C6AF020@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fd6b5d8feab3e2b4815c7046a3993afd520b9838 (commit) via fef1f26749a7dc3839b1e461fb09eecbe97cca90 (commit) from 12a641ce5a8432f09a2e641288ba5581efcd168f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd6b5d8feab3e2b4815c7046a3993afd520b9838 commit fd6b5d8feab3e2b4815c7046a3993afd520b9838 Merge: 12a641c fef1f26 Author: Brad King AuthorDate: Mon Apr 13 13:01:35 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 13:01:35 2015 -0400 Merge topic 'doc-ctest-update-option-wording' into next fef1f267 Help: Fix {GIT,P4}UpdateCustom documentation (#15512) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fef1f26749a7dc3839b1e461fb09eecbe97cca90 commit fef1f26749a7dc3839b1e461fb09eecbe97cca90 Author: Brad King AuthorDate: Mon Apr 13 12:57:59 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 13:00:58 2015 -0400 Help: Fix {GIT,P4}UpdateCustom documentation (#15512) The GITUpdateCustom and P4UpdateCustom options take only one command line with all arguments as a ;-list, not a ;-list of multiple command lines. Fix the incorrect documentation originally added by commit v3.1.0-rc1~463^2 (Help: Document ctest dashboard client usage, 2014-05-30). diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index dd3bcfb..584786f 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -573,7 +573,7 @@ Configuration settings to specify the version control tool include: * :module:`CTest` module variable: ``GITCOMMAND`` ``GITUpdateCustom`` - Specify a semicolon-separated list of custom command lines to run + Specify a custom command line (as a semicolon-separated list) to run in the source tree (Git work tree) to update it instead of running the ``GITCommand``. @@ -617,7 +617,7 @@ Configuration settings to specify the version control tool include: * :module:`CTest` module variable: ``CTEST_P4_OPTIONS`` ``P4UpdateCustom`` - Specify a semicolon-separated list of custom command lines to run + Specify a custom command line (as a semicolon-separated list) to run in the source tree (Perforce tree) to update it instead of running the ``P4Command``. ----------------------------------------------------------------------- Summary of changes: Help/manual/ctest.1.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 14:31:45 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 14:31:45 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-774-gf1db1de Message-ID: <20150413183145.8B33DAF2F2@public.kitware.com> This is an automated email from 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 f1db1de61e913e4e8841e4d28fb33461d679c516 (commit) via 91d5261b58e97107fca610a868fbc283cbb8c856 (commit) from 62c5e6f1a19df0043a0e9aaba6cf7247f76a5cc3 (commit) Those revisions listed 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 Apr 13 14:31:45 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 14:31:45 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1820-gc167c89 Message-ID: <20150413183145.D8390AF308@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c167c897a95576f0b0bddca12433decb157ea4b2 (commit) via f1db1de61e913e4e8841e4d28fb33461d679c516 (commit) from fd6b5d8feab3e2b4815c7046a3993afd520b9838 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c167c897a95576f0b0bddca12433decb157ea4b2 commit c167c897a95576f0b0bddca12433decb157ea4b2 Merge: fd6b5d8 f1db1de Author: Brad King AuthorDate: Mon Apr 13 14:30:31 2015 -0400 Commit: Brad King CommitDate: Mon Apr 13 14:30:31 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Apr 13 14:31:45 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 13 Apr 2015 14:31:45 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.2.1-17-g91d5261 Message-ID: <20150413183145.EA39BAF30D@public.kitware.com> This is an automated email from 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 91d5261b58e97107fca610a868fbc283cbb8c856 (commit) from 74337b87acd837b9631f44b4df3027fe83ee9b42 (commit) Those revisions listed 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 steveire at gmail.com Mon Apr 13 15:49:09 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 13 Apr 2015 15:49:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1834-gc009d68 Message-ID: <20150413194909.CDC84AE7B2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c009d6847b4f82db1d85cdd88b67f664b83ed791 (commit) via de486a5ab283a9767dc4bed024dee24e2ca4344e (commit) via 36dc8942b55f876671168cd5f500939b0aa11038 (commit) via bc294599074e6a53b6cfbfb6555b88428c7c1164 (commit) via 9609ba5a5aa05ffbb7690853ceecc9902cc68eb8 (commit) via b320cfb93b88aed2881fc134a822feb3e94c7b05 (commit) via 1e8ad9c0d80bdf50f0336e3bc2de50b40be1a6d2 (commit) via 96f8c5f9a3bd60f553af054b43e06ce4864269e0 (commit) via 97e53ebb3cd728e6091f93cb7d4eac91ae417bdb (commit) via 1e738bcf9c7952bc9ae9bfb1be831c9f16998f54 (commit) via 62854e9966a3fe308cff4a76c89f6bf72f76551c (commit) via db8425be18439c899c08294dde117cc137c75d23 (commit) via 74de9a734c92288fb3e602be0d1c967b33b67443 (commit) via b159bff732d4e34a683edd1740604428049d1819 (commit) from c167c897a95576f0b0bddca12433decb157ea4b2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c009d6847b4f82db1d85cdd88b67f664b83ed791 commit c009d6847b4f82db1d85cdd88b67f664b83ed791 Merge: c167c89 de486a5 Author: Stephen Kelly AuthorDate: Mon Apr 13 15:49:07 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 15:49:07 2015 -0400 Merge topic 'port-global-properties-to-cmState' into next de486a5a Port Global property interaction to cmState. 36dc8942 Move property initialization to cmState. bc294599 Move global properties to cmState. 9609ba5a cmake: Remove the happy global property scope pattern. b320cfb9 cmake: Remove unused cmCommand methods. 1e8ad9c0 Port cmCommand consumers to cmState. 96f8c5f9 cmState: Move cmCommand-related methods from cmake class. 97e53ebb cmake: Simplify command clean up loop. 1e738bcf cmake: Simplify RemoveUnscriptableCommands algorithm. 62854e99 cmState: Move try_compile state from cmake class. db8425be cmake: Get enabled languages from cmState. 74de9a73 cmGlobalGenerator: Delegate storage of enabled languages to cmState. b159bff7 Move property definition to cmState. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de486a5ab283a9767dc4bed024dee24e2ca4344e commit de486a5ab283a9767dc4bed024dee24e2ca4344e Author: Stephen Kelly AuthorDate: Sat Apr 11 14:15:55 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 21:35:20 2015 +0200 Port Global property interaction to cmState. diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 4cdcd45..1e12f15 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -17,6 +17,7 @@ #include "cmGeneratedFileStream.h" #include "cmCTest.h" #include "cmXMLParser.h" +#include "cmState.h" #include #include @@ -1132,7 +1133,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, cmCTestScriptHandler* ch = static_cast(this->CTest->GetHandler("script")); cmake* cm = ch->GetCMake(); - const char* subproject = cm->GetProperty("SubProject"); + const char* subproject = cm->GetState()->GetGlobalProperty("SubProject"); // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index edf82bd..74e1a93 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -12,6 +12,7 @@ #include "cmAddLibraryCommand.h" #include "cmake.h" +#include "cmState.h" // cmLibraryCommand bool cmAddLibraryCommand @@ -330,7 +331,7 @@ bool cmAddLibraryCommand yet its linker language. */ if ((type == cmTarget::SHARED_LIBRARY || type == cmTarget::MODULE_LIBRARY) && - (this->Makefile->GetCMakeInstance()->GetPropertyAsBool( + (this->Makefile->GetState()->GetGlobalPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS") == false)) { std::ostringstream w; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index d54a651..cd2cd7c 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -27,6 +27,7 @@ #include "cmCTestCommand.h" #include "cmCTestStartCommand.h" #include "cmAlgorithms.h" +#include "cmState.h" #include "cmCTestBuildHandler.h" #include "cmCTestBuildAndTestHandler.h" @@ -1558,12 +1559,14 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) return; } // This code should go when cdash is changed to use labels only - const char* subproject = cm->GetProperty("SubProject"); + const char* subproject = cm->GetState() + ->GetGlobalProperty("SubProject"); if(subproject) { ostr << "\n"; const char* labels = - ch->GetCMake()->GetProperty("SubProjectLabels"); + ch->GetCMake()->GetState() + ->GetGlobalProperty("SubProjectLabels"); if(labels) { ostr << " \n"; @@ -1581,7 +1584,7 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) } // This code should stay when cdash only does label based sub-projects - const char* label = cm->GetProperty("Label"); + const char* label = cm->GetState()->GetGlobalProperty("Label"); if(label) { ostr << "\n"; diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 8880667..83d38ef 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -15,6 +15,7 @@ #include "cmOrderDirectories.h" #include "cmGlobalGenerator.h" +#include "cmState.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmTarget.h" @@ -250,8 +251,8 @@ cmComputeLinkInformation this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance(); // Check whether to recognize OpenBSD-style library versioned names. - this->OpenBSD = this->Makefile->GetCMakeInstance() - ->GetPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING"); + this->OpenBSD = this->Makefile->GetState() + ->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING"); // The configuration being linked. this->Config = config; @@ -796,9 +797,8 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, void cmComputeLinkInformation::ComputeLinkTypeInfo() { // Check whether archives may actually be shared libraries. - this->ArchivesMayBeShared = - this->CMakeInstance->GetPropertyAsBool( - "TARGET_ARCHIVES_MAY_BE_SHARED_LIBS"); + this->ArchivesMayBeShared = this->CMakeInstance->GetState() + ->GetGlobalPropertyAsBool("TARGET_ARCHIVES_MAY_BE_SHARED_LIBS"); // First assume we cannot do link type stuff. this->LinkTypeEnabled = false; @@ -1527,9 +1527,10 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item, // Print the warning at most once for this item. std::string wid = "CMP0008-WARNING-GIVEN-"; wid += item; - if(!this->CMakeInstance->GetPropertyAsBool(wid)) + if(!this->CMakeInstance->GetState() + ->GetGlobalPropertyAsBool(wid)) { - this->CMakeInstance->SetProperty(wid, "1"); + this->CMakeInstance->GetState()->SetGlobalProperty(wid, "1"); std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0008)) << "\n" @@ -1576,9 +1577,11 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories() switch(this->Target->GetPolicyStatusCMP0003()) { case cmPolicies::WARN: - if(!this->CMakeInstance->GetPropertyAsBool("CMP0003-WARNING-GIVEN")) + if(!this->CMakeInstance->GetState() + ->GetGlobalPropertyAsBool("CMP0003-WARNING-GIVEN")) { - this->CMakeInstance->SetProperty("CMP0003-WARNING-GIVEN", "1"); + this->CMakeInstance->GetState() + ->SetGlobalProperty("CMP0003-WARNING-GIVEN", "1"); std::ostringstream w; this->PrintLinkPolicyDiagnosis(w); this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index bbffd5d..11056cd 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -15,6 +15,7 @@ #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmState.h" #include "cmSystemTools.h" #include "cmSourceFile.h" #include "cmTarget.h" @@ -98,8 +99,10 @@ cmComputeTargetDepends::cmComputeTargetDepends(cmGlobalGenerator* gg) { this->GlobalGenerator = gg; cmake* cm = this->GlobalGenerator->GetCMakeInstance(); - this->DebugMode = cm->GetPropertyAsBool("GLOBAL_DEPENDS_DEBUG_MODE"); - this->NoCycles = cm->GetPropertyAsBool("GLOBAL_DEPENDS_NO_CYCLES"); + this->DebugMode = cm->GetState() + ->GetGlobalPropertyAsBool("GLOBAL_DEPENDS_DEBUG_MODE"); + this->NoCycles = cm->GetState() + ->GetGlobalPropertyAsBool("GLOBAL_DEPENDS_NO_CYCLES"); } //---------------------------------------------------------------------------- diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 16d5119..2aa4d93 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -469,8 +469,8 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() fout << "\t\t" << *nit << "\n"; } - if (const char *extraNaturesProp = mf->GetCMakeInstance()-> - GetProperty("ECLIPSE_EXTRA_NATURES")) + if (const char *extraNaturesProp = mf->GetState() + ->GetGlobalProperty("ECLIPSE_EXTRA_NATURES")) { std::vector extraNatures; cmSystemTools::ExpandListArgument(extraNaturesProp, extraNatures); diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index ef8340b..507d011 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -54,8 +54,8 @@ bool cmFindLibraryCommand } } - if(this->Makefile->GetCMakeInstance() - ->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS")) + if(this->Makefile->GetState() + ->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS")) { // add special 64 bit paths if this is a 64 bit compile. if(this->Makefile->PlatformIs64Bit()) @@ -226,8 +226,8 @@ cmFindLibraryHelper::cmFindLibraryHelper(cmMakefile* mf): // Check whether to use OpenBSD-style library version comparisons. this->OpenBSD = - this->Makefile->GetCMakeInstance() - ->GetPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING"); + this->Makefile->GetState() + ->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING"); } //---------------------------------------------------------------------------- diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index b32f5fd..e1074b0 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -120,8 +120,8 @@ bool cmFindPackageCommand // Lookup whether lib64 paths should be used. if(this->Makefile->PlatformIs64Bit() && - this->Makefile->GetCMakeInstance() - ->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS")) + this->Makefile->GetState() + ->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS")) { this->UseLib64Paths = true; } @@ -1015,8 +1015,8 @@ bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr) void cmFindPackageCommand::AppendToFoundProperty(bool found) { std::vector foundContents; - const char *foundProp = - this->Makefile->GetCMakeInstance()->GetProperty("PACKAGES_FOUND"); + const char *foundProp = this->Makefile->GetState() + ->GetGlobalProperty("PACKAGES_FOUND"); if (foundProp && *foundProp) { std::string tmp = foundProp; @@ -1032,7 +1032,8 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found) std::vector notFoundContents; const char *notFoundProp = - this->Makefile->GetCMakeInstance()->GetProperty("PACKAGES_NOT_FOUND"); + this->Makefile->GetState() + ->GetGlobalProperty("PACKAGES_NOT_FOUND"); if (notFoundProp && *notFoundProp) { std::string tmp = notFoundProp; @@ -1057,12 +1058,12 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found) std::string tmp = cmJoin(foundContents, ";"); - this->Makefile->GetCMakeInstance()->SetProperty("PACKAGES_FOUND", - tmp.c_str()); + this->Makefile->GetState() + ->SetGlobalProperty("PACKAGES_FOUND", tmp.c_str()); tmp = cmJoin(notFoundContents, ";"); - this->Makefile->GetCMakeInstance()->SetProperty("PACKAGES_NOT_FOUND", - tmp.c_str()); + this->Makefile->GetState() + ->SetGlobalProperty("PACKAGES_NOT_FOUND", tmp.c_str()); } //---------------------------------------------------------------------------- @@ -1071,8 +1072,8 @@ void cmFindPackageCommand::AppendSuccessInformation() { std::string transitivePropName = "_CMAKE_"; transitivePropName += this->Name + "_TRANSITIVE_DEPENDENCY"; - this->Makefile->GetCMakeInstance() - ->SetProperty(transitivePropName, "False"); + this->Makefile->GetState() + ->SetGlobalProperty(transitivePropName, "False"); } std::string found = this->Name; found += "_FOUND"; @@ -1090,8 +1091,8 @@ void cmFindPackageCommand::AppendSuccessInformation() std::string quietInfoPropName = "_CMAKE_"; quietInfoPropName += this->Name; quietInfoPropName += "_QUIET"; - this->Makefile->GetCMakeInstance()->SetProperty(quietInfoPropName, - this->Quiet ? "TRUE" : "FALSE"); + this->Makefile->GetState() + ->SetGlobalProperty(quietInfoPropName, this->Quiet ? "TRUE" : "FALSE"); // set a global property to record the required version of this package std::string versionInfoPropName = "_CMAKE_"; @@ -1104,15 +1105,15 @@ void cmFindPackageCommand::AppendSuccessInformation() versionInfo += " "; versionInfo += this->Version; } - this->Makefile->GetCMakeInstance()->SetProperty(versionInfoPropName, - versionInfo.c_str()); + this->Makefile->GetState() + ->SetGlobalProperty(versionInfoPropName, versionInfo.c_str()); if (this->Required) { std::string requiredInfoPropName = "_CMAKE_"; requiredInfoPropName += this->Name; requiredInfoPropName += "_TYPE"; - this->Makefile->GetCMakeInstance()->SetProperty( - requiredInfoPropName, "REQUIRED"); + this->Makefile->GetState() + ->SetGlobalProperty(requiredInfoPropName, "REQUIRED"); } diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 85aa31f..b035750 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -14,6 +14,7 @@ #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmake.h" +#include "cmState.h" #include "cmAlgorithms.h" // cmGetCMakePropertyCommand @@ -53,7 +54,8 @@ bool cmGetCMakePropertyCommand else { const char *prop = - this->Makefile->GetCMakeInstance()->GetProperty(args[1]); + this->Makefile->GetState() + ->GetGlobalProperty(args[1]); if (prop) { output = prop; diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index a8481ad..3e1d08e 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -237,7 +237,8 @@ bool cmGetPropertyCommand::HandleGlobalMode() // Get the property. cmake* cm = this->Makefile->GetCMakeInstance(); - return this->StoreResult(cm->GetProperty(this->PropertyName)); + return this->StoreResult(cm->GetState() + ->GetGlobalProperty(this->PropertyName)); } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 56a0a45..ab044c1 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -200,7 +200,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, if (cnameString != pathString) { const char* cvars = - this->GetCMakeInstance()->GetProperty( + this->GetCMakeInstance()->GetState()->GetGlobalProperty( "__CMAKE_DELETE_CACHE_CHANGE_VARS_"); if(cvars) { @@ -210,7 +210,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, changeVars += langComp; changeVars += ";"; changeVars += cname; - this->GetCMakeInstance()->SetProperty( + this->GetCMakeInstance()->GetState()->SetGlobalProperty( "__CMAKE_DELETE_CACHE_CHANGE_VARS_", changeVars.c_str()); } @@ -1170,8 +1170,8 @@ void cmGlobalGenerator::AddCMP0042WarnTarget(const std::string& target) bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const { // If the property is not enabled then okay. - if(!this->CMakeInstance - ->GetPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS")) + if(!this->CMakeInstance->GetState() + ->GetGlobalPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS")) { return true; } @@ -2391,8 +2391,8 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) //---------------------------------------------------------------------------- const char* cmGlobalGenerator::GetPredefinedTargetsFolder() { - const char* prop = - this->GetCMakeInstance()->GetProperty("PREDEFINED_TARGETS_FOLDER"); + const char* prop = this->GetCMakeInstance()->GetState() + ->GetGlobalProperty("PREDEFINED_TARGETS_FOLDER"); if (prop) { @@ -2405,7 +2405,8 @@ const char* cmGlobalGenerator::GetPredefinedTargetsFolder() //---------------------------------------------------------------------------- bool cmGlobalGenerator::UseFolderProperty() { - const char* prop = this->GetCMakeInstance()->GetProperty("USE_FOLDERS"); + const char* prop = this->GetCMakeInstance()->GetState() + ->GetGlobalProperty("USE_FOLDERS"); // If this property is defined, let the setter turn this on or off... // diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 124e849..645d32a 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -18,6 +18,7 @@ #include "cmGeneratedFileStream.h" #include "cmSourceFile.h" #include "cmake.h" +#include "cmState.h" #include @@ -234,7 +235,8 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os) { cmGlobalNinjaGenerator::WriteDivider(os); - const char* jobpools = this->GetCMakeInstance()->GetProperty("JOB_POOLS"); + const char* jobpools = this->GetCMakeInstance()->GetState() + ->GetGlobalProperty("JOB_POOLS"); if (jobpools) { cmGlobalNinjaGenerator::WriteComment(os, diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2fe1e33..205508b 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4239,7 +4239,7 @@ const char *cmMakefile::GetProperty(const std::string& prop, return this->LocalGenerator->GetParent()->GetMakefile()-> GetProperty(prop, scope); } - return this->GetCMakeInstance()->GetProperty(prop); + return this->GetState()->GetGlobalProperty(prop); } return retVal; @@ -4585,7 +4585,8 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, this->LocalGenerator->GetGlobalGenerator()->GetCMakeInstance(); if(isCustom && existing->GetType() == cmTarget::UTILITY && this != existing->GetMakefile() && - cm->GetPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS")) + cm->GetState() + ->GetGlobalPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS")) { return true; } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index bd9c579..0076caf 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -20,6 +20,7 @@ #include "cmSourceFile.h" #include "cmTarget.h" #include "cmake.h" +#include "cmState.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratorExpression.h" @@ -51,7 +52,8 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target) this->GeneratorTarget = this->GlobalGenerator->GetGeneratorTarget(target); cmake* cm = this->GlobalGenerator->GetCMakeInstance(); this->NoRuleMessages = false; - if(const char* ruleStatus = cm->GetProperty("RULE_MESSAGES")) + if(const char* ruleStatus = cm->GetState() + ->GetGlobalProperty("RULE_MESSAGES")) { this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus); } diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 4cb49c8..4d0b3f4 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -16,6 +16,7 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" +#include "cmState.h" #include "cmAlgorithms.h" #if defined(_WIN32) && !defined(__CYGWIN__) @@ -472,12 +473,12 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target) } // Set target folder - const char* autogenFolder = makefile->GetCMakeInstance()->GetProperty( - "AUTOMOC_TARGETS_FOLDER"); + const char* autogenFolder = makefile->GetState() + ->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER"); if (!autogenFolder) { - autogenFolder = makefile->GetCMakeInstance()->GetProperty( - "AUTOGEN_TARGETS_FOLDER"); + autogenFolder = makefile->GetState() + ->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER"); } if (autogenFolder && *autogenFolder) { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 96b6a22..a542a24 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1152,7 +1152,8 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) std::vector argsSplit; cmSystemTools::ExpandListArgument(std::string(var), argsSplit, true); // erase the property to avoid infinite recursion - this->SetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", ""); + this->State + ->SetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", ""); if(this->State->GetIsInTryCompile()) { return 0; @@ -1229,8 +1230,8 @@ int cmake::Configure() } } int ret = this->ActualConfigure(); - const char* delCacheVars = - this->GetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_"); + const char* delCacheVars = this->State + ->GetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_"); if(delCacheVars && delCacheVars[0] != 0) { return this->HandleDeleteCacheVariables(delCacheVars); @@ -1505,7 +1506,7 @@ int cmake::ActualConfigure() cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); if (mf->IsOn("CTEST_USE_LAUNCHERS") - && !this->GetProperty("RULE_LAUNCH_COMPILE")) + && !this->State->GetGlobalProperty("RULE_LAUNCH_COMPILE")) { cmSystemTools::Error("CTEST_USE_LAUNCHERS is enabled, but the " "RULE_LAUNCH_COMPILE global property is not defined.\n" @@ -2194,7 +2195,7 @@ const char *cmake::GetProperty(const std::string& prop) bool cmake::GetPropertyAsBool(const std::string& prop) { - return cmSystemTools::IsOn(this->GetProperty(prop)); + return this->State->GetGlobalPropertyAsBool(prop); } cmInstalledFile *cmake::GetOrCreateInstalledFile( @@ -2590,7 +2591,8 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, std::vector cmake::GetDebugConfigs() { std::vector configs; - if(const char* config_list = this->GetProperty("DEBUG_CONFIGURATIONS")) + if(const char* config_list = + this->State->GetGlobalProperty("DEBUG_CONFIGURATIONS")) { // Expand the specified list and convert to upper-case. cmSystemTools::ExpandListArgument(config_list, configs); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=36dc8942b55f876671168cd5f500939b0aa11038 commit 36dc8942b55f876671168cd5f500939b0aa11038 Author: Stephen Kelly AuthorDate: Mon Apr 6 19:47:21 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 21:35:19 2015 +0200 Move property initialization to cmState. diff --git a/Source/cmState.cxx b/Source/cmState.cxx index e46846e..96f8a51 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -22,6 +22,7 @@ cmState::cmState(cmake* cm) : CMakeInstance(cm), IsInTryCompile(false) { + this->Initialize(); } cmState::~cmState() diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7d02505..96b6a22 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -136,8 +136,6 @@ cmake::cmake() this->Policies = new cmPolicies(); this->State = new cmState(this); - this->InitializeProperties(); - #ifdef __APPLE__ struct rlimit rlp; if(!getrlimit(RLIMIT_STACK, &rlp)) @@ -186,14 +184,9 @@ cmake::~cmake() delete this->FileComparison; } -void cmake::InitializeProperties() -{ - this->State->Initialize(); -} - void cmake::CleanupCommandsAndMacros() { - this->InitializeProperties(); + this->State->Initialize(); this->State->RemoveUserDefinedCommands(); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bc294599074e6a53b6cfbfb6555b88428c7c1164 commit bc294599074e6a53b6cfbfb6555b88428c7c1164 Author: Stephen Kelly AuthorDate: Sat Apr 11 14:17:46 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 21:35:19 2015 +0200 Move global properties to cmState. diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 17b6cf2..e46846e 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -191,6 +191,8 @@ void cmState::RemoveCacheEntryProperty(std::string const& key, void cmState::Initialize() { + this->GlobalProperties.clear(); + this->PropertyDefinitions.clear(); this->DefineProperty ("RULE_LAUNCH_COMPILE", cmProperty::DIRECTORY, @@ -384,3 +386,60 @@ void cmState::RemoveUserDefinedCommands() } } } + +void cmState::SetGlobalProperty(const std::string& prop, const char* value) +{ + this->GlobalProperties.SetProperty(prop, value, cmProperty::GLOBAL); +} + +void cmState::AppendGlobalProperty(const std::string& prop, + const char* value, bool asString) +{ + this->GlobalProperties.AppendProperty(prop, value, + cmProperty::GLOBAL, asString); +} + +const char *cmState::GetGlobalProperty(const std::string& prop) +{ + // watch for special properties + std::string output = ""; + if ( prop == "CACHE_VARIABLES" ) + { + std::vector cacheKeys = this->GetCacheEntryKeys(); + this->SetGlobalProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); + } + else if ( prop == "COMMANDS" ) + { + std::vector commands = this->GetCommandNames(); + this->SetGlobalProperty("COMMANDS", cmJoin(commands, ";").c_str()); + } + else if ( prop == "IN_TRY_COMPILE" ) + { + this->SetGlobalProperty("IN_TRY_COMPILE", + this->IsInTryCompile ? "1" : "0"); + } + else if ( prop == "ENABLED_LANGUAGES" ) + { + std::string langs; + langs = cmJoin(this->EnabledLanguages, ";"); + this->SetGlobalProperty("ENABLED_LANGUAGES", langs.c_str()); + } +#define STRING_LIST_ELEMENT(F) ";" #F + if (prop == "CMAKE_C_KNOWN_FEATURES") + { + return FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT) + 1; + } + if (prop == "CMAKE_CXX_KNOWN_FEATURES") + { + return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1; + } +#undef STRING_LIST_ELEMENT + bool dummy = false; + return this->GlobalProperties.GetPropertyValue(prop, cmProperty::GLOBAL, + dummy); +} + +bool cmState::GetGlobalPropertyAsBool(const std::string& prop) +{ + return cmSystemTools::IsOn(this->GetGlobalProperty(prop)); +} diff --git a/Source/cmState.h b/Source/cmState.h index a7a17ee..34b2ccf 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -14,6 +14,7 @@ #include "cmStandardIncludes.h" #include "cmPropertyDefinitionMap.h" +#include "cmPropertyMap.h" class cmake; class cmCommand; @@ -88,10 +89,17 @@ public: void RemoveUserDefinedCommands(); std::vector GetCommandNames() const; + void SetGlobalProperty(const std::string& prop, const char *value); + void AppendGlobalProperty(const std::string& prop, + const char *value,bool asString=false); + const char *GetGlobalProperty(const std::string& prop); + bool GetGlobalPropertyAsBool(const std::string& prop); + private: std::map PropertyDefinitions; std::vector EnabledLanguages; std::map Commands; + cmPropertyMap GlobalProperties; cmake* CMakeInstance; bool IsInTryCompile; }; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a83596d..7d02505 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -188,8 +188,6 @@ cmake::~cmake() void cmake::InitializeProperties() { - this->Properties.clear(); - this->State->Initialize(); } @@ -2187,52 +2185,18 @@ void cmake::GenerateGraphViz(const char* fileName) const void cmake::SetProperty(const std::string& prop, const char* value) { - this->Properties.SetProperty(prop, value, cmProperty::GLOBAL); + this->State->SetGlobalProperty(prop, value); } void cmake::AppendProperty(const std::string& prop, const char* value, bool asString) { - this->Properties.AppendProperty(prop, value, cmProperty::GLOBAL, asString); + this->State->AppendGlobalProperty(prop, value, asString); } const char *cmake::GetProperty(const std::string& prop) { - // watch for special properties - std::string output = ""; - if ( prop == "CACHE_VARIABLES" ) - { - std::vector cacheKeys = this->State->GetCacheEntryKeys(); - this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); - } - else if ( prop == "COMMANDS" ) - { - std::vector commands = this->State->GetCommandNames(); - this->SetProperty("COMMANDS", cmJoin(commands, ";").c_str()); - } - else if ( prop == "IN_TRY_COMPILE" ) - { - this->SetProperty("IN_TRY_COMPILE", - this->State->GetIsInTryCompile() ? "1" : "0"); - } - else if ( prop == "ENABLED_LANGUAGES" ) - { - std::string langs; - langs = cmJoin(this->State->GetEnabledLanguages(), ";"); - this->SetProperty("ENABLED_LANGUAGES", langs.c_str()); - } -#define STRING_LIST_ELEMENT(F) ";" #F - if (prop == "CMAKE_C_KNOWN_FEATURES") - { - return FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT) + 1; - } - if (prop == "CMAKE_CXX_KNOWN_FEATURES") - { - return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1; - } -#undef STRING_LIST_ELEMENT - bool dummy = false; - return this->Properties.GetPropertyValue(prop, cmProperty::GLOBAL, dummy); + return this->State->GetGlobalProperty(prop); } bool cmake::GetPropertyAsBool(const std::string& prop) diff --git a/Source/cmake.h b/Source/cmake.h index 27f28ac..352850d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -15,7 +15,6 @@ #include "cmListFileCache.h" #include "cmSystemTools.h" -#include "cmPropertyMap.h" #include "cmInstalledFile.h" #include "cmCacheManager.h" #include "cmState.h" @@ -336,7 +335,6 @@ protected: void RunCheckForUnusedVariables(); void InitializeProperties(); int HandleDeleteCacheVariables(const std::string& var); - cmPropertyMap Properties; typedef cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)(); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9609ba5a5aa05ffbb7690853ceecc9902cc68eb8 commit 9609ba5a5aa05ffbb7690853ceecc9902cc68eb8 Author: Stephen Kelly AuthorDate: Mon Apr 13 21:20:25 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 21:32:05 2015 +0200 cmake: Remove the happy global property scope pattern. Global properties are already global in scope, so remove the overload for specifying it and port users of the API. The call from cmMakefile::GetProperty can be simplified because the scope is only used during chaining, and there is no further chaining after processing global properties. diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index d585863..4cdcd45 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1132,7 +1132,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, cmCTestScriptHandler* ch = static_cast(this->CTest->GetHandler("script")); cmake* cm = ch->GetCMake(); - const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + const char* subproject = cm->GetProperty("SubProject"); // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 6715638..d54a651 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1558,12 +1558,12 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) return; } // This code should go when cdash is changed to use labels only - const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + const char* subproject = cm->GetProperty("SubProject"); if(subproject) { ostr << "\n"; const char* labels = - ch->GetCMake()->GetProperty("SubProjectLabels", cmProperty::GLOBAL); + ch->GetCMake()->GetProperty("SubProjectLabels"); if(labels) { ostr << " \n"; @@ -1581,7 +1581,7 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) } // This code should stay when cdash only does label based sub-projects - const char* label = cm->GetProperty("Label", cmProperty::GLOBAL); + const char* label = cm->GetProperty("Label"); if(label) { ostr << "\n"; diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 35b70e8..16d5119 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -470,7 +470,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() } if (const char *extraNaturesProp = mf->GetCMakeInstance()-> - GetProperty("ECLIPSE_EXTRA_NATURES", cmProperty::GLOBAL)) + GetProperty("ECLIPSE_EXTRA_NATURES")) { std::vector extraNatures; cmSystemTools::ExpandListArgument(extraNaturesProp, extraNatures); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 640c1b3..124e849 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -234,8 +234,7 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os) { cmGlobalNinjaGenerator::WriteDivider(os); - const char* jobpools = this->GetCMakeInstance() - ->GetProperty("JOB_POOLS", cmProperty::GLOBAL); + const char* jobpools = this->GetCMakeInstance()->GetProperty("JOB_POOLS"); if (jobpools) { cmGlobalNinjaGenerator::WriteComment(os, diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index be3bcdc..2fe1e33 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4239,7 +4239,7 @@ const char *cmMakefile::GetProperty(const std::string& prop, return this->LocalGenerator->GetParent()->GetMakefile()-> GetProperty(prop, scope); } - return this->GetCMakeInstance()->GetProperty(prop,scope); + return this->GetCMakeInstance()->GetProperty(prop); } return retVal; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e286295..a83596d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1514,7 +1514,7 @@ int cmake::ActualConfigure() cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); if (mf->IsOn("CTEST_USE_LAUNCHERS") - && !this->GetProperty("RULE_LAUNCH_COMPILE", cmProperty::GLOBAL)) + && !this->GetProperty("RULE_LAUNCH_COMPILE")) { cmSystemTools::Error("CTEST_USE_LAUNCHERS is enabled, but the " "RULE_LAUNCH_COMPILE global property is not defined.\n" @@ -2198,12 +2198,6 @@ void cmake::AppendProperty(const std::string& prop, const char *cmake::GetProperty(const std::string& prop) { - return this->GetProperty(prop, cmProperty::GLOBAL); -} - -const char *cmake::GetProperty(const std::string& prop, - cmProperty::ScopeType scope) -{ // watch for special properties std::string output = ""; if ( prop == "CACHE_VARIABLES" ) @@ -2238,7 +2232,7 @@ const char *cmake::GetProperty(const std::string& prop, } #undef STRING_LIST_ELEMENT bool dummy = false; - return this->Properties.GetPropertyValue(prop, scope, dummy); + return this->Properties.GetPropertyValue(prop, cmProperty::GLOBAL, dummy); } bool cmake::GetPropertyAsBool(const std::string& prop) diff --git a/Source/cmake.h b/Source/cmake.h index 359e7bf..27f28ac 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -253,8 +253,6 @@ class cmake void AppendProperty(const std::string& prop, const char *value,bool asString=false); const char *GetProperty(const std::string& prop); - const char *GetProperty(const std::string& prop, - cmProperty::ScopeType scope); bool GetPropertyAsBool(const std::string& prop); ///! Get or create an cmInstalledFile instance and return a pointer to it http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b320cfb93b88aed2881fc134a822feb3e94c7b05 commit b320cfb93b88aed2881fc134a822feb3e94c7b05 Author: Stephen Kelly AuthorDate: Sat Apr 11 13:13:57 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 21:12:15 2015 +0200 cmake: Remove unused cmCommand methods. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a0f813e..e286295 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -199,32 +199,6 @@ void cmake::CleanupCommandsAndMacros() this->State->RemoveUserDefinedCommands(); } -bool cmake::CommandExists(const std::string& name) const -{ - return this->State->GetCommand(name) ? true : false; -} - -cmCommand *cmake::GetCommand(const std::string& name) const -{ - return this->State->GetCommand(name); -} - -void cmake::RenameCommand(const std::string& oldName, - const std::string& newName) -{ - this->State->RenameCommand(oldName, newName); -} - -void cmake::AddCommand(cmCommand* command) -{ - this->State->AddCommand(command); -} - -void cmake::RemoveUnscriptableCommands() -{ - this->State->RemoveUnscriptableCommands(); -} - // Parse the args bool cmake::SetCacheArgs(const std::vector& args) { diff --git a/Source/cmake.h b/Source/cmake.h index e7a8acb..359e7bf 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -24,7 +24,6 @@ class cmGlobalGeneratorFactory; class cmGlobalGenerator; class cmLocalGenerator; class cmMakefile; -class cmCommand; class cmVariableWatch; class cmFileTimeComparison; class cmExternalMakefileProjectGenerator; @@ -216,21 +215,6 @@ class cmake */ int GetSystemInformation(std::vector&); - /** - * Add a command to this cmake instance - */ - void AddCommand(cmCommand* ); - void RenameCommand(const std::string& oldName, const std::string& newName); - void RemoveUnscriptableCommands(); - - /** - * Get a command by its name - */ - cmCommand *GetCommand(const std::string& name) const; - - /** Check if a command exists. */ - bool CommandExists(const std::string& name) const; - ///! Parse command line arguments void SetArgs(const std::vector&, bool directoriesSetBefore = false); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e8ad9c0d80bdf50f0336e3bc2de50b40be1a6d2 commit 1e8ad9c0d80bdf50f0336e3bc2de50b40be1a6d2 Author: Stephen Kelly AuthorDate: Sat Apr 11 12:52:14 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 21:12:15 2015 +0200 Port cmCommand consumers to cmState. diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 00b23cd..a9cabf1 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -198,7 +198,7 @@ int main (int argc, char const* const* argv) "Read CPack config file: " << cpackConfigFile << std::endl); cmake cminst; - cminst.RemoveUnscriptableCommands(); + cminst.GetState()->RemoveUnscriptableCommands(); cmGlobalGenerator cmgg; cmgg.SetCMakeInstance(&cminst); cmsys::auto_ptr cmlg(cmgg.CreateLocalGenerator()); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 3792953..783941b 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -214,7 +214,7 @@ void cmCTestScriptHandler::AddCTestCommand(cmCTestCommand* command) cmCTestCommand* newCom = command; newCom->CTest = this->CTest; newCom->CTestScriptHandler = this; - this->CMake->AddCommand(newCom); + this->CMake->GetState()->AddCommand(newCom); } int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) @@ -353,7 +353,7 @@ void cmCTestScriptHandler::CreateCMake() // remove all cmake commands which are not scriptable, since they can't be // used in ctest scripts - this->CMake->RemoveUnscriptableCommands(); + this->CMake->GetState()->RemoveUnscriptableCommands(); // add any ctest specific commands, probably should have common superclass // for ctest commands to clean this up. If a couple more commands are diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 0e84fbf..c50ea88 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1585,25 +1585,25 @@ void cmCTestTestHandler::GetListOfTests() // Add handler for ADD_TEST cmCTestAddTestCommand* newCom1 = new cmCTestAddTestCommand; newCom1->TestHandler = this; - cm.AddCommand(newCom1); + cm.GetState()->AddCommand(newCom1); // Add handler for SUBDIRS cmCTestSubdirCommand* newCom2 = new cmCTestSubdirCommand; newCom2->TestHandler = this; - cm.AddCommand(newCom2); + cm.GetState()->AddCommand(newCom2); // Add handler for ADD_SUBDIRECTORY cmCTestAddSubdirectoryCommand* newCom3 = new cmCTestAddSubdirectoryCommand; newCom3->TestHandler = this; - cm.AddCommand(newCom3); + cm.GetState()->AddCommand(newCom3); // Add handler for SET_SOURCE_FILES_PROPERTIES cmCTestSetTestsPropertiesCommand* newCom4 = new cmCTestSetTestsPropertiesCommand; newCom4->TestHandler = this; - cm.AddCommand(newCom4); + cm.GetState()->AddCommand(newCom4); const char* testFilename; if( cmSystemTools::FileExists("CTestTestfile.cmake") ) diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 6134c6f..77cd6c6 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -164,7 +164,7 @@ int CCONV cmIsOn(void *arg, const char* name) int CCONV cmCommandExists(void *arg, const char* name) { cmMakefile *mf = static_cast(arg); - return static_cast(mf->CommandExists(name)); + return static_cast(mf->GetState()->GetCommand(name) ? 1 : 0); } void CCONV cmAddDefineFlag(void *arg, const char* definition) diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index eb4f3a1..6b8cfa0 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -482,7 +482,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList &newArgs, if (this->IsKeyword("COMMAND", *arg) && argP1 != newArgs.end()) { this->HandlePredicate( - this->Makefile.CommandExists(argP1->c_str()), + this->Makefile.GetState()->GetCommand(argP1->c_str()), reducible, arg, newArgs, argP1, argP2); } // does a policy exist diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 9297688..fdd1018 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -193,9 +193,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, } std::string newName = "_" + this->Args[0]; - mf.GetCMakeInstance()->RenameCommand(this->Args[0], - newName); - mf.AddCommand(f); + mf.GetState()->RenameCommand(this->Args[0], newName); + mf.GetState()->AddCommand(f); // remove the function blocker now that the function is defined mf.RemoveFunctionBlocker(this, lff); diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index cdfd00c..403f7fc 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -273,7 +273,7 @@ bool cmLoadCommandCommand // create a function blocker and set it up cmLoadedCommand *f = new cmLoadedCommand(); (*initFunction)(&f->info); - this->Makefile->AddCommand(f); + this->Makefile->GetState()->AddCommand(f); return true; } this->SetError("Attempt to load command failed. " diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index b7cbae6..7ac4432 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -232,9 +232,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, f->Functions = this->Functions; mf.RecordPolicies(f->Policies); std::string newName = "_" + this->Args[0]; - mf.GetCMakeInstance()->RenameCommand(this->Args[0], - newName); - mf.AddCommand(f); + mf.GetState()->RenameCommand(this->Args[0], newName); + mf.GetState()->AddCommand(f); // remove the function blocker now that the macro is defined mf.RemoveFunctionBlocker(this, lff); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b1e67f4..be3bcdc 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -244,12 +244,6 @@ void cmMakefile::Print() const #endif } -bool cmMakefile::CommandExists(const char* name) const -{ - return this->GetCMakeInstance()->CommandExists(name); -} - - //---------------------------------------------------------------------------- void cmMakefile::IssueMessage(cmake::MessageType t, std::string const& text) const @@ -340,7 +334,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, static_cast(stack_manager); // Lookup the command prototype. - if(cmCommand* proto = this->GetCMakeInstance()->GetCommand(name)) + if(cmCommand* proto = this->GetState()->GetCommand(name)) { // Clone the prototype. cmsys::auto_ptr pcmd(proto->Clone()); @@ -718,11 +712,6 @@ void cmMakefile::EnforceDirectoryLevelRules() const } } -void cmMakefile::AddCommand(cmCommand* wg) -{ - this->GetCMakeInstance()->AddCommand(wg); -} - // Set the make file void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 43c1b1a..299d550 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -746,14 +746,6 @@ public: bool ExecuteCommand(const cmListFileFunction& lff, cmExecutionStatus &status); - /** Check if a command exists. */ - bool CommandExists(const char* name) const; - - /** - * Add a command to this cmake instance - */ - void AddCommand(cmCommand* ); - ///! Enable support for named language, if nil then all languages are ///enabled. void EnableLanguage(std::vectorconst& languages, bool optional); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 89d5fea..a0f813e 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1758,7 +1758,7 @@ void cmake::AddDefaultCommands() for(std::vector::iterator i = commands.begin(); i != commands.end(); ++i) { - this->AddCommand(*i); + this->State->AddCommand(*i); } } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96f8c5f9a3bd60f553af054b43e06ce4864269e0 commit 96f8c5f9a3bd60f553af054b43e06ce4864269e0 Author: Stephen Kelly AuthorDate: Sat Apr 11 12:30:26 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 21:12:14 2015 +0200 cmState: Move cmCommand-related methods from cmake class. diff --git a/Source/cmState.cxx b/Source/cmState.cxx index be6a766..17b6cf2 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -13,6 +13,10 @@ #include "cmake.h" #include "cmCacheManager.h" +#include "cmCommand.h" +#include "cmAlgorithms.h" + +#include cmState::cmState(cmake* cm) : CMakeInstance(cm), @@ -20,6 +24,11 @@ cmState::cmState(cmake* cm) { } +cmState::~cmState() +{ + cmDeleteAll(this->Commands); +} + const char* cmCacheEntryTypes[] = { "BOOL", "PATH", @@ -274,3 +283,104 @@ void cmState::SetIsInTryCompile(bool b) { this->IsInTryCompile = b; } + +void cmState::RenameCommand(std::string const& oldName, + std::string const& newName) +{ + // if the command already exists, free the old one + std::string sOldName = cmSystemTools::LowerCase(oldName); + std::string sNewName = cmSystemTools::LowerCase(newName); + std::map::iterator pos = + this->Commands.find(sOldName); + if ( pos == this->Commands.end() ) + { + return; + } + cmCommand* cmd = pos->second; + + pos = this->Commands.find(sNewName); + if (pos != this->Commands.end()) + { + delete pos->second; + this->Commands.erase(pos); + } + this->Commands.insert(std::make_pair(sNewName, cmd)); + pos = this->Commands.find(sOldName); + this->Commands.erase(pos); +} + +void cmState::AddCommand(cmCommand* command) +{ + std::string name = cmSystemTools::LowerCase(command->GetName()); + // if the command already exists, free the old one + std::map::iterator pos = this->Commands.find(name); + if (pos != this->Commands.end()) + { + delete pos->second; + this->Commands.erase(pos); + } + this->Commands.insert(std::make_pair(name, command)); +} + +void cmState::RemoveUnscriptableCommands() +{ + std::vector unscriptableCommands; + for (std::map::iterator + pos = this->Commands.begin(); + pos != this->Commands.end(); ) + { + if (!pos->second->IsScriptable()) + { + delete pos->second; + this->Commands.erase(pos++); + } + else + { + ++pos; + } + } +} + +cmCommand* cmState::GetCommand(std::string const& name) const +{ + cmCommand* command = 0; + std::string sName = cmSystemTools::LowerCase(name); + std::map::const_iterator pos = + this->Commands.find(sName); + if (pos != this->Commands.end()) + { + command = (*pos).second; + } + return command; +} + +std::vector cmState::GetCommandNames() const +{ + std::vector commandNames; + commandNames.reserve(this->Commands.size()); + std::map::const_iterator cmds + = this->Commands.begin(); + for ( ; cmds != this->Commands.end(); ++ cmds ) + { + commandNames.push_back(cmds->first); + } + return commandNames; +} + +void cmState::RemoveUserDefinedCommands() +{ + for(std::map::iterator j = this->Commands.begin(); + j != this->Commands.end(); ) + { + if (j->second->IsA("cmMacroHelperCommand") || + j->second->IsA("cmFunctionHelperCommand")) + { + delete j->second; + this->Commands.erase(j++); + } + else + { + ++j; + } + } +} diff --git a/Source/cmState.h b/Source/cmState.h index 6df6182..a7a17ee 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -16,11 +16,13 @@ #include "cmPropertyDefinitionMap.h" class cmake; +class cmCommand; class cmState { public: cmState(cmake* cm); + ~cmState(); enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC, UNINITIALIZED }; @@ -79,9 +81,17 @@ public: bool GetIsInTryCompile() const; void SetIsInTryCompile(bool b); + cmCommand* GetCommand(std::string const& name) const; + void AddCommand(cmCommand* command); + void RemoveUnscriptableCommands(); + void RenameCommand(std::string const& oldName, std::string const& newName); + void RemoveUserDefinedCommands(); + std::vector GetCommandNames() const; + private: std::map PropertyDefinitions; std::vector EnabledLanguages; + std::map Commands; cmake* CMakeInstance; bool IsInTryCompile; }; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 6518207..89d5fea 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -179,7 +179,6 @@ cmake::~cmake() delete this->GlobalGenerator; this->GlobalGenerator = 0; } - cmDeleteAll(this->Commands); cmDeleteAll(this->Generators); #ifdef CMAKE_BUILD_WITH_CMAKE delete this->VariableWatch; @@ -197,94 +196,33 @@ void cmake::InitializeProperties() void cmake::CleanupCommandsAndMacros() { this->InitializeProperties(); - for(RegisteredCommandsMap::iterator j = this->Commands.begin(); - j != this->Commands.end(); ) - { - if (j->second->IsA("cmMacroHelperCommand") || - j->second->IsA("cmFunctionHelperCommand")) - { - delete j->second; - this->Commands.erase(j++); - } - else - { - ++j; - } - } + this->State->RemoveUserDefinedCommands(); } bool cmake::CommandExists(const std::string& name) const { - return this->GetCommand(name) ? true : false; + return this->State->GetCommand(name) ? true : false; } cmCommand *cmake::GetCommand(const std::string& name) const { - cmCommand* command = 0; - std::string sName = cmSystemTools::LowerCase(name); - RegisteredCommandsMap::const_iterator pos = this->Commands.find(sName); - if (pos != this->Commands.end()) - { - command = (*pos).second; - } - return command; + return this->State->GetCommand(name); } void cmake::RenameCommand(const std::string& oldName, const std::string& newName) { - // if the command already exists, free the old one - std::string sOldName = cmSystemTools::LowerCase(oldName); - RegisteredCommandsMap::iterator pos = this->Commands.find(sOldName); - if ( pos == this->Commands.end() ) - { - return; - } - std::string sNewName = cmSystemTools::LowerCase(newName); - cmCommand* cmd = pos->second; - - pos = this->Commands.find(sNewName); - if (pos != this->Commands.end()) - { - delete pos->second; - this->Commands.erase(pos); - } - this->Commands.insert(std::make_pair(sNewName, cmd)); - pos = this->Commands.find(sOldName); - this->Commands.erase(pos); + this->State->RenameCommand(oldName, newName); } void cmake::AddCommand(cmCommand* command) { - std::string name = cmSystemTools::LowerCase(command->GetName()); - // if the command already exists, free the old one - RegisteredCommandsMap::iterator pos = this->Commands.find(name); - if (pos != this->Commands.end()) - { - delete pos->second; - this->Commands.erase(pos); - } - this->Commands.insert(std::make_pair(name, command)); + this->State->AddCommand(command); } - void cmake::RemoveUnscriptableCommands() { - std::vector unscriptableCommands; - for (cmake::RegisteredCommandsMap::iterator - pos = this->Commands.begin(); - pos != this->Commands.end(); ) - { - if (!pos->second->IsScriptable()) - { - delete pos->second; - this->Commands.erase(pos++); - } - else - { - ++pos; - } - } + this->State->RemoveUnscriptableCommands(); } // Parse the args @@ -2301,18 +2239,8 @@ const char *cmake::GetProperty(const std::string& prop, } else if ( prop == "COMMANDS" ) { - cmake::RegisteredCommandsMap::iterator cmds - = this->Commands.begin(); - for (unsigned int cc=0 ; cmds != this->Commands.end(); ++ cmds ) - { - if ( cc > 0 ) - { - output += ";"; - } - output += cmds->first.c_str(); - cc++; - } - this->SetProperty("COMMANDS",output.c_str()); + std::vector commands = this->State->GetCommandNames(); + this->SetProperty("COMMANDS", cmJoin(commands, ";").c_str()); } else if ( prop == "IN_TRY_COMPILE" ) { diff --git a/Source/cmake.h b/Source/cmake.h index 455b54e..e7a8acb 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -93,7 +93,6 @@ class cmake */ FIND_PACKAGE_MODE }; - typedef std::map RegisteredCommandsMap; typedef std::map InstalledFilesMap; /// Default constructor @@ -362,7 +361,6 @@ protected: typedef std::map RegisteredExtraGeneratorsMap; typedef std::vector RegisteredGeneratorsVector; - RegisteredCommandsMap Commands; RegisteredGeneratorsVector Generators; RegisteredExtraGeneratorsMap ExtraGenerators; void AddDefaultCommands(); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97e53ebb3cd728e6091f93cb7d4eac91ae417bdb commit 97e53ebb3cd728e6091f93cb7d4eac91ae417bdb Author: Stephen Kelly AuthorDate: Sun Apr 12 10:48:17 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 21:11:23 2015 +0200 cmake: Simplify command clean up loop. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index b852e00..6518207 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -197,27 +197,20 @@ void cmake::InitializeProperties() void cmake::CleanupCommandsAndMacros() { this->InitializeProperties(); - std::vector commands; for(RegisteredCommandsMap::iterator j = this->Commands.begin(); - j != this->Commands.end(); ++j) + j != this->Commands.end(); ) { - if ( !j->second->IsA("cmMacroHelperCommand") && - !j->second->IsA("cmFunctionHelperCommand")) + if (j->second->IsA("cmMacroHelperCommand") || + j->second->IsA("cmFunctionHelperCommand")) { - commands.push_back(j->second); + delete j->second; + this->Commands.erase(j++); } else { - delete j->second; + ++j; } } - this->Commands.clear(); - std::vector::iterator it; - for ( it = commands.begin(); it != commands.end(); - ++ it ) - { - this->Commands[cmSystemTools::LowerCase((*it)->GetName())] = *it; - } } bool cmake::CommandExists(const std::string& name) const http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e738bcf9c7952bc9ae9bfb1be831c9f16998f54 commit 1e738bcf9c7952bc9ae9bfb1be831c9f16998f54 Author: Stephen Kelly AuthorDate: Mon Apr 13 20:48:48 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 21:10:19 2015 +0200 cmake: Simplify RemoveUnscriptableCommands algorithm. Remove obsolete RemoveCommand method. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 0dcf9be..b852e00 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -261,17 +261,6 @@ void cmake::RenameCommand(const std::string& oldName, this->Commands.erase(pos); } -void cmake::RemoveCommand(const std::string& name) -{ - std::string sName = cmSystemTools::LowerCase(name); - RegisteredCommandsMap::iterator pos = this->Commands.find(sName); - if ( pos != this->Commands.end() ) - { - delete pos->second; - this->Commands.erase(pos); - } -} - void cmake::AddCommand(cmCommand* command) { std::string name = cmSystemTools::LowerCase(command->GetName()); @@ -289,22 +278,19 @@ void cmake::AddCommand(cmCommand* command) void cmake::RemoveUnscriptableCommands() { std::vector unscriptableCommands; - for (cmake::RegisteredCommandsMap::const_iterator + for (cmake::RegisteredCommandsMap::iterator pos = this->Commands.begin(); - pos != this->Commands.end(); - ++pos) + pos != this->Commands.end(); ) { if (!pos->second->IsScriptable()) { - unscriptableCommands.push_back(pos->first); + delete pos->second; + this->Commands.erase(pos++); + } + else + { + ++pos; } - } - - for(std::vector::const_iterator it=unscriptableCommands.begin(); - it != unscriptableCommands.end(); - ++it) - { - this->RemoveCommand(*it); } } diff --git a/Source/cmake.h b/Source/cmake.h index 38c05c9..455b54e 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -222,7 +222,6 @@ class cmake */ void AddCommand(cmCommand* ); void RenameCommand(const std::string& oldName, const std::string& newName); - void RemoveCommand(const std::string& name); void RemoveUnscriptableCommands(); /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=62854e9966a3fe308cff4a76c89f6bf72f76551c commit 62854e9966a3fe308cff4a76c89f6bf72f76551c Author: Stephen Kelly AuthorDate: Sat Apr 11 12:16:54 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 20:27:36 2015 +0200 cmState: Move try_compile state from cmake class. diff --git a/Source/cmState.cxx b/Source/cmState.cxx index c43262f..be6a766 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -15,7 +15,8 @@ #include "cmCacheManager.h" cmState::cmState(cmake* cm) - : CMakeInstance(cm) + : CMakeInstance(cm), + IsInTryCompile(false) { } @@ -263,3 +264,13 @@ void cmState::ClearEnabledLanguages() { this->EnabledLanguages.clear(); } + +bool cmState::GetIsInTryCompile() const +{ + return this->IsInTryCompile; +} + +void cmState::SetIsInTryCompile(bool b) +{ + this->IsInTryCompile = b; +} diff --git a/Source/cmState.h b/Source/cmState.h index b1f1430..6df6182 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -76,10 +76,14 @@ public: std::vector GetEnabledLanguages() const; void ClearEnabledLanguages(); + bool GetIsInTryCompile() const; + void SetIsInTryCompile(bool b); + private: std::map PropertyDefinitions; std::vector EnabledLanguages; cmake* CMakeInstance; + bool IsInTryCompile; }; #endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 94b0ae0..0dcf9be 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -151,7 +151,6 @@ cmake::cmake() #endif this->Verbose = false; - this->InTryCompile = false; this->CacheManager = new cmCacheManager(this); this->GlobalGenerator = 0; this->ProgressCallback = 0; @@ -1272,7 +1271,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) cmSystemTools::ExpandListArgument(std::string(var), argsSplit, true); // erase the property to avoid infinite recursion this->SetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", ""); - if(this->GetIsInTryCompile()) + if(this->State->GetIsInTryCompile()) { return 0; } @@ -1555,7 +1554,7 @@ int cmake::ActualConfigure() // reset any system configuration information, except for when we are // InTryCompile. With TryCompile the system info is taken from the parent's // info to save time - if (!this->InTryCompile) + if (!this->State->GetIsInTryCompile()) { this->GlobalGenerator->ClearEnabledLanguages(); @@ -1958,7 +1957,7 @@ void cmake::SetProgressCallback(ProgressCallbackType f, void *cd) void cmake::UpdateProgress(const char *msg, float prog) { - if(this->ProgressCallback && !this->InTryCompile) + if(this->ProgressCallback && !this->State->GetIsInTryCompile()) { (*this->ProgressCallback)(msg, prog, this->ProgressCallbackClientData); return; @@ -1967,12 +1966,12 @@ void cmake::UpdateProgress(const char *msg, float prog) bool cmake::GetIsInTryCompile() const { - return this->InTryCompile; + return this->State->GetIsInTryCompile(); } void cmake::SetIsInTryCompile(bool b) { - this->InTryCompile = b; + this->State->SetIsInTryCompile(b); } void cmake::GetGeneratorDocumentation(std::vector& v) @@ -2339,7 +2338,7 @@ const char *cmake::GetProperty(const std::string& prop, else if ( prop == "IN_TRY_COMPILE" ) { this->SetProperty("IN_TRY_COMPILE", - this->GetIsInTryCompile()? "1":"0"); + this->State->GetIsInTryCompile() ? "1" : "0"); } else if ( prop == "ENABLED_LANGUAGES" ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db8425be18439c899c08294dde117cc137c75d23 commit db8425be18439c899c08294dde117cc137c75d23 Author: Stephen Kelly AuthorDate: Sat Apr 11 14:16:44 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 20:27:36 2015 +0200 cmake: Get enabled languages from cmState. The check for a global generator is redundant - the enabled languages are only populated by the global generator. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 6adecee..94b0ae0 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2343,14 +2343,9 @@ const char *cmake::GetProperty(const std::string& prop, } else if ( prop == "ENABLED_LANGUAGES" ) { - std::string lang; - if(this->GlobalGenerator) - { - std::vector enLangs; - this->GlobalGenerator->GetEnabledLanguages(enLangs); - lang = cmJoin(enLangs, ";"); - } - this->SetProperty("ENABLED_LANGUAGES", lang.c_str()); + std::string langs; + langs = cmJoin(this->State->GetEnabledLanguages(), ";"); + this->SetProperty("ENABLED_LANGUAGES", langs.c_str()); } #define STRING_LIST_ELEMENT(F) ";" #F if (prop == "CMAKE_C_KNOWN_FEATURES") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74de9a734c92288fb3e602be0d1c967b33b67443 commit 74de9a734c92288fb3e602be0d1c967b33b67443 Author: Stephen Kelly AuthorDate: Sat Apr 11 14:16:39 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 20:19:58 2015 +0200 cmGlobalGenerator: Delegate storage of enabled languages to cmState. diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 171d62a..56a0a45 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -969,13 +969,7 @@ void cmGlobalGenerator::SetLanguageEnabled(const std::string& l, void cmGlobalGenerator::SetLanguageEnabledFlag(const std::string& l, cmMakefile* mf) { - std::vector::iterator it = - std::lower_bound(this->LanguageEnabled.begin(), - this->LanguageEnabled.end(), l); - if (it == this->LanguageEnabled.end() || *it != l) - { - this->LanguageEnabled.insert(it, l); - } + this->CMakeInstance->GetState()->SetLanguageEnabled(l); // Fill the language-to-extension map with the current variable // settings to make sure it is available for the try_compile() @@ -1086,13 +1080,12 @@ bool cmGlobalGenerator::IgnoreFile(const char* ext) const bool cmGlobalGenerator::GetLanguageEnabled(const std::string& l) const { - return std::binary_search(this->LanguageEnabled.begin(), - this->LanguageEnabled.end(), l); + return this->CMakeInstance->GetState()->GetLanguageEnabled(l); } void cmGlobalGenerator::ClearEnabledLanguages() { - this->LanguageEnabled.clear(); + return this->CMakeInstance->GetState()->ClearEnabledLanguages(); } void cmGlobalGenerator::Configure() @@ -1966,7 +1959,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, void cmGlobalGenerator::GetEnabledLanguages(std::vector& lang) const { - lang = this->LanguageEnabled; + lang = this->CMakeInstance->GetState()->GetEnabledLanguages(); } int cmGlobalGenerator::GetLinkerPreference(const std::string& lang) const diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 3e88ecc..c43262f 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -236,3 +236,30 @@ bool cmState::IsPropertyChained(const std::string& name, { return this->PropertyDefinitions[scope].IsPropertyChained(name); } + +void cmState::SetLanguageEnabled(std::string const& l) +{ + std::vector::iterator it = + std::lower_bound(this->EnabledLanguages.begin(), + this->EnabledLanguages.end(), l); + if (it == this->EnabledLanguages.end() || *it != l) + { + this->EnabledLanguages.insert(it, l); + } +} + +bool cmState::GetLanguageEnabled(std::string const& l) const +{ + return std::binary_search(this->EnabledLanguages.begin(), + this->EnabledLanguages.end(), l); +} + +std::vector cmState::GetEnabledLanguages() const +{ + return this->EnabledLanguages; +} + +void cmState::ClearEnabledLanguages() +{ + this->EnabledLanguages.clear(); +} diff --git a/Source/cmState.h b/Source/cmState.h index 310707d..b1f1430 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -71,10 +71,14 @@ public: bool IsPropertyDefined(const std::string& name, cmProperty::ScopeType scope); bool IsPropertyChained(const std::string& name, cmProperty::ScopeType scope); + void SetLanguageEnabled(std::string const& l); + bool GetLanguageEnabled(std::string const& l) const; + std::vector GetEnabledLanguages() const; + void ClearEnabledLanguages(); private: std::map PropertyDefinitions; - + std::vector EnabledLanguages; cmake* CMakeInstance; }; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b159bff732d4e34a683edd1740604428049d1819 commit b159bff732d4e34a683edd1740604428049d1819 Author: Stephen Kelly AuthorDate: Sat Apr 4 23:33:26 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 20:13:13 2015 +0200 Move property definition to cmState. diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 5ae7d4c..6134c6f 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -867,7 +867,7 @@ void CCONV DefineSourceFileProperty (void *arg, const char *name, int chained) { cmMakefile *mf = static_cast(arg); - mf->GetCMakeInstance()->DefineProperty(name,cmProperty::SOURCE_FILE, + mf->GetState()->DefineProperty(name,cmProperty::SOURCE_FILE, briefDocs, longDocs, chained != 0); } diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx index 5ff0186..0efc7fc 100644 --- a/Source/cmDefinePropertyCommand.cxx +++ b/Source/cmDefinePropertyCommand.cxx @@ -11,6 +11,7 @@ ============================================================================*/ #include "cmDefinePropertyCommand.h" #include "cmake.h" +#include "cmState.h" bool cmDefinePropertyCommand ::InitialPass(std::vector const& args, cmExecutionStatus &) @@ -127,7 +128,7 @@ bool cmDefinePropertyCommand } // Actually define the property. - this->Makefile->GetCMakeInstance()->DefineProperty + this->Makefile->GetState()->DefineProperty (this->PropertyName, scope, this->BriefDocs.c_str(), this->FullDocs.c_str(), inherited); diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 80edbcd..a8481ad 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -143,7 +143,7 @@ bool cmGetPropertyCommand // Lookup brief documentation. std::string output; if(cmPropertyDefinition* def = - this->Makefile->GetCMakeInstance()-> + this->Makefile->GetState()-> GetPropertyDefinition(this->PropertyName, scope)) { output = def->GetShortDescription(); @@ -159,7 +159,7 @@ bool cmGetPropertyCommand // Lookup full documentation. std::string output; if(cmPropertyDefinition* def = - this->Makefile->GetCMakeInstance()-> + this->Makefile->GetState()-> GetPropertyDefinition(this->PropertyName, scope)) { output = def->GetFullDescription(); @@ -173,7 +173,7 @@ bool cmGetPropertyCommand else if(this->InfoType == OutDefined) { // Lookup if the property is defined - if(this->Makefile->GetCMakeInstance()-> + if(this->Makefile->GetState()-> GetPropertyDefinition(this->PropertyName, scope)) { this->Makefile->AddDefinition(this->Variable, "1"); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ad3cce4..b1e67f4 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4476,21 +4476,6 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef) } } - -// define properties -void cmMakefile::DefineProperties(cmake *cm) -{ - cm->DefineProperty - ("RULE_LAUNCH_COMPILE", cmProperty::DIRECTORY, - "", "", true); - cm->DefineProperty - ("RULE_LAUNCH_LINK", cmProperty::DIRECTORY, - "", "", true); - cm->DefineProperty - ("RULE_LAUNCH_CUSTOM", cmProperty::DIRECTORY, - "", "", true); -} - //---------------------------------------------------------------------------- cmTarget* cmMakefile::AddImportedTarget(const std::string& name, diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 57a4180..43c1b1a 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -851,9 +851,6 @@ public: const std::vector& GetTestGenerators() const { return this->TestGenerators; } - // Define the properties - static void DefineProperties(cmake *cm); - // push and pop variable scopes void PushScope(); void PopScope(); diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index e335b3b..070f6f1 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -12,6 +12,7 @@ #include "cmPropertyMap.h" #include "cmSystemTools.h" #include "cmake.h" +#include "cmState.h" cmProperty *cmPropertyMap::GetOrCreateProperty(const std::string& name) { @@ -73,7 +74,8 @@ const char *cmPropertyMap // should we chain up? if (this->CMakeInstance) { - chain = this->CMakeInstance->IsPropertyChained(name,scope); + chain = this->CMakeInstance->GetState()-> + IsPropertyChained(name,scope); } return 0; } diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 7602f63..3e88ecc 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -178,3 +178,61 @@ void cmState::RemoveCacheEntryProperty(std::string const& key, this->CMakeInstance->GetCacheManager() ->GetCacheIterator(key.c_str()).SetProperty(propertyName, (void*)0); } + +void cmState::Initialize() +{ + this->PropertyDefinitions.clear(); + this->DefineProperty + ("RULE_LAUNCH_COMPILE", cmProperty::DIRECTORY, + "", "", true); + this->DefineProperty + ("RULE_LAUNCH_LINK", cmProperty::DIRECTORY, + "", "", true); + this->DefineProperty + ("RULE_LAUNCH_CUSTOM", cmProperty::DIRECTORY, + "", "", true); + + this->DefineProperty + ("RULE_LAUNCH_COMPILE", cmProperty::TARGET, + "", "", true); + this->DefineProperty + ("RULE_LAUNCH_LINK", cmProperty::TARGET, + "", "", true); + this->DefineProperty + ("RULE_LAUNCH_CUSTOM", cmProperty::TARGET, + "", "", true); +} + +void cmState::DefineProperty(const std::string& name, + cmProperty::ScopeType scope, + const char *ShortDescription, + const char *FullDescription, + bool chained) +{ + this->PropertyDefinitions[scope].DefineProperty(name,scope,ShortDescription, + FullDescription, + chained); +} + +cmPropertyDefinition *cmState +::GetPropertyDefinition(const std::string& name, + cmProperty::ScopeType scope) +{ + if (this->IsPropertyDefined(name,scope)) + { + return &(this->PropertyDefinitions[scope][name]); + } + return 0; +} + +bool cmState::IsPropertyDefined(const std::string& name, + cmProperty::ScopeType scope) +{ + return this->PropertyDefinitions[scope].IsPropertyDefined(name); +} + +bool cmState::IsPropertyChained(const std::string& name, + cmProperty::ScopeType scope) +{ + return this->PropertyDefinitions[scope].IsPropertyChained(name); +} diff --git a/Source/cmState.h b/Source/cmState.h index f2e8ef5..310707d 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -13,6 +13,7 @@ #define cmState_h #include "cmStandardIncludes.h" +#include "cmPropertyDefinitionMap.h" class cmake; @@ -55,7 +56,25 @@ public: void RemoveCacheEntryProperty(std::string const& key, std::string const& propertyName); + void Initialize(); + // Define a property + void DefineProperty(const std::string& name, cmProperty::ScopeType scope, + const char *ShortDescription, + const char *FullDescription, + bool chain = false); + + // get property definition + cmPropertyDefinition *GetPropertyDefinition + (const std::string& name, cmProperty::ScopeType scope); + + // Is a property defined? + bool IsPropertyDefined(const std::string& name, cmProperty::ScopeType scope); + bool IsPropertyChained(const std::string& name, cmProperty::ScopeType scope); + + private: + std::map PropertyDefinitions; + cmake* CMakeInstance; }; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 6711e86..f1540d4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -264,20 +264,6 @@ cmTarget::cmTarget() this->LinkImplementationLanguageIsContextDependent = true; } -//---------------------------------------------------------------------------- -void cmTarget::DefineProperties(cmake *cm) -{ - cm->DefineProperty - ("RULE_LAUNCH_COMPILE", cmProperty::TARGET, - "", "", true); - cm->DefineProperty - ("RULE_LAUNCH_LINK", cmProperty::TARGET, - "", "", true); - cm->DefineProperty - ("RULE_LAUNCH_CUSTOM", cmProperty::TARGET, - "", "", true); -} - void cmTarget::SetType(TargetType type, const std::string& name) { this->Name = name; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 55bf234..a032414 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -489,9 +489,6 @@ public: const char** imp, std::string& suffix) const; - // Define the properties - static void DefineProperties(cmake *cm); - /** Get the macro to define when building sources in this target. If no macro should be defined null is returned. */ const char* GetExportMacro() const; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 8cdf96f..6adecee 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -191,11 +191,8 @@ cmake::~cmake() void cmake::InitializeProperties() { this->Properties.clear(); - this->PropertyDefinitions.clear(); - // initialize properties - cmTarget::DefineProperties(this); - cmMakefile::DefineProperties(this); + this->State->Initialize(); } void cmake::CleanupCommandsAndMacros() @@ -2298,40 +2295,6 @@ void cmake::GenerateGraphViz(const char* fileName) const #endif } -void cmake::DefineProperty(const std::string& name, - cmProperty::ScopeType scope, - const char *ShortDescription, - const char *FullDescription, - bool chained) -{ - this->PropertyDefinitions[scope].DefineProperty(name,scope,ShortDescription, - FullDescription, - chained); -} - -cmPropertyDefinition *cmake -::GetPropertyDefinition(const std::string& name, - cmProperty::ScopeType scope) -{ - if (this->IsPropertyDefined(name,scope)) - { - return &(this->PropertyDefinitions[scope][name]); - } - return 0; -} - -bool cmake::IsPropertyDefined(const std::string& name, - cmProperty::ScopeType scope) -{ - return this->PropertyDefinitions[scope].IsPropertyDefined(name); -} - -bool cmake::IsPropertyChained(const std::string& name, - cmProperty::ScopeType scope) -{ - return this->PropertyDefinitions[scope].IsPropertyChained(name); -} - void cmake::SetProperty(const std::string& prop, const char* value) { this->Properties.SetProperty(prop, value, cmProperty::GLOBAL); diff --git a/Source/cmake.h b/Source/cmake.h index e80cc1c..38c05c9 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -15,7 +15,6 @@ #include "cmListFileCache.h" #include "cmSystemTools.h" -#include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" #include "cmInstalledFile.h" #include "cmCacheManager.h" @@ -323,20 +322,6 @@ class cmake void MarkCliAsUsed(const std::string& variable); - // Define a property - void DefineProperty(const std::string& name, cmProperty::ScopeType scope, - const char *ShortDescription, - const char *FullDescription, - bool chain = false); - - // get property definition - cmPropertyDefinition *GetPropertyDefinition - (const std::string& name, cmProperty::ScopeType scope); - - // Is a property defined? - bool IsPropertyDefined(const std::string& name, cmProperty::ScopeType scope); - bool IsPropertyChained(const std::string& name, cmProperty::ScopeType scope); - /** Get the list of configurations (in upper case) considered to be debugging configurations.*/ std::vector GetDebugConfigs(); @@ -373,9 +358,6 @@ protected: int HandleDeleteCacheVariables(const std::string& var); cmPropertyMap Properties; - std::map - PropertyDefinitions; - typedef cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)(); typedef std::map This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a4f0f6ca892491e787e3259d5eba632196e2a4d6 (commit) via 7172add972038e6a9076cc1c752cacce9c00f256 (commit) from c009d6847b4f82db1d85cdd88b67f664b83ed791 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a4f0f6ca892491e787e3259d5eba632196e2a4d6 commit a4f0f6ca892491e787e3259d5eba632196e2a4d6 Merge: c009d68 7172add Author: Stephen Kelly AuthorDate: Mon Apr 13 17:14:24 2015 -0400 Commit: CMake Topic Stage CommitDate: Mon Apr 13 17:14:24 2015 -0400 Merge topic 'port-global-properties-to-cmState' into next 7172add9 fixup! Port cmCommand consumers to cmState. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7172add972038e6a9076cc1c752cacce9c00f256 commit 7172add972038e6a9076cc1c752cacce9c00f256 Author: Stephen Kelly AuthorDate: Mon Apr 13 23:08:24 2015 +0200 Commit: Stephen Kelly CommitDate: Mon Apr 13 23:08:24 2015 +0200 fixup! Port cmCommand consumers to cmState. diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 6b8cfa0..0a71c60 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -481,8 +481,10 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList &newArgs, // does a command exist if (this->IsKeyword("COMMAND", *arg) && argP1 != newArgs.end()) { + cmCommand* command = + this->Makefile.GetState()->GetCommand(argP1->c_str()); this->HandlePredicate( - this->Makefile.GetState()->GetCommand(argP1->c_str()), + command ? true : false, reducible, arg, newArgs, argP1, argP2); } // does a policy exist ----------------------------------------------------------------------- Summary of changes: Source/cmConditionEvaluator.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Apr 14 00:01:08 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 14 Apr 2015 00:01:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.1-775-gcdc53b6 Message-ID: <20150414040108.752E3AF4F1@public.kitware.com> This is an automated email from 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 cdc53b62c20605467334ecb80c474533e04ff26c (commit) from f1db1de61e913e4e8841e4d28fb33461d679c516 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cdc53b62c20605467334ecb80c474533e04ff26c commit cdc53b62c20605467334ecb80c474533e04ff26c Author: Kitware Robot AuthorDate: Tue Apr 14 00:01:06 2015 -0400 Commit: Kitware Robot CommitDate: Tue Apr 14 00:01:06 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f91acbe..84e2e49 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150413) +set(CMake_VERSION_PATCH 20150414) #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 Apr 14 11:44:04 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 14 Apr 2015 11:44:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1839-g53d490d Message-ID: <20150414154404.425C7AE56F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 53d490d597a79d61de14db75b10b589c72eaef11 (commit) via baef72f2b369b77507969e3362edfc8d7171c43a (commit) via cdc53b62c20605467334ecb80c474533e04ff26c (commit) from a4f0f6ca892491e787e3259d5eba632196e2a4d6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53d490d597a79d61de14db75b10b589c72eaef11 commit 53d490d597a79d61de14db75b10b589c72eaef11 Merge: a4f0f6c baef72f Author: Brad King AuthorDate: Tue Apr 14 11:44:03 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 14 11:44:03 2015 -0400 Merge topic 'test-xl-preprocess-updates' into next baef72f2 Tests: Update Preprocess test for XL compiler limitations cdc53b62 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=baef72f2b369b77507969e3362edfc8d7171c43a commit baef72f2b369b77507969e3362edfc8d7171c43a Author: Brad King AuthorDate: Tue Apr 14 11:03:48 2015 -0400 Commit: Brad King CommitDate: Tue Apr 14 11:03:48 2015 -0400 Tests: Update Preprocess test for XL compiler limitations diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 8ff0cfd..15e2aca 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -134,6 +134,15 @@ if((NOT MSVC OR PP_NMAKE) AND set(EXPR_OP1 "%") endif() +# XL: )( +# The XL compiler cannot pass unbalanced parens correctly to a tool +# it launches internally. +if(CMAKE_C_COMPILER_ID STREQUAL "XL") + set(STRING_EXTRA "${STRING_EXTRA}()") +else() + set(STRING_EXTRA "${STRING_EXTRA})(") +endif() + # General: \" # Make tools do not reliably accept \\\" syntax: # - MinGW and MSYS make tools crash with \\\" @@ -141,7 +150,10 @@ endif() # or $(BACKSLASH)\" where BACKSLASH is a variable set to \\ # - VS IDE gets confused about the bounds of the definition value \\\" # - NMake is okay with just \\\" -if(PP_NMAKE OR PP_UMAKE) +# - The XL compiler does not re-escape \\\" when launching an +# internal tool to do preprocessing . +if((PP_NMAKE OR PP_UMAKE) AND + NOT CMAKE_C_COMPILER_ID STREQUAL "XL") set(STRING_EXTRA "${STRING_EXTRA}\\\"") endif() @@ -160,7 +172,7 @@ endif() # support it and it is not an operator it is not worthwhile. # Compose the final test string. -set(STRING_VALUE "hello`~!@$*)(_+-=}{][:'.?/${STRING_EXTRA}world") +set(STRING_VALUE "hello`~!@$*_+-=}{][:'.?/${STRING_EXTRA}world") #----------------------------------------------------------------------------- # Function-style macro command-line support: ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- Tests/Preprocess/CMakeLists.txt | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Apr 14 13:16:24 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 14 Apr 2015 13:16:24 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.1-1841-g8f354a9 Message-ID: <20150414171624.090EDAEEE9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8f354a97a5e7745870b8e3b540999d47b994f239 (commit) via 9ac05683902c7412476c4514588bff5c016d6ce1 (commit) from 53d490d597a79d61de14db75b10b589c72eaef11 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f354a97a5e7745870b8e3b540999d47b994f239 commit 8f354a97a5e7745870b8e3b540999d47b994f239 Merge: 53d490d 9ac0568 Author: Brad King AuthorDate: Tue Apr 14 13:16:23 2015 -0400 Commit: CMake Topic Stage CommitDate: Tue Apr 14 13:16:23 2015 -0400 Merge topic 'doc-ninja-non-experimental' into next 9ac05683 Ninja: Drop 'experimental' label in documentation http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ac05683902c7412476c4514588bff5c016d6ce1 commit 9ac05683902c7412476c4514588bff5c016d6ce1 Author: Brad King AuthorDate: Tue Apr 14 13:14:50 2015 -0400 Commit: Brad King CommitDate: Tue Apr 14 13:14:50 2015 -0400 Ninja: Drop 'experimental' label in documentation This generator is no longer experimental and has been fairly mature for several releases already. diff --git a/Help/generator/Ninja.rst b/Help/generator/Ninja.rst index 08f74fb..920abcb 100644 --- a/Help/generator/Ninja.rst +++ b/Help/generator/Ninja.rst @@ -1,7 +1,7 @@ Ninja ----- -Generates build.ninja files (experimental). +Generates build.ninja files. A build.ninja file is generated into the build tree. Recent versions of the ninja program can build the project through the "all" target. diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index f74f1e0..9a00fa6 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -507,7 +507,7 @@ void cmGlobalNinjaGenerator ::GetDocumentation(cmDocumentationEntry& entry) { entry.Name = cmGlobalNinjaGenerator::GetActualName(); - entry.Brief = "Generates build.ninja files (experimental)."; + entry.Brief = "Generates build.ninja files."; } // Implemented in all cmGlobaleGenerator sub-classes. ----------------------------------------------------------------------- Summary of changes: Help/generator/Ninja.rst | 2 +- Source/cmGlobalNinjaGenerator.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From robert.maynard at kitware.com Tue Apr 14 13:45:42 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Tue, 14 Apr 2015 13:45:42 -0400 (EDT) Subject: [Cmake-commits] CMake annotated tag, v3.2.2, created. v3.2.2 Message-ID: <20150414174542.559AEAE89A@public.kitware.com> This is an automated email 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.2.2 has been created at 0f45dba42da3b06db86d73e5e5ecf7030ade3f8b (tag) tagging 91d5261b58e97107fca610a868fbc283cbb8c856 (commit) replaces v3.2.1 tagged by Brad King on Mon Apr 13 14:27:58 2015 -0400 - Log ----------------------------------------------------------------- CMake 3.2.2 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJVLAquAAoJEOyP7zp7+07apUcP/2vIWVSNQ9mXzg6o9tvMBlzM PoMv9qes6hDAYLRRpiPZRqtJLSEpNLueTG4RYVXn+rO9jivyDSjqYC8SfpXlDr2l G37BTyFxwQlvU3hCssgBd9Ez+lW8VXvt8vSMtIyTTDXnCCJUaq6uEnYLOUnb7QwL uRekfehx6Jpaoz7AgVmFOlsRKISFu0l7VQVMNk8dYQbi12xVMzYbEiSQkNNJ9kiY pjQ+rkaSFTfhe58b5O5wrZ0YzYDC0SjjAXrTlC6y/BmRRip++nfZQ3+jBKmjtqvO OuI+qkme6t6YHWS+8RIpTXuXWchEV83wpdwsoz+2r4Pxt7rldqP1g1sKpLpUElv0 Em5LXan5ajoFrXUopBcCbxoUrY5ABBIoJoldUJ0bFm2gJv95zyPTzo0SpRteX0WS K4t7lGNOe6AQl/4m4j/Y1PDdrhMlJ7Ts3qr9sGwP0/Yh9LQi93LfCiBcDOR063/Y bEtiAwM2R+YuIgErb1CfHetnRi8D/F0LATlWrJ2xPxg17FsFjdpnKEj3rjUlEFtu 72psfuj88knCi9kNbSO/Cb14lCGEQU9hdHF4tzuvGukXb7zb6GlILQ+rteCX3HW3 v51ONXGMpqagr1qxvXSPPvDl2TaoLNZ4anCG/7ppkDDmTmVImBG2px8kW2nUUWsP DkrVEEGhT2mVq8d7BsHZ =ZIOK -----END PGP SIGNATURE----- Betsy McPhail (1): file(LOCK): Close file descriptor/handle when releasing a lock Brad King (15): FindMFC: Use if(DEFINED) to simplify condition (#15477) Merge branch 'file-LOCK-close' into release Merge branch 'FindMFC-CMP0054' into release curl: Never consider using Windows APIs on Cygwin Merge branch 'curl-cygwin-no-windows' into release liblzma: Use unaligned access only on Intel and PowerPC archs Merge branch 'fix-liblzma-access-alignment' into release liblzma: Disable XL compiler optimizations liblzma: Disable GNU 3.3 compiler optimizations Merge branch 'fix-liblzma-optimize' into release Merge branch 'fix-libarchive-mktemp' into release KWSys SystemTools: Teach Touch with !create to succeed on missing file Makefile: Fix multiple custom command outputs with one missing Merge branch 'custom-command-multiple-outputs' into release CMake 3.2.2 Tim Kientzle (1): libarchive: Fix string concatentation in Windows mktemp implementation ----------------------------------------------------------------------- hooks/post-receive -- CMake From kwrobot at kitware.com Wed Apr 15 00:01:09 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 15 Apr 2015 00:01:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-759-gff742f6 Message-ID: <20150415040109.8FDC7AEE31@public.kitware.com> This is an automated email from 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 ff742f6823acb14b7ec03ef6e87d717e5493ef12 (commit) from cdc53b62c20605467334ecb80c474533e04ff26c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff742f6823acb14b7ec03ef6e87d717e5493ef12 commit ff742f6823acb14b7ec03ef6e87d717e5493ef12 Author: Kitware Robot AuthorDate: Wed Apr 15 00:01:05 2015 -0400 Commit: Kitware Robot CommitDate: Wed Apr 15 00:01:05 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 84e2e49..649f230 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150414) +set(CMake_VERSION_PATCH 20150415) #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 Apr 15 09:12:28 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 09:12:28 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1826-gbdf9ea9 Message-ID: <20150415131228.F3AB3AE31F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via bdf9ea9180d2b1cb86d8a883120497cbc6104a2d (commit) via 85c2626babf40d704f133fe49506d25f0a674b5f (commit) from 8f354a97a5e7745870b8e3b540999d47b994f239 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bdf9ea9180d2b1cb86d8a883120497cbc6104a2d commit bdf9ea9180d2b1cb86d8a883120497cbc6104a2d Merge: 8f354a9 85c2626 Author: Brad King AuthorDate: Wed Apr 15 09:12:26 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 09:12:26 2015 -0400 Merge topic 'vs6-deprecate' into next 85c2626b Deprecate Visual Studio 6 generator http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85c2626babf40d704f133fe49506d25f0a674b5f commit 85c2626babf40d704f133fe49506d25f0a674b5f Author: Brad King AuthorDate: Tue Apr 14 15:48:34 2015 -0400 Commit: Brad King CommitDate: Wed Apr 15 09:08:57 2015 -0400 Deprecate Visual Studio 6 generator Update documentation to mark the generator deprecated. Add a warning at the end of generation plus an option to turn off the warning. diff --git a/Help/generator/Visual Studio 6.rst b/Help/generator/Visual Studio 6.rst index d619354..855589c 100644 --- a/Help/generator/Visual Studio 6.rst +++ b/Help/generator/Visual Studio 6.rst @@ -1,4 +1,10 @@ Visual Studio 6 --------------- -Generates Visual Studio 6 project files. +Deprected. Generates Visual Studio 6 project files. + +.. note:: + This generator is deprecated and will be removed + in a future version of CMake. It will still be + possible to build with VS 6 tools using the + :generator:`NMake Makefiles` generator. diff --git a/Help/release/dev/vs6-deprecate.rst b/Help/release/dev/vs6-deprecate.rst new file mode 100644 index 0000000..83f9afb --- /dev/null +++ b/Help/release/dev/vs6-deprecate.rst @@ -0,0 +1,5 @@ +vs6-deprecate +------------- + +* The :generator:`Visual Studio 6` generator is now deprecated + and will be removed in a future version of CMake. diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 62a308e..e2b2bbd 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -185,6 +185,22 @@ void cmGlobalVisualStudio6Generator::Generate() // Now write out the DSW this->OutputDSWFile(); + + if (!this->CMakeInstance->GetIsInTryCompile()) + { + const char* cmakeWarnVS6 = + this->CMakeInstance->GetState()->GetCacheEntryValue("CMAKE_WARN_VS6"); + if (!cmakeWarnVS6 || !cmSystemTools::IsOff(cmakeWarnVS6)) + { + this->CMakeInstance->IssueMessage( + cmake::WARNING, + "The \"Visual Studio 6\" generator is deprecated " + "and will be removed in a future version of CMake." + "\n" + "Add CMAKE_WARN_VS6=OFF to the cache to disable this warning." + ); + } + } } // Write a DSW file to the stream @@ -411,7 +427,7 @@ void cmGlobalVisualStudio6Generator ::GetDocumentation(cmDocumentationEntry& entry) { entry.Name = cmGlobalVisualStudio6Generator::GetActualName(); - entry.Brief = "Generates Visual Studio 6 project files."; + entry.Brief = "Deprecated. Generates Visual Studio 6 project files."; } //---------------------------------------------------------------------------- diff --git a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake b/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt new file mode 100644 index 0000000..1b6a510 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt @@ -0,0 +1,5 @@ +^CMake Warning: + The "Visual Studio 6" generator is deprecated and will be removed in a + future version of CMake. + + Add CMAKE_WARN_VS6=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake b/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index f047baf..4242723 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -40,6 +40,13 @@ if(RunCMake_GENERATOR STREQUAL "Ninja") unset(RunCMake_TEST_NO_CLEAN) endif() +if(RunCMake_GENERATOR STREQUAL "Visual Studio 6") + set(RunCMake_WARN_VS6 1) + run_cmake(DeprecateVS6-WARN-ON) + unset(RunCMake_WARN_VS6) + run_cmake(DeprecateVS6-WARN-OFF) +endif() + if(UNIX) run_cmake_command(E_create_symlink-no-arg ${CMAKE_COMMAND} -E create_symlink diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 6333703..e5d3590 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -51,6 +51,9 @@ function(run_cmake test) if(APPLE) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW) endif() + if(RunCMake_GENERATOR STREQUAL "Visual Studio 6" AND NOT RunCMake_WARN_VS6) + list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS6=OFF) + endif() if(RunCMake_MAKE_PROGRAM) list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}") endif() ----------------------------------------------------------------------- Summary of changes: Help/generator/Visual Studio 6.rst | 8 +++++++- Help/release/dev/vs6-deprecate.rst | 5 +++++ Source/cmGlobalVisualStudio6Generator.cxx | 18 +++++++++++++++++- .../RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake | 0 .../CommandLine/DeprecateVS6-WARN-ON-stderr.txt | 5 +++++ .../RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake | 0 Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 7 +++++++ Tests/RunCMake/RunCMake.cmake | 3 +++ 8 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/vs6-deprecate.rst copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake (100%) create mode 100644 Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake (100%) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 10:03:58 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 10:03:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1828-g4f72721 Message-ID: <20150415140358.07C60AF14D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4f727215847c810a56770c0cbdd3757663338e88 (commit) via 7b8e7c4ac3885b9a58ce1c238b045d5580f83c27 (commit) from bdf9ea9180d2b1cb86d8a883120497cbc6104a2d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f727215847c810a56770c0cbdd3757663338e88 commit 4f727215847c810a56770c0cbdd3757663338e88 Merge: bdf9ea9 7b8e7c4 Author: Brad King AuthorDate: Wed Apr 15 10:03:56 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 10:03:56 2015 -0400 Merge topic 'vs70-deprecate' into next 7b8e7c4a Deprecate Visual Studio 7 generator (.NET 2002) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b8e7c4ac3885b9a58ce1c238b045d5580f83c27 commit 7b8e7c4ac3885b9a58ce1c238b045d5580f83c27 Author: Brad King AuthorDate: Wed Apr 15 09:20:12 2015 -0400 Commit: Brad King CommitDate: Wed Apr 15 09:21:24 2015 -0400 Deprecate Visual Studio 7 generator (.NET 2002) Update documentation to mark the generator deprecated. Add a warning at the end of generation plus an option to turn off the warning. diff --git a/Help/generator/Visual Studio 7.rst b/Help/generator/Visual Studio 7.rst index d0eb719..eb426f4 100644 --- a/Help/generator/Visual Studio 7.rst +++ b/Help/generator/Visual Studio 7.rst @@ -1,4 +1,10 @@ Visual Studio 7 --------------- -Generates Visual Studio .NET 2002 project files. +Deprected. Generates Visual Studio .NET 2002 project files. + +.. note:: + This generator is deprecated and will be removed + in a future version of CMake. It will still be + possible to build with VS 7.0 tools using the + :generator:`NMake Makefiles` generator. diff --git a/Help/release/dev/vs70-deprecate.rst b/Help/release/dev/vs70-deprecate.rst new file mode 100644 index 0000000..fb94110 --- /dev/null +++ b/Help/release/dev/vs70-deprecate.rst @@ -0,0 +1,5 @@ +vs70-deprecate +-------------- + +* The :generator:`Visual Studio 7` generator (.NET 2002) is now + deprecated and will be removed in a future version of CMake. diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 6a3a145..0d7dfd7 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -351,6 +351,23 @@ void cmGlobalVisualStudio7Generator::Generate() { this->CallVisualStudioMacro(MacroReload); } + + if (!this->CMakeInstance->GetIsInTryCompile() && + this->GetName() == "Visual Studio 7") + { + const char* cmakeWarnVS70 = + this->CMakeInstance->GetState()->GetCacheEntryValue("CMAKE_WARN_VS70"); + if (!cmakeWarnVS70 || !cmSystemTools::IsOff(cmakeWarnVS70)) + { + this->CMakeInstance->IssueMessage( + cmake::WARNING, + "The \"Visual Studio 7\" generator is deprecated " + "and will be removed in a future version of CMake." + "\n" + "Add CMAKE_WARN_VS70=OFF to the cache to disable this warning." + ); + } + } } void cmGlobalVisualStudio7Generator @@ -983,7 +1000,7 @@ void cmGlobalVisualStudio7Generator ::GetDocumentation(cmDocumentationEntry& entry) { entry.Name = cmGlobalVisualStudio7Generator::GetActualName(); - entry.Brief = "Generates Visual Studio .NET 2002 project files."; + entry.Brief = "Deprecated. Generates Visual Studio .NET 2002 project files."; } //---------------------------------------------------------------------------- diff --git a/Tests/RunCMake/CommandLine/DeprecateVS70-WARN-OFF.cmake b/Tests/RunCMake/CommandLine/DeprecateVS70-WARN-OFF.cmake new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CommandLine/DeprecateVS70-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS70-WARN-ON-stderr.txt new file mode 100644 index 0000000..ea31ef3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/DeprecateVS70-WARN-ON-stderr.txt @@ -0,0 +1,5 @@ +^CMake Warning: + The "Visual Studio 7" generator is deprecated and will be removed in a + future version of CMake. + + Add CMAKE_WARN_VS70=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/DeprecateVS70-WARN-ON.cmake b/Tests/RunCMake/CommandLine/DeprecateVS70-WARN-ON.cmake new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 4242723..644e5ae 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -45,6 +45,11 @@ if(RunCMake_GENERATOR STREQUAL "Visual Studio 6") run_cmake(DeprecateVS6-WARN-ON) unset(RunCMake_WARN_VS6) run_cmake(DeprecateVS6-WARN-OFF) +elseif(RunCMake_GENERATOR STREQUAL "Visual Studio 7") + set(RunCMake_WARN_VS70 1) + run_cmake(DeprecateVS70-WARN-ON) + unset(RunCMake_WARN_VS70) + run_cmake(DeprecateVS70-WARN-OFF) endif() if(UNIX) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index e5d3590..b24ae0b 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -54,6 +54,9 @@ function(run_cmake test) if(RunCMake_GENERATOR STREQUAL "Visual Studio 6" AND NOT RunCMake_WARN_VS6) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS6=OFF) endif() + if(RunCMake_GENERATOR STREQUAL "Visual Studio 7" AND NOT RunCMake_WARN_VS70) + list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS70=OFF) + endif() if(RunCMake_MAKE_PROGRAM) list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}") endif() ----------------------------------------------------------------------- Summary of changes: Help/generator/Visual Studio 7.rst | 8 +++++++- Help/release/dev/vs70-deprecate.rst | 5 +++++ Source/cmGlobalVisualStudio7Generator.cxx | 19 ++++++++++++++++++- .../CommandLine/DeprecateVS70-WARN-OFF.cmake | 0 .../CommandLine/DeprecateVS70-WARN-ON-stderr.txt | 5 +++++ .../CommandLine/DeprecateVS70-WARN-ON.cmake | 0 Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 5 +++++ Tests/RunCMake/RunCMake.cmake | 3 +++ 8 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/vs70-deprecate.rst copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/DeprecateVS70-WARN-OFF.cmake (100%) create mode 100644 Tests/RunCMake/CommandLine/DeprecateVS70-WARN-ON-stderr.txt copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/DeprecateVS70-WARN-ON.cmake (100%) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 10:05:21 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 10:05:21 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1830-g251e719 Message-ID: <20150415140521.ED9B7AF1E6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 251e719cc10593dc4fd0fd1f4e9b3a6d59a55f86 (commit) via 885ab9ab37b1f4c094036814882886f5ec9efaf4 (commit) from 4f727215847c810a56770c0cbdd3757663338e88 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=251e719cc10593dc4fd0fd1f4e9b3a6d59a55f86 commit 251e719cc10593dc4fd0fd1f4e9b3a6d59a55f86 Merge: 4f72721 885ab9a Author: Brad King AuthorDate: Wed Apr 15 10:05:20 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 10:05:20 2015 -0400 Merge topic 'vs10-no-macros' into next 885ab9ab VS: Drop reload macros for VS >= 10 (#11258,#14680) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=885ab9ab37b1f4c094036814882886f5ec9efaf4 commit 885ab9ab37b1f4c094036814882886f5ec9efaf4 Author: Brad King AuthorDate: Wed Apr 15 09:30:14 2015 -0400 Commit: Brad King CommitDate: Wed Apr 15 09:58:42 2015 -0400 VS: Drop reload macros for VS >= 10 (#11258,#14680) We never implemented them for VS 11 (2012), 12 (2013), or 14 (2015). For VS 10 (2010) the reload macro does not work correctly when run from inside a build launched through the IDE because stopping the build kills the CMake that is driving the reload. Fortunately VS >= 10 know how to reload the whole solution anyway. diff --git a/Help/release/dev/vs10-no-macros.rst b/Help/release/dev/vs10-no-macros.rst new file mode 100644 index 0000000..89377dc --- /dev/null +++ b/Help/release/dev/vs10-no-macros.rst @@ -0,0 +1,9 @@ +vs10-no-macros +-------------- + +* The :generator:`Visual Studio 10 2010` generator no longer checks + for running VS IDEs with the project open or asks them to reload. + This was originally done for VS 10 because it had been done for + VS 7 through 9 to avoid prompting for every project in a solution. + Since VS >= 10 allow the whole solution to reload at once they + do not need CMake to help them. diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 1c6ac88..231b679 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -371,39 +371,6 @@ const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const } //---------------------------------------------------------------------------- -std::string cmGlobalVisualStudio10Generator::GetUserMacrosDirectory() -{ - std::string base; - std::string path; - - // base begins with the VisualStudioProjectsLocation reg value... - if (cmSystemTools::ReadRegistryValue( - "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\10.0;" - "VisualStudioProjectsLocation", - base)) - { - cmSystemTools::ConvertToUnixSlashes(base); - - // 9.0 macros folder: - path = base + "/VSMacros80"; - // *NOT* a typo; right now in Visual Studio 2008 beta the macros - // folder is VSMacros80... They may change it to 90 before final - // release of 2008 or they may not... we'll have to keep our eyes - // on it - } - - // path is (correctly) still empty if we did not read the base value from - // the Registry value - return path; -} - -//---------------------------------------------------------------------------- -std::string cmGlobalVisualStudio10Generator::GetUserMacrosRegKeyBase() -{ - return "Software\\Microsoft\\VisualStudio\\10.0\\vsmacros"; -} - -//---------------------------------------------------------------------------- void cmGlobalVisualStudio10Generator::FindMakeProgram(cmMakefile* mf) { this->cmGlobalVisualStudio8Generator::FindMakeProgram(mf); diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 92202ba..f0dd7d7 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -84,18 +84,6 @@ public: bool TargetsWindowsStore() const { return this->SystemIsWindowsStore; } - /** - * Where does this version of Visual Studio look for macros for the - * current user? Returns the empty string if this version of Visual - * Studio does not implement support for VB macros. - */ - virtual std::string GetUserMacrosDirectory(); - - /** - * What is the reg key path to "vsmacros" for this version of Visual - * Studio? - */ - virtual std::string GetUserMacrosRegKeyBase(); virtual const char* GetCMakeCFGIntDir() const { return "$(Configuration)";} bool Find64BitTools(cmMakefile* mf); @@ -156,5 +144,8 @@ private: virtual std::string FindMSBuildCommand(); virtual std::string FindDevEnvCommand(); virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); } + + // We do not use the reload macros for VS >= 10. + virtual std::string GetUserMacrosDirectory() { return ""; } }; #endif diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index c79dc97..6d434eb 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -31,8 +31,6 @@ public: ///! create the correct local generator virtual cmLocalGenerator *CreateLocalGenerator(); - /** TODO: VS 11 user macro support. */ - virtual std::string GetUserMacrosDirectory() { return ""; } protected: virtual bool InitializeWindowsPhone(cmMakefile* mf); virtual bool InitializeWindowsStore(cmMakefile* mf); diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h index a81516f..5e5b5f7 100644 --- a/Source/cmGlobalVisualStudio12Generator.h +++ b/Source/cmGlobalVisualStudio12Generator.h @@ -31,9 +31,6 @@ public: ///! create the correct local generator virtual cmLocalGenerator *CreateLocalGenerator(); - /** TODO: VS 12 user macro support. */ - virtual std::string GetUserMacrosDirectory() { return ""; } - //in Visual Studio 2013 they detached the MSBuild tools version //from the .Net Framework version and instead made it have it's own //version number diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h index 3fd60a0..ad1a460 100644 --- a/Source/cmGlobalVisualStudio14Generator.h +++ b/Source/cmGlobalVisualStudio14Generator.h @@ -31,9 +31,6 @@ public: ///! create the correct local generator virtual cmLocalGenerator *CreateLocalGenerator(); - /** TODO: VS 14 user macro support. */ - virtual std::string GetUserMacrosDirectory() { return ""; } - virtual const char* GetToolsVersion() { return "14.0"; } protected: virtual const char* GetIDEVersion() { return "14.0"; } diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 356f4d4..cb54132 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -51,8 +51,8 @@ public: * Call the ReloadProjects macro if necessary based on * GetFilesReplacedDuringGenerate results. */ - virtual void CallVisualStudioMacro(MacroName m, - const char* vsSolutionFile = 0); + void CallVisualStudioMacro(MacroName m, + const char* vsSolutionFile = 0); // return true if target is fortran only bool TargetIsFortranOnly(cmTarget const& t); ----------------------------------------------------------------------- Summary of changes: Help/release/dev/vs10-no-macros.rst | 9 ++++++++ Source/cmGlobalVisualStudio10Generator.cxx | 33 ---------------------------- Source/cmGlobalVisualStudio10Generator.h | 15 +++---------- Source/cmGlobalVisualStudio11Generator.h | 2 -- Source/cmGlobalVisualStudio12Generator.h | 3 --- Source/cmGlobalVisualStudio14Generator.h | 3 --- Source/cmGlobalVisualStudioGenerator.h | 4 ++-- 7 files changed, 14 insertions(+), 55 deletions(-) create mode 100644 Help/release/dev/vs10-no-macros.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 11:33:59 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 11:33:59 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1834-gc6d9edd Message-ID: <20150415153359.59D0FAFA3A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c6d9edd1dfd21bbb3fb1d99053d90114be6c3260 (commit) via 6470bb7f1fcf6d1559750ddbd7bc87a8f8e7f9de (commit) via 17d9a62b3d30075657c147b66550e41c6ed19efb (commit) via 338c17b52b7287c76adf70221ac8075ca7649a1c (commit) from 251e719cc10593dc4fd0fd1f4e9b3a6d59a55f86 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6d9edd1dfd21bbb3fb1d99053d90114be6c3260 commit c6d9edd1dfd21bbb3fb1d99053d90114be6c3260 Merge: 251e719 6470bb7 Author: Brad King AuthorDate: Wed Apr 15 11:33:58 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 11:33:58 2015 -0400 Merge topic 'FPHSA-updates' into next 6470bb7f FPHSA: Document REQUIRED_VARS recommendation (#15352) 17d9a62b FPHSA: Revise and format documentation 338c17b5 FPHSA: Always populate the ExactCase_FOUND variable (#15412). http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6470bb7f1fcf6d1559750ddbd7bc87a8f8e7f9de commit 6470bb7f1fcf6d1559750ddbd7bc87a8f8e7f9de Author: Brad King AuthorDate: Wed Apr 15 11:32:26 2015 -0400 Commit: Brad King CommitDate: Wed Apr 15 11:32:50 2015 -0400 FPHSA: Document REQUIRED_VARS recommendation (#15352) State explicitly that the variables specified are user-facing. diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 9053af3..6fdc917 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -49,6 +49,10 @@ valid filepaths. ``REQUIRED_VARS ...`` Specify the variables which are required for this package. + These may be named in the generated failure message asking the + user to set the missing variable values. Therefore these should + typically be cache entries such as ``FOO_LIBRARY`` and not output + variables like ``FOO_LIBRARIES``. ``VERSION_VAR `` Specify the name of a variable that holds the version of the package http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=17d9a62b3d30075657c147b66550e41c6ed19efb commit 17d9a62b3d30075657c147b66550e41c6ed19efb Author: Brad King AuthorDate: Wed Apr 15 11:30:28 2015 -0400 Commit: Brad King CommitDate: Wed Apr 15 11:30:40 2015 -0400 FPHSA: Revise and format documentation Use better reStructuredText markup and add cross-references. diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index e7b2d95..9053af3 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -1,113 +1,126 @@ -#.rst: -# FindPackageHandleStandardArgs -# ----------------------------- -# -# -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS( ... ) -# -# This function is intended to be used in FindXXX.cmake modules files. -# It handles the REQUIRED, QUIET and version-related arguments to -# find_package(PackageName). It also sets the _FOUND -# variable. The package is considered found if all variables ... -# listed contain valid results, e.g. valid filepaths. -# -# There are two modes of this function. The first argument in both -# modes is the name of the Find-module where it is called (in original -# casing). -# -# The first simple mode looks like this: -# -# :: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS( -# (DEFAULT_MSG|"Custom failure message") ... ) -# -# If the variables to are all valid, then -# _FOUND will be set to TRUE. If DEFAULT_MSG is given -# as second argument, then the function will generate itself useful -# success and error messages. You can also supply a custom error -# message for the failure case. This is not recommended. -# -# The second mode is more powerful and also supports version checking: -# -# :: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS( -# [FOUND_VAR ] -# [REQUIRED_VARS ...] -# [VERSION_VAR ] -# [HANDLE_COMPONENTS] -# [CONFIG_MODE] -# [FAIL_MESSAGE "Custom failure message"] ) -# -# The FOUND_VAR option is obsolete. ``FIND_PACKAGE_HANDLE_STANDARD_ARGS`` -# always populates ``_FOUND``. For backward compatibility, -# it also always populates ``_FOUND``. -# -# As in the simple mode, if through are all valid, -# _FOUND will be set to TRUE. After REQUIRED_VARS the -# variables which are required for this package are listed. Following -# VERSION_VAR the name of the variable can be specified which holds the -# version of the package which has been found. If this is done, this -# version will be checked against the (potentially) specified required -# version used in the find_package() call. The EXACT keyword is also -# handled. The default messages include information about the required -# version and the version which has been actually found, both if the -# version is ok or not. If the package supports components, use the -# HANDLE_COMPONENTS option to enable handling them. In this case, -# find_package_handle_standard_args() will report which components have -# been found and which are missing, and the _FOUND variable -# will be set to FALSE if any of the required components (i.e. not the -# ones listed after OPTIONAL_COMPONENTS) are missing. Use the option -# CONFIG_MODE if your FindXXX.cmake module is a wrapper for a -# find_package(... NO_MODULE) call. In this case VERSION_VAR will be -# set to _VERSION and the macro will automatically check whether -# the Config module was found. Via FAIL_MESSAGE a custom failure -# message can be specified, if this is not used, the default message -# will be displayed. -# -# Example for mode 1: -# -# :: -# -# find_package_handle_standard_args(LibXml2 DEFAULT_MSG -# LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) -# -# -# -# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and -# LIBXML2_INCLUDE_DIR are valid. Then also LibXml2_FOUND is set to -# TRUE. If it is not found and REQUIRED was used, it fails with -# FATAL_ERROR, independent whether QUIET was used or not. If it is -# found, success will be reported, including the content of . On -# repeated Cmake runs, the same message won't be printed again. -# -# Example for mode 2: -# -# :: -# -# find_package_handle_standard_args(LibXslt -# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS -# VERSION_VAR LibXslt_VERSION_STRING) -# -# In this case, LibXslt is considered to be found if the variable(s) -# listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and -# LibXslt_INCLUDE_DIRS in this case. Also the version of LibXslt will be -# checked by using the version contained in LibXslt_VERSION_STRING. Since -# no FAIL_MESSAGE is given, the default messages will be printed. -# -# Another example for mode 2: -# -# :: -# -# find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4) -# find_package_handle_standard_args(Automoc4 CONFIG_MODE) -# -# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 -# NO_MODULE) and adds an additional search directory for automoc4. The -# following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper -# success/error message. +#[=======================================================================[.rst: +FindPackageHandleStandardArgs +----------------------------- + +This module provides a function intended to be used in :ref:`Find Modules` +implementing :command:`find_package()` calls. It handles the +``REQUIRED``, ``QUIET`` and version-related arguments of ``find_package``. +It also sets the ``_FOUND`` variable. The package is +considered found if all variables listed contain valid results, e.g. +valid filepaths. + +.. command:: find_package_handle_standard_args + + There are two signatures:: + + find_package_handle_standard_args( + (DEFAULT_MSG|) + ... + ) + + find_package_handle_standard_args( + [FOUND_VAR ] + [REQUIRED_VARS ...] + [VERSION_VAR ] + [HANDLE_COMPONENTS] + [CONFIG_MODE] + [FAIL_MESSAGE ] + ) + + The ``_FOUND`` variable will be set to ``TRUE`` if all + the variables ``...`` are valid and any optional + constraints are satisfied, and ``FALSE`` otherwise. A success or + failure message may be displayed based on the results and on + whether the ``REQUIRED`` and/or ``QUIET`` option was given to + the :command:`find_package` call. + + The options are: + + ``(DEFAULT_MSG|)`` + In the simple signature this specifies the failure message. + Use ``DEFAULT_MSG`` to ask for a default message to be computed + (recommended). Not valid in the full signature. + + ``FOUND_VAR `` + Obselete. Specifies either ``_FOUND`` or + ``_FOUND`` as the result variable. This exists only + for compatibility with older versions of CMake and is now ignored. + Result variables of both names are always set for compatibility. + + ``REQUIRED_VARS ...`` + Specify the variables which are required for this package. + + ``VERSION_VAR `` + Specify the name of a variable that holds the version of the package + that has been found. This version will be checked against the + (potentially) specified required version given to the + :command:`find_package` call, including its ``EXACT`` option. + The default messages include information about the required + version and the version which has been actually found, both + if the version is ok or not. + + ``HANDLE_COMPONENTS`` + Enable handling of package components. In this case, the command + will report which components have been found and which are missing, + and the ``_FOUND`` variable will be set to ``FALSE`` + if any of the required components (i.e. not the ones listed after + the ``OPTIONAL_COMPONENTS`` option of :command:`find_package`) are + missing. + + ``CONFIG_MODE`` + Specify that the calling find module is a wrapper around a + call to ``find_package( NO_MODULE)``. This implies + a ``VERSION_VAR`` value of ``_VERSION``. The command + will automatically check whether the package configuration file + was found. + + ``FAIL_MESSAGE `` + Specify a custom failure message instead of using the default + generated message. Not recommended. + +Example for the simple signature: + +.. code-block:: cmake + + find_package_handle_standard_args(LibXml2 DEFAULT_MSG + LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) + +The ``LibXml2`` package is considered to be found if both +``LIBXML2_LIBRARY`` and ``LIBXML2_INCLUDE_DIR`` are valid. +Then also ``LibXml2_FOUND`` is set to ``TRUE``. If it is not found +and ``REQUIRED`` was used, it fails with a +:command:`message(FATAL_ERROR)`, independent whether ``QUIET`` was +used or not. If it is found, success will be reported, including +the content of the first ````. On repeated CMake runs, +the same message will not be printed again. + +Example for the full signature: + +.. code-block:: cmake + + find_package_handle_standard_args(LibArchive + REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR + VERSION_VAR LibArchive_VERSION) + +In this case, the ``LibArchive`` package is considered to be found if +both ``LibArchive_LIBRARY`` and ``LibArchive_INCLUDE_DIR`` are valid. +Also the version of ``LibArchive`` will be checked by using the version +contained in ``LibArchive_VERSION``. Since no ``FAIL_MESSAGE`` is given, +the default messages will be printed. + +Another example for the full signature: + +.. code-block:: cmake + + find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4) + find_package_handle_standard_args(Automoc4 CONFIG_MODE) + +In this case, a ``FindAutmoc4.cmake`` module wraps a call to +``find_package(Automoc4 NO_MODULE)`` and adds an additional search +directory for ``automoc4``. Then the call to +``find_package_handle_standard_args`` produces a proper success/failure +message. +#]=======================================================================] #============================================================================= # Copyright 2007-2009 Kitware, Inc. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=338c17b52b7287c76adf70221ac8075ca7649a1c commit 338c17b52b7287c76adf70221ac8075ca7649a1c Author: Stephen Kelly AuthorDate: Mon Feb 23 22:23:11 2015 +0100 Commit: Brad King CommitDate: Wed Apr 15 10:22:00 2015 -0400 FPHSA: Always populate the ExactCase_FOUND variable (#15412). The UPPERCASE name was inconsistent with config-packages, the find_dependency macro, and even FPHSA itself, which expects components to be specified with names matching ExactCase. The FOUND_VAR was only permitted to have two possible values, and now both are set for compatibility. Document it as obsolete, and adjust the code for the same. Users of the variable should just remove it. diff --git a/Help/release/dev/FPHSA-ExactCase-name.rst b/Help/release/dev/FPHSA-ExactCase-name.rst new file mode 100644 index 0000000..675547c --- /dev/null +++ b/Help/release/dev/FPHSA-ExactCase-name.rst @@ -0,0 +1,10 @@ +FPHSA-ExactCase-name +-------------------- + +* The :module:`FindPackageHandleStandardArgs` module + ``FIND_PACKAGE_HANDLE_STANDARD_ARGS`` function now + always populates the both ``_FOUND`` + and ``_FOUND`` variables (the latter + for backwards compatibility). The ``FOUND_VAR`` + option is now ignored except to enforce its allowed + values. diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index bcbd17d..e7b2d95 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -8,9 +8,9 @@ # # This function is intended to be used in FindXXX.cmake modules files. # It handles the REQUIRED, QUIET and version-related arguments to -# find_package(). It also sets the _FOUND variable. The -# package is considered found if all variables ... listed contain -# valid results, e.g. valid filepaths. +# find_package(PackageName). It also sets the _FOUND +# variable. The package is considered found if all variables ... +# listed contain valid results, e.g. valid filepaths. # # There are two modes of this function. The first argument in both # modes is the name of the Find-module where it is called (in original @@ -24,7 +24,7 @@ # (DEFAULT_MSG|"Custom failure message") ... ) # # If the variables to are all valid, then -# _FOUND will be set to TRUE. If DEFAULT_MSG is given +# _FOUND will be set to TRUE. If DEFAULT_MSG is given # as second argument, then the function will generate itself useful # success and error messages. You can also supply a custom error # message for the failure case. This is not recommended. @@ -41,16 +41,12 @@ # [CONFIG_MODE] # [FAIL_MESSAGE "Custom failure message"] ) # -# In this mode, the name of the result-variable can be set either to -# either _FOUND or _FOUND using the -# FOUND_VAR option. Other names for the result-variable are not -# allowed. So for a Find-module named FindFooBar.cmake, the two -# possible names are FooBar_FOUND and FOOBAR_FOUND. It is recommended -# to use the original case version. If the FOUND_VAR option is not -# used, the default is _FOUND. +# The FOUND_VAR option is obsolete. ``FIND_PACKAGE_HANDLE_STANDARD_ARGS`` +# always populates ``_FOUND``. For backward compatibility, +# it also always populates ``_FOUND``. # # As in the simple mode, if through are all valid, -# _FOUND will be set to TRUE. After REQUIRED_VARS the +# _FOUND will be set to TRUE. After REQUIRED_VARS the # variables which are required for this package are listed. Following # VERSION_VAR the name of the variable can be specified which holds the # version of the package which has been found. If this is done, this @@ -61,7 +57,7 @@ # version is ok or not. If the package supports components, use the # HANDLE_COMPONENTS option to enable handling them. In this case, # find_package_handle_standard_args() will report which components have -# been found and which are missing, and the _FOUND variable +# been found and which are missing, and the _FOUND variable # will be set to FALSE if any of the required components (i.e. not the # ones listed after OPTIONAL_COMPONENTS) are missing. Use the option # CONFIG_MODE if your FindXXX.cmake module is a wrapper for a @@ -81,7 +77,7 @@ # # # LibXml2 is considered to be found, if both LIBXML2_LIBRARY and -# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to +# LIBXML2_INCLUDE_DIR are valid. Then also LibXml2_FOUND is set to # TRUE. If it is not found and REQUIRED was used, it fails with # FATAL_ERROR, independent whether QUIET was used or not. If it is # found, success will be reported, including the content of . On @@ -92,16 +88,14 @@ # :: # # find_package_handle_standard_args(LibXslt -# FOUND_VAR LibXslt_FOUND # REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS # VERSION_VAR LibXslt_VERSION_STRING) # # In this case, LibXslt is considered to be found if the variable(s) # listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and -# LibXslt_INCLUDE_DIRS in this case. The result will then be stored in -# LibXslt_FOUND . Also the version of LibXslt will be checked by using -# the version contained in LibXslt_VERSION_STRING. Since no -# FAIL_MESSAGE is given, the default messages will be printed. +# LibXslt_INCLUDE_DIRS in this case. Also the version of LibXslt will be +# checked by using the version contained in LibXslt_VERSION_STRING. Since +# no FAIL_MESSAGE is given, the default messages will be printed. # # Another example for mode 2: # @@ -111,9 +105,8 @@ # find_package_handle_standard_args(Automoc4 CONFIG_MODE) # # In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 -# NO_MODULE) and adds an additional search directory for automoc4. Here -# the result will be stored in AUTOMOC4_FOUND. The following -# FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper +# NO_MODULE) and adds an additional search directory for automoc4. The +# following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper # success/error message. #============================================================================= @@ -239,17 +232,18 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) set(MISSING_VARS "") set(DETAILS "") # check if all passed variables are valid - unset(${_FOUND_VAR}) + unset(${_NAME}_FOUND) + unset(${_NAME_UPPER}_FOUND) foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS}) if(NOT ${_CURRENT_VAR}) - set(${_FOUND_VAR} FALSE) + set(${_NAME}_FOUND FALSE) set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") else() set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") endif() endforeach() - if(NOT "${${_FOUND_VAR}}" STREQUAL "FALSE") - set(${_FOUND_VAR} TRUE) + if(NOT "${${_NAME}_FOUND}" STREQUAL "FALSE") + set(${_NAME}_FOUND TRUE) endif() # component handling @@ -273,7 +267,7 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}") if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_FOUND_VAR} FALSE) + set(${_NAME}_FOUND FALSE) set(MISSING_VARS "${MISSING_VARS} ${comp}") endif() @@ -356,12 +350,12 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) if(VERSION_OK) set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]") else() - set(${_FOUND_VAR} FALSE) + set(${_NAME}_FOUND FALSE) endif() # print the result: - if (${_FOUND_VAR}) + if (${_NAME}_FOUND) FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") else () @@ -377,6 +371,6 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) endif () - set(${_FOUND_VAR} ${${_FOUND_VAR}} PARENT_SCOPE) - + set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE) + set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE) endfunction() diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index f311fb9..8fafa3b 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -45,12 +45,18 @@ endif() find_package(SomePackage) if(NOT SomePackage_FOUND) - message(SEND_ERROR "SomePackage with FOUND_VAR SomePackage_FOUND not found !") + message(SEND_ERROR "SomePackage not found !") +endif() +if(NOT SOMEPACKAGE_FOUND) + message(SEND_ERROR "SomePackage compatibility name SOMEPACKAGE_FOUND not set!") endif() find_package(UpperCasePackage) +if(NOT UpperCasePackage_FOUND) + message(SEND_ERROR "UpperCasePackage not found!") +endif() if(NOT UPPERCASEPACKAGE_FOUND) - message(SEND_ERROR "UpperCasePackage with FOUND_VAR UPPERCASEPACKAGE_FOUND not found !") + message(SEND_ERROR "SomePackage compatibility name SOMEPACKAGE_FOUND not set!") endif() #----------------------------------------------------------------------------- diff --git a/Tests/FindPackageTest/FindSomePackage.cmake b/Tests/FindPackageTest/FindSomePackage.cmake index 7283d24..746c087 100644 --- a/Tests/FindPackageTest/FindSomePackage.cmake +++ b/Tests/FindPackageTest/FindSomePackage.cmake @@ -2,5 +2,4 @@ set(SOP_FOO TRUE) include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(SomePackage REQUIRED_VARS SOP_FOO - FOUND_VAR SomePackage_FOUND ) +find_package_handle_standard_args(SomePackage REQUIRED_VARS SOP_FOO) diff --git a/Tests/FindPackageTest/FindUpperCasePackage.cmake b/Tests/FindPackageTest/FindUpperCasePackage.cmake index 425d417..5e349da 100644 --- a/Tests/FindPackageTest/FindUpperCasePackage.cmake +++ b/Tests/FindPackageTest/FindUpperCasePackage.cmake @@ -2,5 +2,4 @@ set(UCP_FOO TRUE) include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(UpperCasePackage REQUIRED_VARS UCP_FOO - FOUND_VAR UPPERCASEPACKAGE_FOUND ) +find_package_handle_standard_args(UpperCasePackage REQUIRED_VARS UCP_FOO) ----------------------------------------------------------------------- Summary of changes: Help/release/dev/FPHSA-ExactCase-name.rst | 10 + Modules/FindPackageHandleStandardArgs.cmake | 263 +++++++++++----------- Tests/FindPackageTest/CMakeLists.txt | 10 +- Tests/FindPackageTest/FindSomePackage.cmake | 3 +- Tests/FindPackageTest/FindUpperCasePackage.cmake | 3 +- 5 files changed, 157 insertions(+), 132 deletions(-) create mode 100644 Help/release/dev/FPHSA-ExactCase-name.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 11:40:56 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 11:40:56 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1836-gfd0abd0 Message-ID: <20150415154056.4D15AADBA6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fd0abd02fff468bedbd1c07ebddf10522f385bca (commit) via dd7e31bc15471b5c3ea31fcbe2002650780e78b6 (commit) from c6d9edd1dfd21bbb3fb1d99053d90114be6c3260 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd0abd02fff468bedbd1c07ebddf10522f385bca commit fd0abd02fff468bedbd1c07ebddf10522f385bca Merge: c6d9edd dd7e31b Author: Brad King AuthorDate: Wed Apr 15 11:40:55 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 11:40:55 2015 -0400 Merge topic 'UseSWIG-use-absolute-path' into next dd7e31bc UseSWIG: Fix module name detection with relative source file (#15508) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd7e31bc15471b5c3ea31fcbe2002650780e78b6 commit dd7e31bc15471b5c3ea31fcbe2002650780e78b6 Author: Tuukka Pasanen AuthorDate: Wed Apr 15 11:37:48 2015 -0400 Commit: Brad King CommitDate: Wed Apr 15 11:39:44 2015 -0400 UseSWIG: Fix module name detection with relative source file (#15508) When SWIG_GET_EXTRA_OUTPUT_FILES checks to see if a source file exists for use in reading the module name, it must pass an absolute path to the if(EXISTS) command. Teach SWIG_ADD_SOURCE_TO_MODULE to give it the absolute path it already knows. diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index 7423418..1862876 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -156,7 +156,7 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE} swig_extra_generated_files "${swig_outdir}" - "${infile}") + "${swig_source_file_fullname}") set(swig_generated_file_fullname "${swig_outdir}/${swig_source_file_name_we}") # add the language into the name of the file (i.e. TCL_wrap) ----------------------------------------------------------------------- Summary of changes: Modules/UseSWIG.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 11:44:06 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 11:44:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1843-g092cfc8 Message-ID: <20150415154406.0EC06AE527@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 092cfc8d804366ba30b44c72af55ad2f23ddbe7c (commit) via 5d056c0dd85934e7a985cb49f97c343e38f20929 (commit) via de722d7d63866613aaa8105b52ee90ffe2721136 (commit) via 9b5f80a83c07b4c840b190f4f9057f2cf0fa03d4 (commit) via 0076b5d8340be81057195e70853d33e8fb66c1db (commit) via 24b7f31d3a2a464cef5955648e4a152a19d44890 (commit) via 0aec49132885be07e1d92a4a1db58f4c6c4c2844 (commit) from fd0abd02fff468bedbd1c07ebddf10522f385bca (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=092cfc8d804366ba30b44c72af55ad2f23ddbe7c commit 092cfc8d804366ba30b44c72af55ad2f23ddbe7c Merge: fd0abd0 5d056c0 Author: Brad King AuthorDate: Wed Apr 15 11:44:04 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 11:44:04 2015 -0400 Merge topic 'port-global-properties-to-cmState' into next 5d056c0d Port Global property interaction to cmState. de722d7d Move property initialization to cmState. 9b5f80a8 Move global properties to cmState. 0076b5d8 cmake: Remove the happy global property scope pattern. 24b7f31d cmake: Remove unused cmCommand methods. 0aec4913 Port cmCommand consumers to cmState. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d056c0dd85934e7a985cb49f97c343e38f20929 commit 5d056c0dd85934e7a985cb49f97c343e38f20929 Author: Stephen Kelly AuthorDate: Sat Apr 11 14:15:55 2015 +0200 Commit: Brad King CommitDate: Wed Apr 15 11:43:50 2015 -0400 Port Global property interaction to cmState. diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 4cdcd45..1e12f15 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -17,6 +17,7 @@ #include "cmGeneratedFileStream.h" #include "cmCTest.h" #include "cmXMLParser.h" +#include "cmState.h" #include #include @@ -1132,7 +1133,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, cmCTestScriptHandler* ch = static_cast(this->CTest->GetHandler("script")); cmake* cm = ch->GetCMake(); - const char* subproject = cm->GetProperty("SubProject"); + const char* subproject = cm->GetState()->GetGlobalProperty("SubProject"); // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index edf82bd..74e1a93 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -12,6 +12,7 @@ #include "cmAddLibraryCommand.h" #include "cmake.h" +#include "cmState.h" // cmLibraryCommand bool cmAddLibraryCommand @@ -330,7 +331,7 @@ bool cmAddLibraryCommand yet its linker language. */ if ((type == cmTarget::SHARED_LIBRARY || type == cmTarget::MODULE_LIBRARY) && - (this->Makefile->GetCMakeInstance()->GetPropertyAsBool( + (this->Makefile->GetState()->GetGlobalPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS") == false)) { std::ostringstream w; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index d54a651..cd2cd7c 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -27,6 +27,7 @@ #include "cmCTestCommand.h" #include "cmCTestStartCommand.h" #include "cmAlgorithms.h" +#include "cmState.h" #include "cmCTestBuildHandler.h" #include "cmCTestBuildAndTestHandler.h" @@ -1558,12 +1559,14 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) return; } // This code should go when cdash is changed to use labels only - const char* subproject = cm->GetProperty("SubProject"); + const char* subproject = cm->GetState() + ->GetGlobalProperty("SubProject"); if(subproject) { ostr << "\n"; const char* labels = - ch->GetCMake()->GetProperty("SubProjectLabels"); + ch->GetCMake()->GetState() + ->GetGlobalProperty("SubProjectLabels"); if(labels) { ostr << " \n"; @@ -1581,7 +1584,7 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) } // This code should stay when cdash only does label based sub-projects - const char* label = cm->GetProperty("Label"); + const char* label = cm->GetState()->GetGlobalProperty("Label"); if(label) { ostr << "\n"; diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 8880667..83d38ef 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -15,6 +15,7 @@ #include "cmOrderDirectories.h" #include "cmGlobalGenerator.h" +#include "cmState.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmTarget.h" @@ -250,8 +251,8 @@ cmComputeLinkInformation this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance(); // Check whether to recognize OpenBSD-style library versioned names. - this->OpenBSD = this->Makefile->GetCMakeInstance() - ->GetPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING"); + this->OpenBSD = this->Makefile->GetState() + ->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING"); // The configuration being linked. this->Config = config; @@ -796,9 +797,8 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, void cmComputeLinkInformation::ComputeLinkTypeInfo() { // Check whether archives may actually be shared libraries. - this->ArchivesMayBeShared = - this->CMakeInstance->GetPropertyAsBool( - "TARGET_ARCHIVES_MAY_BE_SHARED_LIBS"); + this->ArchivesMayBeShared = this->CMakeInstance->GetState() + ->GetGlobalPropertyAsBool("TARGET_ARCHIVES_MAY_BE_SHARED_LIBS"); // First assume we cannot do link type stuff. this->LinkTypeEnabled = false; @@ -1527,9 +1527,10 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item, // Print the warning at most once for this item. std::string wid = "CMP0008-WARNING-GIVEN-"; wid += item; - if(!this->CMakeInstance->GetPropertyAsBool(wid)) + if(!this->CMakeInstance->GetState() + ->GetGlobalPropertyAsBool(wid)) { - this->CMakeInstance->SetProperty(wid, "1"); + this->CMakeInstance->GetState()->SetGlobalProperty(wid, "1"); std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0008)) << "\n" @@ -1576,9 +1577,11 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories() switch(this->Target->GetPolicyStatusCMP0003()) { case cmPolicies::WARN: - if(!this->CMakeInstance->GetPropertyAsBool("CMP0003-WARNING-GIVEN")) + if(!this->CMakeInstance->GetState() + ->GetGlobalPropertyAsBool("CMP0003-WARNING-GIVEN")) { - this->CMakeInstance->SetProperty("CMP0003-WARNING-GIVEN", "1"); + this->CMakeInstance->GetState() + ->SetGlobalProperty("CMP0003-WARNING-GIVEN", "1"); std::ostringstream w; this->PrintLinkPolicyDiagnosis(w); this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index bbffd5d..11056cd 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -15,6 +15,7 @@ #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmState.h" #include "cmSystemTools.h" #include "cmSourceFile.h" #include "cmTarget.h" @@ -98,8 +99,10 @@ cmComputeTargetDepends::cmComputeTargetDepends(cmGlobalGenerator* gg) { this->GlobalGenerator = gg; cmake* cm = this->GlobalGenerator->GetCMakeInstance(); - this->DebugMode = cm->GetPropertyAsBool("GLOBAL_DEPENDS_DEBUG_MODE"); - this->NoCycles = cm->GetPropertyAsBool("GLOBAL_DEPENDS_NO_CYCLES"); + this->DebugMode = cm->GetState() + ->GetGlobalPropertyAsBool("GLOBAL_DEPENDS_DEBUG_MODE"); + this->NoCycles = cm->GetState() + ->GetGlobalPropertyAsBool("GLOBAL_DEPENDS_NO_CYCLES"); } //---------------------------------------------------------------------------- diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 16d5119..2aa4d93 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -469,8 +469,8 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() fout << "\t\t" << *nit << "\n"; } - if (const char *extraNaturesProp = mf->GetCMakeInstance()-> - GetProperty("ECLIPSE_EXTRA_NATURES")) + if (const char *extraNaturesProp = mf->GetState() + ->GetGlobalProperty("ECLIPSE_EXTRA_NATURES")) { std::vector extraNatures; cmSystemTools::ExpandListArgument(extraNaturesProp, extraNatures); diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index ef8340b..507d011 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -54,8 +54,8 @@ bool cmFindLibraryCommand } } - if(this->Makefile->GetCMakeInstance() - ->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS")) + if(this->Makefile->GetState() + ->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS")) { // add special 64 bit paths if this is a 64 bit compile. if(this->Makefile->PlatformIs64Bit()) @@ -226,8 +226,8 @@ cmFindLibraryHelper::cmFindLibraryHelper(cmMakefile* mf): // Check whether to use OpenBSD-style library version comparisons. this->OpenBSD = - this->Makefile->GetCMakeInstance() - ->GetPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING"); + this->Makefile->GetState() + ->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING"); } //---------------------------------------------------------------------------- diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index b32f5fd..e1074b0 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -120,8 +120,8 @@ bool cmFindPackageCommand // Lookup whether lib64 paths should be used. if(this->Makefile->PlatformIs64Bit() && - this->Makefile->GetCMakeInstance() - ->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS")) + this->Makefile->GetState() + ->GetGlobalPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS")) { this->UseLib64Paths = true; } @@ -1015,8 +1015,8 @@ bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr) void cmFindPackageCommand::AppendToFoundProperty(bool found) { std::vector foundContents; - const char *foundProp = - this->Makefile->GetCMakeInstance()->GetProperty("PACKAGES_FOUND"); + const char *foundProp = this->Makefile->GetState() + ->GetGlobalProperty("PACKAGES_FOUND"); if (foundProp && *foundProp) { std::string tmp = foundProp; @@ -1032,7 +1032,8 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found) std::vector notFoundContents; const char *notFoundProp = - this->Makefile->GetCMakeInstance()->GetProperty("PACKAGES_NOT_FOUND"); + this->Makefile->GetState() + ->GetGlobalProperty("PACKAGES_NOT_FOUND"); if (notFoundProp && *notFoundProp) { std::string tmp = notFoundProp; @@ -1057,12 +1058,12 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found) std::string tmp = cmJoin(foundContents, ";"); - this->Makefile->GetCMakeInstance()->SetProperty("PACKAGES_FOUND", - tmp.c_str()); + this->Makefile->GetState() + ->SetGlobalProperty("PACKAGES_FOUND", tmp.c_str()); tmp = cmJoin(notFoundContents, ";"); - this->Makefile->GetCMakeInstance()->SetProperty("PACKAGES_NOT_FOUND", - tmp.c_str()); + this->Makefile->GetState() + ->SetGlobalProperty("PACKAGES_NOT_FOUND", tmp.c_str()); } //---------------------------------------------------------------------------- @@ -1071,8 +1072,8 @@ void cmFindPackageCommand::AppendSuccessInformation() { std::string transitivePropName = "_CMAKE_"; transitivePropName += this->Name + "_TRANSITIVE_DEPENDENCY"; - this->Makefile->GetCMakeInstance() - ->SetProperty(transitivePropName, "False"); + this->Makefile->GetState() + ->SetGlobalProperty(transitivePropName, "False"); } std::string found = this->Name; found += "_FOUND"; @@ -1090,8 +1091,8 @@ void cmFindPackageCommand::AppendSuccessInformation() std::string quietInfoPropName = "_CMAKE_"; quietInfoPropName += this->Name; quietInfoPropName += "_QUIET"; - this->Makefile->GetCMakeInstance()->SetProperty(quietInfoPropName, - this->Quiet ? "TRUE" : "FALSE"); + this->Makefile->GetState() + ->SetGlobalProperty(quietInfoPropName, this->Quiet ? "TRUE" : "FALSE"); // set a global property to record the required version of this package std::string versionInfoPropName = "_CMAKE_"; @@ -1104,15 +1105,15 @@ void cmFindPackageCommand::AppendSuccessInformation() versionInfo += " "; versionInfo += this->Version; } - this->Makefile->GetCMakeInstance()->SetProperty(versionInfoPropName, - versionInfo.c_str()); + this->Makefile->GetState() + ->SetGlobalProperty(versionInfoPropName, versionInfo.c_str()); if (this->Required) { std::string requiredInfoPropName = "_CMAKE_"; requiredInfoPropName += this->Name; requiredInfoPropName += "_TYPE"; - this->Makefile->GetCMakeInstance()->SetProperty( - requiredInfoPropName, "REQUIRED"); + this->Makefile->GetState() + ->SetGlobalProperty(requiredInfoPropName, "REQUIRED"); } diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 85aa31f..b035750 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -14,6 +14,7 @@ #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmake.h" +#include "cmState.h" #include "cmAlgorithms.h" // cmGetCMakePropertyCommand @@ -53,7 +54,8 @@ bool cmGetCMakePropertyCommand else { const char *prop = - this->Makefile->GetCMakeInstance()->GetProperty(args[1]); + this->Makefile->GetState() + ->GetGlobalProperty(args[1]); if (prop) { output = prop; diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index a8481ad..3e1d08e 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -237,7 +237,8 @@ bool cmGetPropertyCommand::HandleGlobalMode() // Get the property. cmake* cm = this->Makefile->GetCMakeInstance(); - return this->StoreResult(cm->GetProperty(this->PropertyName)); + return this->StoreResult(cm->GetState() + ->GetGlobalProperty(this->PropertyName)); } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 56a0a45..ab044c1 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -200,7 +200,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, if (cnameString != pathString) { const char* cvars = - this->GetCMakeInstance()->GetProperty( + this->GetCMakeInstance()->GetState()->GetGlobalProperty( "__CMAKE_DELETE_CACHE_CHANGE_VARS_"); if(cvars) { @@ -210,7 +210,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, changeVars += langComp; changeVars += ";"; changeVars += cname; - this->GetCMakeInstance()->SetProperty( + this->GetCMakeInstance()->GetState()->SetGlobalProperty( "__CMAKE_DELETE_CACHE_CHANGE_VARS_", changeVars.c_str()); } @@ -1170,8 +1170,8 @@ void cmGlobalGenerator::AddCMP0042WarnTarget(const std::string& target) bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const { // If the property is not enabled then okay. - if(!this->CMakeInstance - ->GetPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS")) + if(!this->CMakeInstance->GetState() + ->GetGlobalPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS")) { return true; } @@ -2391,8 +2391,8 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) //---------------------------------------------------------------------------- const char* cmGlobalGenerator::GetPredefinedTargetsFolder() { - const char* prop = - this->GetCMakeInstance()->GetProperty("PREDEFINED_TARGETS_FOLDER"); + const char* prop = this->GetCMakeInstance()->GetState() + ->GetGlobalProperty("PREDEFINED_TARGETS_FOLDER"); if (prop) { @@ -2405,7 +2405,8 @@ const char* cmGlobalGenerator::GetPredefinedTargetsFolder() //---------------------------------------------------------------------------- bool cmGlobalGenerator::UseFolderProperty() { - const char* prop = this->GetCMakeInstance()->GetProperty("USE_FOLDERS"); + const char* prop = this->GetCMakeInstance()->GetState() + ->GetGlobalProperty("USE_FOLDERS"); // If this property is defined, let the setter turn this on or off... // diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 124e849..645d32a 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -18,6 +18,7 @@ #include "cmGeneratedFileStream.h" #include "cmSourceFile.h" #include "cmake.h" +#include "cmState.h" #include @@ -234,7 +235,8 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os) { cmGlobalNinjaGenerator::WriteDivider(os); - const char* jobpools = this->GetCMakeInstance()->GetProperty("JOB_POOLS"); + const char* jobpools = this->GetCMakeInstance()->GetState() + ->GetGlobalProperty("JOB_POOLS"); if (jobpools) { cmGlobalNinjaGenerator::WriteComment(os, diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2fe1e33..205508b 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4239,7 +4239,7 @@ const char *cmMakefile::GetProperty(const std::string& prop, return this->LocalGenerator->GetParent()->GetMakefile()-> GetProperty(prop, scope); } - return this->GetCMakeInstance()->GetProperty(prop); + return this->GetState()->GetGlobalProperty(prop); } return retVal; @@ -4585,7 +4585,8 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, this->LocalGenerator->GetGlobalGenerator()->GetCMakeInstance(); if(isCustom && existing->GetType() == cmTarget::UTILITY && this != existing->GetMakefile() && - cm->GetPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS")) + cm->GetState() + ->GetGlobalPropertyAsBool("ALLOW_DUPLICATE_CUSTOM_TARGETS")) { return true; } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index bd9c579..0076caf 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -20,6 +20,7 @@ #include "cmSourceFile.h" #include "cmTarget.h" #include "cmake.h" +#include "cmState.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratorExpression.h" @@ -51,7 +52,8 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target) this->GeneratorTarget = this->GlobalGenerator->GetGeneratorTarget(target); cmake* cm = this->GlobalGenerator->GetCMakeInstance(); this->NoRuleMessages = false; - if(const char* ruleStatus = cm->GetProperty("RULE_MESSAGES")) + if(const char* ruleStatus = cm->GetState() + ->GetGlobalProperty("RULE_MESSAGES")) { this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus); } diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 4cb49c8..4d0b3f4 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -16,6 +16,7 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" +#include "cmState.h" #include "cmAlgorithms.h" #if defined(_WIN32) && !defined(__CYGWIN__) @@ -472,12 +473,12 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target) } // Set target folder - const char* autogenFolder = makefile->GetCMakeInstance()->GetProperty( - "AUTOMOC_TARGETS_FOLDER"); + const char* autogenFolder = makefile->GetState() + ->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER"); if (!autogenFolder) { - autogenFolder = makefile->GetCMakeInstance()->GetProperty( - "AUTOGEN_TARGETS_FOLDER"); + autogenFolder = makefile->GetState() + ->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER"); } if (autogenFolder && *autogenFolder) { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 96b6a22..a542a24 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1152,7 +1152,8 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) std::vector argsSplit; cmSystemTools::ExpandListArgument(std::string(var), argsSplit, true); // erase the property to avoid infinite recursion - this->SetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", ""); + this->State + ->SetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", ""); if(this->State->GetIsInTryCompile()) { return 0; @@ -1229,8 +1230,8 @@ int cmake::Configure() } } int ret = this->ActualConfigure(); - const char* delCacheVars = - this->GetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_"); + const char* delCacheVars = this->State + ->GetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_"); if(delCacheVars && delCacheVars[0] != 0) { return this->HandleDeleteCacheVariables(delCacheVars); @@ -1505,7 +1506,7 @@ int cmake::ActualConfigure() cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); if (mf->IsOn("CTEST_USE_LAUNCHERS") - && !this->GetProperty("RULE_LAUNCH_COMPILE")) + && !this->State->GetGlobalProperty("RULE_LAUNCH_COMPILE")) { cmSystemTools::Error("CTEST_USE_LAUNCHERS is enabled, but the " "RULE_LAUNCH_COMPILE global property is not defined.\n" @@ -2194,7 +2195,7 @@ const char *cmake::GetProperty(const std::string& prop) bool cmake::GetPropertyAsBool(const std::string& prop) { - return cmSystemTools::IsOn(this->GetProperty(prop)); + return this->State->GetGlobalPropertyAsBool(prop); } cmInstalledFile *cmake::GetOrCreateInstalledFile( @@ -2590,7 +2591,8 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, std::vector cmake::GetDebugConfigs() { std::vector configs; - if(const char* config_list = this->GetProperty("DEBUG_CONFIGURATIONS")) + if(const char* config_list = + this->State->GetGlobalProperty("DEBUG_CONFIGURATIONS")) { // Expand the specified list and convert to upper-case. cmSystemTools::ExpandListArgument(config_list, configs); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de722d7d63866613aaa8105b52ee90ffe2721136 commit de722d7d63866613aaa8105b52ee90ffe2721136 Author: Stephen Kelly AuthorDate: Mon Apr 6 19:47:21 2015 +0200 Commit: Brad King CommitDate: Wed Apr 15 11:43:50 2015 -0400 Move property initialization to cmState. diff --git a/Source/cmState.cxx b/Source/cmState.cxx index e46846e..96f8a51 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -22,6 +22,7 @@ cmState::cmState(cmake* cm) : CMakeInstance(cm), IsInTryCompile(false) { + this->Initialize(); } cmState::~cmState() diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7d02505..96b6a22 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -136,8 +136,6 @@ cmake::cmake() this->Policies = new cmPolicies(); this->State = new cmState(this); - this->InitializeProperties(); - #ifdef __APPLE__ struct rlimit rlp; if(!getrlimit(RLIMIT_STACK, &rlp)) @@ -186,14 +184,9 @@ cmake::~cmake() delete this->FileComparison; } -void cmake::InitializeProperties() -{ - this->State->Initialize(); -} - void cmake::CleanupCommandsAndMacros() { - this->InitializeProperties(); + this->State->Initialize(); this->State->RemoveUserDefinedCommands(); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b5f80a83c07b4c840b190f4f9057f2cf0fa03d4 commit 9b5f80a83c07b4c840b190f4f9057f2cf0fa03d4 Author: Stephen Kelly AuthorDate: Sat Apr 11 14:17:46 2015 +0200 Commit: Brad King CommitDate: Wed Apr 15 11:43:50 2015 -0400 Move global properties to cmState. diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 17b6cf2..e46846e 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -191,6 +191,8 @@ void cmState::RemoveCacheEntryProperty(std::string const& key, void cmState::Initialize() { + this->GlobalProperties.clear(); + this->PropertyDefinitions.clear(); this->DefineProperty ("RULE_LAUNCH_COMPILE", cmProperty::DIRECTORY, @@ -384,3 +386,60 @@ void cmState::RemoveUserDefinedCommands() } } } + +void cmState::SetGlobalProperty(const std::string& prop, const char* value) +{ + this->GlobalProperties.SetProperty(prop, value, cmProperty::GLOBAL); +} + +void cmState::AppendGlobalProperty(const std::string& prop, + const char* value, bool asString) +{ + this->GlobalProperties.AppendProperty(prop, value, + cmProperty::GLOBAL, asString); +} + +const char *cmState::GetGlobalProperty(const std::string& prop) +{ + // watch for special properties + std::string output = ""; + if ( prop == "CACHE_VARIABLES" ) + { + std::vector cacheKeys = this->GetCacheEntryKeys(); + this->SetGlobalProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); + } + else if ( prop == "COMMANDS" ) + { + std::vector commands = this->GetCommandNames(); + this->SetGlobalProperty("COMMANDS", cmJoin(commands, ";").c_str()); + } + else if ( prop == "IN_TRY_COMPILE" ) + { + this->SetGlobalProperty("IN_TRY_COMPILE", + this->IsInTryCompile ? "1" : "0"); + } + else if ( prop == "ENABLED_LANGUAGES" ) + { + std::string langs; + langs = cmJoin(this->EnabledLanguages, ";"); + this->SetGlobalProperty("ENABLED_LANGUAGES", langs.c_str()); + } +#define STRING_LIST_ELEMENT(F) ";" #F + if (prop == "CMAKE_C_KNOWN_FEATURES") + { + return FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT) + 1; + } + if (prop == "CMAKE_CXX_KNOWN_FEATURES") + { + return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1; + } +#undef STRING_LIST_ELEMENT + bool dummy = false; + return this->GlobalProperties.GetPropertyValue(prop, cmProperty::GLOBAL, + dummy); +} + +bool cmState::GetGlobalPropertyAsBool(const std::string& prop) +{ + return cmSystemTools::IsOn(this->GetGlobalProperty(prop)); +} diff --git a/Source/cmState.h b/Source/cmState.h index a7a17ee..34b2ccf 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -14,6 +14,7 @@ #include "cmStandardIncludes.h" #include "cmPropertyDefinitionMap.h" +#include "cmPropertyMap.h" class cmake; class cmCommand; @@ -88,10 +89,17 @@ public: void RemoveUserDefinedCommands(); std::vector GetCommandNames() const; + void SetGlobalProperty(const std::string& prop, const char *value); + void AppendGlobalProperty(const std::string& prop, + const char *value,bool asString=false); + const char *GetGlobalProperty(const std::string& prop); + bool GetGlobalPropertyAsBool(const std::string& prop); + private: std::map PropertyDefinitions; std::vector EnabledLanguages; std::map Commands; + cmPropertyMap GlobalProperties; cmake* CMakeInstance; bool IsInTryCompile; }; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a83596d..7d02505 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -188,8 +188,6 @@ cmake::~cmake() void cmake::InitializeProperties() { - this->Properties.clear(); - this->State->Initialize(); } @@ -2187,52 +2185,18 @@ void cmake::GenerateGraphViz(const char* fileName) const void cmake::SetProperty(const std::string& prop, const char* value) { - this->Properties.SetProperty(prop, value, cmProperty::GLOBAL); + this->State->SetGlobalProperty(prop, value); } void cmake::AppendProperty(const std::string& prop, const char* value, bool asString) { - this->Properties.AppendProperty(prop, value, cmProperty::GLOBAL, asString); + this->State->AppendGlobalProperty(prop, value, asString); } const char *cmake::GetProperty(const std::string& prop) { - // watch for special properties - std::string output = ""; - if ( prop == "CACHE_VARIABLES" ) - { - std::vector cacheKeys = this->State->GetCacheEntryKeys(); - this->SetProperty("CACHE_VARIABLES", cmJoin(cacheKeys, ";").c_str()); - } - else if ( prop == "COMMANDS" ) - { - std::vector commands = this->State->GetCommandNames(); - this->SetProperty("COMMANDS", cmJoin(commands, ";").c_str()); - } - else if ( prop == "IN_TRY_COMPILE" ) - { - this->SetProperty("IN_TRY_COMPILE", - this->State->GetIsInTryCompile() ? "1" : "0"); - } - else if ( prop == "ENABLED_LANGUAGES" ) - { - std::string langs; - langs = cmJoin(this->State->GetEnabledLanguages(), ";"); - this->SetProperty("ENABLED_LANGUAGES", langs.c_str()); - } -#define STRING_LIST_ELEMENT(F) ";" #F - if (prop == "CMAKE_C_KNOWN_FEATURES") - { - return FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT) + 1; - } - if (prop == "CMAKE_CXX_KNOWN_FEATURES") - { - return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1; - } -#undef STRING_LIST_ELEMENT - bool dummy = false; - return this->Properties.GetPropertyValue(prop, cmProperty::GLOBAL, dummy); + return this->State->GetGlobalProperty(prop); } bool cmake::GetPropertyAsBool(const std::string& prop) diff --git a/Source/cmake.h b/Source/cmake.h index 27f28ac..352850d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -15,7 +15,6 @@ #include "cmListFileCache.h" #include "cmSystemTools.h" -#include "cmPropertyMap.h" #include "cmInstalledFile.h" #include "cmCacheManager.h" #include "cmState.h" @@ -336,7 +335,6 @@ protected: void RunCheckForUnusedVariables(); void InitializeProperties(); int HandleDeleteCacheVariables(const std::string& var); - cmPropertyMap Properties; typedef cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)(); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0076b5d8340be81057195e70853d33e8fb66c1db commit 0076b5d8340be81057195e70853d33e8fb66c1db Author: Stephen Kelly AuthorDate: Mon Apr 13 21:20:25 2015 +0200 Commit: Brad King CommitDate: Wed Apr 15 11:43:50 2015 -0400 cmake: Remove the happy global property scope pattern. Global properties are already global in scope, so remove the overload for specifying it and port users of the API. The call from cmMakefile::GetProperty can be simplified because the scope is only used during chaining, and there is no further chaining after processing global properties. diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index d585863..4cdcd45 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1132,7 +1132,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, cmCTestScriptHandler* ch = static_cast(this->CTest->GetHandler("script")); cmake* cm = ch->GetCMake(); - const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + const char* subproject = cm->GetProperty("SubProject"); // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 6715638..d54a651 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1558,12 +1558,12 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) return; } // This code should go when cdash is changed to use labels only - const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + const char* subproject = cm->GetProperty("SubProject"); if(subproject) { ostr << "\n"; const char* labels = - ch->GetCMake()->GetProperty("SubProjectLabels", cmProperty::GLOBAL); + ch->GetCMake()->GetProperty("SubProjectLabels"); if(labels) { ostr << " \n"; @@ -1581,7 +1581,7 @@ void cmCTest::AddSiteProperties(std::ostream& ostr) } // This code should stay when cdash only does label based sub-projects - const char* label = cm->GetProperty("Label", cmProperty::GLOBAL); + const char* label = cm->GetProperty("Label"); if(label) { ostr << "\n"; diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 35b70e8..16d5119 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -470,7 +470,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() } if (const char *extraNaturesProp = mf->GetCMakeInstance()-> - GetProperty("ECLIPSE_EXTRA_NATURES", cmProperty::GLOBAL)) + GetProperty("ECLIPSE_EXTRA_NATURES")) { std::vector extraNatures; cmSystemTools::ExpandListArgument(extraNaturesProp, extraNatures); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 640c1b3..124e849 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -234,8 +234,7 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os) { cmGlobalNinjaGenerator::WriteDivider(os); - const char* jobpools = this->GetCMakeInstance() - ->GetProperty("JOB_POOLS", cmProperty::GLOBAL); + const char* jobpools = this->GetCMakeInstance()->GetProperty("JOB_POOLS"); if (jobpools) { cmGlobalNinjaGenerator::WriteComment(os, diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index be3bcdc..2fe1e33 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4239,7 +4239,7 @@ const char *cmMakefile::GetProperty(const std::string& prop, return this->LocalGenerator->GetParent()->GetMakefile()-> GetProperty(prop, scope); } - return this->GetCMakeInstance()->GetProperty(prop,scope); + return this->GetCMakeInstance()->GetProperty(prop); } return retVal; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e286295..a83596d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1514,7 +1514,7 @@ int cmake::ActualConfigure() cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); if (mf->IsOn("CTEST_USE_LAUNCHERS") - && !this->GetProperty("RULE_LAUNCH_COMPILE", cmProperty::GLOBAL)) + && !this->GetProperty("RULE_LAUNCH_COMPILE")) { cmSystemTools::Error("CTEST_USE_LAUNCHERS is enabled, but the " "RULE_LAUNCH_COMPILE global property is not defined.\n" @@ -2198,12 +2198,6 @@ void cmake::AppendProperty(const std::string& prop, const char *cmake::GetProperty(const std::string& prop) { - return this->GetProperty(prop, cmProperty::GLOBAL); -} - -const char *cmake::GetProperty(const std::string& prop, - cmProperty::ScopeType scope) -{ // watch for special properties std::string output = ""; if ( prop == "CACHE_VARIABLES" ) @@ -2238,7 +2232,7 @@ const char *cmake::GetProperty(const std::string& prop, } #undef STRING_LIST_ELEMENT bool dummy = false; - return this->Properties.GetPropertyValue(prop, scope, dummy); + return this->Properties.GetPropertyValue(prop, cmProperty::GLOBAL, dummy); } bool cmake::GetPropertyAsBool(const std::string& prop) diff --git a/Source/cmake.h b/Source/cmake.h index 359e7bf..27f28ac 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -253,8 +253,6 @@ class cmake void AppendProperty(const std::string& prop, const char *value,bool asString=false); const char *GetProperty(const std::string& prop); - const char *GetProperty(const std::string& prop, - cmProperty::ScopeType scope); bool GetPropertyAsBool(const std::string& prop); ///! Get or create an cmInstalledFile instance and return a pointer to it http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=24b7f31d3a2a464cef5955648e4a152a19d44890 commit 24b7f31d3a2a464cef5955648e4a152a19d44890 Author: Stephen Kelly AuthorDate: Sat Apr 11 13:13:57 2015 +0200 Commit: Brad King CommitDate: Wed Apr 15 11:43:50 2015 -0400 cmake: Remove unused cmCommand methods. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a0f813e..e286295 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -199,32 +199,6 @@ void cmake::CleanupCommandsAndMacros() this->State->RemoveUserDefinedCommands(); } -bool cmake::CommandExists(const std::string& name) const -{ - return this->State->GetCommand(name) ? true : false; -} - -cmCommand *cmake::GetCommand(const std::string& name) const -{ - return this->State->GetCommand(name); -} - -void cmake::RenameCommand(const std::string& oldName, - const std::string& newName) -{ - this->State->RenameCommand(oldName, newName); -} - -void cmake::AddCommand(cmCommand* command) -{ - this->State->AddCommand(command); -} - -void cmake::RemoveUnscriptableCommands() -{ - this->State->RemoveUnscriptableCommands(); -} - // Parse the args bool cmake::SetCacheArgs(const std::vector& args) { diff --git a/Source/cmake.h b/Source/cmake.h index e7a8acb..359e7bf 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -24,7 +24,6 @@ class cmGlobalGeneratorFactory; class cmGlobalGenerator; class cmLocalGenerator; class cmMakefile; -class cmCommand; class cmVariableWatch; class cmFileTimeComparison; class cmExternalMakefileProjectGenerator; @@ -216,21 +215,6 @@ class cmake */ int GetSystemInformation(std::vector&); - /** - * Add a command to this cmake instance - */ - void AddCommand(cmCommand* ); - void RenameCommand(const std::string& oldName, const std::string& newName); - void RemoveUnscriptableCommands(); - - /** - * Get a command by its name - */ - cmCommand *GetCommand(const std::string& name) const; - - /** Check if a command exists. */ - bool CommandExists(const std::string& name) const; - ///! Parse command line arguments void SetArgs(const std::vector&, bool directoriesSetBefore = false); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0aec49132885be07e1d92a4a1db58f4c6c4c2844 commit 0aec49132885be07e1d92a4a1db58f4c6c4c2844 Author: Stephen Kelly AuthorDate: Sat Apr 11 12:52:14 2015 +0200 Commit: Brad King CommitDate: Wed Apr 15 11:43:49 2015 -0400 Port cmCommand consumers to cmState. diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 00b23cd..a9cabf1 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -198,7 +198,7 @@ int main (int argc, char const* const* argv) "Read CPack config file: " << cpackConfigFile << std::endl); cmake cminst; - cminst.RemoveUnscriptableCommands(); + cminst.GetState()->RemoveUnscriptableCommands(); cmGlobalGenerator cmgg; cmgg.SetCMakeInstance(&cminst); cmsys::auto_ptr cmlg(cmgg.CreateLocalGenerator()); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 3792953..783941b 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -214,7 +214,7 @@ void cmCTestScriptHandler::AddCTestCommand(cmCTestCommand* command) cmCTestCommand* newCom = command; newCom->CTest = this->CTest; newCom->CTestScriptHandler = this; - this->CMake->AddCommand(newCom); + this->CMake->GetState()->AddCommand(newCom); } int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) @@ -353,7 +353,7 @@ void cmCTestScriptHandler::CreateCMake() // remove all cmake commands which are not scriptable, since they can't be // used in ctest scripts - this->CMake->RemoveUnscriptableCommands(); + this->CMake->GetState()->RemoveUnscriptableCommands(); // add any ctest specific commands, probably should have common superclass // for ctest commands to clean this up. If a couple more commands are diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 0e84fbf..c50ea88 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1585,25 +1585,25 @@ void cmCTestTestHandler::GetListOfTests() // Add handler for ADD_TEST cmCTestAddTestCommand* newCom1 = new cmCTestAddTestCommand; newCom1->TestHandler = this; - cm.AddCommand(newCom1); + cm.GetState()->AddCommand(newCom1); // Add handler for SUBDIRS cmCTestSubdirCommand* newCom2 = new cmCTestSubdirCommand; newCom2->TestHandler = this; - cm.AddCommand(newCom2); + cm.GetState()->AddCommand(newCom2); // Add handler for ADD_SUBDIRECTORY cmCTestAddSubdirectoryCommand* newCom3 = new cmCTestAddSubdirectoryCommand; newCom3->TestHandler = this; - cm.AddCommand(newCom3); + cm.GetState()->AddCommand(newCom3); // Add handler for SET_SOURCE_FILES_PROPERTIES cmCTestSetTestsPropertiesCommand* newCom4 = new cmCTestSetTestsPropertiesCommand; newCom4->TestHandler = this; - cm.AddCommand(newCom4); + cm.GetState()->AddCommand(newCom4); const char* testFilename; if( cmSystemTools::FileExists("CTestTestfile.cmake") ) diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 6134c6f..77cd6c6 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -164,7 +164,7 @@ int CCONV cmIsOn(void *arg, const char* name) int CCONV cmCommandExists(void *arg, const char* name) { cmMakefile *mf = static_cast(arg); - return static_cast(mf->CommandExists(name)); + return static_cast(mf->GetState()->GetCommand(name) ? 1 : 0); } void CCONV cmAddDefineFlag(void *arg, const char* definition) diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index eb4f3a1..0a71c60 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -481,8 +481,10 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList &newArgs, // does a command exist if (this->IsKeyword("COMMAND", *arg) && argP1 != newArgs.end()) { + cmCommand* command = + this->Makefile.GetState()->GetCommand(argP1->c_str()); this->HandlePredicate( - this->Makefile.CommandExists(argP1->c_str()), + command ? true : false, reducible, arg, newArgs, argP1, argP2); } // does a policy exist diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 9297688..fdd1018 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -193,9 +193,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, } std::string newName = "_" + this->Args[0]; - mf.GetCMakeInstance()->RenameCommand(this->Args[0], - newName); - mf.AddCommand(f); + mf.GetState()->RenameCommand(this->Args[0], newName); + mf.GetState()->AddCommand(f); // remove the function blocker now that the function is defined mf.RemoveFunctionBlocker(this, lff); diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index cdfd00c..403f7fc 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -273,7 +273,7 @@ bool cmLoadCommandCommand // create a function blocker and set it up cmLoadedCommand *f = new cmLoadedCommand(); (*initFunction)(&f->info); - this->Makefile->AddCommand(f); + this->Makefile->GetState()->AddCommand(f); return true; } this->SetError("Attempt to load command failed. " diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index b7cbae6..7ac4432 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -232,9 +232,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, f->Functions = this->Functions; mf.RecordPolicies(f->Policies); std::string newName = "_" + this->Args[0]; - mf.GetCMakeInstance()->RenameCommand(this->Args[0], - newName); - mf.AddCommand(f); + mf.GetState()->RenameCommand(this->Args[0], newName); + mf.GetState()->AddCommand(f); // remove the function blocker now that the macro is defined mf.RemoveFunctionBlocker(this, lff); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b1e67f4..be3bcdc 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -244,12 +244,6 @@ void cmMakefile::Print() const #endif } -bool cmMakefile::CommandExists(const char* name) const -{ - return this->GetCMakeInstance()->CommandExists(name); -} - - //---------------------------------------------------------------------------- void cmMakefile::IssueMessage(cmake::MessageType t, std::string const& text) const @@ -340,7 +334,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, static_cast(stack_manager); // Lookup the command prototype. - if(cmCommand* proto = this->GetCMakeInstance()->GetCommand(name)) + if(cmCommand* proto = this->GetState()->GetCommand(name)) { // Clone the prototype. cmsys::auto_ptr pcmd(proto->Clone()); @@ -718,11 +712,6 @@ void cmMakefile::EnforceDirectoryLevelRules() const } } -void cmMakefile::AddCommand(cmCommand* wg) -{ - this->GetCMakeInstance()->AddCommand(wg); -} - // Set the make file void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 43c1b1a..299d550 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -746,14 +746,6 @@ public: bool ExecuteCommand(const cmListFileFunction& lff, cmExecutionStatus &status); - /** Check if a command exists. */ - bool CommandExists(const char* name) const; - - /** - * Add a command to this cmake instance - */ - void AddCommand(cmCommand* ); - ///! Enable support for named language, if nil then all languages are ///enabled. void EnableLanguage(std::vectorconst& languages, bool optional); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 89d5fea..a0f813e 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1758,7 +1758,7 @@ void cmake::AddDefaultCommands() for(std::vector::iterator i = commands.begin(); i != commands.end(); ++i) { - this->AddCommand(*i); + this->State->AddCommand(*i); } } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 11:46:09 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 11:46:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-761-g3ad9fe6 Message-ID: <20150415154609.B39AEAE83F@public.kitware.com> This is an automated email from 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 3ad9fe6329476f2df56903620f9464c834b18d50 (commit) via bb2a42aeca46c993f1a8790aadfa0e86d5e30f9b (commit) from ff742f6823acb14b7ec03ef6e87d717e5493ef12 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ad9fe6329476f2df56903620f9464c834b18d50 commit 3ad9fe6329476f2df56903620f9464c834b18d50 Merge: ff742f6 bb2a42a Author: Brad King AuthorDate: Wed Apr 15 11:46:08 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 11:46:08 2015 -0400 Merge topic 'FindMatlab-test-timeout' bb2a42ae Tests: Increasing the stability of the FindMatlab.basic_checks test ----------------------------------------------------------------------- Summary of changes: Tests/FindMatlab/basic_checks/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 11:46:11 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 11:46:11 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-763-g9212d0a Message-ID: <20150415154611.72EAAAE858@public.kitware.com> This is an automated email from 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 9212d0a75d5f0dd01deb5acbe83fd376862f0948 (commit) via fef1f26749a7dc3839b1e461fb09eecbe97cca90 (commit) from 3ad9fe6329476f2df56903620f9464c834b18d50 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9212d0a75d5f0dd01deb5acbe83fd376862f0948 commit 9212d0a75d5f0dd01deb5acbe83fd376862f0948 Merge: 3ad9fe6 fef1f26 Author: Brad King AuthorDate: Wed Apr 15 11:46:10 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 11:46:10 2015 -0400 Merge topic 'doc-ctest-update-option-wording' fef1f267 Help: Fix {GIT,P4}UpdateCustom documentation (#15512) ----------------------------------------------------------------------- Summary of changes: Help/manual/ctest.1.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 11:46:13 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 11:46:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-765-gfc579b9 Message-ID: <20150415154613.7DF4BAE842@public.kitware.com> This is an automated email from 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 fc579b91e0c2f433c17ce004faa38863c15e8ead (commit) via 9ac05683902c7412476c4514588bff5c016d6ce1 (commit) from 9212d0a75d5f0dd01deb5acbe83fd376862f0948 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc579b91e0c2f433c17ce004faa38863c15e8ead commit fc579b91e0c2f433c17ce004faa38863c15e8ead Merge: 9212d0a 9ac0568 Author: Brad King AuthorDate: Wed Apr 15 11:46:12 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 11:46:12 2015 -0400 Merge topic 'doc-ninja-non-experimental' 9ac05683 Ninja: Drop 'experimental' label in documentation ----------------------------------------------------------------------- Summary of changes: Help/generator/Ninja.rst | 2 +- Source/cmGlobalNinjaGenerator.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 11:46:16 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 11:46:16 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-767-gea394c6 Message-ID: <20150415154616.97870AE890@public.kitware.com> This is an automated email from 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 ea394c63aa39fed008eec86b19a304d04bb302cf (commit) via baef72f2b369b77507969e3362edfc8d7171c43a (commit) from fc579b91e0c2f433c17ce004faa38863c15e8ead (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea394c63aa39fed008eec86b19a304d04bb302cf commit ea394c63aa39fed008eec86b19a304d04bb302cf Merge: fc579b9 baef72f Author: Brad King AuthorDate: Wed Apr 15 11:46:15 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 11:46:15 2015 -0400 Merge topic 'test-xl-preprocess-updates' baef72f2 Tests: Update Preprocess test for XL compiler limitations ----------------------------------------------------------------------- Summary of changes: Tests/Preprocess/CMakeLists.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 11:46:18 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 11:46:18 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-781-g8469b6f Message-ID: <20150415154618.8329FAE85E@public.kitware.com> This is an automated email from 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 8469b6f6941ec8afe30f6c5a94f045e596bfe22a (commit) via 5d056c0dd85934e7a985cb49f97c343e38f20929 (commit) via de722d7d63866613aaa8105b52ee90ffe2721136 (commit) via 9b5f80a83c07b4c840b190f4f9057f2cf0fa03d4 (commit) via 0076b5d8340be81057195e70853d33e8fb66c1db (commit) via 24b7f31d3a2a464cef5955648e4a152a19d44890 (commit) via 0aec49132885be07e1d92a4a1db58f4c6c4c2844 (commit) via 96f8c5f9a3bd60f553af054b43e06ce4864269e0 (commit) via 97e53ebb3cd728e6091f93cb7d4eac91ae417bdb (commit) via 1e738bcf9c7952bc9ae9bfb1be831c9f16998f54 (commit) via 62854e9966a3fe308cff4a76c89f6bf72f76551c (commit) via db8425be18439c899c08294dde117cc137c75d23 (commit) via 74de9a734c92288fb3e602be0d1c967b33b67443 (commit) via b159bff732d4e34a683edd1740604428049d1819 (commit) from ea394c63aa39fed008eec86b19a304d04bb302cf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8469b6f6941ec8afe30f6c5a94f045e596bfe22a commit 8469b6f6941ec8afe30f6c5a94f045e596bfe22a Merge: ea394c6 5d056c0 Author: Brad King AuthorDate: Wed Apr 15 11:46:17 2015 -0400 Commit: CMake Topic Stage CommitDate: Wed Apr 15 11:46:17 2015 -0400 Merge topic 'port-global-properties-to-cmState' 5d056c0d Port Global property interaction to cmState. de722d7d Move property initialization to cmState. 9b5f80a8 Move global properties to cmState. 0076b5d8 cmake: Remove the happy global property scope pattern. 24b7f31d cmake: Remove unused cmCommand methods. 0aec4913 Port cmCommand consumers to cmState. 96f8c5f9 cmState: Move cmCommand-related methods from cmake class. 97e53ebb cmake: Simplify command clean up loop. 1e738bcf cmake: Simplify RemoveUnscriptableCommands algorithm. 62854e99 cmState: Move try_compile state from cmake class. db8425be cmake: Get enabled languages from cmState. 74de9a73 cmGlobalGenerator: Delegate storage of enabled languages to cmState. b159bff7 Move property definition to cmState. ----------------------------------------------------------------------- Summary of changes: Source/CPack/cpack.cxx | 2 +- Source/CTest/cmCTestScriptHandler.cxx | 4 +- Source/CTest/cmCTestSubmitHandler.cxx | 3 +- Source/CTest/cmCTestTestHandler.cxx | 8 +- Source/cmAddLibraryCommand.cxx | 3 +- Source/cmCPluginAPI.cxx | 4 +- Source/cmCTest.cxx | 9 +- Source/cmComputeLinkInformation.cxx | 21 +-- Source/cmComputeTargetDepends.cxx | 7 +- Source/cmConditionEvaluator.cxx | 4 +- Source/cmDefinePropertyCommand.cxx | 3 +- Source/cmExtraEclipseCDT4Generator.cxx | 4 +- Source/cmFindLibraryCommand.cxx | 8 +- Source/cmFindPackageCommand.cxx | 35 +++-- Source/cmFunctionCommand.cxx | 5 +- Source/cmGetCMakePropertyCommand.cxx | 4 +- Source/cmGetPropertyCommand.cxx | 9 +- Source/cmGlobalGenerator.cxx | 30 ++-- Source/cmLoadCommandCommand.cxx | 2 +- Source/cmLocalNinjaGenerator.cxx | 5 +- Source/cmMacroCommand.cxx | 5 +- Source/cmMakefile.cxx | 33 +--- Source/cmMakefile.h | 11 -- Source/cmMakefileTargetGenerator.cxx | 4 +- Source/cmPropertyMap.cxx | 4 +- Source/cmQtAutoGenerators.cxx | 9 +- Source/cmState.cxx | 268 +++++++++++++++++++++++++++++++- Source/cmState.h | 45 ++++++ Source/cmTarget.cxx | 14 -- Source/cmTarget.h | 3 - Source/cmake.cxx | 247 +++-------------------------- Source/cmake.h | 41 ----- 32 files changed, 439 insertions(+), 415 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Apr 15 11:46:35 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 15 Apr 2015 11:46:35 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1850-g57ef5b9 Message-ID: <20150415154635.23DB6AE844@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 57ef5b971e1b05343af7e4c4c41e6aa4baad21dd (commit) via 8469b6f6941ec8afe30f6c5a94f045e596bfe22a (commit) via ea394c63aa39fed008eec86b19a304d04bb302cf (commit) via fc579b91e0c2f433c17ce004faa38863c15e8ead (commit) via 9212d0a75d5f0dd01deb5acbe83fd376862f0948 (commit) via 3ad9fe6329476f2df56903620f9464c834b18d50 (commit) via ff742f6823acb14b7ec03ef6e87d717e5493ef12 (commit) from 092cfc8d804366ba30b44c72af55ad2f23ddbe7c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57ef5b971e1b05343af7e4c4c41e6aa4baad21dd commit 57ef5b971e1b05343af7e4c4c41e6aa4baad21dd Merge: 092cfc8 8469b6f Author: Brad King AuthorDate: Wed Apr 15 11:46:28 2015 -0400 Commit: Brad King CommitDate: Wed Apr 15 11:46:28 2015 -0400 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Apr 16 00:01:08 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 16 Apr 2015 00:01:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-782-g532644e Message-ID: <20150416040108.1FFDEAF4A7@public.kitware.com> This is an automated email from 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 532644ea14135753d1b52b8883c7c6cd380b4dfa (commit) from 8469b6f6941ec8afe30f6c5a94f045e596bfe22a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=532644ea14135753d1b52b8883c7c6cd380b4dfa commit 532644ea14135753d1b52b8883c7c6cd380b4dfa Author: Kitware Robot AuthorDate: Thu Apr 16 00:01:04 2015 -0400 Commit: Kitware Robot CommitDate: Thu Apr 16 00:01:04 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 649f230..056368b 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150415) +set(CMake_VERSION_PATCH 20150416) #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 Apr 16 09:57:18 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 16 Apr 2015 09:57:18 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1852-g0507608 Message-ID: <20150416135718.DD78AAEF69@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 05076086e95ccddba5767ff3417faf567390bf70 (commit) via f0c5444349c6702cca12c254125e4d347c19d32c (commit) from 57ef5b971e1b05343af7e4c4c41e6aa4baad21dd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05076086e95ccddba5767ff3417faf567390bf70 commit 05076086e95ccddba5767ff3417faf567390bf70 Merge: 57ef5b9 f0c5444 Author: Brad King AuthorDate: Thu Apr 16 09:57:18 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 16 09:57:18 2015 -0400 Merge topic 'FPHSA-updates' into next f0c54443 fixup! FPHSA: Always populate the ExactCase_FOUND variable (#15412). http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0c5444349c6702cca12c254125e4d347c19d32c commit f0c5444349c6702cca12c254125e4d347c19d32c Author: Brad King AuthorDate: Thu Apr 16 09:56:00 2015 -0400 Commit: Brad King CommitDate: Thu Apr 16 09:56:00 2015 -0400 fixup! FPHSA: Always populate the ExactCase_FOUND variable (#15412). diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 6fdc917..1be38af 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -249,18 +249,21 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) set(MISSING_VARS "") set(DETAILS "") # check if all passed variables are valid - unset(${_NAME}_FOUND) - unset(${_NAME_UPPER}_FOUND) + set(FPHSA_FOUND_${_NAME} TRUE) foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS}) if(NOT ${_CURRENT_VAR}) - set(${_NAME}_FOUND FALSE) + set(FPHSA_FOUND_${_NAME} FALSE) set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") else() set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") endif() endforeach() - if(NOT "${${_NAME}_FOUND}" STREQUAL "FALSE") + if(FPHSA_FOUND_${_NAME}) set(${_NAME}_FOUND TRUE) + set(${_NAME_UPPER}_FOUND TRUE) + else() + set(${_NAME}_FOUND FALSE) + set(${_NAME_UPPER}_FOUND FALSE) endif() # component handling ----------------------------------------------------------------------- Summary of changes: Modules/FindPackageHandleStandardArgs.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 16 09:58:47 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 16 Apr 2015 09:58:47 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-784-g5a45497 Message-ID: <20150416135847.575A6AF014@public.kitware.com> This is an automated email from 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 5a45497fc116c75823103f77e7123b829669eff3 (commit) via 85c2626babf40d704f133fe49506d25f0a674b5f (commit) from 532644ea14135753d1b52b8883c7c6cd380b4dfa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5a45497fc116c75823103f77e7123b829669eff3 commit 5a45497fc116c75823103f77e7123b829669eff3 Merge: 532644e 85c2626 Author: Brad King AuthorDate: Thu Apr 16 09:58:45 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 16 09:58:45 2015 -0400 Merge topic 'vs6-deprecate' 85c2626b Deprecate Visual Studio 6 generator ----------------------------------------------------------------------- Summary of changes: Help/generator/Visual Studio 6.rst | 8 +++++++- Help/release/dev/vs6-deprecate.rst | 5 +++++ Source/cmGlobalVisualStudio6Generator.cxx | 18 +++++++++++++++++- .../RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake | 0 .../CommandLine/DeprecateVS6-WARN-ON-stderr.txt | 5 +++++ .../RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake | 0 Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 7 +++++++ Tests/RunCMake/RunCMake.cmake | 3 +++ 8 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/vs6-deprecate.rst copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake (100%) create mode 100644 Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake (100%) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 16 09:58:49 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 16 Apr 2015 09:58:49 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-786-gab033b0 Message-ID: <20150416135849.B1F29AF01D@public.kitware.com> This is an automated email from 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 ab033b07898945afbd248c66529c27fca7fa9e0e (commit) via 7b8e7c4ac3885b9a58ce1c238b045d5580f83c27 (commit) from 5a45497fc116c75823103f77e7123b829669eff3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab033b07898945afbd248c66529c27fca7fa9e0e commit ab033b07898945afbd248c66529c27fca7fa9e0e Merge: 5a45497 7b8e7c4 Author: Brad King AuthorDate: Thu Apr 16 09:58:48 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 16 09:58:48 2015 -0400 Merge topic 'vs70-deprecate' 7b8e7c4a Deprecate Visual Studio 7 generator (.NET 2002) ----------------------------------------------------------------------- Summary of changes: Help/generator/Visual Studio 7.rst | 8 +++++++- Help/release/dev/vs70-deprecate.rst | 5 +++++ Source/cmGlobalVisualStudio7Generator.cxx | 19 ++++++++++++++++++- .../CommandLine/DeprecateVS70-WARN-OFF.cmake | 0 .../CommandLine/DeprecateVS70-WARN-ON-stderr.txt | 5 +++++ .../CommandLine/DeprecateVS70-WARN-ON.cmake | 0 Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 5 +++++ Tests/RunCMake/RunCMake.cmake | 3 +++ 8 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/vs70-deprecate.rst copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/DeprecateVS70-WARN-OFF.cmake (100%) create mode 100644 Tests/RunCMake/CommandLine/DeprecateVS70-WARN-ON-stderr.txt copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CommandLine/DeprecateVS70-WARN-ON.cmake (100%) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 16 09:58:51 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 16 Apr 2015 09:58:51 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-788-g2ee128d Message-ID: <20150416135851.CF7D0AF028@public.kitware.com> This is an automated email from 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 2ee128d9c8440b056e495cabc2efe411607ee568 (commit) via 885ab9ab37b1f4c094036814882886f5ec9efaf4 (commit) from ab033b07898945afbd248c66529c27fca7fa9e0e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ee128d9c8440b056e495cabc2efe411607ee568 commit 2ee128d9c8440b056e495cabc2efe411607ee568 Merge: ab033b0 885ab9a Author: Brad King AuthorDate: Thu Apr 16 09:58:50 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 16 09:58:50 2015 -0400 Merge topic 'vs10-no-macros' 885ab9ab VS: Drop reload macros for VS >= 10 (#11258,#14680) ----------------------------------------------------------------------- Summary of changes: Help/release/dev/vs10-no-macros.rst | 9 ++++++++ Source/cmGlobalVisualStudio10Generator.cxx | 33 ---------------------------- Source/cmGlobalVisualStudio10Generator.h | 15 +++---------- Source/cmGlobalVisualStudio11Generator.h | 2 -- Source/cmGlobalVisualStudio12Generator.h | 3 --- Source/cmGlobalVisualStudio14Generator.h | 3 --- Source/cmGlobalVisualStudioGenerator.h | 4 ++-- 7 files changed, 14 insertions(+), 55 deletions(-) create mode 100644 Help/release/dev/vs10-no-macros.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 16 09:58:53 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 16 Apr 2015 09:58:53 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-790-g53ef9a0 Message-ID: <20150416135853.F02F9AF045@public.kitware.com> This is an automated email from 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 53ef9a0a9e2937cbda9939593188f3bc75ef24ee (commit) via dd7e31bc15471b5c3ea31fcbe2002650780e78b6 (commit) from 2ee128d9c8440b056e495cabc2efe411607ee568 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53ef9a0a9e2937cbda9939593188f3bc75ef24ee commit 53ef9a0a9e2937cbda9939593188f3bc75ef24ee Merge: 2ee128d dd7e31b Author: Brad King AuthorDate: Thu Apr 16 09:58:52 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 16 09:58:52 2015 -0400 Merge topic 'UseSWIG-use-absolute-path' dd7e31bc UseSWIG: Fix module name detection with relative source file (#15508) ----------------------------------------------------------------------- Summary of changes: Modules/UseSWIG.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 16 09:59:15 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 16 Apr 2015 09:59:15 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1858-g207ec8f Message-ID: <20150416135915.7707BAF06E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 207ec8f5e4c025961831c33d2c11bd020e274240 (commit) via 53ef9a0a9e2937cbda9939593188f3bc75ef24ee (commit) via 2ee128d9c8440b056e495cabc2efe411607ee568 (commit) via ab033b07898945afbd248c66529c27fca7fa9e0e (commit) via 5a45497fc116c75823103f77e7123b829669eff3 (commit) via 532644ea14135753d1b52b8883c7c6cd380b4dfa (commit) from 05076086e95ccddba5767ff3417faf567390bf70 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=207ec8f5e4c025961831c33d2c11bd020e274240 commit 207ec8f5e4c025961831c33d2c11bd020e274240 Merge: 0507608 53ef9a0 Author: Brad King AuthorDate: Thu Apr 16 09:59:06 2015 -0400 Commit: Brad King CommitDate: Thu Apr 16 09:59:06 2015 -0400 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 Apr 16 15:18:28 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 16 Apr 2015 15:18:28 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1864-g6011ea1 Message-ID: <20150416191828.5FA60AF16E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 6011ea115ef6b87d51179fd606cd98fac1503e92 (commit) via e8fdd5f12a379ce91adcb88acdb4354bc271c911 (commit) via 15f1a6b49958cc7757f951839b02a00e8c820154 (commit) via 3f7c7c65968b6d04babd261dab952ee40e0c9ca9 (commit) via 26b5cc5e79320dd73e93e117fffd0d4554e89dbc (commit) via 4556640855515b287dd8a5a0f7fb1a85218267a8 (commit) from 207ec8f5e4c025961831c33d2c11bd020e274240 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6011ea115ef6b87d51179fd606cd98fac1503e92 commit 6011ea115ef6b87d51179fd606cd98fac1503e92 Merge: 207ec8f e8fdd5f Author: Brad King AuthorDate: Thu Apr 16 15:18:26 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 16 15:18:26 2015 -0400 Merge topic 'ninja-autogen' into next e8fdd5f1 QtAutogen: Workaround rcc CRCRLF newlines on Windows (#15459) 15f1a6b4 Tests/QtAutogen: Avoid touching files in the source tree 3f7c7c65 Tests/QtAutogen: Help Qt5Autogen test find Qt5 on Windows 26b5cc5e Tests/QtAutogen: Enable per-config source tests when possible 45566408 Tests/QtAutogen: Require CMake 3.1 to set policies everywhere http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e8fdd5f12a379ce91adcb88acdb4354bc271c911 commit e8fdd5f12a379ce91adcb88acdb4354bc271c911 Author: Brad King AuthorDate: Thu Apr 16 12:51:05 2015 -0400 Commit: Brad King CommitDate: Thu Apr 16 15:10:40 2015 -0400 QtAutogen: Workaround rcc CRCRLF newlines on Windows (#15459) The 'rcc --list' operation may print newlines of the form CRCRLF, so strip any trailing CR characters found on each line. Update the Tests/QtAutogen test to use a resource named in a subdirectory. This causes 'rcc --list' to display a blank line and tests that it is correctly filtered out. diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 4cb49c8..a5238f5 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -201,6 +201,13 @@ std::string cmQtAutoGenerators::ListQt5RccInputs(cmSourceFile* sf, std::string oline; while(std::getline(ostr, oline)) { + // Strip CR characters rcc may have printed (possibly more than one!). + std::string::size_type cr = oline.find('\r'); + if (cr != oline.npos) + { + oline = oline.substr(0, cr); + } + if (oline.empty()) { // The output of rcc --list contains many empty lines. diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 67e0f7e..f76d11e 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -147,7 +147,7 @@ set(timeformat "%Y%j%H%M%S") file(TIMESTAMP "${qrc_file1}" file1_before "${timeformat}") execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change. -execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/autorcc_depends/res1_input.txt") +execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/autorcc_depends/res1/input.txt") execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/autorcc_depends" diff --git a/Tests/QtAutogen/autorcc_depends/CMakeLists.txt b/Tests/QtAutogen/autorcc_depends/CMakeLists.txt index 9faf803..fbe71ad 100644 --- a/Tests/QtAutogen/autorcc_depends/CMakeLists.txt +++ b/Tests/QtAutogen/autorcc_depends/CMakeLists.txt @@ -16,7 +16,7 @@ else() endif() configure_file(res1.qrc.in res1.qrc @ONLY) -configure_file(res1_input.txt.in res1_input.txt @ONLY) +configure_file(res1/input.txt.in res1/input.txt @ONLY) add_executable(test_res1 test_res1.cpp diff --git a/Tests/QtAutogen/autorcc_depends/res1.qrc.in b/Tests/QtAutogen/autorcc_depends/res1.qrc.in index cfea618..2a5417b 100644 --- a/Tests/QtAutogen/autorcc_depends/res1.qrc.in +++ b/Tests/QtAutogen/autorcc_depends/res1.qrc.in @@ -1,5 +1,5 @@ - res1_input.txt + res1/input.txt diff --git a/Tests/QtAutogen/autorcc_depends/res1_input.txt.in b/Tests/QtAutogen/autorcc_depends/res1/input.txt.in similarity index 100% rename from Tests/QtAutogen/autorcc_depends/res1_input.txt.in rename to Tests/QtAutogen/autorcc_depends/res1/input.txt.in http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15f1a6b49958cc7757f951839b02a00e8c820154 commit 15f1a6b49958cc7757f951839b02a00e8c820154 Author: Brad King AuthorDate: Thu Apr 16 13:56:23 2015 -0400 Commit: Brad King CommitDate: Thu Apr 16 15:06:32 2015 -0400 Tests/QtAutogen: Avoid touching files in the source tree diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 81a70f4..67e0f7e 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -147,7 +147,7 @@ set(timeformat "%Y%j%H%M%S") file(TIMESTAMP "${qrc_file1}" file1_before "${timeformat}") execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change. -execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_SOURCE_DIR}/autorcc_depends/res1_input.txt") +execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/autorcc_depends/res1_input.txt") execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/autorcc_depends" diff --git a/Tests/QtAutogen/autorcc_depends/CMakeLists.txt b/Tests/QtAutogen/autorcc_depends/CMakeLists.txt index 0ba86cf..9faf803 100644 --- a/Tests/QtAutogen/autorcc_depends/CMakeLists.txt +++ b/Tests/QtAutogen/autorcc_depends/CMakeLists.txt @@ -15,9 +15,12 @@ else() set(QT_CORE_TARGET Qt5::Core) endif() +configure_file(res1.qrc.in res1.qrc @ONLY) +configure_file(res1_input.txt.in res1_input.txt @ONLY) + add_executable(test_res1 test_res1.cpp - res1.qrc + ${CMAKE_CURRENT_BINARY_DIR}/res1.qrc ) target_link_libraries(test_res1 ${QT_CORE_TARGET}) add_custom_command(TARGET test_res1 POST_BUILD COMMAND diff --git a/Tests/QtAutogen/autorcc_depends/res1.qrc b/Tests/QtAutogen/autorcc_depends/res1.qrc.in similarity index 100% rename from Tests/QtAutogen/autorcc_depends/res1.qrc rename to Tests/QtAutogen/autorcc_depends/res1.qrc.in diff --git a/Tests/QtAutogen/autorcc_depends/res1_input.txt b/Tests/QtAutogen/autorcc_depends/res1_input.txt.in similarity index 100% rename from Tests/QtAutogen/autorcc_depends/res1_input.txt rename to Tests/QtAutogen/autorcc_depends/res1_input.txt.in http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f7c7c65968b6d04babd261dab952ee40e0c9ca9 commit 3f7c7c65968b6d04babd261dab952ee40e0c9ca9 Author: Brad King AuthorDate: Thu Apr 16 13:54:54 2015 -0400 Commit: Brad King CommitDate: Thu Apr 16 15:06:31 2015 -0400 Tests/QtAutogen: Help Qt5Autogen test find Qt5 on Windows Set CMAKE_PREFIX_PATH to tell find_package(Qt5) where to look. diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 7b46619..81a70f4 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 3.1) project(QtAutogen) +# Tell find_package(Qt5) where to find Qt. +if(QT_QMAKE_EXECUTABLE) + get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH) + get_filename_component(Qt_PREFIX_DIR "${Qt_BIN_DIR}" PATH) + set(CMAKE_PREFIX_PATH ${Qt_PREFIX_DIR}) +endif() + if (QT_TEST_VERSION STREQUAL 4) find_package(Qt4 REQUIRED) @@ -124,6 +131,7 @@ try_compile(RCC_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/autorcc_depends" autorcc_depends CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" "-DQT_TEST_VERSION=${QT_TEST_VERSION}" + "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}" OUTPUT_VARIABLE output ) if (NOT RCC_DEPENDS) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26b5cc5e79320dd73e93e117fffd0d4554e89dbc commit 26b5cc5e79320dd73e93e117fffd0d4554e89dbc Author: Brad King AuthorDate: Thu Apr 16 13:30:32 2015 -0400 Commit: Brad King CommitDate: Thu Apr 16 15:00:26 2015 -0400 Tests/QtAutogen: Enable per-config source tests when possible Pass CMAKE_BUILD_TYPE into the test on generators that use it so that the per-config part of the test can activate as needed. Do not make the per-config part conditional on the Debug configuration because the generator expressions evaluate to empty in other configurations. Skip the per-config source case with the Ninja generator because it does not currently work. cmQtAutoGenerators::InitializeAutogenTarget needs to know the list of source files on a target, but generator expressions in the list cannot be evaluated until after CreateGeneratorTargets has been called. That cannot happen until after Autogen targets have been generated. It is a chicken-and-egg problem. diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 41032f8..1655f12 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1173,10 +1173,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release set(run_autogen_test QtAutogen) set(run_autouic_test QtAutoUicInterface) endif() + if(NOT CMAKE_CONFIGURATION_TYPES) + set(QtAutogen_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$) + endif() find_package(Qt5Widgets QUIET NO_MODULE) if(Qt5Widgets_FOUND) - add_test(Qt5Autogen ${CMAKE_CTEST_COMMAND} + add_test(NAME Qt5Autogen COMMAND ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/QtAutogen" "${CMake_BINARY_DIR}/Tests/Qt5Autogen" @@ -1186,6 +1189,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release --force-new-ctest-process --build-options ${build_options} -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5 + ${QtAutogen_BUILD_OPTIONS} --test-command ${run_autogen_test} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Autogen") @@ -1205,7 +1209,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface") endif() if(QT4_WORKS AND QT_QTGUI_FOUND) - add_test(Qt4Autogen ${CMAKE_CTEST_COMMAND} + add_test(NAME Qt4Autogen COMMAND ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/QtAutogen" "${CMake_BINARY_DIR}/Tests/Qt4Autogen" @@ -1215,6 +1219,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release --force-new-ctest-process --build-options ${build_options} -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4 + ${QtAutogen_BUILD_OPTIONS} --test-command ${run_autogen_test} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Autogen") diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 87ade2c..7b46619 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -67,10 +67,9 @@ add_custom_command( DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" ) -message("CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") -if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" AND NOT CMAKE_CONFIGURATION_TYPES) +if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_GENERATOR STREQUAL Ninja) set(debug_srcs "$<$:debug_class.cpp>" $<$:debug_resource.qrc>) - add_definitions(-DTEST_DEBUG_CLASS) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$:TEST_DEBUG_CLASS>) endif() # The -no-protection option disables the generation of include guards. Verify http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4556640855515b287dd8a5a0f7fb1a85218267a8 commit 4556640855515b287dd8a5a0f7fb1a85218267a8 Author: Brad King AuthorDate: Thu Apr 16 13:57:17 2015 -0400 Commit: Brad King CommitDate: Thu Apr 16 14:18:00 2015 -0400 Tests/QtAutogen: Require CMake 3.1 to set policies everywhere We want CMP0020 set in the autorcc_depends test. Also the test should now only run when we can support per-config source files. diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 0dc98e3..87ade2c 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1) project(QtAutogen) diff --git a/Tests/QtAutogen/autorcc_depends/CMakeLists.txt b/Tests/QtAutogen/autorcc_depends/CMakeLists.txt index afd95bc..0ba86cf 100644 --- a/Tests/QtAutogen/autorcc_depends/CMakeLists.txt +++ b/Tests/QtAutogen/autorcc_depends/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.1) project(autorcc_depends) set(CMAKE_AUTORCC ON) ----------------------------------------------------------------------- Summary of changes: Source/cmQtAutoGenerators.cxx | 7 +++++++ Tests/CMakeLists.txt | 9 +++++++-- Tests/QtAutogen/CMakeLists.txt | 17 ++++++++++++----- Tests/QtAutogen/autorcc_depends/CMakeLists.txt | 7 +++++-- .../autorcc_depends/{res1.qrc => res1.qrc.in} | 2 +- .../{res1_input.txt => res1/input.txt.in} | 0 6 files changed, 32 insertions(+), 10 deletions(-) rename Tests/QtAutogen/autorcc_depends/{res1.qrc => res1.qrc.in} (61%) rename Tests/QtAutogen/autorcc_depends/{res1_input.txt => res1/input.txt.in} (100%) hooks/post-receive -- CMake From brad.king at kitware.com Thu Apr 16 15:24:47 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 16 Apr 2015 15:24:47 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1866-g0b6e3bc Message-ID: <20150416192447.D25DDAF641@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0b6e3bc038ade69cb945c663416d4f2acece840a (commit) via d19a3ec889c0a74ec256ed62281dcef22f17515b (commit) from 6011ea115ef6b87d51179fd606cd98fac1503e92 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b6e3bc038ade69cb945c663416d4f2acece840a commit 0b6e3bc038ade69cb945c663416d4f2acece840a Merge: 6011ea1 d19a3ec Author: Brad King AuthorDate: Thu Apr 16 15:24:46 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 16 15:24:46 2015 -0400 Merge topic 'add-GreenHills-MULTI-generator' into next d19a3ec8 GHS: changed library project structure http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d19a3ec889c0a74ec256ed62281dcef22f17515b commit d19a3ec889c0a74ec256ed62281dcef22f17515b Author: Geoff Viola AuthorDate: Wed Apr 15 23:12:34 2015 -0600 Commit: Brad King CommitDate: Thu Apr 16 15:22:18 2015 -0400 GHS: changed library project structure diff --git a/Source/cmGhsMultiGpj.cxx b/Source/cmGhsMultiGpj.cxx index e47d583..e1dce52 100644 --- a/Source/cmGhsMultiGpj.cxx +++ b/Source/cmGhsMultiGpj.cxx @@ -22,6 +22,9 @@ void GhsMultiGpj::WriteGpjTag(Types const gpjType, case INTERGRITY_APPLICATION: tag = "INTEGRITY Application"; break; + case LIBRARY: + tag = "Library"; + break; case PROJECT: tag = "Project"; break; diff --git a/Source/cmGhsMultiGpj.h b/Source/cmGhsMultiGpj.h index 7e5b942..91ff0f4 100644 --- a/Source/cmGhsMultiGpj.h +++ b/Source/cmGhsMultiGpj.h @@ -20,6 +20,7 @@ public: enum Types { INTERGRITY_APPLICATION, + LIBRARY, PROJECT, PROGRAM, REFERENCE, diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 0a116ac..01e2011 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -144,7 +144,10 @@ void cmGhsMultiTargetGenerator::Generate() this->WriteCompilerFlags(config, language); this->WriteCompilerDefinitions(config, language); this->WriteIncludes(config, language); - this->WriteTargetLinkLibraries(); + if (this->Target->GetType() == cmTarget::EXECUTABLE) + { + this->WriteTargetLinkLibraries(); + } this->WriteCustomCommands(); if (this->DynamicDownload) { @@ -187,6 +190,10 @@ GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag(const cmTarget *target) { output = GhsMultiGpj::INTERGRITY_APPLICATION; } + else if (target->GetType() == cmTarget::STATIC_LIBRARY) + { + output = GhsMultiGpj::LIBRARY; + } else { output = GhsMultiGpj::PROGRAM; @@ -209,7 +216,6 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config, if (this->Target->GetType() == cmTarget::STATIC_LIBRARY) { - *this->GetFolderBuildStreams() << " -relobj" << std::endl; *this->GetFolderBuildStreams() << " {optgroup=GhsCommonOptions} -o \"" << outputDir << outputFilename << ".a\"" << std::endl; ----------------------------------------------------------------------- Summary of changes: Source/cmGhsMultiGpj.cxx | 3 +++ Source/cmGhsMultiGpj.h | 1 + Source/cmGhsMultiTargetGenerator.cxx | 10 ++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From domen.vrankar at gmail.com Thu Apr 16 16:17:05 2015 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Thu, 16 Apr 2015 16:17:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1868-gc64fd6c Message-ID: <20150416201705.63610AF588@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c64fd6c01544f0a1d70b58c4fce675b2eb629996 (commit) via 0779b679e59b80ce458c0422a673b36de3a8f4c5 (commit) from 0b6e3bc038ade69cb945c663416d4f2acece840a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c64fd6c01544f0a1d70b58c4fce675b2eb629996 commit c64fd6c01544f0a1d70b58c4fce675b2eb629996 Merge: 0b6e3bc 0779b67 Author: Domen Vrankar AuthorDate: Thu Apr 16 16:17:04 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 16 16:17:04 2015 -0400 Merge topic 'cpack-one-component-only-fixup' into next 0779b679 fixup! CPack single component packaging http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0779b679e59b80ce458c0422a673b36de3a8f4c5 commit 0779b679e59b80ce458c0422a673b36de3a8f4c5 Author: Raffi Enficiaud AuthorDate: Thu Apr 16 22:14:51 2015 +0200 Commit: Domen Vrankar CommitDate: Thu Apr 16 22:14:51 2015 +0200 fixup! CPack single component packaging Component packaging should be enabled if either at least one component or one group is set and should not require both. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 995eb0d..4f37041 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1501,8 +1501,8 @@ bool cmCPackGenerator::WantsComponentInstallation() const { return (!IsOn("CPACK_MONOLITHIC_INSTALL") && SupportsComponentInstallation() - // check that package at least has components - && !(this->ComponentGroups.empty() || this->Components.empty())); + // check that we have at least one group or component + && (!this->ComponentGroups.empty() || !this->Components.empty())); } //---------------------------------------------------------------------- ----------------------------------------------------------------------- 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 Thu Apr 16 16:30:10 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 16 Apr 2015 16:30:10 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1870-g9d4cc1d Message-ID: <20150416203010.08A9EAFB02@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9d4cc1d7b186eb2665e2db3223a6d28874ca4076 (commit) via ed0b06308523e56f6df5de9abdb5211e908ce772 (commit) from c64fd6c01544f0a1d70b58c4fce675b2eb629996 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d4cc1d7b186eb2665e2db3223a6d28874ca4076 commit 9d4cc1d7b186eb2665e2db3223a6d28874ca4076 Merge: c64fd6c ed0b063 Author: Brad King AuthorDate: Thu Apr 16 16:30:09 2015 -0400 Commit: CMake Topic Stage CommitDate: Thu Apr 16 16:30:09 2015 -0400 Merge topic 'cpack-one-component-only' into next ed0b0630 CPack: Fix single component packaging http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed0b06308523e56f6df5de9abdb5211e908ce772 commit ed0b06308523e56f6df5de9abdb5211e908ce772 Author: Raffi Enficiaud AuthorDate: Thu Apr 16 22:14:51 2015 +0200 Commit: Brad King CommitDate: Thu Apr 16 16:29:33 2015 -0400 CPack: Fix single component packaging Refine logic added in commit 0ffd3534 (CPack single component packaging, 2015-04-02). Component packaging should be enabled if either at least one component or one group is set and should not require both. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 995eb0d..4f37041 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1501,8 +1501,8 @@ bool cmCPackGenerator::WantsComponentInstallation() const { return (!IsOn("CPACK_MONOLITHIC_INSTALL") && SupportsComponentInstallation() - // check that package at least has components - && !(this->ComponentGroups.empty() || this->Components.empty())); + // check that we have at least one group or component + && (!this->ComponentGroups.empty() || !this->Components.empty())); } //---------------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Fri Apr 17 00:01:10 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 17 Apr 2015 00:01:10 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-791-ga4d201a Message-ID: <20150417040111.B9DDCAF6E9@public.kitware.com> This is an automated email from 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 a4d201a747c6d56205aa180b19aab64f5880322c (commit) from 53ef9a0a9e2937cbda9939593188f3bc75ef24ee (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a4d201a747c6d56205aa180b19aab64f5880322c commit a4d201a747c6d56205aa180b19aab64f5880322c Author: Kitware Robot AuthorDate: Fri Apr 17 00:01:05 2015 -0400 Commit: Kitware Robot CommitDate: Fri Apr 17 00:01:05 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 056368b..85c6992 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150416) +set(CMake_VERSION_PATCH 20150417) #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 Apr 17 08:08:07 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 17 Apr 2015 08:08:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, maint, updated. v3.2.2 Message-ID: <20150417120807.3C209AFAE0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, maint has been updated via 91d5261b58e97107fca610a868fbc283cbb8c856 (commit) via 74337b87acd837b9631f44b4df3027fe83ee9b42 (commit) via 9660a3cceae12ebb3cdc49484dcef590a12eb33c (commit) via 5c08e2559cf8ad5fc3cb220396016cf816a7b4b8 (commit) via 0740677b9c67cfe8d26c9cf4cbddb8410d7f920a (commit) via 048c6d19253759b1a4405813afc4272c28721c05 (commit) via 0af4b40b6efee388251a9ee5ee22e9cfa90af7fe (commit) via d8126d3784c149f1738865cc239a34fdd29ec442 (commit) via 1f33b45d5daca380e0be0ecfc595eac881328f29 (commit) via 50806a1e26e536bb5cff1d3f1768211a867de8cf (commit) via af61d6cb60a38069fb82f54bd7f2eb2b798bf4dc (commit) via 94d3988c3f75e41b750092a76c01713dc25d33fd (commit) via 4a2ff2b7f27e569032f6c5881e17cb053b32ccc7 (commit) via d449ec2f28ff5791a53e694a766cea75f5e1bb44 (commit) via dc311f5f9dc38b0368e5c0dd11854bb66d6f2093 (commit) via dcf298008f60fa00ddcb225b7a474317ad4d317f (commit) via 1f289095f908fddd64152c5686bec25eecbc66d6 (commit) from 732d8a467ab8a295b1bbf580f865980f8a1a9b29 (commit) Those revisions listed 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/FindMFC.cmake | 2 +- Source/CMakeVersion.cmake | 2 +- Source/cmFileLockUnix.cxx | 4 ++ Source/cmFileLockWin32.cxx | 3 + Source/cmMakefileTargetGenerator.cxx | 58 +++++++++++-------- Source/cmMakefileTargetGenerator.h | 3 +- Source/kwsys/SystemTools.cxx | 17 ++++-- Tests/BuildDepends/CMakeLists.txt | 65 ++++++++++++++++++++++ Tests/BuildDepends/Project/CMakeLists.txt | 18 ++++++ Utilities/cmcurl/CMakeLists.txt | 10 +++- Utilities/cmlibarchive/libarchive/archive_util.c | 8 ++- Utilities/cmliblzma/CMakeLists.txt | 10 ++++ Utilities/cmliblzma/config.h.in | 8 ++- 13 files changed, 169 insertions(+), 39 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 17 10:46:53 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 17 Apr 2015 10:46:53 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1874-g0da7fc8 Message-ID: <20150417144653.8EA0EAF184@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0da7fc85681d25e585b1a90f93af0ad23f9fdc82 (commit) via 84f06d0c84a7db85561cca044780d3ca92c9c3a3 (commit) via a3ad275ce08784493267604d57207fce14602c48 (commit) via d1a6d15bcd4df3d3e347411bd457be32275fb594 (commit) from 9d4cc1d7b186eb2665e2db3223a6d28874ca4076 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0da7fc85681d25e585b1a90f93af0ad23f9fdc82 commit 0da7fc85681d25e585b1a90f93af0ad23f9fdc82 Merge: 9d4cc1d 84f06d0 Author: Brad King AuthorDate: Fri Apr 17 10:46:52 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 17 10:46:52 2015 -0400 Merge topic 'FPHSA-updates' into next 84f06d0c FPHSA: Document REQUIRED_VARS recommendation (#15352) a3ad275c FPHSA: Revise and format documentation d1a6d15b FPHSA: Always populate the ExactCase_FOUND variable (#15412). http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=84f06d0c84a7db85561cca044780d3ca92c9c3a3 commit 84f06d0c84a7db85561cca044780d3ca92c9c3a3 Author: Brad King AuthorDate: Wed Apr 15 11:32:26 2015 -0400 Commit: Brad King CommitDate: Fri Apr 17 10:46:25 2015 -0400 FPHSA: Document REQUIRED_VARS recommendation (#15352) State explicitly that the variables specified are user-facing. diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index a88eaec..1be38af 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -49,6 +49,10 @@ valid filepaths. ``REQUIRED_VARS ...`` Specify the variables which are required for this package. + These may be named in the generated failure message asking the + user to set the missing variable values. Therefore these should + typically be cache entries such as ``FOO_LIBRARY`` and not output + variables like ``FOO_LIBRARIES``. ``VERSION_VAR `` Specify the name of a variable that holds the version of the package http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a3ad275ce08784493267604d57207fce14602c48 commit a3ad275ce08784493267604d57207fce14602c48 Author: Brad King AuthorDate: Wed Apr 15 11:30:28 2015 -0400 Commit: Brad King CommitDate: Fri Apr 17 10:46:24 2015 -0400 FPHSA: Revise and format documentation Use better reStructuredText markup and add cross-references. diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index bf5e921..a88eaec 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -1,113 +1,126 @@ -#.rst: -# FindPackageHandleStandardArgs -# ----------------------------- -# -# -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS( ... ) -# -# This function is intended to be used in FindXXX.cmake modules files. -# It handles the REQUIRED, QUIET and version-related arguments to -# find_package(PackageName). It also sets the _FOUND -# variable. The package is considered found if all variables ... -# listed contain valid results, e.g. valid filepaths. -# -# There are two modes of this function. The first argument in both -# modes is the name of the Find-module where it is called (in original -# casing). -# -# The first simple mode looks like this: -# -# :: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS( -# (DEFAULT_MSG|"Custom failure message") ... ) -# -# If the variables to are all valid, then -# _FOUND will be set to TRUE. If DEFAULT_MSG is given -# as second argument, then the function will generate itself useful -# success and error messages. You can also supply a custom error -# message for the failure case. This is not recommended. -# -# The second mode is more powerful and also supports version checking: -# -# :: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS( -# [FOUND_VAR ] -# [REQUIRED_VARS ...] -# [VERSION_VAR ] -# [HANDLE_COMPONENTS] -# [CONFIG_MODE] -# [FAIL_MESSAGE "Custom failure message"] ) -# -# The FOUND_VAR option is obsolete. ``FIND_PACKAGE_HANDLE_STANDARD_ARGS`` -# always populates ``_FOUND``. For backward compatibility, -# it also always populates ``_FOUND``. -# -# As in the simple mode, if through are all valid, -# _FOUND will be set to TRUE. After REQUIRED_VARS the -# variables which are required for this package are listed. Following -# VERSION_VAR the name of the variable can be specified which holds the -# version of the package which has been found. If this is done, this -# version will be checked against the (potentially) specified required -# version used in the find_package() call. The EXACT keyword is also -# handled. The default messages include information about the required -# version and the version which has been actually found, both if the -# version is ok or not. If the package supports components, use the -# HANDLE_COMPONENTS option to enable handling them. In this case, -# find_package_handle_standard_args() will report which components have -# been found and which are missing, and the _FOUND variable -# will be set to FALSE if any of the required components (i.e. not the -# ones listed after OPTIONAL_COMPONENTS) are missing. Use the option -# CONFIG_MODE if your FindXXX.cmake module is a wrapper for a -# find_package(... NO_MODULE) call. In this case VERSION_VAR will be -# set to _VERSION and the macro will automatically check whether -# the Config module was found. Via FAIL_MESSAGE a custom failure -# message can be specified, if this is not used, the default message -# will be displayed. -# -# Example for mode 1: -# -# :: -# -# find_package_handle_standard_args(LibXml2 DEFAULT_MSG -# LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) -# -# -# -# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and -# LIBXML2_INCLUDE_DIR are valid. Then also LibXml2_FOUND is set to -# TRUE. If it is not found and REQUIRED was used, it fails with -# FATAL_ERROR, independent whether QUIET was used or not. If it is -# found, success will be reported, including the content of . On -# repeated Cmake runs, the same message won't be printed again. -# -# Example for mode 2: -# -# :: -# -# find_package_handle_standard_args(LibXslt -# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS -# VERSION_VAR LibXslt_VERSION_STRING) -# -# In this case, LibXslt is considered to be found if the variable(s) -# listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and -# LibXslt_INCLUDE_DIRS in this case. Also the version of LibXslt will be -# checked by using the version contained in LibXslt_VERSION_STRING. Since -# no FAIL_MESSAGE is given, the default messages will be printed. -# -# Another example for mode 2: -# -# :: -# -# find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4) -# find_package_handle_standard_args(Automoc4 CONFIG_MODE) -# -# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 -# NO_MODULE) and adds an additional search directory for automoc4. The -# following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper -# success/error message. +#[=======================================================================[.rst: +FindPackageHandleStandardArgs +----------------------------- + +This module provides a function intended to be used in :ref:`Find Modules` +implementing :command:`find_package()` calls. It handles the +``REQUIRED``, ``QUIET`` and version-related arguments of ``find_package``. +It also sets the ``_FOUND`` variable. The package is +considered found if all variables listed contain valid results, e.g. +valid filepaths. + +.. command:: find_package_handle_standard_args + + There are two signatures:: + + find_package_handle_standard_args( + (DEFAULT_MSG|) + ... + ) + + find_package_handle_standard_args( + [FOUND_VAR ] + [REQUIRED_VARS ...] + [VERSION_VAR ] + [HANDLE_COMPONENTS] + [CONFIG_MODE] + [FAIL_MESSAGE ] + ) + + The ``_FOUND`` variable will be set to ``TRUE`` if all + the variables ``...`` are valid and any optional + constraints are satisfied, and ``FALSE`` otherwise. A success or + failure message may be displayed based on the results and on + whether the ``REQUIRED`` and/or ``QUIET`` option was given to + the :command:`find_package` call. + + The options are: + + ``(DEFAULT_MSG|)`` + In the simple signature this specifies the failure message. + Use ``DEFAULT_MSG`` to ask for a default message to be computed + (recommended). Not valid in the full signature. + + ``FOUND_VAR `` + Obselete. Specifies either ``_FOUND`` or + ``_FOUND`` as the result variable. This exists only + for compatibility with older versions of CMake and is now ignored. + Result variables of both names are always set for compatibility. + + ``REQUIRED_VARS ...`` + Specify the variables which are required for this package. + + ``VERSION_VAR `` + Specify the name of a variable that holds the version of the package + that has been found. This version will be checked against the + (potentially) specified required version given to the + :command:`find_package` call, including its ``EXACT`` option. + The default messages include information about the required + version and the version which has been actually found, both + if the version is ok or not. + + ``HANDLE_COMPONENTS`` + Enable handling of package components. In this case, the command + will report which components have been found and which are missing, + and the ``_FOUND`` variable will be set to ``FALSE`` + if any of the required components (i.e. not the ones listed after + the ``OPTIONAL_COMPONENTS`` option of :command:`find_package`) are + missing. + + ``CONFIG_MODE`` + Specify that the calling find module is a wrapper around a + call to ``find_package( NO_MODULE)``. This implies + a ``VERSION_VAR`` value of ``_VERSION``. The command + will automatically check whether the package configuration file + was found. + + ``FAIL_MESSAGE `` + Specify a custom failure message instead of using the default + generated message. Not recommended. + +Example for the simple signature: + +.. code-block:: cmake + + find_package_handle_standard_args(LibXml2 DEFAULT_MSG + LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) + +The ``LibXml2`` package is considered to be found if both +``LIBXML2_LIBRARY`` and ``LIBXML2_INCLUDE_DIR`` are valid. +Then also ``LibXml2_FOUND`` is set to ``TRUE``. If it is not found +and ``REQUIRED`` was used, it fails with a +:command:`message(FATAL_ERROR)`, independent whether ``QUIET`` was +used or not. If it is found, success will be reported, including +the content of the first ````. On repeated CMake runs, +the same message will not be printed again. + +Example for the full signature: + +.. code-block:: cmake + + find_package_handle_standard_args(LibArchive + REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR + VERSION_VAR LibArchive_VERSION) + +In this case, the ``LibArchive`` package is considered to be found if +both ``LibArchive_LIBRARY`` and ``LibArchive_INCLUDE_DIR`` are valid. +Also the version of ``LibArchive`` will be checked by using the version +contained in ``LibArchive_VERSION``. Since no ``FAIL_MESSAGE`` is given, +the default messages will be printed. + +Another example for the full signature: + +.. code-block:: cmake + + find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4) + find_package_handle_standard_args(Automoc4 CONFIG_MODE) + +In this case, a ``FindAutmoc4.cmake`` module wraps a call to +``find_package(Automoc4 NO_MODULE)`` and adds an additional search +directory for ``automoc4``. Then the call to +``find_package_handle_standard_args`` produces a proper success/failure +message. +#]=======================================================================] #============================================================================= # Copyright 2007-2009 Kitware, Inc. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d1a6d15bcd4df3d3e347411bd457be32275fb594 commit d1a6d15bcd4df3d3e347411bd457be32275fb594 Author: Stephen Kelly AuthorDate: Mon Feb 23 22:23:11 2015 +0100 Commit: Brad King CommitDate: Fri Apr 17 10:46:24 2015 -0400 FPHSA: Always populate the ExactCase_FOUND variable (#15412). The UPPERCASE name was inconsistent with config-packages, the find_dependency macro, and even FPHSA itself, which expects components to be specified with names matching ExactCase. The FOUND_VAR was only permitted to have two possible values, and now both are set for compatibility. Document it as obsolete, and adjust the code for the same. Users of the variable should just remove it. diff --git a/Help/release/dev/FPHSA-ExactCase-name.rst b/Help/release/dev/FPHSA-ExactCase-name.rst new file mode 100644 index 0000000..675547c --- /dev/null +++ b/Help/release/dev/FPHSA-ExactCase-name.rst @@ -0,0 +1,10 @@ +FPHSA-ExactCase-name +-------------------- + +* The :module:`FindPackageHandleStandardArgs` module + ``FIND_PACKAGE_HANDLE_STANDARD_ARGS`` function now + always populates the both ``_FOUND`` + and ``_FOUND`` variables (the latter + for backwards compatibility). The ``FOUND_VAR`` + option is now ignored except to enforce its allowed + values. diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index bcbd17d..bf5e921 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -8,9 +8,9 @@ # # This function is intended to be used in FindXXX.cmake modules files. # It handles the REQUIRED, QUIET and version-related arguments to -# find_package(). It also sets the _FOUND variable. The -# package is considered found if all variables ... listed contain -# valid results, e.g. valid filepaths. +# find_package(PackageName). It also sets the _FOUND +# variable. The package is considered found if all variables ... +# listed contain valid results, e.g. valid filepaths. # # There are two modes of this function. The first argument in both # modes is the name of the Find-module where it is called (in original @@ -24,7 +24,7 @@ # (DEFAULT_MSG|"Custom failure message") ... ) # # If the variables to are all valid, then -# _FOUND will be set to TRUE. If DEFAULT_MSG is given +# _FOUND will be set to TRUE. If DEFAULT_MSG is given # as second argument, then the function will generate itself useful # success and error messages. You can also supply a custom error # message for the failure case. This is not recommended. @@ -41,16 +41,12 @@ # [CONFIG_MODE] # [FAIL_MESSAGE "Custom failure message"] ) # -# In this mode, the name of the result-variable can be set either to -# either _FOUND or _FOUND using the -# FOUND_VAR option. Other names for the result-variable are not -# allowed. So for a Find-module named FindFooBar.cmake, the two -# possible names are FooBar_FOUND and FOOBAR_FOUND. It is recommended -# to use the original case version. If the FOUND_VAR option is not -# used, the default is _FOUND. +# The FOUND_VAR option is obsolete. ``FIND_PACKAGE_HANDLE_STANDARD_ARGS`` +# always populates ``_FOUND``. For backward compatibility, +# it also always populates ``_FOUND``. # # As in the simple mode, if through are all valid, -# _FOUND will be set to TRUE. After REQUIRED_VARS the +# _FOUND will be set to TRUE. After REQUIRED_VARS the # variables which are required for this package are listed. Following # VERSION_VAR the name of the variable can be specified which holds the # version of the package which has been found. If this is done, this @@ -61,7 +57,7 @@ # version is ok or not. If the package supports components, use the # HANDLE_COMPONENTS option to enable handling them. In this case, # find_package_handle_standard_args() will report which components have -# been found and which are missing, and the _FOUND variable +# been found and which are missing, and the _FOUND variable # will be set to FALSE if any of the required components (i.e. not the # ones listed after OPTIONAL_COMPONENTS) are missing. Use the option # CONFIG_MODE if your FindXXX.cmake module is a wrapper for a @@ -81,7 +77,7 @@ # # # LibXml2 is considered to be found, if both LIBXML2_LIBRARY and -# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to +# LIBXML2_INCLUDE_DIR are valid. Then also LibXml2_FOUND is set to # TRUE. If it is not found and REQUIRED was used, it fails with # FATAL_ERROR, independent whether QUIET was used or not. If it is # found, success will be reported, including the content of . On @@ -92,16 +88,14 @@ # :: # # find_package_handle_standard_args(LibXslt -# FOUND_VAR LibXslt_FOUND # REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS # VERSION_VAR LibXslt_VERSION_STRING) # # In this case, LibXslt is considered to be found if the variable(s) # listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and -# LibXslt_INCLUDE_DIRS in this case. The result will then be stored in -# LibXslt_FOUND . Also the version of LibXslt will be checked by using -# the version contained in LibXslt_VERSION_STRING. Since no -# FAIL_MESSAGE is given, the default messages will be printed. +# LibXslt_INCLUDE_DIRS in this case. Also the version of LibXslt will be +# checked by using the version contained in LibXslt_VERSION_STRING. Since +# no FAIL_MESSAGE is given, the default messages will be printed. # # Another example for mode 2: # @@ -111,9 +105,8 @@ # find_package_handle_standard_args(Automoc4 CONFIG_MODE) # # In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 -# NO_MODULE) and adds an additional search directory for automoc4. Here -# the result will be stored in AUTOMOC4_FOUND. The following -# FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper +# NO_MODULE) and adds an additional search directory for automoc4. The +# following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper # success/error message. #============================================================================= @@ -239,17 +232,21 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) set(MISSING_VARS "") set(DETAILS "") # check if all passed variables are valid - unset(${_FOUND_VAR}) + set(FPHSA_FOUND_${_NAME} TRUE) foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS}) if(NOT ${_CURRENT_VAR}) - set(${_FOUND_VAR} FALSE) + set(FPHSA_FOUND_${_NAME} FALSE) set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") else() set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") endif() endforeach() - if(NOT "${${_FOUND_VAR}}" STREQUAL "FALSE") - set(${_FOUND_VAR} TRUE) + if(FPHSA_FOUND_${_NAME}) + set(${_NAME}_FOUND TRUE) + set(${_NAME_UPPER}_FOUND TRUE) + else() + set(${_NAME}_FOUND FALSE) + set(${_NAME_UPPER}_FOUND FALSE) endif() # component handling @@ -273,7 +270,7 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}") if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_FOUND_VAR} FALSE) + set(${_NAME}_FOUND FALSE) set(MISSING_VARS "${MISSING_VARS} ${comp}") endif() @@ -356,12 +353,12 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) if(VERSION_OK) set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]") else() - set(${_FOUND_VAR} FALSE) + set(${_NAME}_FOUND FALSE) endif() # print the result: - if (${_FOUND_VAR}) + if (${_NAME}_FOUND) FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") else () @@ -377,6 +374,6 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) endif () - set(${_FOUND_VAR} ${${_FOUND_VAR}} PARENT_SCOPE) - + set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE) + set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE) endfunction() diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index f311fb9..8fafa3b 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -45,12 +45,18 @@ endif() find_package(SomePackage) if(NOT SomePackage_FOUND) - message(SEND_ERROR "SomePackage with FOUND_VAR SomePackage_FOUND not found !") + message(SEND_ERROR "SomePackage not found !") +endif() +if(NOT SOMEPACKAGE_FOUND) + message(SEND_ERROR "SomePackage compatibility name SOMEPACKAGE_FOUND not set!") endif() find_package(UpperCasePackage) +if(NOT UpperCasePackage_FOUND) + message(SEND_ERROR "UpperCasePackage not found!") +endif() if(NOT UPPERCASEPACKAGE_FOUND) - message(SEND_ERROR "UpperCasePackage with FOUND_VAR UPPERCASEPACKAGE_FOUND not found !") + message(SEND_ERROR "SomePackage compatibility name SOMEPACKAGE_FOUND not set!") endif() #----------------------------------------------------------------------------- diff --git a/Tests/FindPackageTest/FindSomePackage.cmake b/Tests/FindPackageTest/FindSomePackage.cmake index 7283d24..746c087 100644 --- a/Tests/FindPackageTest/FindSomePackage.cmake +++ b/Tests/FindPackageTest/FindSomePackage.cmake @@ -2,5 +2,4 @@ set(SOP_FOO TRUE) include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(SomePackage REQUIRED_VARS SOP_FOO - FOUND_VAR SomePackage_FOUND ) +find_package_handle_standard_args(SomePackage REQUIRED_VARS SOP_FOO) diff --git a/Tests/FindPackageTest/FindUpperCasePackage.cmake b/Tests/FindPackageTest/FindUpperCasePackage.cmake index 425d417..5e349da 100644 --- a/Tests/FindPackageTest/FindUpperCasePackage.cmake +++ b/Tests/FindPackageTest/FindUpperCasePackage.cmake @@ -2,5 +2,4 @@ set(UCP_FOO TRUE) include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(UpperCasePackage REQUIRED_VARS UCP_FOO - FOUND_VAR UPPERCASEPACKAGE_FOUND ) +find_package_handle_standard_args(UpperCasePackage REQUIRED_VARS UCP_FOO) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 17 10:50:12 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 17 Apr 2015 10:50:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-795-gf4e5a0e Message-ID: <20150417145012.14610AF38A@public.kitware.com> This is an automated email from 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 f4e5a0e6aa598f7cf0f34c2d7fea54e518615443 (commit) via 84f06d0c84a7db85561cca044780d3ca92c9c3a3 (commit) via a3ad275ce08784493267604d57207fce14602c48 (commit) via d1a6d15bcd4df3d3e347411bd457be32275fb594 (commit) from a4d201a747c6d56205aa180b19aab64f5880322c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4e5a0e6aa598f7cf0f34c2d7fea54e518615443 commit f4e5a0e6aa598f7cf0f34c2d7fea54e518615443 Merge: a4d201a 84f06d0 Author: Brad King AuthorDate: Fri Apr 17 10:50:10 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 17 10:50:10 2015 -0400 Merge topic 'FPHSA-updates' 84f06d0c FPHSA: Document REQUIRED_VARS recommendation (#15352) a3ad275c FPHSA: Revise and format documentation d1a6d15b FPHSA: Always populate the ExactCase_FOUND variable (#15412). ----------------------------------------------------------------------- Summary of changes: Help/release/dev/FPHSA-ExactCase-name.rst | 10 + Modules/FindPackageHandleStandardArgs.cmake | 266 ++++++++++++---------- Tests/FindPackageTest/CMakeLists.txt | 10 +- Tests/FindPackageTest/FindSomePackage.cmake | 3 +- Tests/FindPackageTest/FindUpperCasePackage.cmake | 3 +- 5 files changed, 160 insertions(+), 132 deletions(-) create mode 100644 Help/release/dev/FPHSA-ExactCase-name.rst hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 17 10:50:14 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 17 Apr 2015 10:50:14 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-801-g9efee16 Message-ID: <20150417145014.A7FD5AF398@public.kitware.com> This is an automated email from 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 9efee16a7a092555d4bc40498a1acd957943a834 (commit) via e8fdd5f12a379ce91adcb88acdb4354bc271c911 (commit) via 15f1a6b49958cc7757f951839b02a00e8c820154 (commit) via 3f7c7c65968b6d04babd261dab952ee40e0c9ca9 (commit) via 26b5cc5e79320dd73e93e117fffd0d4554e89dbc (commit) via 4556640855515b287dd8a5a0f7fb1a85218267a8 (commit) from f4e5a0e6aa598f7cf0f34c2d7fea54e518615443 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9efee16a7a092555d4bc40498a1acd957943a834 commit 9efee16a7a092555d4bc40498a1acd957943a834 Merge: f4e5a0e e8fdd5f Author: Brad King AuthorDate: Fri Apr 17 10:50:13 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 17 10:50:13 2015 -0400 Merge topic 'ninja-autogen' e8fdd5f1 QtAutogen: Workaround rcc CRCRLF newlines on Windows (#15459) 15f1a6b4 Tests/QtAutogen: Avoid touching files in the source tree 3f7c7c65 Tests/QtAutogen: Help Qt5Autogen test find Qt5 on Windows 26b5cc5e Tests/QtAutogen: Enable per-config source tests when possible 45566408 Tests/QtAutogen: Require CMake 3.1 to set policies everywhere ----------------------------------------------------------------------- Summary of changes: Source/cmQtAutoGenerators.cxx | 7 +++++++ Tests/CMakeLists.txt | 9 +++++++-- Tests/QtAutogen/CMakeLists.txt | 17 ++++++++++++----- Tests/QtAutogen/autorcc_depends/CMakeLists.txt | 7 +++++-- .../autorcc_depends/{res1.qrc => res1.qrc.in} | 2 +- .../{res1_input.txt => res1/input.txt.in} | 0 6 files changed, 32 insertions(+), 10 deletions(-) rename Tests/QtAutogen/autorcc_depends/{res1.qrc => res1.qrc.in} (61%) rename Tests/QtAutogen/autorcc_depends/{res1_input.txt => res1/input.txt.in} (100%) hooks/post-receive -- CMake From brad.king at kitware.com Fri Apr 17 10:50:16 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 17 Apr 2015 10:50:16 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-803-g1f1b62b Message-ID: <20150417145016.A5053AF3A7@public.kitware.com> This is an automated email from 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 1f1b62b0e2598554349dce14542a4c383f620ada (commit) via ed0b06308523e56f6df5de9abdb5211e908ce772 (commit) from 9efee16a7a092555d4bc40498a1acd957943a834 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f1b62b0e2598554349dce14542a4c383f620ada commit 1f1b62b0e2598554349dce14542a4c383f620ada Merge: 9efee16 ed0b063 Author: Brad King AuthorDate: Fri Apr 17 10:50:15 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 17 10:50:15 2015 -0400 Merge topic 'cpack-one-component-only' ed0b0630 CPack: Fix single component packaging ----------------------------------------------------------------------- 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 Apr 17 10:50:47 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 17 Apr 2015 10:50:47 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1879-g4355acd Message-ID: <20150417145047.C96C9AF482@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4355acdb2da42cf59a7aa8a00e9d277caa95d27e (commit) via 1f1b62b0e2598554349dce14542a4c383f620ada (commit) via 9efee16a7a092555d4bc40498a1acd957943a834 (commit) via f4e5a0e6aa598f7cf0f34c2d7fea54e518615443 (commit) via a4d201a747c6d56205aa180b19aab64f5880322c (commit) from 0da7fc85681d25e585b1a90f93af0ad23f9fdc82 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4355acdb2da42cf59a7aa8a00e9d277caa95d27e commit 4355acdb2da42cf59a7aa8a00e9d277caa95d27e Merge: 0da7fc8 1f1b62b Author: Brad King AuthorDate: Fri Apr 17 10:50:38 2015 -0400 Commit: Brad King CommitDate: Fri Apr 17 10:50:38 2015 -0400 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 Apr 17 11:04:06 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 17 Apr 2015 11:04:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1881-gbef4d78 Message-ID: <20150417150406.BD612AFB4C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via bef4d783bf5694dc03cb6f1e1f5021df744f628e (commit) via 164f1df26d1c3b66678a8e585e1ebc1783f9a6fb (commit) from 4355acdb2da42cf59a7aa8a00e9d277caa95d27e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bef4d783bf5694dc03cb6f1e1f5021df744f628e commit bef4d783bf5694dc03cb6f1e1f5021df744f628e Merge: 4355acd 164f1df Author: Brad King AuthorDate: Fri Apr 17 11:04:06 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 17 11:04:06 2015 -0400 Merge topic 'doc-PDB_NAME-fallback' into next 164f1df2 Help: Clarify PDB_NAME fallback behavior (#15518) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=164f1df26d1c3b66678a8e585e1ebc1783f9a6fb commit 164f1df26d1c3b66678a8e585e1ebc1783f9a6fb Author: Brad King AuthorDate: Fri Apr 17 11:00:56 2015 -0400 Commit: Brad King CommitDate: Fri Apr 17 11:00:56 2015 -0400 Help: Clarify PDB_NAME fallback behavior (#15518) It uses the OUTPUT_NAME if set, not always the target name. diff --git a/Help/prop_tgt/PDB_NAME.rst b/Help/prop_tgt/PDB_NAME.rst index 479dec3..3a65796 100644 --- a/Help/prop_tgt/PDB_NAME.rst +++ b/Help/prop_tgt/PDB_NAME.rst @@ -5,7 +5,8 @@ Output name for the MS debug symbol ``.pdb`` file generated by the linker for an executable or shared library target. This property specifies the base name for the debug symbols file. -If not set, the logical target name is used by default. +If not set, the :prop_tgt:`OUTPUT_NAME` target property value or +logical target name is used by default. .. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_NAME` .. include:: PDB_NOTE.txt ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/PDB_NAME.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From gjasny at googlemail.com Fri Apr 17 15:51:45 2015 From: gjasny at googlemail.com (Gregor Jasny) Date: Fri, 17 Apr 2015 15:51:45 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1891-g00b8efc Message-ID: <20150417195145.4BD22AF0A7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 00b8efc2713bfd3e7ef56223bd6b0e9afcc9eaa0 (commit) via 6693590f8144a905b423ca03fa8ed98df4468bae (commit) via a6331eb851c132d3d0496e738886ad76e13a92a0 (commit) via 6e8952c19385acb0ff9f58c2a462d91dd0624e05 (commit) via 4bd2544b25655b6e20e5098a5f4cdd973288c106 (commit) via 5cb4c8380d9a0f5922a2eed60f6a1fd1274e9141 (commit) via a723427b6450c1ec77226fb58aa3070a341891a2 (commit) via 2fe8bca58089fb03f0ffa16792cc15fb741bd22c (commit) via 2e0e205e28922c6584a35ce6ec9966485df47b0d (commit) via 7b68c8df6b78951e6d04eea62c3d5cc056796993 (commit) from bef4d783bf5694dc03cb6f1e1f5021df744f628e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00b8efc2713bfd3e7ef56223bd6b0e9afcc9eaa0 commit 00b8efc2713bfd3e7ef56223bd6b0e9afcc9eaa0 Merge: bef4d78 6693590 Author: Gregor Jasny AuthorDate: Fri Apr 17 15:51:43 2015 -0400 Commit: CMake Topic Stage CommitDate: Fri Apr 17 15:51:43 2015 -0400 Merge topic 'stable-xcode-projects' into next 6693590f Xcode: Refine quoting rules for Strings a6331eb8 Xcode: Let PrintComment decide if the comment is non-empty 6e8952c1 Xcode: PrintComment will prepend a whitespace itself before the comment 4bd2544b Xcode: Do not add whitespace after attribute group opening brace 5cb4c838 Xcode: Properly indent PBXFileReference and PBXBuildFile a723427b Xcode: Remove extra space in PBXProject comment 2fe8bca5 Xcode: Add comment after root object 2e0e205e Xcode: Indent using tabs 7b68c8df Xcode: Sort Xcode objects by Id http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6693590f8144a905b423ca03fa8ed98df4468bae commit 6693590f8144a905b423ca03fa8ed98df4468bae Author: Gregor Jasny AuthorDate: Thu Apr 9 11:04:35 2015 +0200 Commit: Gregor Jasny CommitDate: Fri Apr 17 21:50:05 2015 +0200 Xcode: Refine quoting rules for Strings $ and . do not need to be quoted, but brackets and * must be to not confuse the Xcode parser. diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index b9c41f3..e72d315 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -243,7 +243,7 @@ void cmXCodeObject::PrintString(std::ostream& os,std::string String) bool needQuote = (String.empty() || String.find("//") != String.npos || - String.find_first_of(" <>.+-=@$[],") != String.npos); + String.find_first_of(" <>+-*=@[](){},") != String.npos); const char* quote = needQuote? "\"" : ""; // Print the string, quoted and escaped as necessary. diff --git a/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake b/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake index 7882d7f..1847bc9 100644 --- a/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake @@ -1,6 +1,6 @@ set(expect-default "explicitFileType = sourcecode") -set(expect-explicit "explicitFileType = \"sourcecode.c.h\"") -set(expect-lastKnown "lastKnownFileType = \"sourcecode.c.h\"") +set(expect-explicit "explicitFileType = sourcecode.c.h") +set(expect-lastKnown "lastKnownFileType = sourcecode.c.h") foreach(src default explicit lastKnown) file(STRINGS ${RunCMake_TEST_BINARY_DIR}/XcodeFileType.xcodeproj/project.pbxproj actual-${src} REGEX "PBXFileReference.*src-${src}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6331eb851c132d3d0496e738886ad76e13a92a0 commit a6331eb851c132d3d0496e738886ad76e13a92a0 Author: Gregor Jasny AuthorDate: Thu Apr 9 10:48:33 2015 +0200 Commit: Gregor Jasny CommitDate: Fri Apr 17 21:50:05 2015 +0200 Xcode: Let PrintComment decide if the comment is non-empty diff --git a/Source/cmXCode21Object.cxx b/Source/cmXCode21Object.cxx index 96f7b0f..f30f700 100644 --- a/Source/cmXCode21Object.cxx +++ b/Source/cmXCode21Object.cxx @@ -31,6 +31,10 @@ void cmXCode21Object::PrintComment(std::ostream& out) cmSystemTools::ReplaceString(this->Comment, "\"", ""); } } + if(this->Comment.empty()) + { + return; + } out << " /* "; out << this->Comment; out << " */"; diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index e41f282..b9c41f3 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -99,10 +99,7 @@ void cmXCodeObject::Print(std::ostream& out) indentFactor = 0; } out << this->Id; - if(!(this->IsA == PBXGroup && this->Comment.size() == 0)) - { - this->PrintComment(out); - } + this->PrintComment(out); out << " = {"; if(separator == "\n") { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e8952c19385acb0ff9f58c2a462d91dd0624e05 commit 6e8952c19385acb0ff9f58c2a462d91dd0624e05 Author: Gregor Jasny AuthorDate: Thu Apr 9 10:14:47 2015 +0200 Commit: Gregor Jasny CommitDate: Fri Apr 17 21:50:05 2015 +0200 Xcode: PrintComment will prepend a whitespace itself before the comment diff --git a/Source/cmXCode21Object.cxx b/Source/cmXCode21Object.cxx index 855e1ad..96f7b0f 100644 --- a/Source/cmXCode21Object.cxx +++ b/Source/cmXCode21Object.cxx @@ -31,7 +31,7 @@ void cmXCode21Object::PrintComment(std::ostream& out) cmSystemTools::ReplaceString(this->Comment, "\"", ""); } } - out << "/* "; + out << " /* "; out << this->Comment; out << " */"; } diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 72d8e99..e41f282 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -98,7 +98,7 @@ void cmXCodeObject::Print(std::ostream& out) separator = " "; indentFactor = 0; } - out << this->Id << " "; + out << this->Id; if(!(this->IsA == PBXGroup && this->Comment.size() == 0)) { this->PrintComment(out); @@ -129,7 +129,7 @@ void cmXCodeObject::Print(std::ostream& out) for(unsigned int k = 0; k < i->second->List.size(); k++) { cmXCodeObject::Indent(4*indentFactor, out); - out << i->second->List[k]->Id << " "; + out << i->second->List[k]->Id; i->second->List[k]->PrintComment(out); out << "," << separator; } @@ -192,7 +192,6 @@ void cmXCodeObject::Print(std::ostream& out) out << " = " << object->Object->Id; if(object->Object->HasComment() && i->first != "remoteGlobalIDString") { - out << " "; object->Object->PrintComment(out); } out << ";" << separator; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bd2544b25655b6e20e5098a5f4cdd973288c106 commit 4bd2544b25655b6e20e5098a5f4cdd973288c106 Author: Gregor Jasny AuthorDate: Tue Apr 7 22:00:29 2015 +0200 Commit: Gregor Jasny CommitDate: Fri Apr 17 21:50:04 2015 +0200 Xcode: Do not add whitespace after attribute group opening brace This suppresses the extra space that would be generated if the separator is a space. The conditional block is also used in this form elsewhere. diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 519545a..72d8e99 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -139,7 +139,11 @@ void cmXCodeObject::Print(std::ostream& out) else if(object->TypeValue == ATTRIBUTE_GROUP) { std::map::iterator j; - out << i->first << " = {" << separator; + out << i->first << " = {"; + if(separator == "\n") + { + out << separator; + } for(j = object->ObjectAttributes.begin(); j != object->ObjectAttributes.end(); ++j) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5cb4c8380d9a0f5922a2eed60f6a1fd1274e9141 commit 5cb4c8380d9a0f5922a2eed60f6a1fd1274e9141 Author: Gregor Jasny AuthorDate: Tue Apr 7 20:47:10 2015 +0200 Commit: Gregor Jasny CommitDate: Fri Apr 17 21:50:04 2015 +0200 Xcode: Properly indent PBXFileReference and PBXBuildFile Move indent factor change behind indention of start-of-line. diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 33ce8cc..519545a 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -91,13 +91,13 @@ void cmXCodeObject::Print(std::ostream& out) { std::string separator = "\n"; int indentFactor = 1; + cmXCodeObject::Indent(2*indentFactor, out); if(this->Version > 15 && (this->IsA == PBXFileReference || this->IsA == PBXBuildFile)) { separator = " "; indentFactor = 0; } - cmXCodeObject::Indent(2*indentFactor, out); out << this->Id << " "; if(!(this->IsA == PBXGroup && this->Comment.size() == 0)) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a723427b6450c1ec77226fb58aa3070a341891a2 commit a723427b6450c1ec77226fb58aa3070a341891a2 Author: Gregor Jasny AuthorDate: Tue Apr 7 19:20:54 2015 +0200 Commit: Gregor Jasny CommitDate: Fri Apr 17 21:50:04 2015 +0200 Xcode: Remove extra space in PBXProject comment diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 2e13692..4d98359 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3386,7 +3386,7 @@ bool cmGlobalXCodeGenerator } configlist->AddAttribute("buildConfigurations", buildConfigurations); - std::string comment = "Build configuration list for PBXProject "; + std::string comment = "Build configuration list for PBXProject"; comment += " \""; comment += this->CurrentProject; comment += "\""; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2fe8bca58089fb03f0ffa16792cc15fb741bd22c commit 2fe8bca58089fb03f0ffa16792cc15fb741bd22c Author: Gregor Jasny AuthorDate: Tue Apr 7 19:19:00 2015 +0200 Commit: Gregor Jasny CommitDate: Fri Apr 17 21:50:04 2015 +0200 Xcode: Add comment after root object diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index be40c66..2e13692 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3756,7 +3756,8 @@ cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout, cmXCodeObject::PrintList(this->XCodeObjects, fout); } cmXCodeObject::Indent(1, fout); - fout << "rootObject = " << this->RootObject->GetId() << ";\n"; + fout << "rootObject = " << this->RootObject->GetId() + << " /* Project object */;\n"; fout << "}\n"; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e0e205e28922c6584a35ce6ec9966485df47b0d commit 2e0e205e28922c6584a35ce6ec9966485df47b0d Author: Gregor Jasny AuthorDate: Tue Apr 7 19:13:57 2015 +0200 Commit: Gregor Jasny CommitDate: Fri Apr 17 21:50:04 2015 +0200 Xcode: Indent using tabs diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 5a90fd9..33ce8cc 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -81,7 +81,7 @@ void cmXCodeObject::Indent(int level, std::ostream& out) { while(level) { - out << " "; + out << "\t"; level--; } } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b68c8df6b78951e6d04eea62c3d5cc056796993 commit 7b68c8df6b78951e6d04eea62c3d5cc056796993 Author: Gregor Jasny AuthorDate: Tue Apr 7 19:14:52 2015 +0200 Commit: Gregor Jasny CommitDate: Fri Apr 17 21:49:05 2015 +0200 Xcode: Sort Xcode objects by Id this patch series aims to minimize deltas between the CMake Xcode generator and Xcode itself. It was started by the observation that if one makes any change to the project within Xcode (e.g. to see how a variable is called internally) the user cannot diff the CMake project and the one stored by Xcode afterwards. Xcode keeps the objects ordered by the object id. Because cmake stores them into an unordered container at creation time they must be sorted before writing the pbxproj file. I tested this series with Xcode 6.3 and Xcode 3.2. Both show a reduced diff after this series was applied. diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0561a05..be40c66 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -592,6 +592,20 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile( } //---------------------------------------------------------------------------- + +static bool objectIdLessThan(cmXCodeObject* l, cmXCodeObject* r) +{ + return l->GetId() < r->GetId(); +} + +//---------------------------------------------------------------------------- +void cmGlobalXCodeGenerator::SortXCodeObjects() +{ + std::sort(this->XCodeObjects.begin(), this->XCodeObjects.end(), + objectIdLessThan); +} + +//---------------------------------------------------------------------------- void cmGlobalXCodeGenerator::ClearXCodeObjects() { this->TargetDoneSet.clear(); @@ -3713,6 +3727,8 @@ cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout, cmLocalGenerator* , std::vector& ) { + SortXCodeObjects(); + fout << "// !$*UTF8*$!\n"; fout << "{\n"; cmXCodeObject::Indent(1, fout); diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index b272f6a..1a69fce 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -150,6 +150,7 @@ private: cmXCodeObject* buildSettings, const std::string& buildType); std::string ExtractFlag(const char* flag, std::string& flags); + void SortXCodeObjects(); // delete all objects in the this->XCodeObjects vector. void ClearXCodeObjects(); bool CreateXCodeObjects(cmLocalGenerator* root, ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalXCodeGenerator.cxx | 21 +++++++++++++++++-- Source/cmGlobalXCodeGenerator.h | 1 + Source/cmXCode21Object.cxx | 6 +++++- Source/cmXCodeObject.cxx | 22 ++++++++++---------- .../XcodeProject/XcodeFileType-check.cmake | 4 ++-- 5 files changed, 38 insertions(+), 16 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Apr 18 00:01:08 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 18 Apr 2015 00:01:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.2.2-804-ga0bc4a9 Message-ID: <20150418040108.18397AF6F9@public.kitware.com> This is an automated email from 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 a0bc4a999d2be105fe2cf18deb6f4849381c6573 (commit) from 1f1b62b0e2598554349dce14542a4c383f620ada (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0bc4a999d2be105fe2cf18deb6f4849381c6573 commit a0bc4a999d2be105fe2cf18deb6f4849381c6573 Author: Kitware Robot AuthorDate: Sat Apr 18 00:01:06 2015 -0400 Commit: Kitware Robot CommitDate: Sat Apr 18 00:01:06 2015 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 85c6992..2b56fe7 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 2) -set(CMake_VERSION_PATCH 20150417) +set(CMake_VERSION_PATCH 20150418) #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 Apr 18 09:31:52 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 18 Apr 2015 09:31:52 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1918-gcae2b4e Message-ID: <20150418133152.71508AF179@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via cae2b4e846a2dbabfe930d157c736883cb54313f (commit) via 05245b42294a38c5f7be9b40a918e42575b7dbd7 (commit) via 6e23a4bdddd2bfee668c682a9ab4081b5e6fcfa2 (commit) via d21ebcb2444a4b6001c5997f7004bd5cf917d71b (commit) via 95a27267daee021514df8c93ffd6d9b9e55dea51 (commit) via 7d248547361bbacb4f5b532ef2ce4f4935c97dc8 (commit) via 9db15954104455fef54d59c7aa029d798075bf0e (commit) via 5d4480a8c711a3d5971e100cc1a8984b6305c509 (commit) via 3a8ac2423ef658e87e366a143428835be48bf88f (commit) via 5947d9b031444b48a7d7a9c70ef02d2333aeabee (commit) via e2d0e0fbeb1bf7b43dc55ce55c6000819d108aee (commit) via 3a1ad1713f87ed7219c934dcb32c4d41573807c4 (commit) via f0dae032ee44283d08869c2a948f001dc211bfd5 (commit) via 08da8742709d6da74d1a17de46990ec5aaf3ad0f (commit) via 3dc4fe02e63422532486320739e0cf4abddaa270 (commit) via e4f8f1f1b706d7efc9964826ff4572d27a3062d3 (commit) via 2d6121a9a709e319cca733787bcc21bac593a232 (commit) via bdd4c5f5ba6d3bf60b4e3bc620b146784e1559f1 (commit) via 524ce895427557312eef52d837f0afdb39a0dab6 (commit) via 813cd719c41b05df7a22ad3ebd267cc9bfc2505e (commit) via 5c201f1ee6cc19e0f1871048a6a6af9056c5780f (commit) via 0d9555779d7bd2a8d068f5b9af431bcf9673453a (commit) via 846608f2678b4bced696857b5ca45e11bc86aa2c (commit) via a2f2aeee2f4d4af1f25f4a5b86bacb8a81a7dec4 (commit) via 68f791cd06983e8fd375edfba74a9d821231e269 (commit) via 5bb4248a807029053156dbf4a3cdba4427766306 (commit) via fc7ab8874b0e5c2c010fb73718ae8702b8853ca0 (commit) from 00b8efc2713bfd3e7ef56223bd6b0e9afcc9eaa0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cae2b4e846a2dbabfe930d157c736883cb54313f commit cae2b4e846a2dbabfe930d157c736883cb54313f Merge: 00b8efc 05245b4 Author: Stephen Kelly AuthorDate: Sat Apr 18 09:31:50 2015 -0400 Commit: CMake Topic Stage CommitDate: Sat Apr 18 09:31:50 2015 -0400 Merge topic 'clean-up-ReadListFile' into next 05245b42 cmMakefile: Move some preamble out of the Internal method. 6e23a4bd cmMakefile: Remove always-null first parameter to ReadListFile. d21ebcb2 cmMakefile: Swap parameters of calls to ReadListFile. 95a27267 cmMakefile: Extract conditional code to caller. 7d248547 cmMakefile: Remove intermediate variable. 9db15954 cmMakefile: Move condition to the only calling context where it is true. 5d4480a8 cmMakefile: Populate CMAKE_PARENT_LIST_FILE in callers. 3a8ac242 cmMakefile: Collapse nested conditional. 5947d9b0 cmMakefile: Convert filenametoread into a std::string. e2d0e0fb cmMakefile: Remove intermediate variable. 3a1ad171 cmMakefile: Combine duplicate condition. f0dae032 cmMakefile: Re-order independent statements. 08da8742 cmMakefile: Split a conditional. 3dc4fe02 cmMakefile: Re-order independent variable setting. e4f8f1f1 cmMakefile: Remove intermediate variable. 2d6121a9 cmMakefile: Remove use of intermediate variable. ... http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05245b42294a38c5f7be9b40a918e42575b7dbd7 commit 05245b42294a38c5f7be9b40a918e42575b7dbd7 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:38 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:31:18 2015 +0200 cmMakefile: Move some preamble out of the Internal method. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7790b8a..7be920d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -556,7 +556,15 @@ bool cmMakefile::ReadListFile(const char* listfile, std::string currentFile = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE"); + this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_DIR", + cmSystemTools::GetFilenamePath(filenametoread).c_str()); + this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); + this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); + this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); + + this->ListFileStack.push_back(filenametoread); bool res = this->ReadListFileInternal(filenametoread.c_str(), noPolicyScope, requireProjectCommand); @@ -584,14 +592,6 @@ bool cmMakefile::ReadListFileInternal(const char* filenametoread, bool noPolicyScope, bool requireProjectCommand) { - this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread); - this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); - this->AddDefinition("CMAKE_CURRENT_LIST_DIR", - cmSystemTools::GetFilenamePath(filenametoread).c_str()); - this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); - - // push the listfile onto the stack - this->ListFileStack.push_back(filenametoread); cmListFile cacheFile; if( !cacheFile.ParseFile(filenametoread, requireProjectCommand, this) ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e23a4bdddd2bfee668c682a9ab4081b5e6fcfa2 commit 6e23a4bdddd2bfee668c682a9ab4081b5e6fcfa2 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:37 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:31:18 2015 +0200 cmMakefile: Remove always-null first parameter to ReadListFile. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index a2edab5..2b18c41 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -525,7 +525,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript( tempInstallDirectory.c_str()); this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR", tempInstallDirectory.c_str()); - int res = this->MakefileMap->ReadListFile(0, installScript.c_str()); + int res = this->MakefileMap->ReadListFile(installScript.c_str()); if ( cmSystemTools::GetErrorOccuredFlag() || !res ) { return 0; @@ -888,7 +888,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( "1"); } // do installation - int res = mf->ReadListFile(0, installFile.c_str()); + int res = mf->ReadListFile(installFile.c_str()); // forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES // to CPack (may be used by generators like CPack RPM or DEB) // in order to transparently handle ABSOLUTE PATH @@ -980,7 +980,7 @@ bool cmCPackGenerator::ReadListFile(const char* moduleName) { bool retval; std::string fullPath = this->MakefileMap->GetModulesFile(moduleName); - retval = this->MakefileMap->ReadListFile(0, fullPath.c_str()); + retval = this->MakefileMap->ReadListFile(fullPath.c_str()); // include FATAL_ERROR and ERROR in the return status retval = retval && (! cmSystemTools::GetErrorOccuredFlag()); return retval; @@ -1163,7 +1163,7 @@ int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf) this->GetOption("CPACK_PROJECT_CONFIG_FILE"); if(config) { - mf->ReadListFile(0, config); + mf->ReadListFile(config); } int result = this->InitializeInternal(); if (cmSystemTools::GetErrorOccuredFlag()) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index a9cabf1..2752270 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -244,7 +244,7 @@ int main (int argc, char const* const* argv) // paths, so FIND_XXX() commands can be used in scripts std::string systemFile = globalMF->GetModulesFile("CMakeDetermineSystem.cmake"); - if (!globalMF->ReadListFile(0, systemFile.c_str())) + if (!globalMF->ReadListFile(systemFile.c_str())) { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Error reading CMakeDetermineSystem.cmake" << std::endl); @@ -253,7 +253,7 @@ int main (int argc, char const* const* argv) systemFile = globalMF->GetModulesFile("CMakeSystemSpecificInformation.cmake"); - if (!globalMF->ReadListFile(0, systemFile.c_str())) + if (!globalMF->ReadListFile(systemFile.c_str())) { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Error reading CMakeSystemSpecificInformation.cmake" << std::endl); @@ -272,7 +272,7 @@ int main (int argc, char const* const* argv) cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "Read CPack configuration file: " << cpackConfigFile << std::endl); - if ( !globalMF->ReadListFile(0, cpackConfigFile.c_str()) ) + if ( !globalMF->ReadListFile(cpackConfigFile.c_str()) ) { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Problem reading CPack config file: \"" diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 62fa2be..de6ecde 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -757,7 +757,7 @@ void cmCTestLaunch::LoadConfig() std::string fname = this->LogDir; fname += "CTestLaunchConfig.cmake"; if(cmSystemTools::FileExists(fname.c_str()) && - mf->ReadListFile(0, fname.c_str())) + mf->ReadListFile(fname.c_str())) { this->SourceDir = mf->GetSafeDefinition("CTEST_SOURCE_DIRECTORY"); cmSystemTools::ConvertToUnixSlashes(this->SourceDir); diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 783941b..7f9825c 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -433,7 +433,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) ctest scripting easier. */ std::string systemFile = this->Makefile->GetModulesFile("CTestScriptMode.cmake"); - if (!this->Makefile->ReadListFile(0, systemFile.c_str()) || + if (!this->Makefile->ReadListFile(systemFile.c_str()) || cmSystemTools::GetErrorOccuredFlag()) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read:" @@ -451,7 +451,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) } // finally read in the script - if (!this->Makefile->ReadListFile(0, script.c_str()) || + if (!this->Makefile->ReadListFile(script.c_str()) || cmSystemTools::GetErrorOccuredFlag()) { // Reset the error flag so that it can run more than diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 59c5e92..d778253 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1617,7 +1617,7 @@ void cmCTestTestHandler::GetListOfTests() return; } - if ( !mf->ReadListFile(0, testFilename) ) + if ( !mf->ReadListFile(testFilename) ) { return; } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 91ae889..3697aa4 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2576,7 +2576,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf) bool erroroc = cmSystemTools::GetErrorOccuredFlag(); cmSystemTools::ResetErrorOccuredFlag(); - if ( !mf->ReadListFile(0, fname.c_str()) || + if ( !mf->ReadListFile(fname.c_str()) || cmSystemTools::GetErrorOccuredFlag() ) { cmCTestLog(this, ERROR_MESSAGE, @@ -2606,7 +2606,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf) { cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: " << *fileIt << std::endl); - if ( !mf->ReadListFile(0, fileIt->c_str()) || + if ( !mf->ReadListFile(fileIt->c_str()) || cmSystemTools::GetErrorOccuredFlag() ) { cmCTestLog(this, ERROR_MESSAGE, diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index ab044c1..4a9f628 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -278,7 +278,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) mf->GetModulesFile(this->FindMakeProgramFile.c_str()); if(!setMakeProgram.empty()) { - mf->ReadListFile(0, setMakeProgram.c_str()); + mf->ReadListFile(setMakeProgram.c_str()); } } if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM") @@ -428,7 +428,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, fpath += "/CMakeSystem.cmake"; if(cmSystemTools::FileExists(fpath.c_str())) { - mf->ReadListFile(0,fpath.c_str()); + mf->ReadListFile(fpath.c_str()); } } // Load the CMakeDetermineSystem.cmake file and find out @@ -456,12 +456,12 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, #endif // Read the DetermineSystem file std::string systemFile = mf->GetModulesFile("CMakeDetermineSystem.cmake"); - mf->ReadListFile(0, systemFile.c_str()); + mf->ReadListFile(systemFile.c_str()); // load the CMakeSystem.cmake from the binary directory // this file is configured by the CMakeDetermineSystem.cmake file fpath = rootBin; fpath += "/CMakeSystem.cmake"; - mf->ReadListFile(0,fpath.c_str()); + mf->ReadListFile(fpath.c_str()); } if(readCMakeSystem) @@ -495,7 +495,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INITIALIZE_LOADED")) { fpath = mf->GetModulesFile("CMakeSystemSpecificInitialize.cmake"); - if(!mf->ReadListFile(0,fpath.c_str())) + if(!mf->ReadListFile(fpath.c_str())) { cmSystemTools::Error("Could not find cmake module file: " "CMakeSystemSpecificInitialize.cmake"); @@ -533,7 +533,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, // to avoid duplicate compiler tests. if(cmSystemTools::FileExists(fpath.c_str())) { - if(!mf->ReadListFile(0,fpath.c_str())) + if(!mf->ReadListFile(fpath.c_str())) { cmSystemTools::Error("Could not find cmake module file: ", fpath.c_str()); @@ -563,7 +563,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, determineCompiler += "Compiler.cmake"; std::string determineFile = mf->GetModulesFile(determineCompiler.c_str()); - if(!mf->ReadListFile(0,determineFile.c_str())) + if(!mf->ReadListFile(determineFile.c_str())) { cmSystemTools::Error("Could not find cmake module file: ", determineCompiler.c_str()); @@ -597,7 +597,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, fpath += "/CMake"; fpath += lang; fpath += "Compiler.cmake"; - if(!mf->ReadListFile(0,fpath.c_str())) + if(!mf->ReadListFile(fpath.c_str())) { cmSystemTools::Error("Could not find cmake module file: ", fpath.c_str()); @@ -616,7 +616,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED")) { fpath = mf->GetModulesFile("CMakeSystemSpecificInformation.cmake"); - if(!mf->ReadListFile(0,fpath.c_str())) + if(!mf->ReadListFile(fpath.c_str())) { cmSystemTools::Error("Could not find cmake module file: " "CMakeSystemSpecificInformation.cmake"); @@ -707,7 +707,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, cmSystemTools::Error("Could not find cmake module file: ", fpath.c_str()); } - else if(!mf->ReadListFile(0, informationFile.c_str())) + else if(!mf->ReadListFile(informationFile.c_str())) { cmSystemTools::Error("Could not process cmake module file: ", informationFile.c_str()); @@ -732,7 +732,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, testLang += lang; testLang += "Compiler.cmake"; std::string ifpath = mf->GetModulesFile(testLang.c_str()); - if(!mf->ReadListFile(0,ifpath.c_str())) + if(!mf->ReadListFile(ifpath.c_str())) { cmSystemTools::Error("Could not find cmake module file: ", testLang.c_str()); @@ -777,7 +777,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, projectCompatibility += "Compatibility.cmake"; if(cmSystemTools::FileExists(projectCompatibility.c_str())) { - mf->ReadListFile(0,projectCompatibility.c_str()); + mf->ReadListFile(projectCompatibility.c_str()); } // Inform any extra generator of the new language. if (this->ExtraGenerator) diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index af88d1c..99542a9 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -81,7 +81,7 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName, } } - if ( !mf->ReadListFile(0, inFileName) ) + if ( !mf->ReadListFile(inFileName) ) { cmSystemTools::Error("Problem opening GraphViz options file: ", inFileName); diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 8938e67..153ed09 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1475,7 +1475,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo, bool color) { // read in the target info file - if(!this->Makefile->ReadListFile(0, tgtInfo) || + if(!this->Makefile->ReadListFile(tgtInfo) || cmSystemTools::GetErrorOccuredFlag()) { cmSystemTools::Error("Target DependInfo.cmake file not found"); @@ -1592,7 +1592,7 @@ cmLocalUnixMakefileGenerator3 std::string dirInfoFile = this->Makefile->GetStartOutputDirectory(); dirInfoFile += cmake::GetCMakeFilesDirectory(); dirInfoFile += "/CMakeDirectoryInformation.cmake"; - if(mf->ReadListFile(0, dirInfoFile.c_str()) && + if(mf->ReadListFile(dirInfoFile.c_str()) && !cmSystemTools::GetErrorOccuredFlag()) { haveDirectoryInfo = true; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 51f9a57..7790b8a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -526,7 +526,7 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile); this->cmCurrentListFile = listfile; - return this->ReadListFile(0, listfile, true, + return this->ReadListFile(listfile, true, this->cmStartDirectory == this->cmHomeDirectory); } @@ -536,30 +536,20 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope) this->cmCurrentListFile = cmSystemTools::CollapseFullPath(listfile, this->cmStartDirectory.c_str()); - return this->ReadListFile(0, this->cmCurrentListFile.c_str(), + return this->ReadListFile(this->cmCurrentListFile.c_str(), noPolicyScope); } //---------------------------------------------------------------------------- // Parse the given CMakeLists.txt file executing all commands // -bool cmMakefile::ReadListFile(const char* filename_in, - const char *external_in, +bool cmMakefile::ReadListFile(const char* listfile, bool noPolicyScope, bool requireProjectCommand) { - std::string filenametoread; - if (filename_in) - { - filenametoread = filename_in; - } - - if (external_in) - { - filenametoread = - cmSystemTools::CollapseFullPath(external_in, - this->cmStartDirectory.c_str()); - } + std::string filenametoread = + cmSystemTools::CollapseFullPath(listfile, + this->cmStartDirectory.c_str()); std::string currentParentFile = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE"); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 2664d8e..73d6910 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -86,7 +86,6 @@ public: * Read and parse a CMakeLists.txt file. */ bool ReadListFile(const char* listfile, - const char* external= 0, bool noPolicyScope = true, bool requireProjectCommand = false); diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index d49e997..3d5103f 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1243,7 +1243,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile, cmSystemTools::ConvertToUnixSlashes(filename); filename += "/AutogenInfo.cmake"; - if (!makefile->ReadListFile(0, filename.c_str())) + if (!makefile->ReadListFile(filename.c_str())) { cmSystemTools::Error("Error processing file: ", filename.c_str()); return false; @@ -1413,7 +1413,7 @@ bool cmQtAutoGenerators::ReadOldMocDefinitionsFile(cmMakefile* makefile, cmSystemTools::ConvertToUnixSlashes(filename); filename += "/AutomocOldMocDefinitions.cmake"; - if (makefile->ReadListFile(0, filename.c_str())) + if (makefile->ReadListFile(filename.c_str())) { this->OldCompileSettingsStr = makefile->GetSafeDefinition("AM_OLD_COMPILE_SETTINGS"); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a542a24..c4f7c4e 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -388,7 +388,7 @@ void cmake::ReadListFile(const std::vector& args, lg->GetMakefile()->SetArgcArgv(args); } - if (!lg->GetMakefile()->ReadListFile(0, path)) + if (!lg->GetMakefile()->ReadListFile(path)) { cmSystemTools::Error("Error processing file: ", path); } @@ -424,7 +424,7 @@ bool cmake::FindPackage(const std::vector& args) mf->SetArgcArgv(args); std::string systemFile = mf->GetModulesFile("CMakeFindPackageMode.cmake"); - mf->ReadListFile(0, systemFile.c_str()); + mf->ReadListFile(systemFile.c_str()); std::string language = mf->GetSafeDefinition("LANGUAGE"); std::string mode = mf->GetSafeDefinition("MODE"); @@ -1965,7 +1965,7 @@ int cmake::CheckBuildSystem() gg.SetCMakeInstance(&cm); cmsys::auto_ptr lg(gg.CreateLocalGenerator()); cmMakefile* mf = lg->GetMakefile(); - if(!mf->ReadListFile(0, this->CheckBuildSystemArgument.c_str()) || + if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) || cmSystemTools::GetErrorOccuredFlag()) { if(verbose) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d21ebcb2444a4b6001c5997f7004bd5cf917d71b commit d21ebcb2444a4b6001c5997f7004bd5cf917d71b Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:37 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:31:18 2015 +0200 cmMakefile: Swap parameters of calls to ReadListFile. The version with a null first parameter is now equivalent. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index bc225ff..51f9a57 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -526,7 +526,7 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile); this->cmCurrentListFile = listfile; - return this->ReadListFile(listfile, 0, true, + return this->ReadListFile(0, listfile, true, this->cmStartDirectory == this->cmHomeDirectory); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95a27267daee021514df8c93ffd6d9b9e55dea51 commit 95a27267daee021514df8c93ffd6d9b9e55dea51 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:37 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:31:17 2015 +0200 cmMakefile: Extract conditional code to caller. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d3ea55a..bc225ff 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -525,6 +525,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011() bool cmMakefile::ProcessBuildsystemFile(const char* listfile) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile); + this->cmCurrentListFile = listfile; return this->ReadListFile(listfile, 0, true, this->cmStartDirectory == this->cmHomeDirectory); } @@ -553,11 +554,6 @@ bool cmMakefile::ReadListFile(const char* filename_in, filenametoread = filename_in; } - if (!filenametoread.empty()) - { - this->cmCurrentListFile = filenametoread; - } - if (external_in) { filenametoread = http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d248547361bbacb4f5b532ef2ce4f4935c97dc8 commit 7d248547361bbacb4f5b532ef2ce4f4935c97dc8 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:37 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:31:17 2015 +0200 cmMakefile: Remove intermediate variable. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 9b2ee35..d3ea55a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -532,11 +532,10 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile) bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile()); - std::string filenametoread = + this->cmCurrentListFile = cmSystemTools::CollapseFullPath(listfile, this->cmStartDirectory.c_str()); - this->cmCurrentListFile = filenametoread; - return this->ReadListFile(0, filenametoread.c_str(), + return this->ReadListFile(0, this->cmCurrentListFile.c_str(), noPolicyScope); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9db15954104455fef54d59c7aa029d798075bf0e commit 9db15954104455fef54d59c7aa029d798075bf0e Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:36 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:31:11 2015 +0200 cmMakefile: Move condition to the only calling context where it is true. Call the Internal method with equivalent parameters, passing a null first argument. A duplicate path computation exists inside the external_in condition now, but that is harmless at this point. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7f4fbc1..9b2ee35 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -532,7 +532,11 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile) bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile()); - return this->ReadListFile(this->GetCurrentListFile(), listfile, + std::string filenametoread = + cmSystemTools::CollapseFullPath(listfile, + this->cmStartDirectory.c_str()); + this->cmCurrentListFile = filenametoread; + return this->ReadListFile(0, filenametoread.c_str(), noPolicyScope); } @@ -550,13 +554,6 @@ bool cmMakefile::ReadListFile(const char* filename_in, filenametoread = filename_in; } - if (external_in && filename_in) - { - filenametoread = - cmSystemTools::CollapseFullPath(filename_in, - this->cmStartDirectory.c_str()); - } - if (!filenametoread.empty()) { this->cmCurrentListFile = filenametoread; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d4480a8c711a3d5971e100cc1a8984b6305c509 commit 5d4480a8c711a3d5971e100cc1a8984b6305c509 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:36 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:20 2015 +0200 cmMakefile: Populate CMAKE_PARENT_LIST_FILE in callers. Because all external callers of this method pass a null first parameter, this change has no effect for them. This also makes it obvious that the CMAKE_PARENT_LIST_FILE is set to the name of the file being read itself for CMakeLists.txt files, which may not make any sense. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 9a57223..7f4fbc1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -524,12 +524,14 @@ void cmMakefile::IncludeScope::EnforceCMP0011() bool cmMakefile::ProcessBuildsystemFile(const char* listfile) { + this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile); return this->ReadListFile(listfile, 0, true, this->cmStartDirectory == this->cmHomeDirectory); } bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope) { + this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile()); return this->ReadListFile(this->GetCurrentListFile(), listfile, noPolicyScope); } @@ -572,7 +574,6 @@ bool cmMakefile::ReadListFile(const char* filename_in, std::string currentFile = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE"); - this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in); this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); bool res = this->ReadListFileInternal(filenametoread.c_str(), http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a8ac2423ef658e87e366a143428835be48bf88f commit 3a8ac2423ef658e87e366a143428835be48bf88f Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:36 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:19 2015 +0200 cmMakefile: Collapse nested conditional. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 851e407..9a57223 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -548,14 +548,11 @@ bool cmMakefile::ReadListFile(const char* filename_in, filenametoread = filename_in; } - if (external_in) + if (external_in && filename_in) { - if (filename_in) - { - filenametoread = - cmSystemTools::CollapseFullPath(filename_in, - this->cmStartDirectory.c_str()); - } + filenametoread = + cmSystemTools::CollapseFullPath(filename_in, + this->cmStartDirectory.c_str()); } if (!filenametoread.empty()) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5947d9b031444b48a7d7a9c70ef02d2333aeabee commit 5947d9b031444b48a7d7a9c70ef02d2333aeabee Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:36 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:19 2015 +0200 cmMakefile: Convert filenametoread into a std::string. Remove other intermediate variables. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index eeba6aa..851e407 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -542,34 +542,32 @@ bool cmMakefile::ReadListFile(const char* filename_in, bool noPolicyScope, bool requireProjectCommand) { - std::string external_abs; - - const char* filenametoread = filename_in; - std::string filename_abs; + std::string filenametoread; + if (filename_in) + { + filenametoread = filename_in; + } if (external_in) { if (filename_in) { - filename_abs = + filenametoread = cmSystemTools::CollapseFullPath(filename_in, this->cmStartDirectory.c_str()); - filenametoread = filename_abs.c_str(); } } - if (filenametoread) + if (!filenametoread.empty()) { this->cmCurrentListFile = filenametoread; } if (external_in) { - external_abs = + filenametoread = cmSystemTools::CollapseFullPath(external_in, this->cmStartDirectory.c_str()); - - filenametoread = external_abs.c_str(); } std::string currentParentFile @@ -580,7 +578,7 @@ bool cmMakefile::ReadListFile(const char* filename_in, this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in); this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); - bool res = this->ReadListFileInternal(filenametoread, + bool res = this->ReadListFileInternal(filenametoread.c_str(), noPolicyScope, requireProjectCommand); this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2d0e0fbeb1bf7b43dc55ce55c6000819d108aee commit e2d0e0fbeb1bf7b43dc55ce55c6000819d108aee Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:35 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:19 2015 +0200 cmMakefile: Remove intermediate variable. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 037d697..eeba6aa 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -542,7 +542,6 @@ bool cmMakefile::ReadListFile(const char* filename_in, bool noPolicyScope, bool requireProjectCommand) { - const char* external = 0; std::string external_abs; const char* filenametoread = filename_in; @@ -569,9 +568,8 @@ bool cmMakefile::ReadListFile(const char* filename_in, external_abs = cmSystemTools::CollapseFullPath(external_in, this->cmStartDirectory.c_str()); - external = external_abs.c_str(); - filenametoread= external; + filenametoread = external_abs.c_str(); } std::string currentParentFile http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a1ad1713f87ed7219c934dcb32c4d41573807c4 commit 3a1ad1713f87ed7219c934dcb32c4d41573807c4 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:35 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:19 2015 +0200 cmMakefile: Combine duplicate condition. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 042ffc0..037d697 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -570,10 +570,7 @@ bool cmMakefile::ReadListFile(const char* filename_in, cmSystemTools::CollapseFullPath(external_in, this->cmStartDirectory.c_str()); external = external_abs.c_str(); - } - if(external_in) - { filenametoread= external; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0dae032ee44283d08869c2a948f001dc211bfd5 commit f0dae032ee44283d08869c2a948f001dc211bfd5 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:35 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:19 2015 +0200 cmMakefile: Re-order independent statements. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 5ab1928..042ffc0 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -559,6 +559,11 @@ bool cmMakefile::ReadListFile(const char* filename_in, } } + if (filenametoread) + { + this->cmCurrentListFile = filenametoread; + } + if (external_in) { external_abs = @@ -567,12 +572,6 @@ bool cmMakefile::ReadListFile(const char* filename_in, external = external_abs.c_str(); } - // keep track of the current file being read - if (filenametoread) - { - this->cmCurrentListFile = filenametoread; - } - if(external_in) { filenametoread= external; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08da8742709d6da74d1a17de46990ec5aaf3ad0f commit 08da8742709d6da74d1a17de46990ec5aaf3ad0f Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:34 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:19 2015 +0200 cmMakefile: Split a conditional. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 029fd3d..5ab1928 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -557,6 +557,10 @@ bool cmMakefile::ReadListFile(const char* filename_in, this->cmStartDirectory.c_str()); filenametoread = filename_abs.c_str(); } + } + + if (external_in) + { external_abs = cmSystemTools::CollapseFullPath(external_in, this->cmStartDirectory.c_str()); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3dc4fe02e63422532486320739e0cf4abddaa270 commit 3dc4fe02e63422532486320739e0cf4abddaa270 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:34 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:19 2015 +0200 cmMakefile: Re-order independent variable setting. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ac71ea5..029fd3d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -550,10 +550,6 @@ bool cmMakefile::ReadListFile(const char* filename_in, if (external_in) { - external_abs = - cmSystemTools::CollapseFullPath(external_in, - this->cmStartDirectory.c_str()); - external = external_abs.c_str(); if (filename_in) { filename_abs = @@ -561,6 +557,10 @@ bool cmMakefile::ReadListFile(const char* filename_in, this->cmStartDirectory.c_str()); filenametoread = filename_abs.c_str(); } + external_abs = + cmSystemTools::CollapseFullPath(external_in, + this->cmStartDirectory.c_str()); + external = external_abs.c_str(); } // keep track of the current file being read http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4f8f1f1b706d7efc9964826ff4572d27a3062d3 commit e4f8f1f1b706d7efc9964826ff4572d27a3062d3 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:34 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:18 2015 +0200 cmMakefile: Remove intermediate variable. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 46a10a9..ac71ea5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -545,7 +545,7 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char* external = 0; std::string external_abs; - const char* filename = filename_in; + const char* filenametoread = filename_in; std::string filename_abs; if (external_in) @@ -559,12 +559,10 @@ bool cmMakefile::ReadListFile(const char* filename_in, filename_abs = cmSystemTools::CollapseFullPath(filename_in, this->cmStartDirectory.c_str()); - filename = filename_abs.c_str(); + filenametoread = filename_abs.c_str(); } } - const char *filenametoread = filename; - // keep track of the current file being read if (filenametoread) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d6121a9a709e319cca733787bcc21bac593a232 commit 2d6121a9a709e319cca733787bcc21bac593a232 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:34 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:18 2015 +0200 cmMakefile: Remove use of intermediate variable. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 67138ba..46a10a9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -566,9 +566,9 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char *filenametoread = filename; // keep track of the current file being read - if (filename) + if (filenametoread) { - this->cmCurrentListFile = filename; + this->cmCurrentListFile = filenametoread; } if(external_in) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bdd4c5f5ba6d3bf60b4e3bc620b146784e1559f1 commit bdd4c5f5ba6d3bf60b4e3bc620b146784e1559f1 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:33 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:18 2015 +0200 cmMakefile: Move variable definition above a condition. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index bb0b8cb..67138ba 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -563,15 +563,14 @@ bool cmMakefile::ReadListFile(const char* filename_in, } } + const char *filenametoread = filename; + // keep track of the current file being read if (filename) { this->cmCurrentListFile = filename; } - // Now read the input file - const char *filenametoread= filename; - if(external_in) { filenametoread= external; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=524ce895427557312eef52d837f0afdb39a0dab6 commit 524ce895427557312eef52d837f0afdb39a0dab6 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:33 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:18 2015 +0200 cmMakefile: Change condition to its equivalent. This makes it easier to reason about follow-up commits. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index dafbfef..bb0b8cb 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -572,7 +572,7 @@ bool cmMakefile::ReadListFile(const char* filename_in, // Now read the input file const char *filenametoread= filename; - if( external) + if(external_in) { filenametoread= external; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=813cd719c41b05df7a22ad3ebd267cc9bfc2505e commit 813cd719c41b05df7a22ad3ebd267cc9bfc2505e Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:33 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:18 2015 +0200 cmMakefile: Determine the file to read before calling Internal. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 38e94e2..dafbfef 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -542,41 +542,6 @@ bool cmMakefile::ReadListFile(const char* filename_in, bool noPolicyScope, bool requireProjectCommand) { - std::string currentParentFile - = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE"); - std::string currentFile - = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE"); - - this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in); - this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); - - bool res = this->ReadListFileInternal(filename_in, external_in, - noPolicyScope, requireProjectCommand); - - this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); - this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); - this->AddDefinition("CMAKE_CURRENT_LIST_DIR", - cmSystemTools::GetFilenamePath(currentFile).c_str()); - this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); - this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); - this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); - - this->ListFileStack.pop_back(); - - if (res) - { - // Check for unused variables - this->CheckForUnusedVariables(); - } - - return res; -} - -bool cmMakefile::ReadListFileInternal(const char* filename_in, - const char* external_in, - bool noPolicyScope, - bool requireProjectCommand) -{ const char* external = 0; std::string external_abs; @@ -612,6 +577,40 @@ bool cmMakefile::ReadListFileInternal(const char* filename_in, filenametoread= external; } + std::string currentParentFile + = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE"); + std::string currentFile + = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE"); + + this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in); + this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); + + bool res = this->ReadListFileInternal(filenametoread, + noPolicyScope, requireProjectCommand); + + this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_DIR", + cmSystemTools::GetFilenamePath(currentFile).c_str()); + this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); + this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); + this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); + + this->ListFileStack.pop_back(); + + if (res) + { + // Check for unused variables + this->CheckForUnusedVariables(); + } + + return res; +} + +bool cmMakefile::ReadListFileInternal(const char* filenametoread, + bool noPolicyScope, + bool requireProjectCommand) +{ this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread); this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); this->AddDefinition("CMAKE_CURRENT_LIST_DIR", diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 88faed9..2664d8e 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -992,8 +992,8 @@ private: void Initialize(); - bool ReadListFileInternal(const char* filename_in, - const char* external_in, + + bool ReadListFileInternal(const char* filenametoread, bool noPolicyScope, bool requireProjectCommand); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c201f1ee6cc19e0f1871048a6a6af9056c5780f commit 5c201f1ee6cc19e0f1871048a6a6af9056c5780f Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:33 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:18 2015 +0200 cmMakefile: Remove duplication in ReadListFile. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0211591..38e94e2 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -542,8 +542,34 @@ bool cmMakefile::ReadListFile(const char* filename_in, bool noPolicyScope, bool requireProjectCommand) { - return this->ReadListFileInternal(filename_in, external_in, - noPolicyScope, requireProjectCommand); + std::string currentParentFile + = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE"); + std::string currentFile + = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE"); + + this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in); + this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); + + bool res = this->ReadListFileInternal(filename_in, external_in, + noPolicyScope, requireProjectCommand); + + this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_DIR", + cmSystemTools::GetFilenamePath(currentFile).c_str()); + this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); + this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); + this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); + + this->ListFileStack.pop_back(); + + if (res) + { + // Check for unused variables + this->CheckForUnusedVariables(); + } + + return res; } bool cmMakefile::ReadListFileInternal(const char* filename_in, @@ -551,13 +577,6 @@ bool cmMakefile::ReadListFileInternal(const char* filename_in, bool noPolicyScope, bool requireProjectCommand) { - std::string currentParentFile - = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE"); - std::string currentFile - = this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE"); - this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in); - this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); - const char* external = 0; std::string external_abs; @@ -604,15 +623,6 @@ bool cmMakefile::ReadListFileInternal(const char* filename_in, cmListFile cacheFile; if( !cacheFile.ParseFile(filenametoread, requireProjectCommand, this) ) { - // pop the listfile off the stack - this->ListFileStack.pop_back(); - this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); - this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); - this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); - this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); - this->AddDefinition("CMAKE_CURRENT_LIST_DIR", - cmSystemTools::GetFilenamePath(currentFile).c_str()); - this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); return false; } // add this list file to the list of dependencies @@ -651,20 +661,6 @@ bool cmMakefile::ReadListFileInternal(const char* filename_in, this->EnforceDirectoryLevelRules(); } - this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); - this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); - this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); - this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); - this->AddDefinition("CMAKE_CURRENT_LIST_DIR", - cmSystemTools::GetFilenamePath(currentFile).c_str()); - this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); - - // pop the listfile off the stack - this->ListFileStack.pop_back(); - - // Check for unused variables - this->CheckForUnusedVariables(); - return true; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d9555779d7bd2a8d068f5b9af431bcf9673453a commit 0d9555779d7bd2a8d068f5b9af431bcf9673453a Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:32 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:17 2015 +0200 cmMakefile: Delegate ListFile reading to internal method. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2b4b896..0211591 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -542,6 +542,15 @@ bool cmMakefile::ReadListFile(const char* filename_in, bool noPolicyScope, bool requireProjectCommand) { + return this->ReadListFileInternal(filename_in, external_in, + noPolicyScope, requireProjectCommand); +} + +bool cmMakefile::ReadListFileInternal(const char* filename_in, + const char* external_in, + bool noPolicyScope, + bool requireProjectCommand) +{ std::string currentParentFile = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE"); std::string currentFile diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 3d925fa..88faed9 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -991,6 +991,12 @@ protected: private: void Initialize(); + + bool ReadListFileInternal(const char* filename_in, + const char* external_in, + bool noPolicyScope, + bool requireProjectCommand); + bool ParseDefineFlag(std::string const& definition, bool remove); bool EnforceUniqueDir(const std::string& srcPath, http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=846608f2678b4bced696857b5ca45e11bc86aa2c commit 846608f2678b4bced696857b5ca45e11bc86aa2c Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:32 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:17 2015 +0200 cmMakefile: Remove useless condition. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 29e564f..2b4b896 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -573,10 +573,7 @@ bool cmMakefile::ReadListFile(const char* filename_in, // keep track of the current file being read if (filename) { - if(this->cmCurrentListFile != filename) - { - this->cmCurrentListFile = filename; - } + this->cmCurrentListFile = filename; } // Now read the input file http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2f2aeee2f4d4af1f25f4a5b86bacb8a81a7dec4 commit a2f2aeee2f4d4af1f25f4a5b86bacb8a81a7dec4 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:32 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:17 2015 +0200 cmMakefile: Add wrapper for reading listfiles which have an origin. Such files are delegates from other files, and so they set the CMAKE_PARENT_LIST_FILE to the originator. They also may set a policy scope. diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index c50ea88..59c5e92 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -117,9 +117,7 @@ bool cmCTestSubdirCommand } fname += "/"; fname += testFilename; - bool readit = - this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), - fname.c_str()); + bool readit = this->Makefile->ReadDependentFile(fname.c_str()); cmSystemTools::ChangeDirectory(cwd); if(!readit) { @@ -205,9 +203,7 @@ bool cmCTestAddSubdirectoryCommand } fname += "/"; fname += testFilename; - bool readit = - this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), - fname.c_str()); + bool readit = this->Makefile->ReadDependentFile(fname.c_str()); cmSystemTools::ChangeDirectory(cwd); if(!readit) { diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index cd2cd7c..91ae889 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -687,8 +687,7 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) { cmCTestOptionalLog(this, OUTPUT, " Reading ctest configuration file: " << fname << std::endl, command->ShouldBeQuiet()); - bool readit = mf->ReadListFile(mf->GetCurrentListFile(), - fname.c_str() ); + bool readit = mf->ReadDependentFile(fname.c_str()); if(!readit) { std::string m = "Could not find include file: "; diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index af99b1c..aecd230 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -999,8 +999,8 @@ bool cmFindPackageCommand::FindAppBundleConfig() //---------------------------------------------------------------------------- bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr) { - if(this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), f, - !this->PolicyScope || psr == NoPolicyScope)) + const bool noPolicyScope = !this->PolicyScope || psr == NoPolicyScope; + if(this->Makefile->ReadDependentFile(f, noPolicyScope)) { return true; } diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index e2b2bbd..e268852 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -60,7 +60,7 @@ void cmGlobalVisualStudio6Generator::GenerateConfigurations(cmMakefile* mf) fname += "/Templates"; } fname += "/CMakeVisualStudio6Configurations.cmake"; - if(!mf->ReadListFile(mf->GetCurrentListFile(), fname.c_str())) + if(!mf->ReadDependentFile(fname.c_str())) { cmSystemTools::Error("Cannot open ", fname.c_str(), ". Please copy this file from the main " diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 0c2e73a..18e3585 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -131,8 +131,7 @@ bool cmIncludeCommand } bool readit = - this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(), - fname.c_str(), noPolicyScope); + this->Makefile->ReadDependentFile(fname.c_str(), noPolicyScope); // add the location of the included file if a result variable was given if (!resultVarName.empty()) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b08725e..29e564f 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -528,6 +528,12 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile) this->cmStartDirectory == this->cmHomeDirectory); } +bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope) +{ + return this->ReadListFile(this->GetCurrentListFile(), listfile, + noPolicyScope); +} + //---------------------------------------------------------------------------- // Parse the given CMakeLists.txt file executing all commands // diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 33c4b20..3d925fa 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -90,6 +90,8 @@ public: bool noPolicyScope = true, bool requireProjectCommand = false); + bool ReadDependentFile(const char* listfile, bool noPolicyScope = true); + bool ProcessBuildsystemFile(const char* listfile); /** diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 601dc54..43b02bc 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -236,8 +236,7 @@ bool cmProjectCommand { std::string fullFilePath; bool readit = - this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(), - include); + this->Makefile->ReadDependentFile(include); if(!readit && !cmSystemTools::GetFatalErrorOccured()) { std::string m = http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68f791cd06983e8fd375edfba74a9d821231e269 commit 68f791cd06983e8fd375edfba74a9d821231e269 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:31 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:17 2015 +0200 cmMakefile: Add a method for processing buildsystem files. These are different from other ListFiles in that a project() command is required if it is top-level. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c143bce..56e17ec 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -181,7 +181,7 @@ void cmLocalGenerator::ReadInputFile() currentStart += "/CMakeLists.txt"; if(cmSystemTools::FileExists(currentStart.c_str(), true)) { - this->Makefile->ReadListFile(currentStart.c_str()); + this->Makefile->ProcessBuildsystemFile(currentStart.c_str()); return; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 8bc4ac8..b08725e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -522,12 +522,19 @@ void cmMakefile::IncludeScope::EnforceCMP0011() } } +bool cmMakefile::ProcessBuildsystemFile(const char* listfile) +{ + return this->ReadListFile(listfile, 0, true, + this->cmStartDirectory == this->cmHomeDirectory); +} + //---------------------------------------------------------------------------- // Parse the given CMakeLists.txt file executing all commands // bool cmMakefile::ReadListFile(const char* filename_in, const char *external_in, - bool noPolicyScope) + bool noPolicyScope, + bool requireProjectCommand) { std::string currentParentFile = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE"); @@ -580,21 +587,6 @@ bool cmMakefile::ReadListFile(const char* filename_in, cmSystemTools::GetFilenamePath(filenametoread).c_str()); this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); - // try to see if the list file is the top most - // list file for a project, and if it is, then it - // must have a project command. If there is not - // one, then cmake will provide one via the - // cmListFileCache class. - bool requireProjectCommand = false; - if(!external && this->cmStartDirectory == this->cmHomeDirectory) - { - if(cmSystemTools::LowerCase( - cmSystemTools::GetFilenameName(filename)) == "cmakelists.txt") - { - requireProjectCommand = true; - } - } - // push the listfile onto the stack this->ListFileStack.push_back(filenametoread); cmListFile cacheFile; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index ce21c60..33c4b20 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -87,7 +87,10 @@ public: */ bool ReadListFile(const char* listfile, const char* external= 0, - bool noPolicyScope = true); + bool noPolicyScope = true, + bool requireProjectCommand = false); + + bool ProcessBuildsystemFile(const char* listfile); /** * Add a function blocker to this makefile http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5bb4248a807029053156dbf4a3cdba4427766306 commit 5bb4248a807029053156dbf4a3cdba4427766306 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:31 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:29:17 2015 +0200 cmMakefile: Remove fullPath parameter from ReadListFile. There is no reason for this to be a responsibility of ReadListFile. Additionally, the only user of it already computes it itself. diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index e1074b0..af99b1c 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -999,7 +999,7 @@ bool cmFindPackageCommand::FindAppBundleConfig() //---------------------------------------------------------------------------- bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr) { - if(this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), f, 0, + if(this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), f, !this->PolicyScope || psr == NoPolicyScope)) { return true; diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index c15d46e..0c2e73a 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -130,17 +130,15 @@ bool cmIncludeCommand gg->GenerateImportFile(fname_abs); } - std::string fullFilePath; bool readit = this->Makefile->ReadListFile( this->Makefile->GetCurrentListFile(), - fname.c_str(), &fullFilePath, - noPolicyScope); + fname.c_str(), noPolicyScope); // add the location of the included file if a result variable was given if (!resultVarName.empty()) { this->Makefile->AddDefinition(resultVarName, - readit?fullFilePath.c_str():"NOTFOUND"); + readit?fname_abs.c_str():"NOTFOUND"); } if(!optional && !readit && !cmSystemTools::GetFatalErrorOccured()) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 205508b..8bc4ac8 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -527,7 +527,6 @@ void cmMakefile::IncludeScope::EnforceCMP0011() // bool cmMakefile::ReadListFile(const char* filename_in, const char *external_in, - std::string* fullPath, bool noPolicyScope) { std::string currentParentFile @@ -598,19 +597,11 @@ bool cmMakefile::ReadListFile(const char* filename_in, // push the listfile onto the stack this->ListFileStack.push_back(filenametoread); - if(fullPath!=0) - { - *fullPath=filenametoread; - } cmListFile cacheFile; if( !cacheFile.ParseFile(filenametoread, requireProjectCommand, this) ) { // pop the listfile off the stack this->ListFileStack.pop_back(); - if(fullPath!=0) - { - *fullPath = ""; - } this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE"); this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 299d550..ce21c60 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -87,7 +87,6 @@ public: */ bool ReadListFile(const char* listfile, const char* external= 0, - std::string* fullPath= 0, bool noPolicyScope = true); /** http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc7ab8874b0e5c2c010fb73718ae8702b8853ca0 commit fc7ab8874b0e5c2c010fb73718ae8702b8853ca0 Author: Stephen Kelly AuthorDate: Sat Apr 18 14:50:31 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 15:26:12 2015 +0200 CPack: Read the config listfile in the normal way. This is a unique function call in CMake, and it was likely a programming error when introduced. All other similar calls to ReadListFile use a null first paramter. The effect of this patch is to no-longer define CMAKE_PARENT_LIST_FILE to the config file itself while evaluating it. The ReadListFile method also no longer hits a condition that it uses CollapseFullPath on the input file. However, as cpack does not set the StartDirectory anyway, this has no effect. See bug 15522. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 4f37041..a2edab5 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1163,7 +1163,7 @@ int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf) this->GetOption("CPACK_PROJECT_CONFIG_FILE"); if(config) { - mf->ReadListFile(config); + mf->ReadListFile(0, config); } int result = this->InitializeInternal(); if (cmSystemTools::GetErrorOccuredFlag()) ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 6 +- Source/CPack/cpack.cxx | 6 +- Source/CTest/cmCTestLaunch.cxx | 2 +- Source/CTest/cmCTestScriptHandler.cxx | 4 +- Source/CTest/cmCTestTestHandler.cxx | 10 +- Source/cmCTest.cxx | 7 +- Source/cmFindPackageCommand.cxx | 4 +- Source/cmGlobalGenerator.cxx | 24 ++--- Source/cmGlobalVisualStudio6Generator.cxx | 2 +- Source/cmGraphVizWriter.cxx | 2 +- Source/cmIncludeCommand.cxx | 7 +- Source/cmLocalGenerator.cxx | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 4 +- Source/cmMakefile.cxx | 141 +++++++++++------------------ Source/cmMakefile.h | 15 ++- Source/cmProjectCommand.cxx | 3 +- Source/cmQtAutoGenerators.cxx | 4 +- Source/cmake.cxx | 6 +- 18 files changed, 106 insertions(+), 143 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sat Apr 18 10:02:57 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 18 Apr 2015 10:02:57 -0400 (EDT) Subject: [Cmake-commits] CMake branch, next, updated. v3.2.2-1935-g6d45daa Message-ID: <20150418140257.ED1B4AF2A0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 6d45daa423a2b8561ae2e2ad183f89807bf026ba (commit) via f63fba653a7a279a4fba8b1dfe2a9d0b41746b99 (commit) via 38910712704797cda1bbf1a3b1aebae0dfc3a99f (commit) via 09c7ea5f4b1a85e76639f8ca17d37aa8632ad3c2 (commit) via 614e9f318855efda2f9c1c2cb69a7582a112c69d (commit) via b1fe0225c817ebaaf31f3f51a812560ea56eb7a3 (commit) via 3350fb5c8070c46301602f5ce6c217fc54be2283 (commit) via 0199ec869c06180ffb287449f8388c36f0a429f3 (commit) via b010b851ea66e8b781b24b3ed7413c95f667cc2e (commit) via b44e35630f2b0d1458f49fd85830529eaedb3a9b (commit) via 4e83a73fd2c4842d574fe16a9c0c6ccf1f172e2c (commit) via b88ee742d1db3ad128b77a4658595630c1f8d787 (commit) via 3fa9430456d279511463c46b79b2ac4502d114e3 (commit) via b832e126ae28c730404f82021d343ad1f404195f (commit) via fda7138a0fb2a4899faac9c64d99f12405976437 (commit) via bffd357a4eca5b84c70ff366b5690f61113d6f6b (commit) via a0bc4a999d2be105fe2cf18deb6f4849381c6573 (commit) from cae2b4e846a2dbabfe930d157c736883cb54313f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6d45daa423a2b8561ae2e2ad183f89807bf026ba commit 6d45daa423a2b8561ae2e2ad183f89807bf026ba Merge: cae2b4e f63fba6 Author: Stephen Kelly AuthorDate: Sat Apr 18 10:02:53 2015 -0400 Commit: CMake Topic Stage CommitDate: Sat Apr 18 10:02:53 2015 -0400 Merge topic 'clean-up-cmMakefile' into next f63fba65 cmMakefile: Out-of-line the directory methods. 38910712 cmMakefile: Use method abstraction to access directories. 09c7ea5f cmMakefile: Rename SetStart* directory API to SetCurrent*. 614e9f31 cmMakefile: Remove redundant method duplication. b1fe0225 cmMakefile: Port users of GetStart* methods to new names. 3350fb5c cmMakefile: Rename GetCurrent{Output,Binary}Directory. 0199ec86 cmMakefile: Rename GetCurrent{,Source}Directory. b010b851 cmake: Remove redundant start directories. b44e3563 cmMakefile: Populate Home directories on initialize. 4e83a73f cmake: Initialize Home directories on cmake for find-package mode. b88ee742 Use the Home directories from the cmake class where intended. 3fa94304 cmake: Fix directory used to find the cache b832e126 cmMakefile: Initialize dir definitions early. fda7138a Remove redundant calls to MakeStartDirectoriesCurrent. bffd357a cmMakefile: Fix wrong parameter names. a0bc4a99 CMake Nightly Date Stamp diff --cc Source/cmLocalUnixMakefileGenerator3.cxx index 153ed09,fd43fb2..f66b54a --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@@ -1589,10 -1589,10 +1589,10 @@@ cmLocalUnixMakefileGenerator // Read the directory information file. cmMakefile* mf = this->Makefile; bool haveDirectoryInfo = false; - std::string dirInfoFile = this->Makefile->GetStartOutputDirectory(); + std::string dirInfoFile = this->Makefile->GetCurrentBinaryDirectory(); dirInfoFile += cmake::GetCMakeFilesDirectory(); dirInfoFile += "/CMakeDirectoryInformation.cmake"; - if(mf->ReadListFile(0, dirInfoFile.c_str()) && + if(mf->ReadListFile(dirInfoFile.c_str()) && !cmSystemTools::GetErrorOccuredFlag()) { haveDirectoryInfo = true; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f63fba653a7a279a4fba8b1dfe2a9d0b41746b99 commit f63fba653a7a279a4fba8b1dfe2a9d0b41746b99 Author: Stephen Kelly AuthorDate: Thu Apr 16 09:24:16 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 16:00:57 2015 +0200 cmMakefile: Out-of-line the directory methods. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 3860d8a..d5c5b35 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1703,6 +1703,37 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, } } +void cmMakefile::SetCurrentSourceDirectory(const std::string& dir) +{ + this->cmStartDirectory = dir; + cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory); + this->cmStartDirectory = + cmSystemTools::CollapseFullPath(this->cmStartDirectory); + this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", + this->cmStartDirectory.c_str()); +} + +const char* cmMakefile::GetCurrentSourceDirectory() const +{ + return this->cmStartDirectory.c_str(); +} + +void cmMakefile::SetCurrentBinaryDirectory(const std::string& dir) +{ + this->StartOutputDirectory = dir; + cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); + this->StartOutputDirectory = + cmSystemTools::CollapseFullPath(this->StartOutputDirectory); + cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str()); + this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", + this->StartOutputDirectory.c_str()); +} + +const char* cmMakefile::GetCurrentBinaryDirectory() const +{ + return this->StartOutputDirectory.c_str(); +} + //---------------------------------------------------------------------------- void cmMakefile::AddIncludeDirectories(const std::vector &incs, bool before) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 182cd57..111e238 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -444,43 +444,10 @@ public: */ void SetArgcArgv(const std::vector& args); - //@{ - /** - * Set/Get the start directory (or output directory). The start directory - * is the directory of the CMakeLists.txt file that started the current - * round of processing. Remember that CMake processes CMakeLists files by - * recursing up the tree starting at the StartDirectory and going up until - * it reaches the HomeDirectory. - */ - void SetCurrentSourceDirectory(const std::string& dir) - { - this->cmStartDirectory = dir; - cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory); - this->cmStartDirectory = - cmSystemTools::CollapseFullPath(this->cmStartDirectory); - this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", - this->cmStartDirectory.c_str()); - } - void SetCurrentBinaryDirectory(const std::string& dir) - { - this->StartOutputDirectory = dir; - cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); - this->StartOutputDirectory = - cmSystemTools::CollapseFullPath(this->StartOutputDirectory); - cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str()); - this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", - this->StartOutputDirectory.c_str()); - } - //@} - - const char* GetCurrentSourceDirectory() const - { - return this->cmStartDirectory.c_str(); - } - const char* GetCurrentBinaryDirectory() const - { - return this->StartOutputDirectory.c_str(); - } + void SetCurrentSourceDirectory(const std::string& dir); + const char* GetCurrentSourceDirectory() const; + void SetCurrentBinaryDirectory(const std::string& dir); + const char* GetCurrentBinaryDirectory() const; /* Get the current CMakeLists.txt file that is being processed. This * is just used in order to be able to 'branch' from one file to a second http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=38910712704797cda1bbf1a3b1aebae0dfc3a99f commit 38910712704797cda1bbf1a3b1aebae0dfc3a99f Author: Stephen Kelly AuthorDate: Thu Apr 16 22:37:08 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 16:00:57 2015 +0200 cmMakefile: Use method abstraction to access directories. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0c048b9..3860d8a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -225,11 +225,11 @@ void cmMakefile::Print() const } std::cout << " this->StartOutputDirectory; " << - this->StartOutputDirectory << std::endl; + this->GetCurrentBinaryDirectory() << std::endl; std::cout << " this->HomeOutputDirectory; " << this->HomeOutputDirectory << std::endl; std::cout << " this->cmStartDirectory; " << - this->cmStartDirectory << std::endl; + this->GetCurrentSourceDirectory() << std::endl; std::cout << " this->cmHomeDirectory; " << this->cmHomeDirectory << std::endl; std::cout << " this->ProjectName; " @@ -1584,9 +1584,9 @@ void cmMakefile::InitializeFromParent() this->Internal->VarStack.top() = parent->Internal->VarStack.top().Closure(); this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", - this->cmStartDirectory.c_str()); + this->GetCurrentSourceDirectory()); this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", - this->StartOutputDirectory.c_str()); + this->GetCurrentBinaryDirectory()); const std::vector& parentIncludes = parent->GetIncludeDirectoriesEntries(); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09c7ea5f4b1a85e76639f8ca17d37aa8632ad3c2 commit 09c7ea5f4b1a85e76639f8ca17d37aa8632ad3c2 Author: Stephen Kelly AuthorDate: Thu Apr 16 21:57:52 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 16:00:56 2015 +0200 cmMakefile: Rename SetStart* directory API to SetCurrent*. diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 5a7e0cd..f60d919 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -348,8 +348,8 @@ void cmCTestScriptHandler::CreateCMake() // Set CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR. // Also, some commands need Makefile->GetCurrentSourceDirectory(). std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); - this->Makefile->SetStartDirectory(cwd); - this->Makefile->SetStartOutputDirectory(cwd); + this->Makefile->SetCurrentSourceDirectory(cwd); + this->Makefile->SetCurrentBinaryDirectory(cwd); // remove all cmake commands which are not scriptable, since they can't be // used in ctest scripts diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 73e5b19..0c048b9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1690,8 +1690,8 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, this->LocalGenerator->GetGlobalGenerator()->AddLocalGenerator(lg2); // set the subdirs start dirs - lg2->GetMakefile()->SetStartDirectory(srcPath); - lg2->GetMakefile()->SetStartOutputDirectory(binPath); + lg2->GetMakefile()->SetCurrentSourceDirectory(srcPath); + lg2->GetMakefile()->SetCurrentBinaryDirectory(binPath); if(excludeFromAll) { lg2->GetMakefile()->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index f452f8c..182cd57 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -452,7 +452,7 @@ public: * recursing up the tree starting at the StartDirectory and going up until * it reaches the HomeDirectory. */ - void SetStartDirectory(const std::string& dir) + void SetCurrentSourceDirectory(const std::string& dir) { this->cmStartDirectory = dir; cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory); @@ -461,7 +461,7 @@ public: this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", this->cmStartDirectory.c_str()); } - void SetStartOutputDirectory(const std::string& dir) + void SetCurrentBinaryDirectory(const std::string& dir) { this->StartOutputDirectory = dir; cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 93d02d7..e69739c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -374,11 +374,11 @@ void cmake::ReadListFile(const std::vector& args, cmsys::auto_ptr lg(gg->CreateLocalGenerator()); lg->GetMakefile()->SetHomeOutputDirectory (cmSystemTools::GetCurrentWorkingDirectory()); - lg->GetMakefile()->SetStartOutputDirectory + lg->GetMakefile()->SetCurrentBinaryDirectory (cmSystemTools::GetCurrentWorkingDirectory()); lg->GetMakefile()->SetHomeDirectory (cmSystemTools::GetCurrentWorkingDirectory()); - lg->GetMakefile()->SetStartDirectory + lg->GetMakefile()->SetCurrentSourceDirectory (cmSystemTools::GetCurrentWorkingDirectory()); if (this->GetWorkingMode() != NORMAL_MODE) { diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index a279ec7..bd38566 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -647,8 +647,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) { cm.SetGlobalGenerator(ggd); cmsys::auto_ptr lgd(ggd->CreateLocalGenerator()); - lgd->GetMakefile()->SetStartDirectory(startDir); - lgd->GetMakefile()->SetStartOutputDirectory(startOutDir); + lgd->GetMakefile()->SetCurrentSourceDirectory(startDir); + lgd->GetMakefile()->SetCurrentBinaryDirectory(startOutDir); // Actually scan dependencies. return lgd->UpdateDependencies(depInfo.c_str(), http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=614e9f318855efda2f9c1c2cb69a7582a112c69d commit 614e9f318855efda2f9c1c2cb69a7582a112c69d Author: Stephen Kelly AuthorDate: Thu Apr 16 21:37:52 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 16:00:56 2015 +0200 cmMakefile: Remove redundant method duplication. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index fdccd3c..f452f8c 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -461,10 +461,6 @@ public: this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", this->cmStartDirectory.c_str()); } - const char* GetStartDirectory() const - { - return this->cmStartDirectory.c_str(); - } void SetStartOutputDirectory(const std::string& dir) { this->StartOutputDirectory = dir; @@ -475,10 +471,6 @@ public: this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", this->StartOutputDirectory.c_str()); } - const char* GetStartOutputDirectory() const - { - return this->StartOutputDirectory.c_str(); - } //@} const char* GetCurrentSourceDirectory() const http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b1fe0225c817ebaaf31f3f51a812560ea56eb7a3 commit b1fe0225c817ebaaf31f3f51a812560ea56eb7a3 Author: Stephen Kelly AuthorDate: Thu Apr 16 20:06:54 2015 +0200 Commit: Stephen Kelly CommitDate: Sat Apr 18 16:00:56 2015 +0200 cmMakefile: Port users of GetStart* methods to new names. diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 4f1fa3c..c55ea35 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -131,12 +131,12 @@ const char* CCONV cmGetHomeOutputDirectory(void *arg) const char* CCONV cmGetStartDirectory(void *arg) { cmMakefile *mf = static_cast(arg); - return mf->GetStartDirectory(); + return mf->GetCurrentSourceDirectory(); } const char* CCONV cmGetStartOutputDirectory(void *arg) { cmMakefile *mf = static_cast(arg); - return mf->GetStartOutputDirectory(); + return mf->GetCurrentBinaryDirectory(); } const char* CCONV cmGetCurrentDirectory(void *arg) { diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index dfa2cb1..e374387 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -77,7 +77,7 @@ void cmExtraCodeBlocksGenerator::CreateProjectFile( const std::vector& lgs) { const cmMakefile* mf=lgs[0]->GetMakefile(); - std::string outputDir=mf->GetStartOutputDirectory(); + std::string outputDir=mf->GetCurrentBinaryDirectory(); std::string projectName=mf->GetProjectName(); std::string filename=outputDir+"/"; @@ -331,7 +331,7 @@ void cmExtraCodeBlocksGenerator { // Only add the global targets from CMAKE_BINARY_DIR, // not from the subdirs - if (strcmp(makefile->GetStartOutputDirectory(), + if (strcmp(makefile->GetCurrentBinaryDirectory(), makefile->GetHomeOutputDirectory())==0) { this->AppendTarget(fout, ti->first, 0, @@ -550,14 +550,14 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, const cmMakefile* makefile, const char* compiler) { - std::string makefileName = makefile->GetStartOutputDirectory(); + std::string makefileName = makefile->GetCurrentBinaryDirectory(); makefileName += "/Makefile"; fout<<" \n"; if (target!=0) { int cbTargetType = this->GetCBTargetType(target); - std::string workingDir = makefile->GetStartOutputDirectory(); + std::string workingDir = makefile->GetCurrentBinaryDirectory(); if ( target->GetType()==cmTarget::EXECUTABLE) { // Determine the directory where the executable target is created, and @@ -653,7 +653,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, else // e.g. all and the GLOBAL and UTILITY targets { fout<<"