| 1 |
# |
| 2 |
# Test solution file for deployment. |
| 3 |
# |
| 4 |
|
| 5 |
set(vcSlnFile "${RunCMake_TEST_BINARY_DIR}/DeployEnabled.sln") |
| 6 |
if(NOT EXISTS "${vcSlnFile}") |
| 7 |
set(RunCMake_TEST_FAILED "Solution file ${vcSlnFile} does not exist.") |
| 8 |
return() |
| 9 |
endif() |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
set(FooProjGUID "") |
| 14 |
set(FoundFooProj FALSE) |
| 15 |
set(InFooProj FALSE) |
| 16 |
set(FoundReleaseDeploy FALSE) |
| 17 |
set(DeployConfigs Debug MinSizeRel RelWithDebInfo ) |
| 18 |
|
| 19 |
file(STRINGS "${vcSlnFile}" lines) |
| 20 |
foreach(line IN LISTS lines) |
| 21 |
#message(STATUS "${line}") |
| 22 |
if( (NOT InFooProj ) AND (line MATCHES "^[ \\t]*Project\\(\"{[A-F0-9-]+}\"\\) = \"foo\", \"foo.vcxproj\", \"({[A-F0-9-]+})\"[ \\t]*$")) |
| 23 |
# First, identify the GUID for the foo project, and record it. |
| 24 |
set(FoundFooProj TRUE) |
| 25 |
set(InFooProj TRUE) |
| 26 |
set(FooProjGUID ${CMAKE_MATCH_1}) |
| 27 |
elseif(InFooProj AND line MATCHES "EndProject") |
| 28 |
set(InFooProj FALSE) |
| 29 |
elseif((NOT InFooProj) AND line MATCHES "${FooProjGUID}\\.Release.*\\.Deploy\\.0") |
| 30 |
# If foo's Release configuration is set to deploy, this is the error. |
| 31 |
set(FoundReleaseDeploy TRUE) |
| 32 |
endif() |
| 33 |
if( line MATCHES "{[A-F0-9-]+}\\.([^\\|]+).*\\.Deploy\\.0" ) |
| 34 |
# Check that the other configurations ARE set to deploy. |
| 35 |
list( REMOVE_ITEM DeployConfigs ${CMAKE_MATCH_1}) |
| 36 |
endif() |
| 37 |
endforeach() |
| 38 |
|
| 39 |
if(FoundReleaseDeploy) |
| 40 |
set(RunCMake_TEST_FAILED "Release deployment enabled.") |
| 41 |
return() |
| 42 |
endif() |
| 43 |
|
| 44 |
if(NOT FoundFooProj) |
| 45 |
set(RunCMake_TEST_FAILED "Failed to find foo project in the solution.") |
| 46 |
return() |
| 47 |
endif() |
| 48 |
|
| 49 |
list(LENGTH DeployConfigs length) |
| 50 |
if( length GREATER 0 ) |
| 51 |
set(RunCMake_TEST_FAILED "Failed to find Deploy lines for non-Release configurations. (${length})") |
| 52 |
return() |
| 53 |
endif() |