CMake/Tests/MissingInstall/ExpectInstallFail.cmake
Nils Gladitz be0458c562 InstallRules: added new variable to disable generation of install rules
The boolean variable CMAKE_SKIP_INSTALL_RULES
allows disabling generation of install rules for projects which don't
want them.
2014-01-08 16:28:14 +01:00

19 lines
340 B
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()