Skip to content

Commit ee5c6ed

Browse files
committed
Added googletest as a submodule, validated that the changes I made succeed with clang 3.7 and gcc 5.2.
1 parent f6d2b13 commit ee5c6ed

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "deps/googletest"]
2+
path = deps/googletest
3+
url = https://github.com/google/googletest.git

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ add_subdirectory(src)
5656
# Testing
5757
if (CMAKE_PROJECT_NAME STREQUAL "Uri" OR CPP-NETLIB_BUILD_TESTS)
5858
enable_testing()
59-
find_package(GTest REQUIRED)
59+
add_subdirectory(deps/googletest)
6060
add_subdirectory(test)
6161
endif()
6262

deps/googletest

Submodule googletest added at ff5ffd4

test/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Copyright (c) Glyn Matthews 2012, 2013.
1+
# Copyright (c) Glyn Matthews 2012-2016.
22
# Distributed under the Boost Software License, Version 1.0.
33
# (See accompanying file LICENSE_1_0.txt or copy at
44
# http://www.boost.org/LICENSE_1_0.txt)
55

66

7-
include_directories(${GTEST_INCLUDE_DIRS})
7+
include_directories( ${gtest_SOURCE_DIR}/include)
88

99
set(
1010
TESTS
@@ -20,8 +20,8 @@ set(
2020

2121
foreach (test ${TESTS})
2222
add_executable(${test} ${test}.cpp)
23-
add_dependencies(${test} network-uri)
24-
target_link_libraries(${test} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} network-uri)
23+
add_dependencies(${test} network-uri gtest_main)
24+
target_link_libraries(${test} ${CMAKE_THREAD_LIBS_INIT} network-uri gtest_main)
2525
if (OPENSSL_FOUND)
2626
target_link_libraries(${test} ${OPENSSL_LIBRARIES})
2727
endif()

0 commit comments

Comments
 (0)