[CMake] Pre-install targets?

David Thompson david.thompson at kitware.com
Thu Oct 11 09:09:29 EDT 2018


Hi all,

Is there a way to force a custom target (i.e., ADD_CUSTOM_TARGET) to be built just before installation?

We have documentation added as a custom target that is **not** passed the "ALL" keyword because generating the documentation is slow. However, that target creates files that have a matching INSTALL, so "make install" or "ninja install" will fail unless the target is built before installation. We want to encourage developers to configure with documentation turned on, but want buildbot/dashboard builds to work without magic options or special configuration.

Along those lines:

1. Is there any ordering of INSTALL(CODE ...) relative to INSTALL(FILES ...)? If it is guaranteed to run first, we could force the target to build that way.

2. Is there really nothing to replace the deprecated PRE_INSTALL_SCRIPT property?

	Thanks,
	David


More information about the CMake mailing list