From ae0d246caa7b3995e50d5ab933f8047747586305 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:15:19 +0100 Subject: [PATCH] fixup! cmake: Add root `CMakeLists.txt` file Forbid in-source builds. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c013986f1a74d..32db4189d49a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,10 @@ if(POLICY CMP0141) cmake_policy(SET CMP0141 NEW) endif() +if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "In-source builds are not allowed.") +endif() + #============================= # Project / Package metadata #=============================