Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add files from subdirectories ? #8

Open
skipit opened this issue Jun 27, 2017 · 0 comments
Open

How to add files from subdirectories ? #8

skipit opened this issue Jun 27, 2017 · 0 comments

Comments

@skipit
Copy link

skipit commented Jun 27, 2017

I was trying to extend this, by adding a directory and a cpp file in that directory and a test_*.cpp file in that directory and add it.

I used the add_subdirectory(another_dir) directive, and inside that, I added lines

1 include_directories(${CMAKE_SOURCE_DIR})
2 include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
3 add_library(another_dir test_project2.cpp)

It compiles fine.

On the toplevel CMakeLists.txt I added, target_link_library(.... , another_dir).

This was not linking the library from the subdirectory.

Can you update this git-repo on how to handle subdirectories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant