[Cmake-commits] CMake branch, next, updated. v3.5.0-645-gefe4b5c
Brad King
brad.king at kitware.com
Thu Mar 24 08:44:55 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 efe4b5ca9b3223a816ebe63a8280cb92cc72ee42 (commit)
via ad140c6e1bb6eda5d17a199304578dbd92bedbad (commit)
via f069be054833f465ab469b534fddbc52c5c9913b (commit)
from 89b60904cdd2d27cd9dbeea919b267522524702d (commit)
Those revisions listed 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=efe4b5ca9b3223a816ebe63a8280cb92cc72ee42
commit efe4b5ca9b3223a816ebe63a8280cb92cc72ee42
Merge: 89b6090 ad140c6
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Mar 24 08:44:54 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Mar 24 08:44:54 2016 -0400
Merge topic 'vs-startup-project' into next
ad140c6e VS: Put ALL_BUILD in the PREDEFINED_TARGETS_FOLDER
f069be05 VS: Fix default target support for targets nested inside a folder
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ad140c6e1bb6eda5d17a199304578dbd92bedbad
commit ad140c6e1bb6eda5d17a199304578dbd92bedbad
Author: Taylor Braun-Jones <taylor at braun-jones.org>
AuthorDate: Mon Mar 21 16:05:41 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Mar 23 13:22:15 2016 -0400
VS: Put ALL_BUILD in the PREDEFINED_TARGETS_FOLDER
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index b11b49a..04146fb 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -89,19 +89,13 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]);
gen[0]->AddGeneratorTarget(gt);
-#if 0
- // Can't activate this code because we want ALL_BUILD
- // selected as the default "startup project" when first
- // opened in Visual Studio... And if it's nested in a
- // folder, then that doesn't happen.
//
// Organize in the "predefined targets" folder:
//
- if (this->UseFolderProperty())
+ if (this->UseFolderProperty() && this->GetVersion() > VS71)
{
allBuild->SetProperty("FOLDER", this->GetPredefinedTargetsFolder());
}
-#endif
// Now make all targets depend on the ALL_BUILD target
for(std::vector<cmLocalGenerator*>::iterator i = gen.begin();
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f069be054833f465ab469b534fddbc52c5c9913b
commit f069be054833f465ab469b534fddbc52c5c9913b
Author: Taylor Braun-Jones <taylor at braun-jones.org>
AuthorDate: Mon Mar 21 16:01:20 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Mar 23 13:22:15 2016 -0400
VS: Fix default target support for targets nested inside a folder
It's not actually the first target in a `.sln` file that is treated as
the default startup project, but rather the first fully defined target.
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index f6796a5..7b51fdf 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -97,14 +97,31 @@ void cmGlobalVisualStudio71Generator
OrderedTargetDependSet orderedProjectTargets(
projectTargets, this->GetStartupProjectName(root));
- this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
+ // Generate the targets specification to a string. We will put this in
+ // the actual .sln file later. As a side effect, this method also
+ // populates the set of folders.
+ std::ostringstream targetsSlnString;
+ this->WriteTargetsToSolution(targetsSlnString, root, orderedProjectTargets);
+
+ // VS 7 does not support folders specified first.
+ if (this->GetVersion() <= VS71)
+ {
+ fout << targetsSlnString.str();
+ }
+ // Generate folder specification.
bool useFolderProperty = this->UseFolderProperty();
if (useFolderProperty)
{
this->WriteFolders(fout);
}
+ // Now write the actual target specification content.
+ if (this->GetVersion() > VS71)
+ {
+ fout << targetsSlnString.str();
+ }
+
// Write out the configurations information for the solution
fout << "Global\n";
// Write out the configurations for the solution
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index c7fe649..0207753 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -234,7 +234,10 @@ endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
add_RunCMake_test(include_external_msproject)
- add_RunCMake_test(VSSolution)
+ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([789]|10)" AND NOT CMAKE_VS_DEVENV_COMMAND)
+ set(NO_USE_FOLDERS 1)
+ endif()
+ add_RunCMake_test(VSSolution -DNO_USE_FOLDERS=${NO_USE_FOLDERS})
endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^789]|[789][0-9])")
diff --git a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
index 8ae9598..afd74a1 100644
--- a/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VSSolution/RunCMakeTest.cmake
@@ -10,3 +10,7 @@ run_cmake(Override1)
run_cmake(Override2)
run_cmake(StartupProject)
run_cmake(StartupProjectMissing)
+
+if(RunCMake_GENERATOR MATCHES "Visual Studio ([^7]|[7][0-9])" AND NOT NO_USE_FOLDERS)
+ run_cmake(StartupProjectUseFolders)
+endif()
diff --git a/Tests/RunCMake/VSSolution/StartupProjectUseFolders-check.cmake b/Tests/RunCMake/VSSolution/StartupProjectUseFolders-check.cmake
new file mode 100644
index 0000000..c0a545a
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/StartupProjectUseFolders-check.cmake
@@ -0,0 +1,9 @@
+getProjectNames(projects)
+list(GET projects 0 first_project)
+if(NOT first_project STREQUAL "CMakePredefinedTargets")
+ error("CMakePredefinedTargets is not the first project")
+endif()
+list(GET projects 1 second_project)
+if(NOT second_project STREQUAL "TestStartup")
+ error("TestStartup does not immediately follow the CMakePredefinedTargets project")
+endif()
diff --git a/Tests/RunCMake/VSSolution/StartupProjectUseFolders.cmake b/Tests/RunCMake/VSSolution/StartupProjectUseFolders.cmake
new file mode 100644
index 0000000..8e422a4
--- /dev/null
+++ b/Tests/RunCMake/VSSolution/StartupProjectUseFolders.cmake
@@ -0,0 +1,3 @@
+add_custom_target(TestStartup)
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT "TestStartup")
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list