[CMake] ADD_CUSTOM_TARGET(target ALL) and Visual Studio

Hendrik Sattler post at hendrik-sattler.de
Thu Jan 24 17:17:32 EST 2008


Am Donnerstag 24 Januar 2008 schrieb Sahn Lam:
> I don't trust myself to be able to specify the dependencies correctly - now
> or in the future.  It is not as simple as it seems.  For example, let's say
> I have this structure:
>
> libA has gen.h which is generated
> libB has header1.h which includes libA/gen.h
> libC has header2.h which includes libB/header1.h
>
> If I understand how cmake works correctly, in order for things to get built
> in the right order, I have to use ADD_DEPENDENCIES to tell cmake that to
> build libA before libB and libC.

You shouldn't have to do anything to make that work, actually. That's what the 
dependency scanner is supposed to handle automatically.
Do you add the header files as source files to the add_library()?

HS


More information about the CMake mailing list