I have a folder structure like this: Project/Libraries/Math, Project/Libraries/Math2.
In the Project folder I have the main.cpp, and the CMakeLists.txt with the following content:
cmake_minimum_required (VERSION 2.6) project (CppMain) add_executable(CppMain main.cpp) include_directories(${CMAKE_CURRENT_SOURCE_DIR)) In the Math folder I have the header MyVectors.h and in the Math2 folder I have MyMatrices.h, that I would like to include in the main.cpp file, and this works as:
#include "Libraries/Math/MyVectors.h" #include "Libraries/Math2/MyMatrices.h" The problem is that also the header MyVectors.h includes the header MyMatrices.h at the same way, but the linker doesn't find it. What can I modify in the CMakeLists to fix this problem?