Skip to content

Commit 4b9329f

Browse files
committed
cmake: error out if building in source tree
1 parent 94259fb commit 4b9329f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ if (LWS_WITH_SECURE_STREAMS_CPP)
5353
enable_language(CXX)
5454
endif()
5555

56+
if ("${PROJECT_BINARY_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}")
57+
message(FATAL_ERROR "Fatal Error: Building in the source tree is not possible. Please build in a subdirectory, eg from toplevel: `mkdir -p build && cd build` then `cmake .. && make`")
58+
endif()
59+
5660
include(CheckFunctionExists)
5761
include(CheckSymbolExists)
5862
include(CheckIncludeFile)

0 commit comments

Comments
 (0)