CMake can not find include files

There were two problems. Firstly you have to add the jsoncpp/json path to your included directories. However, doing so creates a second problem. Since your executables are not in the source folder you needed to prefix ${CMAKE_SOURCE_DIR} to your paths so include_directories() would look like following:

include_directories("${CMAKE_SOURCE_DIR}/jsoncpp"
    "${CMAKE_SOURCE_DIR}/jsoncpp/json"
    "${CMAKE_SOURCE_DIR}/jsonreader")

I’ve added quotes just out of habit. I do this most of the time with my CMakeLists.txt so there are no problems with spaces in paths.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)