MacroEnsureOutOfSourceBuild.cmake 658 B

123456789101112131415161718
  1. # MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
  2. macro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage )
  3. string( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource )
  4. if( _insource )
  5. message( SEND_ERROR "${_errorMessage}" )
  6. message( FATAL_ERROR
  7. "In-source builds are not allowed.
  8. CMake would overwrite the makefiles distributed with Compiler-RT.
  9. Please create a directory and run cmake from there, passing the path
  10. to this source directory as the last argument.
  11. This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
  12. Please delete them."
  13. )
  14. endif( _insource )
  15. endmacro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD )