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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:20:38+00:00 2026-05-28T02:20:38+00:00

I decided to include a library (more specifically yaml-cpp ) in my project. Since

  • 0

I decided to include a library (more specifically yaml-cpp) in my project. Since both the projects (yaml-cpp and mine) are using CMAKE for building I decided to try and place the yaml-cpp directory inside my root directory and just use add_subdirectory(yaml-cpp) and target_link_libraries(${EXECUTABLE_NAME} foolib yaml-cpp), since yaml-cpp’s CMakeLists.txt already contains

include_directories(${YAML_CPP_SOURCE_DIR}/include)

# ...

add_library(yaml-cpp
    ${sources}
    ${public_headers}
    ${private_headers}
    ${contrib_sources}
    ${contrib_public_headers}
    ${contrib_private_headers}
)

…and I should be fine on both includes and the library target. But as it turns out, upon compilation I get the following error:

P:\zpp\TheGameShow\TGS.cpp(16): fatal error C1083: Cannot open include file: ‘yaml-cpp/yaml.h’: No such file or directory

…unless I duplicate the line include_directories(${YAML_CPP_SOURCE_DIR}/include) in my own CMakeLists.txt

My question is: Is it the desired behavior? Shouldn’t the include directories propagate from subdirectories to root directories? Am I doing something wrong?

edit: I am using Visual Studio 2010 and CMake 2.8.6

  • 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-28T02:20:39+00:00Added an answer on May 28, 2026 at 2:20 am

    Yes, it’s desired behavior. Nothing is being propagated to the higher-level CMakeLists.txt. The only exception – cache values (created by various find_* and set(VAR 123 CACHE STRING) and set(VAR 123 PARENT_SCOPE).

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

Sidebar

Related Questions

I've decided to use this.variableName when referring to string/int etc.. fields. Would that include
I decided to make a system for a client using Castle ActiveRecord , everything
I decided to use log4net as a logger for a new webservice project. Everything
I've been building a small library for myself for a job I have at
I'm currently working on a UI development project and it was decided to implement
While working on a C++ project, I was looking for a third party library
After laying out some ideas in Processing, I've decided to move my MIDI project
I decided to include some SQL Scripts into VS2010 for ease of editing /
Since I decided to reinvert the wheel and write a growing MVC, I though
This is basically for a library I'm building. In this module I'll attempt to

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.