How can I refer inside a CMake file the install target?
For example I want to do something like
add_custom_target(my-target DEPENDS install COMMAND my-target-command)
If I call
cmake --build . --target help
from CMAKE_CURRENT_BINARY_DIR, in the returned list I can see there is target install.
Trying to
make my-target
with "Unix Makefiles" as generator results in an error
make[2]: *** No rule to make target `CMakeFiles/install.dir/all', needed by `CMakeFiles/my-target.dir/all'. Stop.