add-custom-command

How to add_custom_command() for the CMake build process itself?

孤街浪徒 提交于 2019-12-02 07:58:29
Is there any way to do the equivalent of add_custom_command (run an external script when a certain file changes), but for something that should be run during CMake script execution itself? (That is, for dependency graph generation.) We have our source code files split up into multiple sub-libraries, and there are configuration files which list which source file goes with which library. (The format of these configuration files are fixed by another tool we use.) Currently, we run a custom external script which parses those configuration files and writes new files, which are then loaded by the

How to execute custom file specific command / task in Visual Studio?

。_饼干妹妹 提交于 2019-12-01 07:01:31
问题 I would like to be able to define custom commands/task/macro for a VisualStudio solution. Then I would like to execute that command for a file that is selected in the Solution Explorer . There are several possibilities to execute the command that would be fine for me: a) Right click on the file in the Solution Explorer and choose the command from the context menu (my favorite) b) Select a file in the Solution Explorer . Then click on a button on a tool bar. The command would then somehow

How to call a CMake function from add_custom_target/command?

牧云@^-^@ 提交于 2019-11-27 14:23:13
Is it possible to call a CMake function out of an add_custom_target or add_custom_command ? I know I could move the CMake function to a Python (or whatever) script and call it from add_custom_target / command but I would like to avoid having tons of script next to the existing CMake infra. What I want to achieve is to use CPack for generating a zip package of binary artifacts and publish them in an artifact repository. For the publishing part I have already the CMake function created but now I need to combine the packaging and publishing together. Thanks for any help/hints in advance. I

add_custom_command is not generating a target

牧云@^-^@ 提交于 2019-11-27 03:11:26
问题 Perhaps this is impossible and I'm misreading the cmake 3.2 documentation, but I though creating a custom command would create a custom "target" in the Makefile so that I could build the target by invoking the name of the output file. The CMake docs says: In makefile terms this creates a new target in the following form: OUTPUT: MAIN_DEPENDENCY DEPENDS COMMAND so I thought I could then run make OUTPUT . Perhaps the documentation is confusing CMake targets with Makefile targets? For example,