Files
cmake/Tests/RunCMake/CMakePresets/ErrorAbsInstallPath.cmake
Robert Maynard 39a56136a3 Diagnostic: Add warn or error on absolute install paths
Add `-Winstall-absolute-destination` diagnostic to warn or
error when an install command has an absolute destination.

This allow projects to enforce the best practice of not allowing
absolute install DESTINATIONS.
2026-04-29 09:22:29 -04:00

7 lines
253 B
CMake

cmake_diagnostic(GET CMD_INSTALL_ABSOLUTE_DESTINATION action)
if(NOT "${action}" STREQUAL SEND_ERROR)
message(SEND_ERROR
"wrong action for diagnostic CMD_INSTALL_ABSOLUTE_DESTINATION"
" (expected 'SEND_ERROR', actual '${action}')")
endif()