I have a directory structure as follows:
root
libA
CMakeLists.txt
ClassA.cpp
libB
CMakeLists.txt
ClassB.cpp
sharedCode
enums.h
AbstractClass.h
In the CMake file how can include the sharedCode directory? So that both classA (in libA) and classB (in libB) can use the enums.h and AbstractClass.h?
In the CMakeLists.txt I tried using:
add_subdirectory(../sharedCode)
but it gives the error
add_subdirectory not given a binary directory but the given source
directory "/root/sharedCode" is not
a subdirectory of "root/libA". When
specifying an out-of-tree source a binary directory must be explicitly
specified.