summaryrefslogtreecommitdiff
path: root/cmake/Modules/EjdbUtils.cmake
diff options
context:
space:
mode:
authorAnton Adamansky <adamansky@gmail.com>2015-03-17 23:39:15 +0600
committerAnton Adamansky <adamansky@gmail.com>2015-03-17 23:39:15 +0600
commitd0f0b6a825ed460f01f073499cee55a921225a7e (patch)
tree44a15c23f0f29328d96b4c069f3bd2c043b4dcc7 /cmake/Modules/EjdbUtils.cmake
parent82545e27b0acc047dffc1e36bed8c3f8119ff4cd (diff)
downloadejdb-d0f0b6a825ed460f01f073499cee55a921225a7e.tar.gz
ejdb-d0f0b6a825ed460f01f073499cee55a921225a7e.tar.bz2
ejdb-d0f0b6a825ed460f01f073499cee55a921225a7e.zip
#115 project refactoring
Diffstat (limited to 'cmake/Modules/EjdbUtils.cmake')
-rw-r--r--cmake/Modules/EjdbUtils.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/Modules/EjdbUtils.cmake b/cmake/Modules/EjdbUtils.cmake
new file mode 100644
index 0000000..91a7d38
--- /dev/null
+++ b/cmake/Modules/EjdbUtils.cmake
@@ -0,0 +1,10 @@
+
+
+macro(MACRO_ENSURE_OUT_OF_SOURCE_BUILD MSG)
+ string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
+ get_filename_component(PARENTDIR ${CMAKE_SOURCE_DIR} PATH)
+ string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir)
+ if(insource OR insourcesubdir)
+ message(FATAL_ERROR "${MSG}")
+ endif(insource OR insourcesubdir)
+endmacro(MACRO_ENSURE_OUT_OF_SOURCE_BUILD)