Adds googletest/include for test targets only

develop
Josh Cooper 2022-11-25 09:42:59 -08:00
parent b11b1c3d5f
commit 72ad7a1b01
1 changed files with 2 additions and 5 deletions

@ -417,10 +417,6 @@ endif()
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
if(BUILD_CORE_TESTS)
include_directories(depends/googletest/googletest/include)
endif()
include_directories(depends/protobuf) include_directories(depends/protobuf)
include_directories(depends/lua/include) include_directories(depends/lua/include)
include_directories(depends/md5) include_directories(depends/md5)
@ -437,9 +433,10 @@ if(BUILD_TESTING OR BUILD_CORE_TESTS)
macro(dfhack_test name files) macro(dfhack_test name files)
message("dfhack_test(${name}, ${files})") message("dfhack_test(${name}, ${files})")
add_executable(${name} ${files}) add_executable(${name} ${files})
target_include_directories(${name} PUBLIC depends/googletest/googletest/include)
target_link_libraries(${name} dfhack gtest) target_link_libraries(${name} dfhack gtest)
add_test(NAME ${name} COMMAND ${name})
set_target_properties(${name} PROPERTIES COMPILE_FLAGS "-Wno-sign-compare") set_target_properties(${name} PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
add_test(NAME ${name} COMMAND ${name})
endmacro() endmacro()
include(CTest) include(CTest)
endif() endif()