File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.2)
2
2
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
+
3
18
# Build a Release version by default (default build flags for each build type
4
19
# are configured below).
5
20
if (NOT EXISTS ${CMAKE_BINARY_DIR} /CMakeCache.txt)
You can’t perform that action at this time.
0 commit comments