CMake: Prevent people from doing in-tree builds

Can create weird messes with include directories
This commit is contained in:
TellowKrinkle 2022-01-22 22:36:24 -06:00 committed by tellowkrinkle
parent f9f4557841
commit 6d0e35ddcb
1 changed files with 4 additions and 0 deletions

View File

@ -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)