Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-PLACET committed Dec 12, 2024
1 parent 388feb1 commit 20ce4f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ OPTION(BUILD_DOCS "Build sparrow documentation" OFF)
OPTION(BUILD_EXAMPLES "Build sparrow examples" OFF)
OPTION(USE_DATE_POLYFILL "Use date polyfill implementation" ON)
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)

Expand Down
20 changes: 15 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 20ce4f6

Please sign in to comment.