Cmake, including h files from other directories

I am having trouble testing in a cmake project. My project is as follows:

                                       TerrainMap
                                        /     \
                         PointAccumulator     heightQuadGrid
                                                \
                                                 Test

In the TerrainMap directory, the CMakeLists.txt file simply indicates the version of the cmake project and includes two subdirectories.

In heightQuadGrid, CMakeLists.txt looks like this:

cmake_minimum_required(VERSION 2.8)

find_package(PCL 1.2 REQUIRED)
find_package(OpenCV REQUIRED)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_library(heightQuadGrid heightQuadGrid.cpp)

add_subdirectory(Test)

which, as I understand it, creates a library called heightQuadGrid. CMakeLists.txt in the test is as follows:

FIND_PACKAGE(PCL 1.2 REQUIRED)
FIND_PACKAGE(OpenCV REQUIRED)
FIND_PACKAGE(Boost COMPONENTS unit_test_framework REQUIRED)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS} )

link_libraries(heightQuadGrid)

add_executable(heightQuadTreeTest heightQuadGridTest.cpp)
target_link_libraries (heightQuadTreeTest heightQuadGrid ${PCL_LIBRARIES} ${OpenCV_LIBS} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

And finally, the cpp file heightQuadGridTest.cpp includes:

#include <heightQuadGrid/heightQuadGrid.h>

CMake works correctly, but when I go to make a project, it tells me that it cannot find heightQuadGrid / heightQuadGrid.h

What is the deal, as I saw a very similar approach in another working draft?

+5
source share
1 answer
#include <heightQuadGrid/heightQuadGrid.h>

, " " heightQuadGrid. cmakelists.txt heightQuadTreeTest include:

include_directories(../../)
+3

All Articles