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 479419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:47:27+00:00 2026-05-13T00:47:27+00:00

I have two projects, both of which use CMake. Now I want to include

  • 0

I have two projects, both of which use CMake. Now I want to include one of the projects as a library inside the other, while still maintaining the ability to compile them as standalone projects.

What I have done so far is: Use the version control system to clone a copy of the child project in a subdir of the parent project. I’ve used the “add_subdirectory” to include the CMakeLists.txt of the child project into the parent project. And I have fixed name collisions between targets by renaming some of the targets in the child project.

However, an issue that I am running into is that the various configuration tests in the child project don’t seem to be running. For example, the child project uses the FindThreads module to determine what synchronization primitives are available. The parent project is unaware of threading issues and therefore does not have any tests related to this. Similarly, the child project has various tests for headers and such that are not needed by the parent project. None of these tests appear to be running, and the symbols defined by these tests aren’t being added to the CMakeCache.txt file.

I really don’t want to have to hoist all of the child project’s tests (which mostly deal with platform-specific issues that are not relevant to the parent) into the parent project’s CMakeLists.txt.

  • 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-13T00:47:27+00:00Added an answer on May 13, 2026 at 12:47 am

    CMake 2.8 added a new External Project module, which lets you create a custom target to drive the build of another CMake project. The documentation on this is kind of weak, but it looks like it might do what you want.

    I think the idea would be to call ExternalProject_Add from your parent project, pointing it to the source directory of the child project (you can even have it check the child project out of SVN or CVS for you, nice!).

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

Sidebar

Related Questions

I have two projects.One project is build in MVC asp.net and the other project
I have a project that uses two third party libraries, both of which make
We have two projects that are both class libraries. Project 1 is a VS
I have two projects A and B both are built differently, but the jars
OK I have two web projects WebProject1 & WebProject2. Both require database connectivity so
I have two projects and I want to combine them together.When I install each
I have two CVS projects, which I maintain in Eclipse. I check out first
I have developed an Android app which I want to be available both as
Scenario: I have a project containgin two C# projects, which for historical reasons must
i have a two webservers, REMOTE and LOCAL. I have multiple projects of which

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.