This is an automated email from 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 dd764e11ffcb065779e6ca84e6ffa8435db7f681 (commit) via 6122909c33bea1256867a40a09e0eafa569e8c8b (commit) from f51df41763ad67dc955e79dbd3a95bee436eb154 (commit) Those revisions listed 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=dd764e11ffcb065779e6ca84e6ffa8435db7f681 commit dd764e11ffcb065779e6ca84e6ffa8435db7f681 Merge: f51df41 6122909 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Feb 26 11:05:40 2016 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Fri Feb 26 11:05:40 2016 -0500 Merge topic 'vs-vcxproj-ConfigurationType' into next 6122909c VS: Add option to set `ConfigurationType` of a .vcxproj file https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6122909c33bea1256867a40a09e0eafa569e8c8b commit 6122909c33bea1256867a40a09e0eafa569e8c8b Author: Fabian Otto <fabian.o...@rohde-schwarz.com> AuthorDate: Thu Feb 25 22:04:05 2016 +0100 Commit: Brad King <brad.k...@kitware.com> CommitDate: Fri Feb 26 10:52:13 2016 -0500 VS: Add option to set `ConfigurationType` of a .vcxproj file Add a VS_CONFIGURATION_TYPE target property to set this value explicitly. This is useful to build a Windows Kernel Mode Driver, for example. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index a41d484..d6618fe 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -255,6 +255,7 @@ Properties on Targets /prop_tgt/TYPE /prop_tgt/VERSION /prop_tgt/VISIBILITY_INLINES_HIDDEN + /prop_tgt/VS_CONFIGURATION_TYPE /prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION /prop_tgt/VS_DOTNET_REFERENCES /prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION diff --git a/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst b/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst new file mode 100644 index 0000000..ff987ff --- /dev/null +++ b/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst @@ -0,0 +1,10 @@ +VS_CONFIGURATION_TYPE +--------------------- + +Visual Studio project configuration type. + +Sets the ``ConfigurationType`` attribute for a generated Visual Studio project. +If this property is set, it overrides the default setting that is based on the +target type (e.g. ``StaticLibrary``, ``Application``, ...). + +Supported on :ref:`Visual Studio Generators` for VS 2010 and higher. diff --git a/Help/release/dev/vs-vcxproj-ConfigurationType.rst b/Help/release/dev/vs-vcxproj-ConfigurationType.rst new file mode 100644 index 0000000..46d05b4 --- /dev/null +++ b/Help/release/dev/vs-vcxproj-ConfigurationType.rst @@ -0,0 +1,6 @@ +vs-vcxproj-ConfigurationType +---------------------------- + +* :ref:`Visual Studio Generators` for VS 2010 and above learned a new + :prop_tgt:`VS_CONFIGURATION_TYPE` target property to specify a custom + project file type. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index a664442..61d7855 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -696,43 +696,51 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() i->c_str(), 1, " Label=\"Configuration\"", "\n"); std::string configType = "<ConfigurationType>"; - switch(this->GeneratorTarget->GetType()) - { - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: - configType += "DynamicLibrary"; - break; - case cmState::OBJECT_LIBRARY: - case cmState::STATIC_LIBRARY: - configType += "StaticLibrary"; - break; - case cmState::EXECUTABLE: - if(this->NsightTegra && - !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) - { - // Android executables are .so too. + if (const char* vsConfigurationType = + this->GeneratorTarget->GetProperty("VS_CONFIGURATION_TYPE")) + { + configType += cmVS10EscapeXML(vsConfigurationType); + } + else + { + switch(this->GeneratorTarget->GetType()) + { + case cmState::SHARED_LIBRARY: + case cmState::MODULE_LIBRARY: configType += "DynamicLibrary"; - } - else - { - configType += "Application"; - } - break; - case cmState::UTILITY: - case cmState::GLOBAL_TARGET: - if(this->NsightTegra) - { - // Tegra-Android platform does not understand "Utility". + break; + case cmState::OBJECT_LIBRARY: + case cmState::STATIC_LIBRARY: configType += "StaticLibrary"; - } - else - { - configType += "Utility"; - } - break; - case cmState::UNKNOWN_LIBRARY: - case cmState::INTERFACE_LIBRARY: - break; + break; + case cmState::EXECUTABLE: + if(this->NsightTegra && + !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) + { + // Android executables are .so too. + configType += "DynamicLibrary"; + } + else + { + configType += "Application"; + } + break; + case cmState::UTILITY: + case cmState::GLOBAL_TARGET: + if(this->NsightTegra) + { + // Tegra-Android platform does not understand "Utility". + configType += "StaticLibrary"; + } + else + { + configType += "Utility"; + } + break; + case cmState::UNKNOWN_LIBRARY: + case cmState::INTERFACE_LIBRARY: + break; + } } configType += "</ConfigurationType>\n"; this->WriteString(configType.c_str(), 2); diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 0a388c5..5bef629 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -236,6 +236,10 @@ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio [^6]") add_RunCMake_test(SolutionGlobalSections) endif() +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^6789]|[6789][0-9])") + add_RunCMake_test(VS10Project) +endif() + if(XCODE_VERSION AND NOT "${XCODE_VERSION}" VERSION_LESS 3) add_RunCMake_test(XcodeProject -DXCODE_VERSION=${XCODE_VERSION}) endif() diff --git a/Tests/RunCMake/VS10Project/CMakeLists.txt b/Tests/RunCMake/VS10Project/CMakeLists.txt new file mode 100644 index 0000000..91baae7 --- /dev/null +++ b/Tests/RunCMake/VS10Project/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.5.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake new file mode 100644 index 0000000..cc2cc2e --- /dev/null +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -0,0 +1,2 @@ +include(RunCMake) +run_cmake(VsConfigurationType) diff --git a/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake b/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake new file mode 100644 index 0000000..4690970 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake @@ -0,0 +1,24 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() + +set(propertyFound FALSE) +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "^ *<ConfigurationType>(.*)</ConfigurationType>$") + set(propertyFound TRUE) + set(expectedValue "MyValue") + set(actualValue ${CMAKE_MATCH_1}) + if(NOT (${actualValue} STREQUAL ${expectedValue})) + set(RunCMake_TEST_FAILED "ConfigurationType \"${actualValue}\" differs from expected value \"${expectedValue}\".") + return() + endif() + endif() +endforeach() + +if(NOT propertyFound) + set(RunCMake_TEST_FAILED "Property ConfigurationType not found in project file.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsConfigurationType.cmake b/Tests/RunCMake/VS10Project/VsConfigurationType.cmake new file mode 100644 index 0000000..a73dfe8 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsConfigurationType.cmake @@ -0,0 +1,3 @@ +enable_language(CXX) +add_library(foo foo.cpp) +set_target_properties(foo PROPERTIES VS_CONFIGURATION_TYPE "MyValue") diff --git a/Tests/RunCMake/VS10Project/foo.cpp b/Tests/RunCMake/VS10Project/foo.cpp new file mode 100644 index 0000000..2fb55ee --- /dev/null +++ b/Tests/RunCMake/VS10Project/foo.cpp @@ -0,0 +1 @@ +void foo() { } ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 1 + Help/prop_tgt/VS_CONFIGURATION_TYPE.rst | 10 +++ Help/release/dev/vs-vcxproj-ConfigurationType.rst | 6 ++ Source/cmVisualStudio10TargetGenerator.cxx | 78 +++++++++++--------- Tests/RunCMake/CMakeLists.txt | 4 + .../{AutoExportDll => VS10Project}/CMakeLists.txt | 2 +- Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 2 + .../VS10Project/VsConfigurationType-check.cmake | 24 ++++++ .../RunCMake/VS10Project/VsConfigurationType.cmake | 3 + .../RunCMake/{XcodeProject => VS10Project}/foo.cpp | 0 10 files changed, 94 insertions(+), 36 deletions(-) create mode 100644 Help/prop_tgt/VS_CONFIGURATION_TYPE.rst create mode 100644 Help/release/dev/vs-vcxproj-ConfigurationType.rst copy Tests/RunCMake/{AutoExportDll => VS10Project}/CMakeLists.txt (62%) create mode 100644 Tests/RunCMake/VS10Project/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake create mode 100644 Tests/RunCMake/VS10Project/VsConfigurationType.cmake copy Tests/RunCMake/{XcodeProject => VS10Project}/foo.cpp (100%) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits