mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-25 04:31:10 +02:00
workaround for cmake < 3.28
Some checks failed
Build the package using cmake then documentation / build (ubuntu-latest, 3.12) (push) Failing after 43s
Some checks failed
Build the package using cmake then documentation / build (ubuntu-latest, 3.12) (push) Failing after 43s
This commit is contained in:
@ -82,14 +82,28 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|||||||
if(AARE_FETCH_LMFIT)
|
if(AARE_FETCH_LMFIT)
|
||||||
#TODO! Should we fetch lmfit from the web or inlcude a tar.gz in the repo?
|
#TODO! Should we fetch lmfit from the web or inlcude a tar.gz in the repo?
|
||||||
set(LMFIT_PATCH_COMMAND git apply ${CMAKE_CURRENT_SOURCE_DIR}/patches/lmfit.patch)
|
set(LMFIT_PATCH_COMMAND git apply ${CMAKE_CURRENT_SOURCE_DIR}/patches/lmfit.patch)
|
||||||
FetchContent_Declare(
|
|
||||||
lmfit
|
# For cmake < 3.28 we can't supply EXCLUDE_FROM_ALL to FetchContent_Declare
|
||||||
GIT_REPOSITORY https://jugit.fz-juelich.de/mlz/lmfit.git
|
# so we need this workaround
|
||||||
GIT_TAG main
|
if (${CMAKE_VERSION} VERSION_LESS "3.28")
|
||||||
PATCH_COMMAND ${LMFIT_PATCH_COMMAND}
|
FetchContent_Declare(
|
||||||
UPDATE_DISCONNECTED 1
|
lmfit
|
||||||
EXCLUDE_FROM_ALL 1
|
GIT_REPOSITORY https://jugit.fz-juelich.de/mlz/lmfit.git
|
||||||
)
|
GIT_TAG main
|
||||||
|
PATCH_COMMAND ${LMFIT_PATCH_COMMAND}
|
||||||
|
UPDATE_DISCONNECTED 1
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
FetchContent_Declare(
|
||||||
|
lmfit
|
||||||
|
GIT_REPOSITORY https://jugit.fz-juelich.de/mlz/lmfit.git
|
||||||
|
GIT_TAG main
|
||||||
|
PATCH_COMMAND ${LMFIT_PATCH_COMMAND}
|
||||||
|
UPDATE_DISCONNECTED 1
|
||||||
|
EXCLUDE_FROM_ALL 1
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
#Disable what we don't need from lmfit
|
#Disable what we don't need from lmfit
|
||||||
set(BUILD_TESTING OFF CACHE BOOL "")
|
set(BUILD_TESTING OFF CACHE BOOL "")
|
||||||
set(LMFIT_CPPTEST OFF CACHE BOOL "")
|
set(LMFIT_CPPTEST OFF CACHE BOOL "")
|
||||||
@ -97,8 +111,15 @@ if(AARE_FETCH_LMFIT)
|
|||||||
set(LMFIT_CPPTEST OFF CACHE BOOL "")
|
set(LMFIT_CPPTEST OFF CACHE BOOL "")
|
||||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")
|
||||||
|
|
||||||
|
if (${CMAKE_VERSION} VERSION_LESS "3.28")
|
||||||
|
if(NOT lmfit_POPULATED)
|
||||||
|
FetchContent_Populate(lmfit)
|
||||||
|
add_subdirectory(${lmfit_SOURCE_DIR} ${lmfit_BINARY_DIR} EXCLUDE_FROM_ALL)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
FetchContent_MakeAvailable(lmfit)
|
||||||
|
endif()
|
||||||
|
|
||||||
FetchContent_MakeAvailable(lmfit)
|
|
||||||
set_property(TARGET lmfit PROPERTY POSITION_INDEPENDENT_CODE ON)
|
set_property(TARGET lmfit PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
else()
|
else()
|
||||||
find_package(lmfit REQUIRED)
|
find_package(lmfit REQUIRED)
|
||||||
@ -117,6 +138,7 @@ if(AARE_FETCH_ZMQ)
|
|||||||
GIT_REPOSITORY https://github.com/zeromq/libzmq.git
|
GIT_REPOSITORY https://github.com/zeromq/libzmq.git
|
||||||
GIT_TAG v4.3.4
|
GIT_TAG v4.3.4
|
||||||
PATCH_COMMAND ${ZMQ_PATCH_COMMAND}
|
PATCH_COMMAND ${ZMQ_PATCH_COMMAND}
|
||||||
|
UPDATE_DISCONNECTED 1
|
||||||
)
|
)
|
||||||
# Disable unwanted options from libzmq
|
# Disable unwanted options from libzmq
|
||||||
set(BUILD_TESTS OFF CACHE BOOL "Switch off libzmq test build")
|
set(BUILD_TESTS OFF CACHE BOOL "Switch off libzmq test build")
|
||||||
|
Reference in New Issue
Block a user