Skip to content

Commit

Permalink
fix: reorganize third_party modules for use of FetchContent
Browse files Browse the repository at this point in the history
  • Loading branch information
abdes committed Feb 26, 2022
1 parent 546fe73 commit cc65bc2
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,27 @@ endif()
# Third party modules
# ------------------------------------------------------------------------------

include(FetchContent)
# We make sure that we have 'third_party' in the name so that the targets get
# excluded from the generated target lists for the various tools.
set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/third_party_deps)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG # GoogleTest now follows the Abseil Live at Head philosophy. We
# recommend using the latest commit in the main branch in your
# projects.
origin/main)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt
ON
CACHE BOOL "" FORCE)
set(INSTALL_GTEST
OFF
CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
include(GoogleTest)

add_subdirectory(third_party)

# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -265,27 +286,6 @@ enable_testing()
asap_add_code_coverage_all_targets(EXCLUDE */test/* *googlemock* *googletest*
/usr/*)

include(FetchContent)
# We make sure that we have 'third_party' in the name so that the targets get
# excluded from the generated target lists for the various tools.
set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/third_party_deps)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG # GoogleTest now follows the Abseil Live at Head philosophy. We
# recommend using the latest commit in the main branch in your
# projects.
origin/main)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt
ON
CACHE BOOL "" FORCE)
set(INSTALL_GTEST
OFF
CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
include(GoogleTest)

# ==============================================================================
# Documentation - doxygen, sphinx/breathe/exhale
# ==============================================================================
Expand Down

0 comments on commit cc65bc2

Please sign in to comment.