include_guard() # Packages that must be available by some other means # for some reason : # # - too big/too long to compile (ROOT) # - not buildable with CMake (boost?,OpenSSL, ZLIB) # - not easily usable with genuine find_package (FFTW3) # (FIXME? try with ExternalProject and find_package) # # so they can not be integrated with FetchContent find_package(OpenSSL REQUIRED) find_package(ZLIB REQUIRED) find_package(FFTW3 REQUIRED) find_package(Boost REQUIRED COMPONENTS atomic chrono program_options regex thread) find_package(libuuid REQUIRED) # Packages that we might have to build ourselves, if they are # not yet available. # To discard the attempt at find_package (FIND_PACKAGE_ARGS arg) # for those, use -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER # when performing the cmake configuration phase. include(FetchContent) FetchContent_Declare(km3net-ulib GIT_REPOSITORY git@git.km3net.de:common/ulib GIT_TAG 8c093ade6cdfb4ee4a150d4da16ade9cdd110505 ) if(KM3NET_JPP_ENABLE_ANTARES) FetchContent_Declare(antares-dataformat GIT_REPOSITORY git@git.km3net.de:common/antares-dataformat GIT_TAG 5dc7aa760516399cb474160f7d75c1235734d263 FIND_PACKAGE_ARGS NO_CMAKE_INSTALL_PREFIX ) endif() FetchContent_Declare(km3net-chsm GIT_REPOSITORY git@git.km3net.de:common/chsm GIT_TAG 526b0fddc91ebcddbf6808edc2ea7d243fd29390 FIND_PACKAGE_ARGS NO_CMAKE_INSTALL_PREFIX ) set(KM3NET_DATAFORMAT_BUILD_DOCUMENTATION ${KM3NET_JPP_ENABLE_DOCUMENTATION}) FetchContent_Declare(km3net-dataformat GIT_REPOSITORY git@git.km3net.de:common/km3net-dataformat GIT_TAG e9180a49eef4daec3c8f7f0584a30a521f4b074e FIND_PACKAGE_ARGS NO_CMAKE_INSTALL_PREFIX ) FetchContent_Declare(km3net-dbclient GIT_REPOSITORY git@git.km3net.de:common/dbclient GIT_TAG f2c9373cfa03ab3e06cdb52b68f070787bd6ea8b FIND_PACKAGE_ARGS NO_CMAKE_INSTALL_PREFIX ) FetchContent_Declare(km3net-flux GIT_REPOSITORY git@git.km3net.de:common/flux GIT_TAG 6c4e727ae7e17759bb52fccbef4bfa4c9d1b5c5d GIT_SUBMODULES "" FIND_PACKAGE_ARGS NO_CMAKE_INSTALL_PREFIX ) set(JSON_Install TRUE) FetchContent_Declare(nlohmann_json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz URL_HASH SHA256=d6c65aca6b1ed68e7a182f4757257b107ae403032760ed6ef121c9d55e81757d DOWNLOAD_EXTRACT_TIMESTAMP FALSE FIND_PACKAGE_ARGS NO_CMAKE_INSTALL_PREFIX ) FetchContent_MakeAvailable( km3net-chsm km3net-dataformat km3net-dbclient km3net-flux nlohmann_json ) if(KM3NET_JPP_ENABLE_ANTARES) FetchContent_MakeAvailable( antares-dataformat ) endif() # we put Root after km3net-dataformat to get km3net-dataformat drives the # search. In principle order should not matter but there is currently a bug in # the Mac homebrew Root installation (<=6.30.02), for which a workaround is put # in place in km3net-dataformat. Should be a temporary measure. find_package(ROOT REQUIRED) FetchContent_MakeAvailable( km3net-ulib ) if("${km3net-ulib_SOURCE_DIR}" STREQUAL "") message(FATAL_ERROR "Could not locate ulib") endif() message(VERBOSE "ulib is at ${km3net-ulib_SOURCE_DIR}")