ExpectInstallFail.cmake 340 B

123456789101112131415161718
  1. if(MULTI_CONFIG)
  2. set(SI_CONFIG --config $<CONFIGURATION>)
  3. else()
  4. set(SI_CONFIG)
  5. endif()
  6. execute_process(
  7. COMMAND ${CMAKE_COMMAND}
  8. --build .
  9. --target install ${SI_CONFIG}
  10. RESULT_VARIABLE RESULT
  11. OUTPUT_VARIABLE OUTPUT
  12. ERROR_VARIABLE ERROR
  13. )
  14. if(RESULT EQUAL 0)
  15. message(FATAL_ERROR "install should have failed")
  16. endif()