summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-08 14:00:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-03-08 14:00:29 (GMT)
commit12234b2851427284167b1513af3725fa3a2325a4 (patch)
tree1be6604589fd8f5b0798233596bcb9668ac1e03d
parentccf288186ad0b7cf43899475bb876980fcf71542 (diff)
parentd3c4c6d630f25d988b1f4876d55e7e35b9bfb6da (diff)
downloadCMake-12234b2851427284167b1513af3725fa3a2325a4.zip
CMake-12234b2851427284167b1513af3725fa3a2325a4.tar.gz
CMake-12234b2851427284167b1513af3725fa3a2325a4.tar.bz2
Merge topic 'vs-props-order'
d3c4c6d630 VS: Import default C++ props file before toolset-specific props file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8294
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake3
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx2
2 files changed, 4 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 1f89c74..0878dff 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -401,6 +401,9 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
endif()
endif()
set(id_toolset_version_props "<Import Project=\"${CMAKE_GENERATOR_INSTANCE}\\VC\\Auxiliary\\Build${id_sep}${CMAKE_VS_PLATFORM_TOOLSET_VERSION}\\Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props\" />")
+ if(lang STREQUAL CXX OR lang STREQUAL C)
+ set(id_toolset_version_props "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />${id_toolset_version_props}")
+ endif()
unset(id_sep)
endif()
endif()
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d9d3fff..a669152 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -693,12 +693,12 @@ void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile(
switch (this->ProjectType) {
case VsProjectType::vcxproj: {
+ Elem(e0, "Import").Attribute("Project", VS10_CXX_DEFAULT_PROPS);
std::string const& props =
this->GlobalGenerator->GetPlatformToolsetVersionProps();
if (!props.empty()) {
Elem(e0, "Import").Attribute("Project", props);
}
- Elem(e0, "Import").Attribute("Project", VS10_CXX_DEFAULT_PROPS);
} break;
case VsProjectType::csproj:
Elem(e0, "Import")