Skip to content

Commit

Permalink
Cmake: Prevent in-source builds
Browse files Browse the repository at this point in the history
  • Loading branch information
cozycactus committed Sep 12, 2023
1 parent 8249ac2 commit c92a59e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Set minimum required version for CMake
cmake_minimum_required(VERSION 3.10)

# Prevent in-source builds
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds are not allowed. Please create a separate\
build directory and run CMake from there.")
endif()

# workaround for https://gitlab.kitware.com/cmake/cmake/issues/16967
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
project(rx888)
Expand Down

0 comments on commit c92a59e

Please sign in to comment.