cmake_minimum_required(VERSION 2.8)
include(ExternalProject)

set(3RDPARTY_USR ${CMAKE_CURRENT_LIST_DIR}/usr)
set(3RDPARTY_USR ${CMAKE_CURRENT_LIST_DIR}/usr PARENT_SCOPE)

set(LIBARCHIVE_DIR libarchive-3.1.2)
ExternalProject_add(_get_libarchive
  PREFIX ${LIBARCHIVE_DIR}
  TMP_DIR ./tmp
  STAMP_DIR ./stamp
  DOWNLOAD_DIR .
  URL http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz
  URL_HASH SHA1=6a991777ecb0f890be931cec4aec856d1a195489
  SOURCE_DIR ${LIBARCHIVE_DIR}
  CONFIGURE_COMMAND ./configure --prefix=${3RDPARTY_USR}
  BUILD_COMMAND make all
  BUILD_IN_SOURCE 1
  TEST_COMMAND ""
  TEST_BEFORE_INSTALL 0
  TEST_AFTER_INSTALL 0
  INSTALL_COMMAND make install
  LOG_DOWNLOAD 1
  LOG_CONFIGURE 1
  LOG_BUILD 1
  LOG_TEST 1
  LOG_INSTALL 1
)

set(LIBCURL_DIR curl-7.40.0)
ExternalProject_add(_get_libcurl
  PREFIX ${LIBCURL_DIR}
  TMP_DIR ./tmp
  STAMP_DIR ./stamp
  DOWNLOAD_DIR .
  URL http://curl.haxx.se/download/curl-7.40.0.tar.gz
  URL_HASH SHA1=86cc77ddd7814dd417ec807a48dbc60d99a83ddd
  SOURCE_DIR ${LIBCURL_DIR}
  CONFIGURE_COMMAND ./configure --prefix=${3RDPARTY_USR}
  BUILD_COMMAND make all
  BUILD_IN_SOURCE 1
  TEST_COMMAND ""
  TEST_BEFORE_INSTALL 1
  TEST_AFTER_INSTALL 0
  INSTALL_COMMAND make install
  LOG_DOWNLOAD 1
  LOG_CONFIGURE 1
  LOG_BUILD 1
  LOG_TEST 1
  LOG_INSTALL 1
)

Bring in libcurl and libarchive
3rdparty: Bring in libcurl and libarchive
