1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Add google test as git submodule.

This commit is contained in:
Matias Fontanini
2015-04-23 19:39:48 -07:00
parent f4ccba93e6
commit c5b9afaf83
5 changed files with 26 additions and 7 deletions

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "googletest"]
path = googletest
url = https://github.com/smarr/googletest.git

View File

@@ -137,9 +137,11 @@ install(
ENABLE_TESTING()
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(examples)
ADD_SUBDIRECTORY(googletest)
ADD_SUBDIRECTORY(tests)
# Add all targets to the build-tree export set
EXPORT(
TARGETS tins

1
googletest Submodule

Submodule googletest added at 2ccb2496fe

View File

@@ -1,7 +1,12 @@
FIND_PACKAGE(GTest)
IF(gtest_BINARY_DIR)
MESSAGE(STATUS "Using googletest submodule")
SET(GTEST_FOUND true)
ELSE()
FIND_PACKAGE(GTest)
ENDIF()
IF(GTEST_FOUND)
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${gtest_INCLUDE_DIRS})
ADD_SUBDIRECTORY(src)
ELSE(GTEST_FOUND)
MESSAGE(WARNING "Google test not found. Disabling tests.")
MESSAGE(WARNING "Google test not found. Tests disabled.")
ENDIF(GTEST_FOUND)

View File

@@ -1,14 +1,22 @@
# Use libtins' include directories + test include directories
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include/tins/ ../include/)
INCLUDE_DIRECTORIES(
${PROJECT_SOURCE_DIR}/include/tins/
../include/
${gtest_SOURCE_DIR}/include
)
# Find pthread library
FIND_PACKAGE(Threads REQUIRED)
LINK_DIRECTORIES(
${gtest_BINARY_DIR}
)
# Link against GoogleTest, libtins and pthread.
# Pthread is required by GoogleTest
LINK_LIBRARIES(
${GTEST_LIBRARIES}
${GTEST_MAIN_LIBRARY}
gtest
gtest_main
tins
${CMAKE_THREAD_LIBS_INIT}
)