PrusaSlicer-NonPlainar/deps/OpenSSL/OpenSSL.cmake

35 lines
1.1 KiB
CMake
Raw Permalink Normal View History

2021-03-20 15:16:50 +00:00
include(ProcessorCount)
ProcessorCount(NPROC)
2021-03-23 18:35:33 +00:00
set(_conf_cmd "./config")
2021-03-20 15:16:50 +00:00
set(_cross_arch "")
set(_cross_comp_prefix_line "")
if (CMAKE_CROSSCOMPILING)
2021-03-23 18:35:33 +00:00
set(_conf_cmd "./Configure")
2021-03-22 16:10:00 +00:00
set(_cross_comp_prefix_line "--cross-compile-prefix=${TOOLCHAIN_PREFIX}-")
2021-03-20 15:16:50 +00:00
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")
set(_cross_arch "linux-aarch64")
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armhf") # For raspbian
# TODO: verify
set(_cross_arch "linux-armv4")
endif ()
endif ()
ExternalProject_Add(dep_OpenSSL
EXCLUDE_FROM_ALL ON
URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0l.tar.gz"
URL_HASH SHA256=e2acf0cf58d9bff2b42f2dc0aee79340c8ffe2c5e45d3ca4533dd5d4f5775b1d
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL
2021-03-20 15:16:50 +00:00
BUILD_IN_SOURCE ON
2021-03-23 18:35:33 +00:00
CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch}
2021-03-20 15:16:50 +00:00
"--prefix=${DESTDIR}/usr/local"
${_cross_comp_prefix_line}
no-shared
no-ssl3-method
no-dynamic-engine
-Wa,--noexecstack
BUILD_COMMAND make depend && make "-j${NPROC}"
INSTALL_COMMAND make install_sw
)