-
Notifications
You must be signed in to change notification settings - Fork 0
/
import-openssl.cmake
executable file
·47 lines (39 loc) · 1.59 KB
/
import-openssl.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
################################################################################
# openssl
################################################################################
include(ExternalProject)
set(extlibs_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/install")
find_program (PERL_CMD perl)
ExternalProject_Add(openssl_extern
PREFIX ${extlibs_INSTALL_PREFIX} # Root dir for entire project
GIT_REPOSITORY https://github.com/openssl/openssl.git
GIT_TAG OpenSSL_1_1_0-stable
CONFIGURE_COMMAND ${PERL_CMD} ${extlibs_INSTALL_PREFIX}/src/openssl_extern/Configure "darwin64-x86_64-cc" "--prefix=${extlibs_INSTALL_PREFIX}"
#CONFIGURE_COMMAND sh "${extlibs_INSTALL_PREFIX}/src/openssl_extern/config" "--prefix=${extlibs_INSTALL_PREFIX}"
#BUILD_IN_SOURCE 1
BUILD_COMMAND make
#TEST_COMMAND make test # 50% failing on mac os xz
INSTALL_COMMAND make install
)
#To build for Win64/x64:
#> perl Configure VC-WIN64A
#> ms\do_win64a
#> nmake -f ms\ntdll.mak
#> cd out32dll
#> ..\ms\test
add_library(ssl SHARED IMPORTED)
add_dependencies(ssl openssl_extern)
set_property(TARGET ssl APPEND PROPERTY
IMPORTED_LOCATION "${extlibs_INSTALL_PREFIX}/lib/libssl.1.1.dylib"
)
set_property(TARGET ssl APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${extlibs_INSTALL_PREFIX}/include"
)
add_library(crypto SHARED IMPORTED)
add_dependencies(crypto openssl_extern)
set_property(TARGET crypto APPEND PROPERTY
IMPORTED_LOCATION "${extlibs_INSTALL_PREFIX}/lib/libcrypto.1.1.dylib"
)
set_property(TARGET crypto APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${extlibs_INSTALL_PREFIX}/include"
)