[CMake] How to manage dependencies between projects in Visual Studio

Luca Gherardi luca.gherardi at unibg.it
Wed Feb 5 06:19:20 EST 2014


I'm working with Visual Studio and I need to create the CMakeLists files for
the following scenario.

 

I have a project A, which contains the sources for a library.

This project has its own CMakeLists and generates a lib (add_library).

 

I have a second project B, which contains the sources from an executable and
uses the library generated by A.

I would like to setup its CMakeLists in such a way that:

 

-        The Visual Studio solution generated from the CMakeLists of B
includes the projects for A and B

-        The project A should be just a link to the project generated with
the CMakeLists of A. In other words I would like to avoid duplications of
compilation files. I would like that the file generated for A by a
compilation started from the solution of A were stored in the same path of
the file generated for A by a compilation started from the solution of B.

 

Is that possible?

I know it is possible to do it with visual studio, but I don't know how to
do it with CMake.

 

Thanks in advance.

 

----------------------------------------------------------------------------
--

Luca Gherardi, PhD
Postdoc at ETH Zurich
Institute for Dynamic Systems and Control
Room ML K 34
Sonneggstrasse 3 - 8092 Zurich

SWITZERLAND


Office: +41 44 632 73 55
Mobile: +41 788 833 174
Home:  <http://www.lucagherardi.it> http://www.lucagherardi.it

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140205/9cbbcfbc/attachment.html>


More information about the CMake mailing list