diff options
Diffstat (limited to 'Tests/MissingInstall/ExpectInstallFail.cmake')
-rw-r--r-- | Tests/MissingInstall/ExpectInstallFail.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/MissingInstall/ExpectInstallFail.cmake b/Tests/MissingInstall/ExpectInstallFail.cmake new file mode 100644 index 0000000..3d677bf --- /dev/null +++ b/Tests/MissingInstall/ExpectInstallFail.cmake @@ -0,0 +1,18 @@ +if(MULTI_CONFIG) + set(SI_CONFIG --config $<CONFIGURATION>) +else() + set(SI_CONFIG) +endif() + +execute_process( + COMMAND ${CMAKE_COMMAND} + --build . + --target install ${SI_CONFIG} + RESULT_VARIABLE RESULT + OUTPUT_VARIABLE OUTPUT + ERROR_VARIABLE ERROR +) + +if(RESULT EQUAL 0) + message(FATAL_ERROR "install should have failed") +endif() |