Browse Source

handling symlinks

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
674b73dff7
  1. 10
      extdep/CMakeLists.txt
  2. 44
      extdep/eth_download.cmake
  3. 8
      extdep/precompiled/json-rpc-cpp.cmake

10
extdep/CMakeLists.txt

@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
include(eth_download.cmake)
# all dependencies will be installed into this directory, separated by platform
string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name)
@ -26,12 +27,17 @@ if (ETH_COMPILE)
include(compile/snappy.cmake)
include(compile/leveldb.cmake)
# cryptopp
include(compile/cryptopp.cmake)
else()
include(precompiled/json-rpc-cpp.cmake)
eth_download("json-rpc-cpp")
eth_download("qt")
eth_download("cryptopp")
#include(compile/snappy.cmake)
eth_download("leveldb")
endif()
# will be re-eanbled later
# include(miniupnpc.cmake)
# if install phase of extep fails, even if libs are already created, the ethereum install will fail

44
extdep/eth_download.cmake

@ -0,0 +1,44 @@
# this macro requires the following variables to be specified:
#
# ETH_DEPENDENCY_SERVER - server from which dependencies should be downloaded
# ETH_DEPENDENCY_INSTALL_DIR - install location for all dependencies
#
# usage:
#
# eth_download("json-rpc-cpp")
# eth_download("json-rpc-cpp" "0.3.2")
#
# TODO:
# check if install_command is handling symlinks correctly on linux and windows
macro(eth_download eth_package_name)
set (extra_macro_args ${ARGN})
if (extra_macro_args GREATER 0)
set(eth_tar_name "${eth_package_name}-${ARGV1}.tar.gz")
else()
set(eth_tar_name "${eth_package_name}.tar.gz")
endif()
message(STATUS "download path for ${eth_package_name} is : ${ETH_DEPENDENCY_SERVER}/${eth_tar_name}.tar.gz")
# we need that to copy symlinks
# see http://superuser.com/questions/138587/how-to-copy-symbolic-links
if (APPLE)
set (eth_package_install cp -a . ${ETH_DEPENDENCY_INSTALL_DIR})
elseif (UNIX)
set (eth_package_install cp -a . ${ETH_DEPENDENCY_INSTALL_DIR})
else ()
set (eth_package_install cmake -E copy_directory . ${ETH_DEPENDENCY_INSTALL_DIR})
endif()
ExternalProject_Add(${eth_package_name}
URL ${ETH_DEPENDENCY_SERVER}/${eth_tar_name}
BINARY_DIR ${eth_package_name}-prefix/src/${eth_package_name}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${eth_package_install}
)
endmacro()

8
extdep/precompiled/json-rpc-cpp.cmake

@ -1,8 +0,0 @@
ExternalProject_Add(json-rpc-cpp
URL ${ETH_DEPENDENCY_SERVER}/json-rpc-cpp.tar.gz
BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND cmake -E copy_directory . ${ETH_DEPENDENCY_INSTALL_DIR}
)
Loading…
Cancel
Save