[Cmake-commits] CMake branch, next, updated. v3.5.0-544-g020f72f
Brad King
brad.king at kitware.com
Fri Mar 18 13:28:40 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 020f72fae1990c8da4e291e7cd07b6b220a85d05 (commit)
via cdfd837a09bd752ff1756feb18c4d9443020c54b (commit)
via 5c1f4da83d1142e52b361e8f59dd68ea5728e843 (commit)
from 52badc53fb23ba97db7a46b1bbb7d4cc3c47b858 (commit)
Those revisions listed 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=020f72fae1990c8da4e291e7cd07b6b220a85d05
commit 020f72fae1990c8da4e291e7cd07b6b220a85d05
Merge: 52badc5 cdfd837
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 18 13:28:36 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Mar 18 13:28:36 2016 -0400
Merge topic 'vs-startup-project' into next
cdfd837a VS: Add option to choose the `.sln` startup project (#15578)
5c1f4da8 Tests: Rename RunCMake.{SolutionGlobalSections => VSSolution}
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cdfd837a09bd752ff1756feb18c4d9443020c54b
commit cdfd837a09bd752ff1756feb18c4d9443020c54b
Author: Davy Durham <ddurham at bomgar.com>
AuthorDate: Thu Mar 17 16:12:02 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 18 13:27:24 2016 -0400
VS: Add option to choose the `.sln` startup project (#15578)
Add a `VS_STARTUP_PROJECT` directory property to specify the project
that should be placed first in the `.sln` file so that it will be
selected as the default startup project.
Co-Author: Taylor Braun-Jones <taylor.braunjones at avigilon.com>
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index fbde4eb..dadbc6e 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -76,6 +76,7 @@ Properties on Directories
/prop_dir/VARIABLES
/prop_dir/VS_GLOBAL_SECTION_POST_section
/prop_dir/VS_GLOBAL_SECTION_PRE_section
+ /prop_dir/VS_STARTUP_PROJECT
.. _`Target Properties`:
diff --git a/Help/prop_dir/VS_STARTUP_PROJECT.rst b/Help/prop_dir/VS_STARTUP_PROJECT.rst
new file mode 100644
index 0000000..edd4832
--- /dev/null
+++ b/Help/prop_dir/VS_STARTUP_PROJECT.rst
@@ -0,0 +1,12 @@
+VS_STARTUP_PROJECT
+------------------
+
+Specify the default startup project in a Visual Studio solution.
+
+The property must be set to the name of an existing target. This
+will cause that project to be listed first in the generated solution
+file causing Visual Studio to make it the startup project if the
+solution has never been opened before.
+
+If this property is not specified, then the "ALL_BUILD" project
+will be the default.
diff --git a/Help/release/dev/vs-startup-project.rst b/Help/release/dev/vs-startup-project.rst
new file mode 100644
index 0000000..f467400
--- /dev/null
+++ b/Help/release/dev/vs-startup-project.rst
@@ -0,0 +1,6 @@
+vs-startup-project
+------------------
+
+* The :ref:`Visual Studio Generators` learned to honor a new
+ :prop_dir:`VS_STARTUP_PROJECT` directory property that specifies
+ the default startup project for generated solutions (``.sln`` files).
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 8227b82..f6796a5 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -94,7 +94,8 @@ void cmGlobalVisualStudio71Generator
TargetDependSet projectTargets;
TargetDependSet originalTargets;
this->GetTargetSets(projectTargets, originalTargets, root, generators);
- OrderedTargetDependSet orderedProjectTargets(projectTargets, "ALL_BUILD");
+ OrderedTargetDependSet orderedProjectTargets(
+ projectTargets, this->GetStartupProjectName(root));
this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 00bb511..b11b49a 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -519,6 +519,32 @@ cmGlobalVisualStudioGenerator::GetUtilityDepend(
}
//----------------------------------------------------------------------------
+std::string
+cmGlobalVisualStudioGenerator::GetStartupProjectName(
+ cmLocalGenerator const* root) const
+{
+ const char* n = root->GetMakefile()->GetProperty("VS_STARTUP_PROJECT");
+ if (n && *n)
+ {
+ std::string startup = n;
+ if (this->FindTarget(startup))
+ {
+ return startup;
+ }
+ else
+ {
+ root->GetMakefile()->IssueMessage(
+ cmake::AUTHOR_WARNING,
+ "Directory property VS_STARTUP_PROJECT specifies target "
+ "'" + startup + "' that does not exist. Ignoring.");
+ }
+ }
+
+ // default, if not specified
+ return this->GetAllTargetName();
+}
+
+//----------------------------------------------------------------------------
#include <windows.h>
//----------------------------------------------------------------------------
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index ac9111e..723a75f 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -106,6 +106,8 @@ public:
void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const;
+ std::string GetStartupProjectName(cmLocalGenerator const* root) const;
+
void AddSymbolExportCommand(
cmGeneratorTarget*, std::vector<cmCustomCommand>& commands,
std::string const& configName);
diff --git a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
index 6ae158d..8ae9598 100644
--- a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
@@ -8,3 +8,5 @@ run_cmake(MorePost)
run_cmake(PrePost)
run_cmake(Override1)
run_cmake(Override2)
+run_cmake(StartupProject)
+run_cmake(StartupProjectMissing)
diff --git a/Tests/RunCMake/VSSolution/StartupProject-check.cmake b/Tests/RunCMake/VSSolution/StartupProject-check.cmake
new file mode 100644
index 0000000..fd7cc28
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/StartupProject-check.cmake
@@ -0,0 +1,4 @@
+getFirstProject(first_project StartupProject)
+if(NOT first_project STREQUAL "ZERO_CHECK")
+ error("ZERO_CHECK is not the startup project")
+endif()
diff --git a/Tests/RunCMake/VSSolution/StartupProject.cmake b/Tests/RunCMake/VSSolution/StartupProject.cmake
new file mode 100644
index 0000000..8ba4e3e
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/StartupProject.cmake
@@ -0,0 +1 @@
+set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT "ZERO_CHECK")
diff --git a/Tests/RunCMake/VSSolution/StartupProjectMissing-check.cmake b/Tests/RunCMake/VSSolution/StartupProjectMissing-check.cmake
new file mode 100644
index 0000000..95fede7
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/StartupProjectMissing-check.cmake
@@ -0,0 +1,4 @@
+getFirstProject(first_project StartupProjectMissing)
+if(NOT first_project STREQUAL "ALL_BUILD")
+ error("ALL_BUILD is not the startup project")
+endif()
diff --git a/Tests/RunCMake/VSSolution/StartupProjectMissing-stderr.txt b/Tests/RunCMake/VSSolution/StartupProjectMissing-stderr.txt
new file mode 100644
index 0000000..da92c6d
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/StartupProjectMissing-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Warning \(dev\) in CMakeLists.txt:
+ Directory property VS_STARTUP_PROJECT specifies target 'DoesNotExist' that
+ does not exist. Ignoring.
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/VSSolution/StartupProjectMissing.cmake b/Tests/RunCMake/VSSolution/StartupProjectMissing.cmake
new file mode 100644
index 0000000..907a877
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/StartupProjectMissing.cmake
@@ -0,0 +1 @@
+set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT "DoesNotExist")
diff --git a/Tests/RunCMake/VSSolution/solution_parsing.cmake b/Tests/RunCMake/VSSolution/solution_parsing.cmake
index dd158ef..001b584 100644
--- a/Tests/RunCMake/VSSolution/solution_parsing.cmake
+++ b/Tests/RunCMake/VSSolution/solution_parsing.cmake
@@ -50,6 +50,20 @@ macro(parseGlobalSections arg_out_pre arg_out_post testName)
endmacro()
+macro(getFirstProject arg_out_first_project testName)
+ set(${arg_out_first_project} "")
+ set(sln "${RunCMake_TEST_BINARY_DIR}/${testName}.sln")
+ if(NOT EXISTS "${sln}")
+ error("Expected solution file ${sln} does not exist")
+ endif()
+ file(STRINGS "${sln}" project_lines REGEX "^Project\\(")
+ list(GET project_lines 0 first_project)
+ string(REGEX REPLACE ".* = \"" "" first_project "${first_project}")
+ string(REGEX REPLACE "\", .*" "" first_project "${first_project}")
+ set(${arg_out_first_project} "${first_project}")
+endmacro()
+
+
macro(testGlobalSection prefix sectionName)
if(NOT DEFINED ${prefix}_${sectionName})
error("Section ${sectionName} does not exist")
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c1f4da83d1142e52b361e8f59dd68ea5728e843
commit 5c1f4da83d1142e52b361e8f59dd68ea5728e843
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 18 13:20:42 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 18 13:20:42 2016 -0400
Tests: Rename RunCMake.{SolutionGlobalSections => VSSolution}
The test will be suitable for covering other `.sln` content too.
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 588f3a1..c7fe649 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -234,7 +234,7 @@ endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
add_RunCMake_test(include_external_msproject)
- add_RunCMake_test(SolutionGlobalSections)
+ add_RunCMake_test(VSSolution)
endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^789]|[789][0-9])")
diff --git a/Tests/RunCMake/SolutionGlobalSections/CMakeLists.txt b/Tests/RunCMake/VSSolution/CMakeLists.txt
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/CMakeLists.txt
rename to Tests/RunCMake/VSSolution/CMakeLists.txt
diff --git a/Tests/RunCMake/SolutionGlobalSections/MorePost-check.cmake b/Tests/RunCMake/VSSolution/MorePost-check.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/MorePost-check.cmake
rename to Tests/RunCMake/VSSolution/MorePost-check.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/MorePost.cmake b/Tests/RunCMake/VSSolution/MorePost.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/MorePost.cmake
rename to Tests/RunCMake/VSSolution/MorePost.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/MorePre-check.cmake b/Tests/RunCMake/VSSolution/MorePre-check.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/MorePre-check.cmake
rename to Tests/RunCMake/VSSolution/MorePre-check.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/MorePre.cmake b/Tests/RunCMake/VSSolution/MorePre.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/MorePre.cmake
rename to Tests/RunCMake/VSSolution/MorePre.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/OnePost-check.cmake b/Tests/RunCMake/VSSolution/OnePost-check.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/OnePost-check.cmake
rename to Tests/RunCMake/VSSolution/OnePost-check.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/OnePost.cmake b/Tests/RunCMake/VSSolution/OnePost.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/OnePost.cmake
rename to Tests/RunCMake/VSSolution/OnePost.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/OnePre-check.cmake b/Tests/RunCMake/VSSolution/OnePre-check.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/OnePre-check.cmake
rename to Tests/RunCMake/VSSolution/OnePre-check.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/OnePre.cmake b/Tests/RunCMake/VSSolution/OnePre.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/OnePre.cmake
rename to Tests/RunCMake/VSSolution/OnePre.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/Override1-check.cmake b/Tests/RunCMake/VSSolution/Override1-check.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/Override1-check.cmake
rename to Tests/RunCMake/VSSolution/Override1-check.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/Override1.cmake b/Tests/RunCMake/VSSolution/Override1.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/Override1.cmake
rename to Tests/RunCMake/VSSolution/Override1.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/Override2-check.cmake b/Tests/RunCMake/VSSolution/Override2-check.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/Override2-check.cmake
rename to Tests/RunCMake/VSSolution/Override2-check.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/Override2.cmake b/Tests/RunCMake/VSSolution/Override2.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/Override2.cmake
rename to Tests/RunCMake/VSSolution/Override2.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/PrePost-check.cmake b/Tests/RunCMake/VSSolution/PrePost-check.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/PrePost-check.cmake
rename to Tests/RunCMake/VSSolution/PrePost-check.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/PrePost.cmake b/Tests/RunCMake/VSSolution/PrePost.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/PrePost.cmake
rename to Tests/RunCMake/VSSolution/PrePost.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/RunCMakeTest.cmake b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/RunCMakeTest.cmake
rename to Tests/RunCMake/VSSolution/RunCMakeTest.cmake
diff --git a/Tests/RunCMake/SolutionGlobalSections/solution_parsing.cmake b/Tests/RunCMake/VSSolution/solution_parsing.cmake
similarity index 100%
rename from Tests/RunCMake/SolutionGlobalSections/solution_parsing.cmake
rename to Tests/RunCMake/VSSolution/solution_parsing.cmake
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-properties.7.rst | 1 +
Help/prop_dir/VS_STARTUP_PROJECT.rst | 12 +++++++++
Help/release/dev/vs-startup-project.rst | 6 +++++
Source/cmGlobalVisualStudio71Generator.cxx | 3 ++-
Source/cmGlobalVisualStudioGenerator.cxx | 26 ++++++++++++++++++++
Source/cmGlobalVisualStudioGenerator.h | 2 ++
Tests/RunCMake/CMakeLists.txt | 2 +-
.../CMakeLists.txt | 0
.../MorePost-check.cmake | 0
.../MorePost.cmake | 0
.../MorePre-check.cmake | 0
.../MorePre.cmake | 0
.../OnePost-check.cmake | 0
.../OnePost.cmake | 0
.../OnePre-check.cmake | 0
.../OnePre.cmake | 0
.../Override1-check.cmake | 0
.../Override1.cmake | 0
.../Override2-check.cmake | 0
.../Override2.cmake | 0
.../PrePost-check.cmake | 0
.../PrePost.cmake | 0
.../RunCMakeTest.cmake | 2 ++
.../RunCMake/VSSolution/StartupProject-check.cmake | 4 +++
Tests/RunCMake/VSSolution/StartupProject.cmake | 1 +
.../VSSolution/StartupProjectMissing-check.cmake | 4 +++
.../VSSolution/StartupProjectMissing-stderr.txt | 4 +++
.../VSSolution/StartupProjectMissing.cmake | 1 +
.../solution_parsing.cmake | 14 +++++++++++
29 files changed, 80 insertions(+), 2 deletions(-)
create mode 100644 Help/prop_dir/VS_STARTUP_PROJECT.rst
create mode 100644 Help/release/dev/vs-startup-project.rst
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/CMakeLists.txt (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/MorePost-check.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/MorePost.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/MorePre-check.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/MorePre.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/OnePost-check.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/OnePost.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/OnePre-check.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/OnePre.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/Override1-check.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/Override1.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/Override2-check.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/Override2.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/PrePost-check.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/PrePost.cmake (100%)
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/RunCMakeTest.cmake (78%)
create mode 100644 Tests/RunCMake/VSSolution/StartupProject-check.cmake
create mode 100644 Tests/RunCMake/VSSolution/StartupProject.cmake
create mode 100644 Tests/RunCMake/VSSolution/StartupProjectMissing-check.cmake
create mode 100644 Tests/RunCMake/VSSolution/StartupProjectMissing-stderr.txt
create mode 100644 Tests/RunCMake/VSSolution/StartupProjectMissing.cmake
rename Tests/RunCMake/{SolutionGlobalSections => VSSolution}/solution_parsing.cmake (78%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list