https://github.com/Kitware/CMake
Raw File
Tip revision: 8c562ece28b7a13ddb734b8c51710ebafe9ac570 authored by Brad King on 23 June 2022, 14:58:01 UTC
CMake 3.24.0-rc2
Tip revision: 8c562ec
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