[CMake] dependencies on auto-generated files and VC-8.0
William A. Hoffman
billlist at nycap.rr.com
Sat Jul 1 15:21:45 EDT 2006
At 03:09 PM 7/1/2006, Alex Makarenko wrote:
>Hi Bill,
>
>Thanks a lot for your response, here's the basic structure of the project:
>
>File: Autogen{.h/.cpp}
> > generated using ADD_CUSTOM_COMMAND
>
>Library: Lib0
> > compiles Autogen{.h/.cpp} into a lib with ADD_LIBRARY()
>
>File: humanwritten.cpp
> > #include's Autogen.h
>
>Library: Lib1
> > builds humanwritten.cpp into a lib
> > links to Lib0
>
>This works with gcc Makefiles. The problem is that VCC jumps to compile Lib1
>before Lib0 is finished (or even started) and before the Autogen.* files are
>generated.
>
>Lib1's CMakeLists.txt file includes the following:
> ADD_LIBRARY( Lib1 STATIC ${SRCS} )
> TARGET_LINK_LIBRARIES( Lib1 Lib0 )
>
>So do you mean that I have to manually add the list of files included from
>humanwritten.h/cpp to the source list of Lib1? And is that the part of the
>job that CMake expects VCC to do?
>
>Thank you very much for your help, alex
Try this:
ADD_DEPENDENCIES(Lib1 Lib0)
-Bill
More information about the CMake
mailing list