• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3macro(MACRO_ENSURE_OUT_OF_SOURCE_BUILD MSG)
4	string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
5	get_filename_component(PARENTDIR ${CMAKE_SOURCE_DIR} PATH)
6	string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir)
7    if(insource OR insourcesubdir)
8        message(FATAL_ERROR "${MSG}")
9    endif(insource OR insourcesubdir)
10endmacro(MACRO_ENSURE_OUT_OF_SOURCE_BUILD)
11