diff options
author | Steven Boswell <ulatekh@yahoo.com> | 2021-09-03 00:12:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-09-09 18:19:28 (GMT) |
commit | f21158cdfe8a1938401f86b85b1ae1239372115b (patch) | |
tree | ab1107708045eb42e0a6fbf84ac9c313c6af05df /Tests/RunCMake/VS10Project | |
parent | 3bf013632d26241672897e4aab10823d219f025c (diff) | |
download | CMake-f21158cdfe8a1938401f86b85b1ae1239372115b.zip CMake-f21158cdfe8a1938401f86b85b1ae1239372115b.tar.gz CMake-f21158cdfe8a1938401f86b85b1ae1239372115b.tar.bz2 |
VS: Honor VS_SETTINGS source file property on all sources
Extend the feature added by commit 2ce42f281f (VS: Add VS_SETTINGS
source file property, 2020-03-18, v3.18.0-rc1~449^2~3) to support
all source file types.
Diffstat (limited to 'Tests/RunCMake/VS10Project')
-rw-r--r-- | Tests/RunCMake/VS10Project/VsSettings-check.cmake | 15 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsSettings.cmake | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/Tests/RunCMake/VS10Project/VsSettings-check.cmake b/Tests/RunCMake/VS10Project/VsSettings-check.cmake index 0f8b26c..13cc8e2 100644 --- a/Tests/RunCMake/VS10Project/VsSettings-check.cmake +++ b/Tests/RunCMake/VS10Project/VsSettings-check.cmake @@ -4,20 +4,29 @@ macro(ensure_props_set projectFile) return() endif() - set(SettingFound FALSE) + set(Setting1Found FALSE) + set(Setting2Found FALSE) file(STRINGS "${projectFile}" lines) foreach(line IN LISTS lines) if(line MATCHES "<SourceProperty1.*Debug.*>SourceProperty1Value</SourceProperty1>") message("SourceProperty1 setting found") - set(SettingFound TRUE) + set(Setting1Found TRUE) + endif() + if(line MATCHES "<SourceProperty2.*Debug.*>SourceProperty2Value</SourceProperty2>") + message("SourceProperty2 setting found") + set(Setting2Found TRUE) endif() endforeach() - if (NOT SettingFound) + if (NOT Setting1Found) set(RunCMake_TEST_FAILED "SourceProperty1 setting was not found") return() endif() + if (NOT Setting2Found) + set(RunCMake_TEST_FAILED "SourceProperty2 setting was not found") + return() + endif() endmacro() ensure_props_set("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") diff --git a/Tests/RunCMake/VS10Project/VsSettings.cmake b/Tests/RunCMake/VS10Project/VsSettings.cmake index a4b321b..3a046f1 100644 --- a/Tests/RunCMake/VS10Project/VsSettings.cmake +++ b/Tests/RunCMake/VS10Project/VsSettings.cmake @@ -3,3 +3,5 @@ enable_language(CXX) add_library(foo foo.cpp shader.hlsl) set_property(SOURCE shader.hlsl PROPERTY VS_SETTINGS "$<$<CONFIG:DEBUG>:SourceProperty1=SourceProperty1Value>") +set_property(SOURCE foo.cpp PROPERTY VS_SETTINGS + "$<$<CONFIG:DEBUG>:SourceProperty2=SourceProperty2Value>") |