If I override functions like add_library or add_executable, cmake stops with a segfault example code: macro(add_library _target) _add_library (${_target} ${ARGN}) endmacro()