CMake add_custom_command not being run

后端 未结 3 650
北恋
北恋 2020-11-27 04:06

I\'m trying to use add_custom_command to generate a file during the build. The command never seemed to be run, so I made this test file.

cmake_minimum_requir         


        
3条回答
  •  北海茫月
    2020-11-27 04:12

    Add the following:

    add_custom_target(run ALL
        DEPENDS hello.txt)
    

    If you're familiar with makefiles, this means:

    all: run
    run: hello.txt
    

提交回复
热议问题