mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
System : Optionally bundle OpenSSL on Linux (#7458)
This commit is contained in:
parent
7798aa4b25
commit
0377da8097
14
.github/workflows/ResInsightWithCache.yml
vendored
14
.github/workflows/ResInsightWithCache.yml
vendored
@ -127,7 +127,7 @@ jobs:
|
||||
uses: lukka/set-shell-env@master
|
||||
with:
|
||||
VCPKGRESPONSEFILE: ${{ github.workspace }}/${{ matrix.config.vcpkg-response-file }}
|
||||
- name: Run vcpkg
|
||||
- name: Restore from cache and install vcpkg
|
||||
uses: lukka/run-vcpkg@v5
|
||||
id: runvcpkg
|
||||
with:
|
||||
@ -136,6 +136,18 @@ jobs:
|
||||
# Ensure the cache key changes any time the content of the response file changes.
|
||||
appendedCacheKey: ${{ hashFiles(env.VCPKGRESPONSEFILE) }}
|
||||
|
||||
- name: Cache dynamic version of OpenSSL (Linux)
|
||||
if: "contains( matrix.config.os, 'ubuntu')"
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ github.workspace }}/ThirdParty/vcpkg/installed/x64-linux-dynamic
|
||||
key: ${{ matrix.config.os }}-vcpkg-x64-linux-dynamic_v01
|
||||
|
||||
- name: Install dynamic version of OpenSSL (Linux)
|
||||
if: "contains( matrix.config.os, 'ubuntu')"
|
||||
run: |
|
||||
$VCPKG_ROOT/vcpkg install --overlay-triplets=${{ github.workspace }}/ThirdParty/vcpkg-custom-triplets --triplet x64-linux-dynamic openssl
|
||||
|
||||
- name: Configure
|
||||
shell: cmake -P {0}
|
||||
run: |
|
||||
|
@ -143,7 +143,6 @@ jobs:
|
||||
-D CMAKE_BUILD_TYPE=$ENV{BUILD_TYPE}
|
||||
-D CMAKE_INSTALL_PREFIX=cmakebuild/install
|
||||
-D RESINSIGHT_ENABLE_UNITY_BUILD=true
|
||||
-D RESINSIGHT_BUNDLE_OPENSSL=true
|
||||
-D RESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true
|
||||
-D RESINSIGHT_TREAT_WARNINGS_AS_ERRORS=true
|
||||
-D RESINSIGHT_ENABLE_GRPC=true
|
||||
|
@ -549,25 +549,6 @@ if(RESINSIGHT_PRIVATE_INSTALL)
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/Python/rips/generated)
|
||||
endif()
|
||||
|
||||
# OpenSSL
|
||||
option(RESINSIGHT_BUNDLE_OPENSSL "Bundle the OpenSSL binary DLLs" OFF)
|
||||
mark_as_advanced(FORCE RESINSIGHT_BUNDLE_OPENSSL)
|
||||
|
||||
if(RESINSIGHT_BUNDLE_OPENSSL)
|
||||
find_package(OpenSSL)
|
||||
if(OPENSSL_FOUND)
|
||||
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
|
||||
set(OPENSSL_BIN_DIR ${OPENSSL_INCLUDE_DIR})
|
||||
string(REPLACE "include" "bin" OPENSSL_BIN_DIR ${OPENSSL_BIN_DIR})
|
||||
message("OpenSSL binary dir: ${OPENSSL_BIN_DIR}")
|
||||
|
||||
install(FILES ${OPENSSL_BIN_DIR}/libcrypto-1_1-x64.dll
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER})
|
||||
install(FILES ${OPENSSL_BIN_DIR}/libssl-1_1-x64.dll
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER})
|
||||
endif(OPENSSL_FOUND)
|
||||
endif(RESINSIGHT_BUNDLE_OPENSSL)
|
||||
|
||||
# Boost
|
||||
find_package(Boost REQUIRED filesystem system)
|
||||
|
||||
@ -637,6 +618,43 @@ else(RESINSIGHT_PRIVATE_INSTALL)
|
||||
DESTINATION share/applications)
|
||||
endif(RESINSIGHT_PRIVATE_INSTALL)
|
||||
|
||||
# OpenSSL
|
||||
option(RESINSIGHT_BUNDLE_OPENSSL "Bundle the OpenSSL binary library files" OFF)
|
||||
mark_as_advanced(FORCE RESINSIGHT_BUNDLE_OPENSSL)
|
||||
|
||||
if(RESINSIGHT_BUNDLE_OPENSSL)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
find_package(OpenSSL)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
|
||||
set(OPENSSL_BIN_DIR ${OPENSSL_INCLUDE_DIR})
|
||||
string(REPLACE "include" "bin" OPENSSL_BIN_DIR ${OPENSSL_BIN_DIR})
|
||||
message("OpenSSL binary dir: ${OPENSSL_BIN_DIR}")
|
||||
|
||||
install(FILES ${OPENSSL_BIN_DIR}/libcrypto-1_1-x64.dll
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER})
|
||||
install(FILES ${OPENSSL_BIN_DIR}/libssl-1_1-x64.dll
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER})
|
||||
endif(OPENSSL_FOUND)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
# Assumes that OpenSSL is installed by ./vcpkg install
|
||||
# --overlay-triplets=custom-triplets --triplet x64-linux-dynamic openssl
|
||||
set(OPENSSL_BIN_DIR
|
||||
${CMAKE_SOURCE_DIR}/ThirdParty/vcpkg/installed/x64-linux-dynamic/lib)
|
||||
message("OpenSSL binary dir: ${OPENSSL_BIN_DIR}")
|
||||
|
||||
install(FILES ${OPENSSL_BIN_DIR}/libcrypto.so
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER})
|
||||
install(FILES ${OPENSSL_BIN_DIR}/libcrypto.so.1.1
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER})
|
||||
install(FILES ${OPENSSL_BIN_DIR}/libssl.so
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER})
|
||||
install(FILES ${OPENSSL_BIN_DIR}/libssl.so.1.1
|
||||
DESTINATION ${RESINSIGHT_INSTALL_FOLDER})
|
||||
endif()
|
||||
endif(RESINSIGHT_BUNDLE_OPENSSL)
|
||||
|
||||
# ##############################################################################
|
||||
# Installation packaging
|
||||
# ##############################################################################
|
||||
|
5
ThirdParty/vcpkg-custom-triplets/x64-linux-dynamic.cmake
vendored
Normal file
5
ThirdParty/vcpkg-custom-triplets/x64-linux-dynamic.cmake
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
|
||||
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
|
Loading…
Reference in New Issue
Block a user