I am trying to link my library with some other library lib1
using CMAKE 2.8
. It should be said it's on Windows.
In CMakeLists.txt
I have:
add_library(mylib ${sources})
include_directories(${CMAKE_SOURCE_DIR}/lib1/include)
target_link_libraries(mylib ${lib1_path})
But compiler says that some #include <lib1/foo.h>
in my library is unresolved, maybe because there is no -I.../lib1/include
command-line parameter for gcc
.
UPDATE: It should be said that compiler is complaining when compiling TESTS not the mylib
.
Check the following:
Does the path ${CMAKE_SOURCE_DIR}/lib1/include/lib1/foo.h
exist?
Quote ("
) the path passed to include_directories
, otherwise you may be passing several paths when it is split by spaces
Try running make VERBOSE=1
to see exactly what options are being passed to gcc
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