kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [7/8] incubator-kudu git commit: cmake: require out-of-tree builds
Date Fri, 29 Jan 2016 21:28:52 GMT
cmake: require out-of-tree builds

With out-of-tree builds once again working, this patch "flips the switch"
and requires all builds to be out-of-tree. There's an override for complex
workflows; to use it, run cmake with -DKUDU_ALLOW_IN_SOURCE_BUILD=1.

Change-Id: I57a9eab7d35419a3668b9dce384a049cddd1afef
Reviewed-on: http://gerrit.cloudera.org:8080/1762
Reviewed-by: Todd Lipcon <todd@apache.org>
Tested-by: Kudu Jenkins
Reviewed-by: David Ribeiro Alves <david.alves@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/f461e0a5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/f461e0a5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/f461e0a5

Branch: refs/heads/master
Commit: f461e0a5e6a5b2a936c253065f078c8fc83e070a
Parents: dd9f9d2
Author: Adar Dembo <adar@cloudera.com>
Authored: Mon Jan 11 16:00:36 2016 -0800
Committer: Adar Dembo <adar@cloudera.com>
Committed: Fri Jan 29 20:49:20 2016 +0000

----------------------------------------------------------------------
 CMakeLists.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/f461e0a5/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5bbcd08..c67b54a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,22 @@
 # 1. https://cmake.org/Bug/view.php?id=14963
 cmake_minimum_required(VERSION 3.2.0)
 
+# Prevent builds from the top-level source directory. This ensures that build
+# output is well isolated from the source tree.
+#
+# May be overridden by setting KUDU_ALLOW_IN_SOURCE_BUILDS; this is only
+# recommended for experts!
+if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}" AND
+    NOT "${KUDU_ALLOW_IN_SOURCE_BUILD}")
+  message(FATAL_ERROR
+    "Kudu may not be built from the top-level source directory. Create a new "
+    "directory and run cmake from there, passing the path to the top-level "
+    "source directory as the last argument. "
+    "To override this, rerun CMake with -DKUDU_ALLOW_IN_SOURCE_BUILD=1. "
+    "Also, delete 'CMakeCache.txt' and 'CMakeFiles' from the top-level source "
+    "directory, otherwise future builds will not work.")
+endif()
+
 # Provide a 'latest' symlink to this build directory if the "blessed"
 # multi-build layout is detected:
 #


Mime
View raw message