Cmake'sadd_custom_command()并且add_custom_target()我打电话给我的makefileClion Run/Debug Configuration --> Executable我从我的 makefile 中选择编译的可执行文件。--- 编辑 ---
1. 示例
add_custom_command(OUTPUT app_run.txt
COMMAND /bin/echo "Not building!"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_custom_target(app_run ALL
DEPENDS app_run.txt)
Run Code Online (Sandbox Code Playgroud)