From 6d0e35ddcb0a1a5d54ebe59fcdbd92e2c6790d92 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sat, 22 Jan 2022 22:36:24 -0600 Subject: [PATCH] CMake: Prevent people from doing in-tree builds Can create weird messes with include directories --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a72a03a32d..cf70c1edfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,10 @@ # versions as well, avoiding setting policies. cmake_minimum_required(VERSION 3.11...3.22) +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "PCSX2 does not support in-tree builds. Please make a build directory that is not the PCSX2 source directory and generate your CMake project there using either `cmake -B build_directory` or by running cmake from the build directory.") +endif() + # Project Name project(Pcsx2)