add_executable(bintoc bintoc.c) macro(bintoc out in sym) if(IS_ABSOLUTE ${out}) set(theOut ${out}) else() set(theOut ${CMAKE_CURRENT_BINARY_DIR}/${out}) endif() if(IS_ABSOLUTE ${in}) set(theIn ${in}) else() set(theIn ${CMAKE_CURRENT_SOURCE_DIR}/${in}) endif() add_custom_command(OUTPUT ${theOut} COMMAND $ ARGS ${theIn} ${theOut} ${sym} DEPENDS ${theIn}) endmacro()