summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VS10ProjectWinCE
diff options
context:
space:
mode:
authorWil Stark <wil_stark@keysight.com>2019-02-19 23:02:34 (GMT)
committerBrad King <brad.king@kitware.com>2019-02-25 14:14:15 (GMT)
commit917c035ada212cec47f92b51449b554526119372 (patch)
tree0aac592abaa8f35ec58acf03a082514241260103 /Tests/RunCMake/VS10ProjectWinCE
parent7574e16096abe57d44cde4e6380a22d940cde98c (diff)
downloadCMake-917c035ada212cec47f92b51449b554526119372.zip
CMake-917c035ada212cec47f92b51449b554526119372.tar.gz
CMake-917c035ada212cec47f92b51449b554526119372.tar.bz2
VS: support suppressing deployment of selected targets
Add a `VS_NO_SOLUTION_DEPLOY` target property to explicitly specify for each target whether to suppress VS solution deployment of the generated target project. Fixes: #18953
Diffstat (limited to 'Tests/RunCMake/VS10ProjectWinCE')
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake59
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy.cmake3
2 files changed, 61 insertions, 1 deletions
diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
index 6ab3833..dab1c33 100644
--- a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
+++ b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
@@ -40,3 +40,62 @@ if(NOT FoundToolsVersion4)
set(RunCMake_TEST_FAILED "Failed to find correct ToolsVersion=\"4.0\" .")
return()
endif()
+
+#
+# Test solution file deployment items.
+#
+
+set(vcSlnFile "${RunCMake_TEST_BINARY_DIR}/VsCEDebuggerDeploy.sln")
+if(NOT EXISTS "${vcSlnFile}")
+ set(RunCMake_TEST_FAILED "Solution file ${vcSlnFile} does not exist.")
+ return()
+endif()
+
+
+if( NOT ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsCE" )
+ set(RunCMake_TEST_FAILED "Test only valid for WindowsCE")
+ return()
+endif()
+
+
+set(FooProjGUID "")
+set(FoundFooProj FALSE)
+set(InFooProj FALSE)
+set(FoundReleaseDeploy FALSE)
+set(DeployConfigs Debug MinSizeRel RelWithDebInfo )
+
+file(STRINGS "${vcSlnFile}" lines)
+foreach(line IN LISTS lines)
+#message(STATUS "${line}")
+ if( (NOT InFooProj ) AND (line MATCHES "^[ \\t]*Project\\(\"{[A-F0-9-]+}\"\\) = \"foo\", \"foo.vcxproj\", \"({[A-F0-9-]+})\"[ \\t]*$"))
+ # First, identify the GUID for the foo project, and record it.
+ set(FoundFooProj TRUE)
+ set(InFooProj TRUE)
+ set(FooProjGUID ${CMAKE_MATCH_1})
+ elseif(InFooProj AND line MATCHES "EndProject")
+ set(InFooProj FALSE)
+ elseif((NOT InFooProj) AND line MATCHES "${FooProjGUID}\\.Release.*\\.Deploy\\.0")
+ # If foo's Release configuration is set to deploy, this is the error.
+ set(FoundReleaseDeploy TRUE)
+ endif()
+ if( line MATCHES "{[A-F0-9-]+}\\.([^\\|]+).*\\.Deploy\\.0" )
+ # Check that the other configurations ARE set to deploy.
+ list( REMOVE_ITEM DeployConfigs ${CMAKE_MATCH_1})
+ endif()
+endforeach()
+
+if(FoundReleaseDeploy)
+ set(RunCMake_TEST_FAILED "Release deployment not inhibited by VS_NO_SOLUTION_DEPLOY_Release.")
+ return()
+endif()
+
+if(NOT FoundFooProj)
+ set(RunCMake_TEST_FAILED "Failed to find foo project in the solution.")
+ return()
+endif()
+
+list(LENGTH DeployConfigs length)
+if( length GREATER 0 )
+ set(RunCMake_TEST_FAILED "Failed to find Deploy lines for non-Release configurations. (${length})")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy.cmake
index 948f14c..611db0a 100644
--- a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy.cmake
+++ b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy.cmake
@@ -4,10 +4,11 @@ set(DEPLOY_DIR
"temp\\foodir"
)
-add_library(foo foo.cpp)
+add_library(foo SHARED foo.cpp)
set_target_properties(foo
PROPERTIES
DEPLOYMENT_ADDITIONAL_FILES "foo.dll|\\foo\\src\\dir\\on\\host|$(RemoteDirectory)|0;bar.dll|\\bar\\src\\dir|$(RemoteDirectory)bardir|0"
DEPLOYMENT_REMOTE_DIRECTORY ${DEPLOY_DIR}
+ VS_NO_SOLUTION_DEPLOY $<CONFIG:Release>
)