[CMake] Only build a subset of all targets in ALL_BUILD

Brad King brad.king at kitware.com
Wed Aug 24 16:52:32 EDT 2005


wedekind wrote:
> Hello Brad,
> 
> thanks for your reply! I have tried the second approach that you have
> suggested and it creates a target which only builds the targets I want and
> any targets that my given targets depend on :) I guess that targets that my
> subset components depend on will not be build if I exclude them by not
> adding them to the SUBDIRS (which was your first suggestion)?
> 
> Now there is something I need in addition to this behaviour... =O
> As I have already written in "[CMake] How do I install targets?", I want to
> build the INSTALL target, to be able to use CMake's INSTALL_TARGETS-support
> without additionaly calling something like "make install". The INSTALL
> target however triggers the ALL_BUILD target by default. Is there a way to
> trigger another (custom) target with INSTALL instead of ALL_BUILD? Or could
> I somehow influence the ALL_BUILD target more directly? If this would be
> possible, I could you the same build process to build the whole package or
> just subsets that have been fixed recently for example.

The problem with this is that the INSTALL target will try to install 
everything that is added for installation with the INSTALL_* commands. 
This includes things that might not be built by this special target. 
When they don't exist the INSTALL process will complain and fail. 
You'll probably have to use solution #1 to solve this problem and 
manually enforce dependencies.

-Brad


More information about the CMake mailing list