Add optional download of binaries in build

* #10202 Download and use binaries as part of a build
This commit is contained in:
Magne Sjaastad 2023-05-01 18:44:05 +02:00 committed by GitHub
parent 3c1f0862e4
commit bb0ae9e381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 14 deletions

View File

@ -198,6 +198,7 @@ jobs:
-D RESINSIGHT_ENABLE_GRPC=${{ matrix.config.build-python-module }}
-D RESINSIGHT_GRPC_PYTHON_EXECUTABLE=${{ steps.python-path.outputs.PYTHON_EXECUTABLE }}
-D RESINSIGHT_GRPC_DOWNLOAD_PYTHON_MODULE=true
-D RESINSIGHT_ENABLE_HDF5=false
-D CMAKE_TOOLCHAIN_FILE=ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake
-G Ninja
RESULT_VARIABLE result

View File

@ -192,6 +192,21 @@ endif()
#
list(APPEND RI_PRIVATE_INCLUDES ${RESINSIGHT_OPENVDS_API_DIR}/include)
#
# Configure include directories if opm-common.lib is downloaded and linked
# without building from source
#
if(NOT BUILD_FROM_SOURCE)
list(APPEND RI_PUBLIC_INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/custom-opm-common/opm-common
)
list(
APPEND
RI_PRIVATE_INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/custom-opm-common/generated-opm-common/include
)
endif()
#
# HDF5
#
@ -415,6 +430,7 @@ target_include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/Measurement
${ResInsight_SOURCE_DIR}/ThirdParty
${CMAKE_BINARY_DIR}/Generated
${RI_PUBLIC_INCLUDES}
)
# ##############################################################################

View File

@ -373,14 +373,21 @@ endif()
# ##############################################################################
# HDF5
# ##############################################################################
if(MSVC)
set(RESINSIGHT_HDF5_DIR
""
CACHE PATH "Windows Only: Optional path to HDF5 libraries on Windows"
)
endif()
if(MSVC)
# this option is disabled in the daily build defined in
# ResInsightWithCache.yml, as the text input to ninja becomes too long
option(RESINSIGHT_ENABLE_HDF5 "Use external HDF5 library" ON)
if(RESINSIGHT_ENABLE_HDF5)
FetchContent_Declare(
hdf-external-lib
URL https://github.com/CeetronSolutions/resinsight-dependencies/releases/download/2023.04/HDF_Group.zip
)
FetchContent_Populate(hdf-external-lib)
set(RESINSIGHT_HDF5_DIR ${hdf-external-lib_SOURCE_DIR}/HDF5/1.8.18)
endif()
if(NOT ${RESINSIGHT_HDF5_DIR} EQUAL "")
list(APPEND EXTERNAL_LINK_LIBRARIES ${RESINSIGHT_HDF5_DIR}/lib/hdf5.lib
${RESINSIGHT_HDF5_DIR}/lib/hdf5_cpp.lib
@ -425,16 +432,30 @@ endif()
add_subdirectory(ThirdParty/custom-opm-flowdiagnostics)
add_subdirectory(ThirdParty/custom-opm-flowdiag-app)
add_subdirectory(ThirdParty/custom-opm-common)
add_subdirectory(ThirdParty/custom-opm-common/custom-opm-parser-tests)
list(APPEND OPM_LIBRARIES custom-opm-flowdiagnostics custom-opm-flowdiag-app
custom-opm-common
)
# Option used to build opm-common from source or use precompiled binaries
option(RESINSIGHT_BUILD_LIBS_FROM_SOURCE "Build opm-common from source" ON)
set_property(
TARGET ${OPM_LIBRARIES} opm-parser-tests PROPERTY FOLDER "Thirdparty/OPM"
)
if(RESINSIGHT_BUILD_LIBS_FROM_SOURCE)
add_subdirectory(ThirdParty/custom-opm-common)
add_subdirectory(ThirdParty/custom-opm-common/custom-opm-parser-tests)
list(APPEND OPM_LIBRARIES custom-opm-common)
set_property(TARGET opm-parser-tests PROPERTY FOLDER "Thirdparty/OPM")
else()
if(MSVC)
FetchContent_Declare(
ri-dependencies
URL https://github.com/CeetronSolutions/resinsight-dependencies/releases/download/2023.04/custom-opm-common.zip
)
FetchContent_Populate(ri-dependencies)
list(APPEND EXTERNAL_LINK_LIBRARIES
${ri-dependencies_SOURCE_DIR}/custom-opm-common.lib
)
endif()
endif()
list(APPEND OPM_LIBRARIES custom-opm-flowdiagnostics custom-opm-flowdiag-app)
set_property(TARGET ${OPM_LIBRARIES} PROPERTY FOLDER "Thirdparty/OPM")
# ##############################################################################
# NRLib