Skip to content

Commit

Permalink
Conditionally call find_package(GTest) on the generated Config file
Browse files Browse the repository at this point in the history
  • Loading branch information
ericriff committed Sep 27, 2024
1 parent 9d87d23 commit b128265
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ if(ENABLE_TESTING)

FetchContent_MakeAvailable(googletest)
include(GoogleTest)

set(AU_CONFIG_FIND_GTEST_LINE "find_dependency(googletest 1.12.1)")
else()
message(STATUS "Unit tests disabled")
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/AuConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(googletest 1.12.1)
@AU_CONFIG_FIND_GTEST_LINE@

include(${CMAKE_CURRENT_LIST_DIR}/AuHeaders.cmake)

Expand Down

0 comments on commit b128265

Please sign in to comment.