mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-29 10:21:54 -06:00
Add optional download of binaries in build
* #10202 Download and use binaries as part of a build
This commit is contained in:
parent
3c1f0862e4
commit
bb0ae9e381
1
.github/workflows/ResInsightWithCache.yml
vendored
1
.github/workflows/ResInsightWithCache.yml
vendored
@ -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
|
||||
|
@ -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}
|
||||
)
|
||||
|
||||
# ##############################################################################
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user