Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6997271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:15:44+00:00 2026-05-27T20:15:44+00:00

I am currently developing a library, HAMMER , and using CMake as its build

  • 0

I am currently developing a library, HAMMER, and using CMake as its build system. I’m in the process of integrating YARP which also uses CMake as its build system. Consequently I import YARP using the standard CMake method, ie. pointing CMake to a YARPConfig.cmake file that was generated during YARP compilation and using YARP_LIBRARIES and YARP_INCLUDE_DIRS. So far, so good.

The problem is that during the linking stage (of my library) CMake will automatically link against all the libraries that YARP depends upon. For example YARP uses gsl but my library does not (at most it calls the YARP methods that use gsl), yet gsl appears listed as one the ld dependencies of my library (using ldd).

This is not much of an issue when using libraries that are in the default library path, but if you need to link against a library that is not on the library path (and that is not part of your project), then linking will fail (as the required library won’t be found).

That is exactly what is happens when trying to build an application that uses HAMMER (also with CMake), since YARP is not installed in the default location, my application tries to link against it (as per the behaviour just described) and fails because it cannot find the YARP libraries.

Does anyone know why CMake has this policy? And, more importantly, is there a way around this that doesn’t imply importing YARP into the CMake scripts of the application?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:15:45+00:00Added an answer on May 27, 2026 at 8:15 pm

    See the CMake FAQ Why are libraries linked to my shared library included when something links to it?. If you want to prevent that behavior, I think you have to change the LINK_INTERFACE_LIBRARIES property of YARP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently in the process of developing a fairly large static library which will
currently, I am developing a J2ME application for mobiles using LWUIT library. The build
I am currently developing a library and a set of programs using this library,
I am developing a website using Codeigniter and MongoDB (Alex Bilbie library). Currently there
I'm currently developing a C++ library for Windows which will be distributed as a
I am currently developing a program in Qt and it uses the library libqextserialport.1.dylib.
I'm currently in the process of developing my own little threading library, mainly for
I am using the Reflections library in the Eclipse plug-in I am currently developing.
I'm currently developing a cross-platform C++ library which I intend to be Unicode aware.
I am currently developing a RESTful Webservice in Java using the Jersey library. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.