[CMake] Why is target installation done in 2 separate steps?

Robert Dailey rcdailey.lists at gmail.com
Sun Jul 10 18:26:02 EDT 2016


Documentation states, that to export a file that imports your targets,
you must do roughly:

install(TARGETS fubar EXPORT fubar-targets)
install(EXPORT fubar-targets DESTINATION lib/cmake/fubar)

Why is this done in two steps? Based on reading the install()
documentation, I don't see how the install(TARGETS) command is useful
without the corresponding install(EXPORT).

Can someone explain why these are separate commands instead of 1
complete command? Thanks in advance.


More information about the CMake mailing list