| 1 | Use shared gtest instead of submodule
|
| 2 |
|
| 3 | diff --git a/CMakeLists.txt b/CMakeLists.txt
|
| 4 | index 617e4b2..2857875 100644
|
| 5 | |
| 6 | |
| 7 | @@ -18,7 +18,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
| 8 | include(GNUInstallDirs)
|
| 9 |
|
| 10 | project(leelaz)
|
| 11 | -add_subdirectory(gtest EXCLUDE_FROM_ALL) # We don't want to install gtest, exclude it from `all`
|
| 12 |
|
| 13 | # Required Packages
|
| 14 | set(Boost_MIN_VERSION "1.58.0")
|
| 15 | @@ -27,6 +26,7 @@ find_package(Boost 1.58.0 REQUIRED program_options filesystem)
|
| 16 | find_package(Threads REQUIRED)
|
| 17 | find_package(ZLIB REQUIRED)
|
| 18 | find_package(OpenCL REQUIRED)
|
| 19 | +find_package(GTest REQUIRED)
|
| 20 | # We need OpenBLAS for now, because we make some specific
|
| 21 | # calls. Ideally we'd use OpenBLAS is possible and fall back to
|
| 22 | # not doing those calls if it's not present.
|
| 23 | @@ -93,6 +93,7 @@ include_directories(${IncludePath})
|
| 24 | include_directories(${Boost_INCLUDE_DIRS})
|
| 25 | include_directories(${OpenCL_INCLUDE_DIRS})
|
| 26 | include_directories(${ZLIB_INCLUDE_DIRS})
|
| 27 | +include_directories(${GTEST_INCLUDE_DIRS})
|
| 28 |
|
| 29 | if((UNIX AND NOT APPLE) OR WIN32)
|
| 30 | include_directories(${BLAS_INCLUDE_DIRS})
|
| 31 | @@ -141,7 +142,8 @@ target_link_libraries(tests ${Boost_LIBRARIES})
|
| 32 | target_link_libraries(tests ${BLAS_LIBRARIES})
|
| 33 | target_link_libraries(tests ${OpenCL_LIBRARIES})
|
| 34 | target_link_libraries(tests ${ZLIB_LIBRARIES})
|
| 35 | -target_link_libraries(tests gtest_main ${CMAKE_THREAD_LIBS_INIT})
|
| 36 | +target_link_libraries(tests ${GTEST_BOTH_LIBRARIES})
|
| 37 | +target_link_libraries(tests ${CMAKE_THREAD_LIBS_INIT})
|
| 38 |
|
| 39 | include(GetGitRevisionDescription)
|
| 40 | git_describe(VERSION --tags)
|