From ac74cafbf052d25d9c222f689a57232377863dd4 Mon Sep 17 00:00:00 2001 From: Alexis Placet Date: Thu, 12 Dec 2024 14:19:21 +0100 Subject: [PATCH] Improvements --- CMakeLists.txt | 2 +- test/CMakeLists.txt | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d589a18..8dc7fbef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ OPTION(BUILD_EXAMPLES "Build sparrow examples" OFF) OPTION(USE_DATE_POLYFILL "Use date polyfill implementation" ON) OPTION(USE_LARGE_INT_PLACEHOLDERS "use types without api for big integers" OFF) set(DEPENDENCIES_CMAKE_FOLDER "External dependencies") -OPTION(FETCH_DEPENDENCIES_WITH_CMAKE "Fetch dependencies with CMake: Can be OFF, ON, or MISSING, in this case CMake donwload only dependencies which are not previously found." OFF) +OPTION(FETCH_DEPENDENCIES_WITH_CMAKE "Fetch dependencies with CMake: Can be OFF, ON, or MISSING, in this case CMake download only dependencies which are not previously found." OFF) OPTION(SPARROW_TARGET_32BIT "Test 32bit support" OFF) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d7432d68..41e906d3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -22,47 +22,57 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) set(SPARROW_INCLUDE_DIR ${sparrow_INCLUDE_DIRS}) endif() -if(FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "ON") +if(FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "OFF") set(FIND_PACKAGE_OPTIONS REQUIRED) else() set(FIND_PACKAGE_OPTIONS QUIET) endif() -find_package(doctest ${FIND_PACKAGE_OPTIONS}) -find_package(Catch2 3 ${FIND_PACKAGE_OPTIONS}) -find_package(nanoarrow ${FIND_PACKAGE_OPTIONS}) +if(NOT FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "ON") + find_package(doctest ${FIND_PACKAGE_OPTIONS}) + find_package(Catch2 3 ${FIND_PACKAGE_OPTIONS}) + find_package(nanoarrow ${FIND_PACKAGE_OPTIONS}) +endif() + +Set(FETCHCONTENT_QUIET FALSE) -if(FETCH_DEPENDENCIES_WITH_CMAKE) +if(FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "ON" OR FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "MISSING") include(FetchContent) if(NOT doctest_FOUND) + message(STATUS "📦 Fetching doctest v2.4.11") FetchContent_Declare( doctest GIT_SHALLOW TRUE GIT_REPOSITORY https://github.com/doctest/doctest.git GIT_TAG v2.4.11 + GIT_PROGRESS TRUE SYSTEM EXCLUDE_FROM_ALL) FetchContent_MakeAvailable(doctest) endif() if(NOT Catch2_FOUND) + message(STATUS "📦 Fetching Catch2 v3.7.1") FetchContent_Declare( Catch2 GIT_SHALLOW TRUE GIT_REPOSITORY https://github.com/catchorg/Catch2.git GIT_TAG v3.7.1 + GIT_PROGRESS TRUE SYSTEM EXCLUDE_FROM_ALL) FetchContent_MakeAvailable(Catch2) endif() if(NOT nanoarrow_FOUND) + message(STATUS "📦 Fetching nanoarrow 0.6") FetchContent_Declare( nanoarrow GIT_SHALLOW TRUE GIT_REPOSITORY https://github.com/apache/arrow-nanoarrow.git GIT_TAG apache-arrow-nanoarrow-0.6.0 + GIT_PROGRESS TRUE SYSTEM EXCLUDE_FROM_ALL) FetchContent_MakeAvailable(nanoarrow)