Skip to content

Commit

Permalink
Merge pull request #96 from kejxu/use_global_gtest_library
Browse files Browse the repository at this point in the history
update CMakeLists.txt to search for local gtest first
  • Loading branch information
trainman419 authored Mar 12, 2019
2 parents 7ec6b19 + 8c4a3a1 commit f824f8f
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 f824f8f

Please sign in to comment.