[CMake] Install targets

Tim Gallagher tim.gallagher at gatech.edu
Fri Jul 1 22:34:36 EDT 2011


Hi,

We have a project that has a main executable and dozens of utility executables that may or may not be needed. We can add an executable for each util with EXCLUDE_FROM_ALL defined so just typing make only does the main code and something like 'make grid' compiles the grid generator. 

But, how can we install these things? I see from the documentation that if EXCLUDE_FROM_ALL is set to true, the behavior is undefined. More generally, is there a way to set 'make install' to only install things that have been built (rather than the current behavior which is to build the default target if it's not built)? 

A work around would be to create custom install targets that use the cmake copy command to manually move the utility executable to the install directory, but it would be nice if 'make install' installed all targets built without building unbuilt ones...

Thanks,

Tim


More information about the CMake mailing list