Reputation: 5760
I am trying to build a library using cmake version 2.8.10.2
A header is included from a directory outside of the project, I’ve tried adding the path to the directory using:
add_subdirectory($ENV{PRJ2}/path/)
I’ve check the path is correct but when building I get:
fatal error: header_name.h: No such file or directory
It’s driving me crazy…
Upvotes: 0
Views: 68
Reputation: 1372
add_subdirectory
adds a folder to the cmake project, searching for the CMakeLists.txt file in it and loading the configuration. If you want to add headers from a directory to a project you should use include_directories
(link here)
Consider that using a directory out of the main folder of the project is not convenient. I suggest you two possibilities:
Upvotes: 1