xref: /openbsd-src/gnu/llvm/libcxxabi/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake (revision 79c2e3e6701c0feff28e91707e6fb8294ca9a8eb)
1*79c2e3e6Spatrick# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
2*79c2e3e6Spatrick
3*79c2e3e6Spatrickmacro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage )
4*79c2e3e6Spatrick
5*79c2e3e6Spatrickstring( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource )
6*79c2e3e6Spatrickif( _insource )
7*79c2e3e6Spatrick message( SEND_ERROR "${_errorMessage}" )
8*79c2e3e6Spatrick message( FATAL_ERROR
9*79c2e3e6Spatrick "In-source builds are not allowed.
10*79c2e3e6Spatrick CMake would overwrite the makefiles distributed with libcxxabi.
11*79c2e3e6Spatrick Please create a directory and run cmake from there, passing the path
12*79c2e3e6Spatrick to this source directory as the last argument.
13*79c2e3e6Spatrick This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
14*79c2e3e6Spatrick Please delete them."
15*79c2e3e6Spatrick )
16*79c2e3e6Spatrickendif( _insource )
17*79c2e3e6Spatrick
18*79c2e3e6Spatrickendmacro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD )
19