summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/opentrack-check-build-directory.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/opentrack-check-build-directory.cmake b/cmake/opentrack-check-build-directory.cmake
new file mode 100755
index 00000000..a9351b6a
--- /dev/null
+++ b/cmake/opentrack-check-build-directory.cmake
@@ -0,0 +1,7 @@
+get_filename_component(_abs_src_path ${CMAKE_SOURCE_DIR} REALPATH)
+string(TOLOWER ${_abs_src_path} _abs_src_path)
+get_filename_component(_abs_build_path ${CMAKE_BINARY_DIR} REALPATH)
+string(TOLOWER ${_abs_build_path} _abs_build_path)
+if(_abs_src_path STREQUAL _abs_build_path)
+ message(FATAL_ERROR "source directory has to be different than build directory")
+endif()