diff options
author | Anton Adamansky <adamansky@gmail.com> | 2015-03-17 23:39:15 +0600 |
---|---|---|
committer | Anton Adamansky <adamansky@gmail.com> | 2015-03-17 23:39:15 +0600 |
commit | d0f0b6a825ed460f01f073499cee55a921225a7e (patch) | |
tree | 44a15c23f0f29328d96b4c069f3bd2c043b4dcc7 /cmake/Modules/EjdbUtils.cmake | |
parent | 82545e27b0acc047dffc1e36bed8c3f8119ff4cd (diff) | |
download | ejdb-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.cmake | 10 |
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) |