I want CMake to find the header for add_executable and find the .so file for target_link_libraries.
The header file I want to find is lcm-cpp.hpp (on ubunthu)
ls /usr/local/include/lcm/
eventlog.h lcm_coretypes.h lcm-cpp.hpp lcm-cpp-impl.hpp lcm.h
The CMakeLists.txt file in the root of my project
cmake_minimum_required (VERSION 2.6)
project (libFoo)
include_directories(include /usr/local/include/lcm/)
set(PROJECT_SRC
src/Foo.cpp )
set(PROJECT_H
include/Foo.hpp )
find_library(LCM_LIBRARY
NAMES liblcm.so
PATHS
/usr/local/lib/
)
add_library(liblcm STATIC IMPORTED)
add_library(foo_lib ${PROJECT_SRC} ${PROJECT_H})
add_executable(foo_lcm src/lcm_foo.cpp ${PROJECT_H} lcm-cpp.hpp)
The error I get:
Cannot find source file:
lcm-cpp.hpp
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
include_directoriesand passing a full path totarget_link_libraries?