Код: Выделить всё
project
|. CMakeLists.txt
|----src
|. classA.cpp
|----include
| classA.h
|----SecondFolder
| include
| Messages
| messageA.h // this includes messageUtilityA.h
|. |. messageB.h // etc
| MessageUtilities
} |. messageUtilityA.h
|
|----ExampleProject
| src
| example.cpp // needs to be able to include ClassA.h, and messageA.h
< /code>
classA.cpp
Код: Выделить всё
example.cpp
Я в настоящее время использую Conan и Cmake. Мне просто нужно сделать второе место, его собственная библиотека. В Cmake я делаю < /p>
Код: Выделить всё
project(base CXX)
add_library(base
src/classA.cpp
)
target_include_directories(base
PUBLIC
include
SecondFolder/include
set_target_properties(base PROPERTIES PUBLIC_HEADER "include classA.h;{PROJECT_SOURCE_DIR}/SecondFolder/include/Messages/include/MessageA.h") # might just need to glob all the .h's from the entire folder perhaps
install(TARGETS base)
< /code>
Maybe I just need to add more to the cmake target_properties, make a second library just for the SecondFolder?
the CMakeLists.txt
conan file действительно имеет
Код: Выделить всё
exports_source = "CMakeLists.txt", "src/*", "include/*", "SecondFolder/*"
Подробнее здесь: https://stackoverflow.com/questions/796 ... etain-path