aboutsummaryrefslogtreecommitdiff
path: root/include/PreventInBuildInstalls.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'include/PreventInBuildInstalls.cmake')
-rw-r--r--include/PreventInBuildInstalls.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/PreventInBuildInstalls.cmake b/include/PreventInBuildInstalls.cmake
new file mode 100644
index 0000000..accfea6
--- /dev/null
+++ b/include/PreventInBuildInstalls.cmake
@@ -0,0 +1,9 @@
+string(TOLOWER "${CMAKE_INSTALL_PREFIX}" _PREFIX)
+string(TOLOWER "${ITK_BINARY_DIR}" _BUILD)
+if("${_PREFIX}" STREQUAL "${_BUILD}")
+ message(FATAL_ERROR
+ "The current CMAKE_INSTALL_PREFIX points at the build tree:\n"
+ " ${CMAKE_INSTALL_PREFIX}\n"
+ "This is not supported."
+ )
+endif()