Can I build targets during all but NOT during install?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Can I build targets during all but NOT during install?

Paul Smith
I have (what I thought was) a common environment where my build creates
both programs to be installed and also test programs etc. that aren't

What I hoped is for the default build with no targets specified to
build everything ("all"), but if I invoke the build with the "install"
target it builds only the things that are to be installed, not the test

Unfortunately it doesn't seem like this is possible; at least when I
examine the Makefiles generated by the CMake Unix Makefiles generator,
the install target depends on the preinstall target which depends on
all.  Is this true in general or is there something in my CMake setup
that causes it?

I find this very limiting: it seems clear to me that a default "all"
build might create all sort of other things that aren't installed via
the "install" target... I should be able to build "install" to only
build those things not "all" the things.

Any ideas for this?

Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: