1macro(MACRO_ENSURE_OUT_OF_SOURCE_BUILD MSG) 2 string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource) 3 get_filename_component(PARENTDIR ${CMAKE_SOURCE_DIR} PATH) 4 string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir) 5 if(insource OR insourcesubdir) 6 message(FATAL_ERROR "${MSG}") 7 endif(insource OR insourcesubdir) 8endmacro(MACRO_ENSURE_OUT_OF_SOURCE_BUILD) 9 10function(UTILS_LIST_PREPEND var prefix) 11 set(_collector) 12 foreach(n ${ARGN}) 13 list(APPEND _collector "${prefix}${n}") 14 endforeach() 15 set(${var} ${_collector} PARENT_SCOPE) 16endfunction(UTILS_LIST_PREPEND) 17