Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions reference/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,22 @@ else()
message(STATUS "ENABLE_SVP is OFF: Building SecAPI without SVP functionality")
endif()

if(${BUILD_TESTS})
# Download and unpack googletest at configure time
if(BUILD_TESTS)
include(FetchContent)

# Download and unpack googletest at configure time
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.13.0
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.15.2
)
FetchContent_MakeAvailable(googletest)

FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

# The following line is a hack to avoid adding a bunch of CTest targets to
# the build. By setting this internal property used by the CTest module and
# its dependencies, it skips the generation of the extra targets. This
# property could change in the future.
# - https://stackoverflow.com/a/57240389
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
include(CTest)
include(GoogleTest)
Expand Down
Loading