[Cmake-commits] CMake branch, next, updated. v3.2.2-2579-g6a6fae9
Brad King
brad.king at kitware.com
Wed May 6 10:35:44 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 6a6fae9caf7d70999db96e4317e62859a53dd5d4 (commit)
via a6e4e73da3de092439b6fcfe884f44a7c8a1ad81 (commit)
via 562e69dd500f3b1558ab3ffd62679b8b4b0df842 (commit)
from 3b2929cd2d253b02f88112943db9b19b5ff81a9f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a6fae9caf7d70999db96e4317e62859a53dd5d4
commit 6a6fae9caf7d70999db96e4317e62859a53dd5d4
Merge: 3b2929c a6e4e73
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed May 6 10:35:42 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed May 6 10:35:42 2015 -0400
Merge topic 'vs-install-in-default-build' into next
a6e4e73d VS: Add option to put INSTALL target in .sln default build
562e69dd Tests: Enable devenv tests on VS >= 10
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6e4e73da3de092439b6fcfe884f44a7c8a1ad81
commit a6e4e73da3de092439b6fcfe884f44a7c8a1ad81
Author: Robert Goulet <robert.goulet at autodesk.com>
AuthorDate: Fri May 1 13:46:17 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed May 6 10:31:39 2015 -0400
VS: Add option to put INSTALL target in .sln default build
Add a CMAKE_VS_INCLUDE_INSTALL_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 cbc8a07..e6c966b 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -268,6 +268,7 @@ Variables that Control the Build
/variable/CMAKE_TRY_COMPILE_CONFIGURATION
/variable/CMAKE_USE_RELATIVE_PATHS
/variable/CMAKE_VISIBILITY_INLINES_HIDDEN
+ /variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
/variable/CMAKE_WIN32_EXECUTABLE
/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute
/variable/EXECUTABLE_OUTPUT_PATH
diff --git a/Help/release/dev/vs-install-in-default-build.rst b/Help/release/dev/vs-install-in-default-build.rst
new file mode 100644
index 0000000..b57592e
--- /dev/null
+++ b/Help/release/dev/vs-install-in-default-build.rst
@@ -0,0 +1,7 @@
+vs-install-in-default-build
+---------------------------
+
+* The :ref:`Visual Studio Generators` learned a new
+ :variable:`CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD` option
+ to put the ``INSTALL`` target in the default build of a
+ solution (``.sln``) file.
diff --git a/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst b/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst
new file mode 100644
index 0000000..68f1ff6
--- /dev/null
+++ b/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst
@@ -0,0 +1,8 @@
+CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
+-----------------------------------------
+
+Include INSTALL target to default build.
+
+In Visual Studio solution, by default the INSTALL target will not be part of
+the default build. Setting this variable will enable the INSTALL target to be
+part of the default build.
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index de90f7e..ead5ddc 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -1031,6 +1031,24 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
int type = target->GetType();
if (type == cmTarget::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>::iterator i = this->Configurations.begin();
+ i != this->Configurations.end(); ++i)
+ {
+ const char* propertyValue = target->GetMakefile()
+ ->GetDefinition("CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD");
+ cmGeneratorExpression ge;
+ cmsys::auto_ptr<cmCompiledGeneratorExpression>
+ cge = ge.Parse(propertyValue);
+ if(cmSystemTools::IsOn(cge->Evaluate(target->GetMakefile(), *i)))
+ {
+ activeConfigs.insert(*i);
+ }
+ }
+ }
return activeConfigs;
}
if(type == cmTarget::UTILITY && !this->IsDependedOn(projectTargets, target))
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index a6cefa2..9e340a8 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1870,6 +1870,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
--build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
--build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
--build-project VSExcludeFromDefaultBuild
+ --build-target install
--test-command ${CMAKE_COMMAND}
-D "activeConfig=${config}"
-D "allConfigs=${CMAKE_CONFIGURATION_TYPES}"
diff --git a/Tests/VSExcludeFromDefaultBuild/CMakeLists.txt b/Tests/VSExcludeFromDefaultBuild/CMakeLists.txt
index d30414b..243fdf5 100644
--- a/Tests/VSExcludeFromDefaultBuild/CMakeLists.txt
+++ b/Tests/VSExcludeFromDefaultBuild/CMakeLists.txt
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 2.8.9)
project(VSExcludeFromDefaultBuild)
+# CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD will enable the INSTALL target to be part of the default build
+set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
+
# First step is to clear all .exe files in output so that possible past
# failures of this test do not prevent it from succeeding.
add_custom_target(ClearExes ALL
@@ -13,6 +16,7 @@ add_custom_target(ClearExes ALL
function(add_test_executable target)
add_executable("${target}" ${ARGN})
add_dependencies("${target}" ClearExes)
+ install(TARGETS "${target}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/install" OPTIONAL)
endfunction()
add_test_executable(DefaultBuilt main.c)
diff --git a/Tests/VSExcludeFromDefaultBuild/ClearExes.cmake b/Tests/VSExcludeFromDefaultBuild/ClearExes.cmake
index ece30ad..99cf1a5 100644
--- a/Tests/VSExcludeFromDefaultBuild/ClearExes.cmake
+++ b/Tests/VSExcludeFromDefaultBuild/ClearExes.cmake
@@ -2,3 +2,7 @@ file(GLOB exeFiles "${dir}/*.exe")
foreach(exeFile IN LISTS exeFiles)
file(REMOVE "${exeFile}")
endforeach()
+file(GLOB exeFiles "${dir}/install/*.exe")
+foreach(exeFile IN LISTS exeFiles)
+ file(REMOVE "${exeFile}")
+endforeach()
diff --git a/Tests/VSExcludeFromDefaultBuild/ResultTest.cmake b/Tests/VSExcludeFromDefaultBuild/ResultTest.cmake
index 8fb00bf..f96e70b 100644
--- a/Tests/VSExcludeFromDefaultBuild/ResultTest.cmake
+++ b/Tests/VSExcludeFromDefaultBuild/ResultTest.cmake
@@ -7,6 +7,12 @@ macro(TestExists exeName)
else()
message(FATAL_ERROR "File ${exeFile} was expected ${ARGN} to exist!")
endif()
+ set(exeFile "${dir}/${activeConfig}/install/${exeName}.exe")
+ if(${ARGN} EXISTS "${exeFile}")
+ message(STATUS "File ${exeFile} was correctly found ${ARGN} to exist.")
+ else()
+ message(FATAL_ERROR "File ${exeFile} was expected ${ARGN} to exist!")
+ endif()
endmacro()
TestExists(DefaultBuilt)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=562e69dd500f3b1558ab3ffd62679b8b4b0df842
commit 562e69dd500f3b1558ab3ffd62679b8b4b0df842
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon May 4 16:03:43 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon May 4 16:07:23 2015 -0400
Tests: Enable devenv tests on VS >= 10
The VSExcludeFromDefaultBuild have not been enabled on VS >= 10 since
commit v3.0.0-rc1~260^2~9 (Tests: Simplify VSExcludeFromDefaultBuild
configuration, 2013-11-14). Since commit v3.0.0-rc1~260^2~2 (VS: Add
CMAKE_VS_(DEVENV|MSBUILD|MSDEV)_COMMAND variables, 2013-12-04) we can
simply check the CMAKE_VS_DEVENV_COMMAND variable for a devenv tool
to use for the test.
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 07545ae..a6cefa2 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -46,7 +46,9 @@ configure_file(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in
# Testing
if(BUILD_TESTING)
set(CMake_TEST_DEVENV "")
- if(CMAKE_GENERATOR MATCHES "Visual Studio [7-9] " AND
+ if(CMAKE_VS_DEVENV_COMMAND)
+ set(CMake_TEST_DEVENV "${CMAKE_VS_DEVENV_COMMAND}")
+ elseif(CMAKE_GENERATOR MATCHES "Visual Studio [7-9] " AND
NOT CMAKE_MAKE_PROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]")
set(CMake_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}")
endif()
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-variables.7.rst | 1 +
Help/release/dev/vs-install-in-default-build.rst | 7 +++++++
.../CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst | 8 ++++++++
Source/cmGlobalVisualStudio7Generator.cxx | 18 ++++++++++++++++++
Tests/CMakeLists.txt | 5 ++++-
Tests/VSExcludeFromDefaultBuild/CMakeLists.txt | 4 ++++
Tests/VSExcludeFromDefaultBuild/ClearExes.cmake | 4 ++++
Tests/VSExcludeFromDefaultBuild/ResultTest.cmake | 6 ++++++
8 files changed, 52 insertions(+), 1 deletion(-)
create mode 100644 Help/release/dev/vs-install-in-default-build.rst
create mode 100644 Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list