We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3475102 commit 84dfef7Copy full SHA for 84dfef7
1 file changed
CMakeLists.txt
@@ -1,4 +1,14 @@
1
cmake_minimum_required(VERSION 3.16)
2
+
3
+# Require out-of-source builds
4
+file(TO_CMAKE_PATH "${CMAKE_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
5
+if(EXISTS "${LOC_PATH}")
6
+ message(
7
+ FATAL_ERROR
8
+ "You cannot build in a source directory (or any directory with a CMakeLists.txt file). "
9
+ "Please make a build subdirectory.")
10
+endif()
11
12
include(CMakeDependentOption)
13
if(POLICY CMP0135) # https://cmake.org/cmake/help/git-stage/policy/CMP0135.html
14
cmake_policy(SET CMP0135 NEW)
0 commit comments