[CMake] Dependency question

Robert Dailey rcdailey at gmail.com
Fri Oct 28 13:52:23 EDT 2011


I tested this and it works! I was using target_link_libraries() before which
sets the dependency but also links it.

I noticed that it creates a "fubar_UTILITY" project in addition to "fubar"
project in my solution when I specify it in add_dependencies()... is this
normal? What does the _UTILITY project do?

---------
Robert Dailey


On Fri, Oct 28, 2011 at 12:32 PM, Robert Dailey <rcdailey at gmail.com> wrote:

>
> 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/c879d8b1/attachment-0001.htm>


More information about the CMake mailing list