Skip to content

Commit

Permalink
🔨 Disallow in source build
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierLDff committed Aug 29, 2021
1 parent 417559f commit 0d85845
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@

cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

# ──── Include guards ────

if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(FATAL_ERROR "In-source builds not allowed. " "Please make a new directory (called a build directory) and run CMake from there.")
endif()

# ──── Main Project behavior ────

set(QOLM_MAIN_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(QOLM_MAIN_PROJECT ON)
Expand Down

0 comments on commit 0d85845

Please sign in to comment.