Skip to content

Commit e782b2a

Browse files
committed
find Gtest include
1 parent d784aea commit e782b2a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ install(FILES include/dtlmod.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
242242

243243
# Google test
244244
find_library(GTEST_LIBRARY NAMES gtest)
245+
find_path(GTEST_INCLUDE_DIR NAMES gtest/gtest.h PATHS /opt/gtest/include)
245246
if(GTEST_LIBRARY)
246247
set(TEST_FILES
247248
test/dtl_config.cpp
@@ -253,14 +254,15 @@ if(GTEST_LIBRARY)
253254
test/main.cpp
254255
test/test_util.hpp
255256
include/dtlmod.hpp)
256-
257+
257258
add_definitions(-DGTEST_USED)
258259
add_executable(unit_tests EXCLUDE_FROM_ALL ${SOURCE_FILES} ${HEADER_FILES} ${TEST_FILES})
259260
target_include_directories(unit_tests PRIVATE
260261
${CMAKE_SOURCE_DIR}/include
261262
${CMAKE_BINARY_DIR}/include
262263
${SimGrid_INCLUDE_DIR}
263264
${FSMOD_INCLUDE_DIR}
265+
${GTEST_INCLUDE_DIR}
264266
)
265267
target_link_libraries(unit_tests ${GTEST_LIBRARY} ${SimGrid_LIBRARY} ${FSMOD_LIBRARY} dtlmod -lpthread -lm)
266268
set_target_properties(unit_tests PROPERTIES COMPILE_FLAGS "-g -O0 --coverage")

0 commit comments

Comments
 (0)