Skip to content

Commit

Permalink
update cmake include directories to use correct gtest.h
Browse files Browse the repository at this point in the history
  • Loading branch information
kejxu committed Feb 14, 2019
1 parent 7a2c3d0 commit 8c4a3a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions diagnostic_aggregator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ if( (${diagnostic_msgs_VERSION} VERSION_EQUAL "1.12.0") OR
endif()

find_package(Boost REQUIRED COMPONENTS system)
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} gtest-1.7.0/include)
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

set(LOCAL_GTEST_DIR "gtest-1.7.0")
# gtest could be included in ${catkin_INCLUDE_DIRS}, prepend local gtest include directory so it's searched first
include_directories(BEFORE ${LOCAL_GTEST_DIR}/include)

add_library(${PROJECT_NAME}
src/status_item.cpp
Expand All @@ -41,8 +45,7 @@ target_link_libraries(aggregator_node ${catkin_LIBRARIES}
)

# Analyzer loader allows other users to test that Analyzers load
add_executable(analyzer_loader test/analyzer_loader.cpp
gtest-1.7.0/gtest-all.cc)
add_executable(analyzer_loader test/analyzer_loader.cpp ${LOCAL_GTEST_DIR}/gtest-all.cc)
target_link_libraries(analyzer_loader diagnostic_aggregator)

if(CATKIN_ENABLE_TESTING)
Expand Down
2 changes: 1 addition & 1 deletion diagnostic_aggregator/test/analyzer_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <diagnostic_aggregator/analyzer_group.h>
#include <ros/ros.h>
#include <string>
#include <gtest/gtest.h>
#include "gtest/gtest.h"

//using namespace std;
//using namespace diagnostic_aggregator;
Expand Down

0 comments on commit 8c4a3a1

Please sign in to comment.