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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:12:50+00:00 2026-05-27T09:12:50+00:00

Is It possible to include sibling directory as Sub-Directory inside cmake ? Something like

  • 0

Is It possible to include sibling directory as Sub-Directory inside cmake ?

Something like

A 
  CMakeLists.txt

B
  CMakeLists.txt

and B includes A as sub-directory ?

  • 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-27T09:12:51+00:00Added an answer on May 27, 2026 at 9:12 am

    It is possible, although perhaps not recommended…

    You can use the two-argument form of the add_subdirectory command to add any directory you want as a “sub” directory:

    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../A ${CMAKE_CURRENT_BINARY_DIR}/A)
    

    The second argument of the two-argument form specifies where to put the binary directory for the added subdirectory.

    You just have to be careful that there’s not also another real sub-directory of B that is also named “A” and that is also add_subdirectory’d… Because if you do, then that would be an error, as CMake cannot have two different source directories mapping into the same build directory.

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

Sidebar

Related Questions

is it possible to include some kind of libraries inside of VBA that will
Possible Duplicate: include file from different directory I have a site laid out as
is it possible to include an EntryPoint inside the GWT project's test folder? if
Possible Duplicates: Include javascript file inside javascript file? How do you dynamically load a
Question: Is it possible to include some type of character (like \r or \n,
Is it possible to include .R files in the data directory of my package
Is it possible to include something in PHP without passing the variables that were
Is it possible to include the installer of Flash inside my Application's APK? So
I was wondering if it is possible to include SVG content inside a panel
I would like to know if it is possible to include a progress bar,

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.