How to update librarian section of project properties for a visual studio project using cmake?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to update librarian section of project properties for a visual studio project using cmake?

Ritesh Singh
Hi,

I am creating a static library which in turn depends on several other libraries. So on Windows in Visual studio for my master library I have updated Librarian section of project properties to add the other libraries as additional dependencies. If I update Librarian section manually then I am able to create the master library successfully, but I am not able to figure out how to update Librarian from cmake. Now I want to do same thing using the cmake, I tried several options but nothing worked yet.

Any help would be appreciated.

I have posted these couple of questions and still waiting for the response:

How to update Librarian section of project properties for a Visual studio project using cmake?
https://stackoverflow.com/q/50346060/2657912?sem=2

CMake not linking static library to other static libraries
https://stackoverflow.com/q/50341118/2657912?sem=2

Thank you!

Regards,
Ritesh

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How to update librarian section of project properties for a visual studio project using cmake?

J. Caleb Wherry
You are unfortunately out of luck here. CMake does not provide built in functionality to create "fat" static libs (multiple static libs combined). Visual Studio allows this quite easily but CMake does not. All static libs are considered transitive dependencies and get carried through to executable and shared libs, they cannot be combined into a single static lib target using the normal add_library and target_link_libraries calls.

It is possible to get a fat lib but you will have to use custom targets and look into running the archiver directly (see CMAKE_AR). I did this once upon a time and ran into a bunch of problems because I needed a cross-platform solution. Things like [1] will get you down the right path of using a custom target to get this to work.

-Caleb



On Tue, May 15, 2018 at 3:44 PM, Ritesh Singh <[hidden email]> wrote:
Hi,

I am creating a static library which in turn depends on several other libraries. So on Windows in Visual studio for my master library I have updated Librarian section of project properties to add the other libraries as additional dependencies. If I update Librarian section manually then I am able to create the master library successfully, but I am not able to figure out how to update Librarian from cmake. Now I want to do same thing using the cmake, I tried several options but nothing worked yet.

Any help would be appreciated.

I have posted these couple of questions and still waiting for the response:

How to update Librarian section of project properties for a Visual studio project using cmake?
https://stackoverflow.com/q/50346060/2657912?sem=2

CMake not linking static library to other static libraries
https://stackoverflow.com/q/50341118/2657912?sem=2

Thank you!

Regards,
Ritesh

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake




--
J. Caleb Wherry
Scientific Software Engineer

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How to update librarian section of project properties for a visual studio project using cmake?

J. Caleb Wherry
In reply to this post by Ritesh Singh
If you want an official CMake response, take it from Brad King himself:


His second comment is interesting, I haven't tried the path of trying to trick it into thinking it is an object file. That might be the way to go!

-Caleb

On Tue, May 15, 2018 at 3:44 PM, Ritesh Singh <[hidden email]> wrote:
Hi,

I am creating a static library which in turn depends on several other libraries. So on Windows in Visual studio for my master library I have updated Librarian section of project properties to add the other libraries as additional dependencies. If I update Librarian section manually then I am able to create the master library successfully, but I am not able to figure out how to update Librarian from cmake. Now I want to do same thing using the cmake, I tried several options but nothing worked yet.

Any help would be appreciated.

I have posted these couple of questions and still waiting for the response:

How to update Librarian section of project properties for a Visual studio project using cmake?
https://stackoverflow.com/q/50346060/2657912?sem=2

CMake not linking static library to other static libraries
https://stackoverflow.com/q/50341118/2657912?sem=2

Thank you!

Regards,
Ritesh

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake




--
J. Caleb Wherry
Scientific Software Engineer

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake