blob: d132d9b4c37047aeb90a7da8848cce14684975b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,31 +48,11 @@
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb")
# -- [ GTest
-enable_testing()
-set(GOOGLETEST_ROOT external/googletest/googletest CACHE STRING "Google Test source root")
-include_directories(
- ${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}
- ${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}/include
- )
-set(GOOGLETEST_SOURCES
- ${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}/src/gtest-all.cc
- ${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}/src/gtest_main.cc
- )
-foreach(_source ${GOOGLETEST_SOURCES})
- set_source_files_properties(${_source} PROPERTIES GENERATED 1)
-endforeach()
-
-add_library(googletest ${GOOGLETEST_SOURCES})
+find_package(GTest REQUIRED)
# -- [ GFlags
-set(GFLAGS_ROOT external/gflags CACHE STRING "Google Flags")
-
-add_subdirectory(${PROJECT_SOURCE_DIR}/${GFLAGS_ROOT})
-
-include_directories(
- ${PROJECT_BINARY_DIR}/${GFLAGS_ROOT}/include
-)
+find_package(gflags REQUIRED)
# --[ Threads
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -9,7 +9,6 @@
add_executable(test_suite test_suite.cpp)
target_link_libraries(test_suite sqlcheck_library
${GTEST_BOTH_LIBRARIES}
-googletest
${GLOG_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
|