[CMake] Dependency question

Robert Dailey rcdailey at gmail.com
Fri Oct 28 13:32:36 EDT 2011


On Fri, Oct 28, 2011 at 12:25 PM, David Cole <david.cole at kitware.com> wrote:

> On Fri, Oct 28, 2011 at 1:06 PM, Robert Dailey <rcdailey at gmail.com> wrote:
> > I'm using CMake 2.8.6 and generating for VS 2003.
> > I have a DLL project that my EXE project needs to depend on, however I
> don't
> > want my EXE to link against that DLL's import library, since the EXE will
> > call LoadLibrary() to dynamically import symbols from the DLL being
> built.
> > I want the EXE project to depend on the DLL project so that in visual
> studio
> > the DLL is built when I build the EXE (because of project dependencies),
> but
> > I don't want the DLL 's import LIB to be linked in via command line.
> > Any way to do this?
> >
> > ---------
> > Robert Dailey
> >
> > --
> >
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/listinfo/cmake
> >
>
> add_dependencies(exe dll)
>
> But use the CMake target names, not "exe" and "dll"...
>
> That makes sure that the project build for "dll" is completely done
> before beginning any build commands for the "exe" project.


Correct me if I'm wrong but doesn't this still cause the LIB to be linked?
There is an option to inherit dependency libraries in project settings which
is enabled, so CMake would somehow need to specify this import library to be
ignored.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111028/34bc0c1a/attachment.htm>


More information about the CMake mailing list