File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.2)
22
3+ # If cmake generates files inside of the cbmc source directory this can lead to important files being overwritten, so we prevent that here
4+ if ("${CMAKE_BINARY_DIR} " STREQUAL "${CMAKE_SOURCE_DIR} " )
5+ message (FATAL_ERROR
6+ "We have detected that you were trying to invoke cmake with its output"
7+ " directory being equal to the source directory. You may have done this by"
8+ " accident by invoking cmake from the cbmc top level directory without"
9+ " specifying a build directory. Since this can lead to cmake overwriting"
10+ " files in the source tree, this is prohibited. Please perform an"
11+ " out-of-source build by either creating a separate build directory and"
12+ " invoking cmake from there, or specifying a build directory with -B.\n "
13+ "(see also: COMPILING.md)\n "
14+ "Note that running this command will have created CMakeCache.txt"
15+ " and a CMakeFiles directory; You should delete both of them." )
16+ endif ()
17+
318# Build a Release version by default (default build flags for each build type
419# are configured below).
520if (NOT EXISTS ${CMAKE_BINARY_DIR} /CMakeCache.txt)
You can’t perform that action at this time.
0 commit comments