[CMake] Make target dependent on all executables & libraries

Lezz Giles lgiles at SoapStoneNetworks.com
Tue Mar 31 12:07:15 EDT 2009


I want to use doxygen to generate documentation, but I also want it to only run if something has changed.  At first I was playing with the idea of having it be dependent on all source & header files, but I quickly realized that that would be difficult or impossible in cmake.  Then I realized that if any source files changed, at least one of my executables or libraries would rebuild, and so I could make my doxygen dependent on the executables & libraries.

Is there any simple way to get a list of all executables and libraries?  I was hoping for variables ALL_EXECUTABLES and ALL_LIBRARIES but unfortunately they don't exist.  The doxygen target will be added to a central cmake file that is shared by many projects so I'd like to have a solution that has little or no impact on the projects.  I know I can define my own ALL_TARGETS and just go to all the projects and assign to ALL_TARGETS, but this is not a good solution from a maintenance perspective.

Lezz Giles




More information about the CMake mailing list