Skip to content

Commit

Permalink
cmake: prevent in-source build
Browse files Browse the repository at this point in the history
Signed-off-by: Janusz Jankowski <[email protected]>
  • Loading branch information
jajanusz authored and lgirdwood committed Jan 28, 2019
1 parent 1f5a965 commit 4fc3af5
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
@@ -1,5 +1,13 @@
cmake_minimum_required(VERSION 3.10)

if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
message(FATAL_ERROR
" In-source builds are not supported.\n"
" Please remove CMakeCache.txt and the CMakeFiles directory.\n"
" Then specify a build directory. Example: cmake -Bbuild ..."
)
endif()

if(NOT (${CMAKE_VERSION} VERSION_LESS "3.13.0"))
# CMake 3.13+ has less restrictive rules for target_link_libraries()
# Until we make 3.13 as required minimum version we want to
Expand Down

0 comments on commit 4fc3af5

Please sign in to comment.