| 1 |
set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/main.vcxproj") |
| 2 |
if(NOT EXISTS "${vcProjectFile}") |
| 3 |
string(CONCAT RunCMake_TEST_FAILED "Project file\n ${vcProjectFile}\n" "does not exist.") |
| 4 |
return() |
| 5 |
endif() |
| 6 |
|
| 7 |
set(TreatWarningAsError_FOUND FALSE) |
| 8 |
file(STRINGS "${vcProjectFile}" lines) |
| 9 |
foreach(line IN LISTS lines) |
| 10 |
if(line MATCHES "^ *<TreatWarningAsError>([^<>]*)</TreatWarningAsError>$") |
| 11 |
set(TreatWarningAsError_FOUND TRUE) |
| 12 |
set(expectedValue "false") |
| 13 |
set(actualValue "${CMAKE_MATCH_1}") |
| 14 |
if(NOT (${actualValue} STREQUAL ${expectedValue})) |
| 15 |
set(RunCMake_TEST_FAILED "TreatWarningAsError \"${actualValue}\" differs from expected value \"${expectedValue}\".") |
| 16 |
return() |
| 17 |
endif() |
| 18 |
endif() |
| 19 |
endforeach() |
| 20 |
|
| 21 |
if(NOT TreatWarningAsError_FOUND) |
| 22 |
set(RunCMake_TEST_FAILED "Property TreatWarningAsError not found in project file:\n ${vcProjectFile}.") |
| 23 |
return() |
| 24 |
endif() |