summaryrefslogtreecommitdiff
path: root/r21/sources/cxx-stl/llvm-libc++abi/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake
blob: e75002bd8b7bc05c99ad6e4bc30546c9f43ff691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)

macro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage )

string( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource )
if( _insource )
 message( SEND_ERROR "${_errorMessage}" )
 message( FATAL_ERROR
 "In-source builds are not allowed.
 CMake would overwrite the makefiles distributed with libcxxabi.
 Please create a directory and run cmake from there, passing the path
 to this source directory as the last argument.
 This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
 Please delete them."
 )
endif( _insource )

endmacro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD )