myproject/
lib/
src/
project2/
**CMakeLists.txt**
test.cpp
I wrote CMakeLists.txt for compile 'test.cpp' file.
I'd like to include /src because i should access src's file.
How could i include src file above?
I tried like set(MORE_INCLUDE_DIR "-I${CMAKE_SOURCE_DIR}../../
but it's not working.
I should compile 'test.cpp' seperately
please somebody help me.
Thanks in advance!
In this case, cmake required absolute path not relative. Let's try call include_directories like this:
get_filename_component(PARENT_DIR ../ ABSOLUTE)
include_directories(${PARENT_DIR}/src)
It can help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With