https://github.com/Kitware/CMake
Raw File
Tip revision: ceb742a8fbadbda57bd288c1677a5d2dc791234f authored by Brad King on 27 November 2023, 18:48:12 UTC
CMake 3.26.6
Tip revision: ceb742a
ExpectInstallFail.cmake
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()
back to top