| 1 |
set(vcSlnFile "${RunCMake_TEST_BINARY_DIR}/AddPackageToDefault.sln") |
| 2 |
if(NOT EXISTS "${vcSlnFile}") |
| 3 |
set(RunCMake_TEST_FAILED "Project file ${vcSlnFile} does not exist.") |
| 4 |
return() |
| 5 |
endif() |
| 6 |
|
| 7 |
set(packageGuidFound FALSE) |
| 8 |
set(packageGuid "") |
| 9 |
set(packageInBuild FALSE) |
| 10 |
file(STRINGS "${vcSlnFile}" lines) |
| 11 |
foreach(line IN LISTS lines) |
| 12 |
if(NOT packageGuidFound) |
| 13 |
if(line MATCHES "^Project.*\"PACKAGE.vcx?proj\".*\"{([A-F0-9-]+)}\"$") |
| 14 |
set(packageGuidFound TRUE) |
| 15 |
set(packageGuid ${CMAKE_MATCH_1}) |
| 16 |
endif() |
| 17 |
else() |
| 18 |
if(line MATCHES ".*{${packageGuid}}.*") |
| 19 |
if(line MATCHES "^[ \t]*{${packageGuid}}\\..*\\.Build.0 = .*$") |
| 20 |
set(packageInBuild TRUE) |
| 21 |
endif() |
| 22 |
endif() |
| 23 |
endif() |
| 24 |
endforeach() |
| 25 |
|
| 26 |
if(NOT packageInBuild) |
| 27 |
set(RunCMake_TEST_FAILED "PACKAGE is not in default build") |
| 28 |
return() |
| 29 |
endif() |