summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2014-01-02 10:48:20 +0100
committerPavel Březina <pbrezina@redhat.com>2014-03-28 13:55:28 +0100
commitd595f3c52fe99c122b3ec7da0023b563defda330 (patch)
tree2889746480a4765661559e7677be90895cc1ff47 /cmake
parent88b368705222e30fd1d721fa400472ebce9daa9a (diff)
downloadopenlmi_sssd-d595f3c52fe99c122b3ec7da0023b563defda330.tar.gz
openlmi_sssd-d595f3c52fe99c122b3ec7da0023b563defda330.tar.xz
openlmi_sssd-d595f3c52fe99c122b3ec7da0023b563defda330.zip
Initial import
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/MacroEnsureOutOfSourceBuild.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake b/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake
new file mode 100644
index 0000000..a2e9480
--- /dev/null
+++ b/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake
@@ -0,0 +1,17 @@
+# - MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
+# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+macro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage)
+
+ string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource)
+ if (_insource)
+ message(SEND_ERROR "${_errorMessage}")
+ message(FATAL_ERROR "Remove the file CMakeCache.txt in ${CMAKE_SOURCE_DIR} first.")
+ endif (_insource)
+
+endmacro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD)