include header files in cmake
cmake, include
Solution
cause the code before:
`new_library(startevn ${sources} ${headers})`
it did tell the library's location,
but after, your `include_directories()` maybe isn't.
try:
set(INCLUDE_DIR /new_folder_location/sub_folder)
include_directories (${INCLUDE_DIR}) # make sure your .h all inside.
(or need to use find_library() of cmake before to check if it is rightly found.)
Problem
I have a CMakeList.txt file which has just one liner `include(startevn.cmake)` in startevn.cmake I have, ``` project(startevn) set(headers startup.h ) set(sources system-init.cpp ) new_library(startevn ${sources} ${headers}) ``` Now I have to move the startup to a different directory. After doing that I added the following line to "startevn.cmake", ``` include_directories("/new_folder_location/sub_folder") ``` where sub_folder is where startup.h is now located but compiler still says Cannot find source file: startup.h. What am I doing wrong?