This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  0235eda8011ac6f8bdafa2a2e2ae8044c47556dc (commit)
       via  dd84d713d8bc75aef40564320afecea2ea8165fd (commit)
      from  03ed0e9279261bc7967d77b19ab9d71d3a929512 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0235eda8011ac6f8bdafa2a2e2ae8044c47556dc
commit 0235eda8011ac6f8bdafa2a2e2ae8044c47556dc
Merge: 03ed0e9 dd84d71
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Nov 28 15:57:40 2016 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Mon Nov 28 15:57:40 2016 -0500

    Merge topic 'vs-default-build-package' into next
    
    dd84d713 VS: Add option to place `PACKAGE` target in solution default build


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd84d713d8bc75aef40564320afecea2ea8165fd
commit dd84d713d8bc75aef40564320afecea2ea8165fd
Author:     Michael Stürmer <michael.stuer...@schaeffler.com>
AuthorDate: Mon Nov 21 13:25:35 2016 +0100
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Mon Nov 28 15:55:42 2016 -0500

    VS: Add option to place `PACKAGE` target in solution default build
    
    Add a `CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD` variable to control
    this behavior.

diff --git a/Help/manual/cmake-variables.7.rst 
b/Help/manual/cmake-variables.7.rst
index d68265d..c621d3a 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -328,6 +328,7 @@ Variables that Control the Build
    /variable/CMAKE_USE_RELATIVE_PATHS
    /variable/CMAKE_VISIBILITY_INLINES_HIDDEN
    /variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
+   /variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD
    /variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
    /variable/CMAKE_WIN32_EXECUTABLE
    /variable/CMAKE_XCODE_ATTRIBUTE_an-attribute
diff --git a/Help/release/dev/vs-default-build-package.rst 
b/Help/release/dev/vs-default-build-package.rst
new file mode 100644
index 0000000..62c66e0
--- /dev/null
+++ b/Help/release/dev/vs-default-build-package.rst
@@ -0,0 +1,7 @@
+vs-default-build-package
+------------------------
+
+* The :ref:`Visual Studio Generators` for VS 2010 and above now support
+  adding the PACKAGE target to the targets which are built by default.
+  The behavior is similar to 
:variable:`CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD`
+  and can be toggled using 
:variable:`CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD`.
diff --git a/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst 
b/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst
new file mode 100644
index 0000000..693ba45
--- /dev/null
+++ b/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst
@@ -0,0 +1,8 @@
+CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD
+-----------------------------------------
+
+Include ``PACKAGE`` target to default build.
+
+In Visual Studio solution, by default the ``PACKAGE`` target will not be part
+of the default build. Setting this variable will enable the ``PACKAGE`` target
+to be part of the default build.
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx 
b/Source/cmGlobalVisualStudio7Generator.cxx
index c60a1ff..602666e 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -681,20 +681,27 @@ std::set<std::string> 
cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
   // default build if another target depends on it
   int type = target->GetType();
   if (type == cmStateEnums::GLOBAL_TARGET) {
-    // check if INSTALL target is part of default build
-    if (target->GetName() == "INSTALL") {
-      // inspect CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD properties
-      for (std::vector<std::string>::const_iterator i = configs.begin();
-           i != configs.end(); ++i) {
-        const char* propertyValue =
-          target->Target->GetMakefile()->GetDefinition(
-            "CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD");
-        cmGeneratorExpression ge;
-        CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
-          ge.Parse(propertyValue);
-        if (cmSystemTools::IsOn(
-              cge->Evaluate(target->GetLocalGenerator(), *i))) {
-          activeConfigs.insert(*i);
+    std::list<std::string> targetNames;
+    targetNames.push_back("INSTALL");
+    targetNames.push_back("PACKAGE");
+    for (std::list<std::string>::const_iterator t = targetNames.begin();
+         t != targetNames.end(); ++t) {
+      // check if target <*t> is part of default build
+      if (target->GetName() == *t) {
+        const std::string propertyName =
+          "CMAKE_VS_INCLUDE_" + *t + "_TO_DEFAULT_BUILD";
+        // inspect CMAKE_VS_INCLUDE_<*t>_TO_DEFAULT_BUILD properties
+        for (std::vector<std::string>::const_iterator i = configs.begin();
+             i != configs.end(); ++i) {
+          const char* propertyValue =
+            target->Target->GetMakefile()->GetDefinition(propertyName);
+          cmGeneratorExpression ge;
+          CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
+            ge.Parse(propertyValue);
+          if (cmSystemTools::IsOn(
+                cge->Evaluate(target->GetLocalGenerator(), *i))) {
+            activeConfigs.insert(*i);
+          }
         }
       }
     }
diff --git a/Tests/RunCMake/VSSolution/AddPackageToDefault-check.cmake 
b/Tests/RunCMake/VSSolution/AddPackageToDefault-check.cmake
new file mode 100644
index 0000000..402f6d5
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/AddPackageToDefault-check.cmake
@@ -0,0 +1,29 @@
+set(vcSlnFile "${RunCMake_TEST_BINARY_DIR}/AddPackageToDefault.sln")
+if(NOT EXISTS "${vcSlnFile}")
+  set(RunCMake_TEST_FAILED "Project file ${vcSlnFile} does not exist.")
+  return()
+endif()
+
+set(packageGuidFound FALSE)
+set(packageGuid "")
+set(packageInBuild FALSE)
+file(STRINGS "${vcSlnFile}" lines)
+foreach(line IN LISTS lines)
+  if(NOT packageGuidFound)
+    if(line MATCHES "^Project.*\"PACKAGE.vcxproj\".*\"{([A-F0-9-]+)}\"$")
+      set(packageGuidFound TRUE)
+      set(packageGuid ${CMAKE_MATCH_1})
+    endif()
+  else()
+    if(line MATCHES ".*{${packageGuid}}.*")
+      if(line MATCHES "^[ \t]*{${packageGuid}}\\..*\\.Build.0 = .*$")
+          set(packageInBuild TRUE)
+      endif()
+    endif()
+  endif()
+endforeach()
+
+if(NOT packageInBuild)
+  set(RunCMake_TEST_FAILED "PACKAGE is not in default build")
+  return()
+endif()
diff --git a/Tests/RunCMake/VSSolution/AddPackageToDefault.cmake 
b/Tests/RunCMake/VSSolution/AddPackageToDefault.cmake
new file mode 100644
index 0000000..5f69ec5
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/AddPackageToDefault.cmake
@@ -0,0 +1,2 @@
+include(CPack)
+set(CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD TRUE)
diff --git a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake 
b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
index afd74a1..4ec3e3b 100644
--- a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
@@ -10,6 +10,7 @@ run_cmake(Override1)
 run_cmake(Override2)
 run_cmake(StartupProject)
 run_cmake(StartupProjectMissing)
+run_cmake(AddPackageToDefault)
 
 if(RunCMake_GENERATOR MATCHES "Visual Studio ([^7]|[7][0-9])" AND NOT 
NO_USE_FOLDERS)
   run_cmake(StartupProjectUseFolders)

-----------------------------------------------------------------------

Summary of changes:
 Help/manual/cmake-variables.7.rst                  |    1 +
 Help/release/dev/vs-default-build-package.rst      |    7 ++++
 .../CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst  |    8 +++++
 Source/cmGlobalVisualStudio7Generator.cxx          |   35 ++++++++++++--------
 .../VSSolution/AddPackageToDefault-check.cmake     |   29 ++++++++++++++++
 .../RunCMake/VSSolution/AddPackageToDefault.cmake  |    2 ++
 Tests/RunCMake/VSSolution/RunCMakeTest.cmake       |    1 +
 7 files changed, 69 insertions(+), 14 deletions(-)
 create mode 100644 Help/release/dev/vs-default-build-package.rst
 create mode 100644 Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst
 create mode 100644 Tests/RunCMake/VSSolution/AddPackageToDefault-check.cmake
 create mode 100644 Tests/RunCMake/VSSolution/AddPackageToDefault.cmake


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to