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

  • Home
  • SEARCH
  • 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 6362345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:53:47+00:00 2026-05-24T23:53:47+00:00

I have a huge project with 2 main directories : – /myproject/src – /myproject/app

  • 0

I have a huge project with 2 main directories :
– /myproject/src
– /myproject/app

The strategy is that src produces libraries in the /myproject/lib directory and then apps use these libraries to produce executables in /myproject/bin directory.

But the problem is the following. The classic stategy to link libraries is to use the FIND_LIBRARY(). But how to link a library that is not already produced ?

Thank you.

  • 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-24T23:53:48+00:00Added an answer on May 24, 2026 at 11:53 pm

    find_library() is a little more than the name suggests, it not only finds the path to a (preinstalled) lib, but often also prepares a lot of variables and functions. Also find_library() only works with specific library modules, which reside in the cmake/share directory.

    When you build your own library you have to add it to the CMakeLists.txt with the add_library() command, which works exactly like the add_executable() command.

    When you have done that, you can actually add the library to the executable using the target_link_libraries() command.

    To sum it up:

    add_library(myLib libsourceA.c libSourceB.c)
    
    add_executable(myProgram prgsourceA.c prgsourceB.c)
    target_link_libraries(myProgram myLib)
    

    You actually don’t have to know or specify the exact location of the library-file, cmake will manage that for you.

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

Sidebar

Related Questions

I have a huge web app that is having issues with memory leak in
I have a huge project that I want to move from JQuery 1.4.x to
i have huge project that contains around 200 jars, when i prepare release maven
I have just been handed a huge project for an application that must run
I have an huge old software project that I want to integrate in my
I have one huge project that I use only for source viewing. But the
I have checked in a huge Eclipse project from my desktop computer to the
I have to give a general note to some huge Java project for which
I have this huge VB project which i just got from some one. i
What do you guys do, when you have huge project built with ant 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.