Skip to content

Commit

Permalink
enven more tries
Browse files Browse the repository at this point in the history
  • Loading branch information
yobeonline committed Aug 14, 2024
1 parent fabdcfc commit 1fcb9e0
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,29 @@ project(test_add_target)

include(add_target.cmake)

include(FetchContent)
FetchContent_Declare(
cmake_test
GIT_REPOSITORY https://github.com/CMakePP/CMakeTest
GIT_TAG v0.1.14
)
FetchContent_MakeAvailable(cmake_test)
macro(get_cmake_test)
include(cmake_test/cmake_test OPTIONAL RESULT_VARIABLE cmake_test_found)
if(NOT cmake_test_found)

# Store whether we are building tests or not, then turn off the tests
set(build_testing_old "${BUILD_TESTING}")
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
# Download CMakeTest and bring it into scope
include(FetchContent)
FetchContent_Declare(
cmake_test
GIT_REPOSITORY https://github.com/CMakePP/CMakeTest
)
FetchContent_MakeAvailable(cmake_test)

# Restore the previous value
set(BUILD_TESTING "${build_testing_old}" CACHE BOOL "" FORCE)
endif()
endmacro()

# Call the function we just wrote to get CMakeTest
get_cmake_test()


include(cmake_test/cmake_test)

Expand Down

0 comments on commit 1fcb9e0

Please sign in to comment.