[CMake] Making a Top Level CMakeLists File and Dependant libraries

Mike Jackson imikejackson at gmail.com
Fri Aug 18 12:07:12 EDT 2006


On 8/18/06, Brad King <brad.king at kitware.com> wrote:
> Mike Jackson wrote:
> > On 8/18/06, Brad King <brad.king at kitware.com> wrote:
> >> You don't need to find libraries built by CMake in the same project.
> >> Just reference them by their logical target name:
> >>
> >> # Fox/Core/CMakeLists.txt
> >> ADD_LIBRARY(FoxCore ...)
> >>
> >> # Fox/CMakeLists.txt
> >> ADD_EXECUTABLE(Fox ...)
> >> TARGET_LINK_LIBRARIES(Fox FoxCore)
> >>
> >> -Brad
> >>
> >
> > Cool!.. will that also work if I want to build just Fox/Core? Say
> > while I am developing code for Fox/Core I don't want to build the
> > entire project every time..
>
> Yes.  If you change something in Fox/Core and type
>
>   make Fox
>
> at the top, FoxCore will be rebuilt and Fox will be re-linked but
> nothing else will build.  If you instead type
>
>   make FoxCore
>
> at the top, just FoxCore will be rebuilt.  If you didn't change the
> interface then the previously built Fox executable will just run.
>
> -Brad
>

Oh.. yeah!!.. This is great.. way better than some darn bash script...
Now to work on that Eclipse Integration...
-- 
Mike Jackson
imikejackson _at_ gee-mail dot com


More information about the CMake mailing list