MacroEnsureOutOfSourceBuild.cmake 658 B

12345678910111213141516171819
  1. # - MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
  2. # MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
  3. # Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
  4. #
  5. # Redistribution and use is allowed according to the terms of the BSD license.
  6. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  7. macro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage)
  8. string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource)
  9. if (_insource)
  10. file(REMOVE [CMakeCache.txt CMakeFiles])
  11. message(FATAL_ERROR "${_errorMessage}")
  12. endif (_insource)
  13. endmacro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD)
  14. # vim:ts=4:sw=4:expandtab