| 1 |
# - MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>) |
| 2 |
# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>) |
| 3 |
|
| 4 |
# Copyright (c) 2006, Alexander Neundorf, <[email protected]> |
| 5 |
# |
| 6 |
# Redistribution and use is allowed according to the terms of the BSD license. |
| 7 |
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. |
| 8 |
|
| 9 |
macro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage) |
| 10 |
|
| 11 |
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource) |
| 12 |
if (_insource) |
| 13 |
message(SEND_ERROR "${_errorMessage}") |
| 14 |
message(FATAL_ERROR "Remove the file CMakeCache.txt in ${CMAKE_SOURCE_DIR} first.") |
| 15 |
endif (_insource) |
| 16 |
|
| 17 |
endmacro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD) |