How to create specific files in CMAKE every time?

I am looking for a way to create some c, C ++ files in CMAKE every time I type make, no matter how I modify the file. Because this file contains assembly information codes, such as build time. Is this possible in CMAKE?

Thanks in advance.

+6
source share
1 answer

You can use the add_custom_target command to add a goal that will be completed for each assembly.

For example, you can use the CMake command button to mark some source files, so they are restored every time you start:

 add_custom_target(invalidate_files ALL COMMAND ${CMAKE_COMMAND} -E touch ${MY_SRC_FILE}) 
+6
source

Source: https://habr.com/ru/post/957316/


All Articles