* CMakeLists.txt: Disallow in-source builds.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93863d9..193a33b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,8 +92,25 @@ else ()
endif ()
endif ()
+
project(freetype)
+
+# Disallow in-source builds
+if ("${PROJECT_BINARY_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}")
+ message(FATAL_ERROR
+ "
+In-source builds are not permitted! Make a separate folder for"
+ " building, e.g.,"
+ "
+ mkdir build; cd build; cmake .."
+ "
+Before that, remove the files created by this failed run with"
+ "
+ rm -rf CMakeCache.txt CMakeFiles")
+endif ()
+
+
if (BUILD_FRAMEWORK)
if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
message(FATAL_ERROR
diff --git a/ChangeLog b/ChangeLog
index 4611972..d19b618 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-06-28 Werner Lemberg <wl@gnu.org>
+
+ * CMakeLists.txt: Disallow in-source builds.
+
2015-06-27 Werner Lemberg <wl@gnu.org>
* src/tools/docmaker/utils.py (check_output): Add missing `\n'.