Can I add a custom_target that depends on triggering the build first?
Is there a way to make a custom_target that depends on triggering the build first? How is the default install target doing this? i.e when doing an install, it always builds the project first.
add_custom_target(install-runtime
${CMAKE_COMMAND}
-DCMAKE_INSTALL_COMPONENT=runtime
-P "${PROJECT_BINARY_DIR}/cmake_install.cmake"
)
Is there a DEPENDS ALL_BUILD
or similar? (I tried this one and doesn't work with -G Ninja
)
So, the problem I had with that custom_target is that it doesn't trigger the build. I know I could manually add dependencies to that target, but then I will have to take into account user options.