actual I’m struggling with CMAKE_CUSTOM_COMMAND. Actually I try to define a separated make target for my demo sources while i got dependencies i could only solve after “regular” build, when any file is generated. This target should perform some steps after any regular build:
- Compile sources
- Create executables
Up to this point anything works fine using add_subdirectory command with separated CMakeLists files, but this fails when I try to solve dependencies which have not
created yet (i.e. copy dll on windows platform to demo executable dir)
- Copy dependencies (dlls ect.)
I’ve tried to use the CMAKE_CUSTOM_TARGET and CMAKE_CUSTOM_COMMAND commands. But I fail. How I could invoke a build of my demo sources using a separeted target?
Thanks for any help.
Best regards.
To build one target after another you can use cmake add_dependencies command, specialy designed for this purpose.
Also copying dlls and executables typically is done during installation, not building (Using make – while running command
make installjust aftermake). To achieve this use install command. For installing executable, for example, it can be used like this: