summaryrefslogtreecommitdiffstats
path: root/Tests/MissingInstall/ExpectInstallFail.cmake
blob: 3d677bf72c6c54436bdc45e66dd9c25d0834e38f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()