| 1 | This patch allows the build process to use the provided dependencies instead
|
| 2 | of adding their source as CMake sub-directories (in which case "make install"
|
| 3 | would install googletest's and googlebenchmark's libraries and headers).
|
| 4 |
|
| 5 | diff --git a/CMakeLists.txt b/CMakeLists.txt
|
| 6 | index bcae6b5..ff6710d 100644
|
| 7 | |
| 8 | |
| 9 | @@ -21,7 +21,7 @@ IF(FXDIV_BUILD_TESTS)
|
| 10 | ENDIF()
|
| 11 |
|
| 12 | # ---[ Download deps
|
| 13 | -IF(FXDIV_BUILD_TESTS AND NOT DEFINED GOOGLETEST_SOURCE_DIR)
|
| 14 | +IF(FALSE)
|
| 15 | MESSAGE(STATUS "Downloading Google Test to ${CMAKE_BINARY_DIR}/googletest-source (define GOOGLETEST_SOURCE_DIR to avoid it)")
|
| 16 | CONFIGURE_FILE(cmake/DownloadGoogleTest.cmake "${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt")
|
| 17 | EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
|
| 18 | @@ -31,7 +31,7 @@ IF(FXDIV_BUILD_TESTS AND NOT DEFINED GOOGLETEST_SOURCE_DIR)
|
| 19 | SET(GOOGLETEST_SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-source" CACHE STRING "Google Test source directory")
|
| 20 | ENDIF()
|
| 21 |
|
| 22 | -IF(FXDIV_BUILD_BENCHMARKS AND NOT DEFINED GOOGLEBENCHMARK_SOURCE_DIR)
|
| 23 | +IF(FALSE)
|
| 24 | MESSAGE(STATUS "Downloading Google Benchmark to ${CMAKE_BINARY_DIR}/googlebenchmark-source (define GOOGLEBENCHMARK_SOURCE_DIR to avoid it)")
|
| 25 | CONFIGURE_FILE(cmake/DownloadGoogleBenchmark.cmake "${CMAKE_BINARY_DIR}/googlebenchmark-download/CMakeLists.txt")
|
| 26 | EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
|
| 27 | @@ -54,7 +54,7 @@ INSTALL(FILES include/fxdiv.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
| 28 |
|
| 29 | IF(FXDIV_BUILD_TESTS)
|
| 30 | # ---[ Build google test
|
| 31 | - IF(NOT TARGET gtest)
|
| 32 | + IF(FALSE)
|
| 33 | SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
| 34 | ADD_SUBDIRECTORY(
|
| 35 | "${GOOGLETEST_SOURCE_DIR}"
|
| 36 | @@ -78,7 +78,7 @@ ENDIF()
|
| 37 |
|
| 38 | IF(FXDIV_BUILD_BENCHMARKS)
|
| 39 | # ---[ Build google benchmark
|
| 40 | - IF(NOT TARGET benchmark)
|
| 41 | + IF(FALSE)
|
| 42 | SET(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
|
| 43 | ADD_SUBDIRECTORY(
|
| 44 | "${GOOGLEBENCHMARK_SOURCE_DIR}"
|