xref: /6.0.3/tlm/deps/packages/erlang/CMakeLists.txt (revision 1c87a21d)
1# Downloads the declared version of Erlang source code and builds it.
2
3# We bundle OpenSSL on some platforms, and we want support
4# for OpenSSL in Erlang so we need to install the OpenSSL Package.
5# Note: So far this is only for Windows and MacOS. On a couple
6# Linux platforms, eg Debian 9, we do need a custom build of OpenSSL
7# but *only* for Erlang, therefore we don't have cbdeps packages for
8# those platforms; erlang_unix.sh actually builds OpenSSL here.
9SET (_openssl_install "${CMAKE_CURRENT_BINARY_DIR}/ignored")
10SET (_orig_install_prefix "${CMAKE_INSTALL_PREFIX}")
11SET (CMAKE_INSTALL_PREFIX "${_openssl_install}")
12DECLARE_DEP (openssl VERSION 1.0.2k-cb2 PLATFORMS macosx)
13SET (CMAKE_INSTALL_PREFIX "${_orig_install_prefix}")
14
15INCLUDE (ExternalProject)
16
17IF (WIN32)
18  SET (_build_script ${CMAKE_CURRENT_SOURCE_DIR}/erlang_windows.sh)
19ELSE ()
20  SET (_build_script ${CMAKE_CURRENT_SOURCE_DIR}/erlang_unix.sh)
21ENDIF ()
22SET (_install_dir "${CMAKE_BINARY_DIR}/install")
23FILE (TO_NATIVE_PATH "${_install_dir}" _install_dir)
24
25ExternalProject_Add (erlang
26  GIT_REPOSITORY ${_git_repo}
27  GIT_TAG ${_git_rev}
28
29  CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E make_directory <INSTALL_DIR>
30  BUILD_COMMAND "${_build_script}" <INSTALL_DIR> ${PLATFORM} "${CMAKE_CURRENT_BINARY_DIR}/openssl.exploded"
31  BUILD_IN_SOURCE 1
32  INSTALL_DIR "${_install_dir}"
33  INSTALL_COMMAND "${CMAKE_COMMAND}" -E copy
34    "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_package.txt"
35    <INSTALL_DIR>/CMakeLists.txt
36)
37
38# cbdeps boilerplate
39_ADD_PACKAGE_STEP()
40