Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Layout update. Top directories: Base, Download, Source
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslo committed Dec 29, 2013
1 parent 707b0df commit aa9e3b7
Show file tree
Hide file tree
Showing 29 changed files with 55 additions and 47 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ env:
- TEST_DIR=cmake/schemes TEST_NAME=tests/url_sha1_openssl_ios
- TEST_DIR=cmake/schemes TEST_NAME=tests/url_sha1_release_debug
- TEST_DIR=examples TEST_NAME=Sugar
- TEST_DIR=examples TEST_NAME=GTest
# - TEST_DIR=examples TEST_NAME=GTest # TODO, update gtest version
- TEST_DIR=examples TEST_NAME=Boost
- TEST_DIR=examples TEST_NAME=Boost-filesystem
- TEST_DIR=examples TEST_NAME=Boost-stdlibcxx
- TEST_DIR=examples TEST_NAME=Boost-ios

script:
- cd ${TEST_DIR}
- export DIR=`pwd`
- cd ..
- mkdir Source
- mv ${DIR}/* Source
- cd Source/${TEST_DIR}
- python3 ./test.py --include ./${TEST_NAME}/
18 changes: 11 additions & 7 deletions cmake/Hunter
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ if(HUNTER_ROOT)
get_filename_component(HUNTER_ROOT_OLD "${HUNTER_ROOT}" ABSOLUTE)
endif()

get_filename_component(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
get_filename_component(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)

### test self
if(NOT EXISTS "${HUNTER_ROOT}/cmake/Hunter")
message(FATAL_ERROR "Can't find Hunter components in: ${HUNTER_ROOT}")
if(NOT EXISTS "${HUNTER_ROOT}/Source/cmake/Hunter")
message(
FATAL_ERROR
"Can't find Hunter components in: `${HUNTER_ROOT}` "
"Expected location: <HUNTER_ROOT>/Source/cmake/Hunter"
)
endif()

### add cmake modules to search path
list(APPEND CMAKE_MODULE_PATH "${HUNTER_ROOT}/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "${HUNTER_ROOT}/cmake/find")
list(APPEND CMAKE_MODULE_PATH "${HUNTER_ROOT}/Source/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "${HUNTER_ROOT}/Source/cmake/find")

include(hunter_status_debug)
include(hunter_status_print)
Expand All @@ -48,7 +52,7 @@ endif()

unset(HUNTER_ROOT_OLD)

set(HUNTER_BASE "${HUNTER_ROOT}/_base")
set(HUNTER_BASE "${HUNTER_ROOT}/Base")

### Check 'EP_BASE` correctness
get_directory_property(HUNTER_EP_BASE_OLD EP_BASE)
Expand All @@ -74,4 +78,4 @@ endif()

### 1. Clear all '<NAME>_ROOT' variables (cache, environment, ...)
### 2. Set '<NAME>_ROOT' or 'HUNTER_<name>_VERSION' variables
include("${HUNTER_ROOT}/cmake/config.cmake")
include("${HUNTER_ROOT}/Source/cmake/config.cmake")
2 changes: 1 addition & 1 deletion cmake/modules/hunter_add_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ macro(hunter_add_package)

set(
_hunter_ap_project_dir
${HUNTER_ROOT}/cmake/projects/${_hunter_ap_project}
${HUNTER_ROOT}/Source/cmake/projects/${_hunter_ap_project}
)
if(NOT EXISTS "${_hunter_ap_project_dir}")
hunter_fatal_error("Project '${_hunter_ap_project}' not found")
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/hunter_download.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function(hunter_download)
set(HUNTER_PACKAGE_INSTALL_DIR "${${h_root_name}}")
set(HUNTER_PACKAGE_URL "${HUNTER_${h_name}_URL}")
set(HUNTER_PACKAGE_SHA1 "${HUNTER_${h_name}_SHA1}")
set(HUNTER_PACKAGE_DOWNLOAD_DIR "${HUNTER_BASE}/Download/${h_name}")
set(HUNTER_PACKAGE_DOWNLOAD_DIR "${HUNTER_ROOT}/Download/${h_name}")
set(HUNTER_PACKAGE_SOURCE_DIR "${HUNTER_BASE}/Source/${h_name}")

if(NOT HUNTER_PACKAGE_URL)
Expand Down Expand Up @@ -187,7 +187,7 @@ function(hunter_download)

set(
download_scheme
"${HUNTER_ROOT}/cmake/schemes/${HUNTER_DOWNLOAD_SCHEME}.cmake.in"
"${HUNTER_ROOT}/Source/cmake/schemes/${HUNTER_DOWNLOAD_SCHEME}.cmake.in"
)
if(NOT EXISTS "${download_scheme}")
hunter_fatal_error("Download scheme not found")
Expand Down
4 changes: 2 additions & 2 deletions cmake/schemes/tests/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

cmake_minimum_required(VERSION 2.8.8)

set(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../..")
include(${HUNTER_ROOT}/cmake/Hunter)
set(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../..")
include(${HUNTER_ROOT}/Source/cmake/Hunter)

include(${CMAKE_CURRENT_LIST_DIR}/utilities.cmake)

Expand Down
2 changes: 1 addition & 1 deletion cmake/schemes/tests/url_sha1_boost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set(
)

configure_file(
${HUNTER_ROOT}/cmake/schemes/url_sha1_boost.cmake.in
${HUNTER_ROOT}/Source/cmake/schemes/url_sha1_boost.cmake.in
${DOWNLOAD_PROJECT_BASE}/CMakeLists.txt
@ONLY
)
Expand Down
4 changes: 2 additions & 2 deletions cmake/schemes/tests/url_sha1_boost_ios_library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(HUNTER_PACKAGE_COMPONENT system)

# Download boost
configure_file(
${HUNTER_ROOT}/cmake/schemes/url_sha1_boost.cmake.in
${HUNTER_ROOT}/Source/cmake/schemes/url_sha1_boost.cmake.in
${DOWNLOAD_PROJECT_BASE}/CMakeLists.txt
@ONLY
)
Expand All @@ -32,7 +32,7 @@ set(HUNTER_PACKAGE_VARIANTS ios ios_sim ios_universal)

# Install library
configure_file(
${HUNTER_ROOT}/cmake/schemes/url_sha1_boost_ios_library.cmake.in
${HUNTER_ROOT}/Source/cmake/schemes/url_sha1_boost_ios_library.cmake.in
${DOWNLOAD_PROJECT_BASE}/CMakeLists.txt
@ONLY
)
Expand Down
4 changes: 2 additions & 2 deletions cmake/schemes/tests/url_sha1_boost_library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(HUNTER_PACKAGE_COMPONENT system)

# Download boost
configure_file(
${HUNTER_ROOT}/cmake/schemes/url_sha1_boost.cmake.in
${HUNTER_ROOT}/Source/cmake/schemes/url_sha1_boost.cmake.in
${DOWNLOAD_PROJECT_BASE}/CMakeLists.txt
@ONLY
)
Expand All @@ -30,7 +30,7 @@ execute_test(${CMAKE_COMMAND} --build .)

# Install library
configure_file(
${HUNTER_ROOT}/cmake/schemes/url_sha1_boost_library.cmake.in
${HUNTER_ROOT}/Source/cmake/schemes/url_sha1_boost_library.cmake.in
${DOWNLOAD_PROJECT_BASE}/CMakeLists.txt
@ONLY
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(
set(HUNTER_PACKAGE_SHA1 48179067d11828dc347f98fc148654f88766529d)

configure_file(
${HUNTER_ROOT}/cmake/schemes/url_sha1_combined_release_debug.cmake.in
${HUNTER_ROOT}/Source/cmake/schemes/url_sha1_combined_release_debug.cmake.in
${DOWNLOAD_PROJECT_BASE}/CMakeLists.txt
@ONLY
)
Expand Down
2 changes: 1 addition & 1 deletion cmake/schemes/tests/url_sha1_no_install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(
set(HUNTER_PACKAGE_SHA1 48179067d11828dc347f98fc148654f88766529d)

configure_file(
${HUNTER_ROOT}/cmake/schemes/url_sha1_no_install.cmake.in
${HUNTER_ROOT}/Source/cmake/schemes/url_sha1_no_install.cmake.in
${DOWNLOAD_PROJECT_BASE}/CMakeLists.txt
@ONLY
)
Expand Down
2 changes: 1 addition & 1 deletion cmake/schemes/tests/url_sha1_openssl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(
set(HUNTER_PACKAGE_SHA1 4e8e2b21899f0dab567def50680dfd02a7acbb1a)

configure_file(
${HUNTER_ROOT}/cmake/schemes/url_sha1_openssl.cmake.in
${HUNTER_ROOT}/Source/cmake/schemes/url_sha1_openssl.cmake.in
${DOWNLOAD_PROJECT_BASE}/CMakeLists.txt
@ONLY
)
Expand Down
2 changes: 1 addition & 1 deletion cmake/schemes/tests/url_sha1_openssl_ios/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set(

# Install library
configure_file(
${HUNTER_ROOT}/cmake/schemes/url_sha1_openssl_ios.cmake.in
${HUNTER_ROOT}/Source/cmake/schemes/url_sha1_openssl_ios.cmake.in
${DOWNLOAD_PROJECT_BASE}/CMakeLists.txt
@ONLY
)
Expand Down
2 changes: 1 addition & 1 deletion cmake/schemes/tests/url_sha1_release_debug/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(HUNTER_PACKAGE_SHA1 48179067d11828dc347f98fc148654f88766529d)
set(HUNTER_PACKAGE_VARIANTS release debug)

configure_file(
${HUNTER_ROOT}/cmake/schemes/url_sha1_release_debug.cmake.in
${HUNTER_ROOT}/Source/cmake/schemes/url_sha1_release_debug.cmake.in
${DOWNLOAD_PROJECT_BASE}/CMakeLists.txt
@ONLY
)
Expand Down
4 changes: 2 additions & 2 deletions cmake/schemes/url_sha1_boost.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(ExternalProject) # ExternalProject_Add

# Scheme for download boost and install header-only libraries (no build step)

list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/Source/cmake/modules")

include(hunter_assert_lists_equal)
include(hunter_status_debug)
Expand Down Expand Up @@ -74,7 +74,7 @@ if(XCODE_VERSION)
# remove xcode environment variables
set(
bootstrap
. @HUNTER_ROOT@/scripts/clear-all.sh &&
. @HUNTER_ROOT@/Source/scripts/clear-all.sh &&
./bootstrap.sh
)
else()
Expand Down
6 changes: 3 additions & 3 deletions cmake/schemes/url_sha1_boost_ios_library.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(ExternalProject) # ExternalProject_Add

# Scheme for download and install ios universal boost library

list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/Source/cmake/modules")

include(hunter_assert_lists_equal)
include(hunter_fatal_error)
Expand Down Expand Up @@ -137,7 +137,7 @@ set(
if(XCODE_VERSION)
set(
bootstrap
. @HUNTER_ROOT@/scripts/clear-all.sh &&
. @HUNTER_ROOT@/Source/scripts/clear-all.sh &&
./bootstrap.sh
)
else()
Expand Down Expand Up @@ -226,7 +226,7 @@ ExternalProject_Add(
INSTALL_COMMAND
${CMAKE_COMMAND} -E make_directory "@HUNTER_PACKAGE_INSTALL_DIR@/lib"
COMMAND
"@HUNTER_ROOT@/scripts/create-boost-ios-fatlib.sh"
"@HUNTER_ROOT@/Source/scripts/create-boost-ios-fatlib.sh"
"@HUNTER_PACKAGE_SOURCE_DIR@"
"${LIBNAME}"
"@HUNTER_PACKAGE_COMPONENT@"
Expand Down
4 changes: 2 additions & 2 deletions cmake/schemes/url_sha1_boost_library.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(ExternalProject) # ExternalProject_Add

# Scheme for download and install boost library

list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/Source/cmake/modules")

include(hunter_assert_lists_equal)
include(hunter_fatal_error)
Expand Down Expand Up @@ -147,7 +147,7 @@ if(APPLE)
FixDylibId
COMMAND
${PYTHON_EXECUTABLE}
"@HUNTER_ROOT@/scripts/fix-boost-dylib-id.py"
"@HUNTER_ROOT@/Source/scripts/fix-boost-dylib-id.py"
"--install-dir"
"@HUNTER_PACKAGE_INSTALL_DIR@/lib"
DEPENDEES
Expand Down
2 changes: 1 addition & 1 deletion cmake/schemes/url_sha1_combined_release_debug.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(ExternalProject) # ExternalProject_Add
# Scheme for Xcode and MSVC IDE:
# install both Debug and Release from one project

list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/Source/cmake/modules")

include(hunter_assert_lists_equal)
include(hunter_fatal_error)
Expand Down
4 changes: 2 additions & 2 deletions cmake/schemes/url_sha1_ios_sim.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.8.10) # SHA1

include(ExternalProject) # ExternalProject_Add

list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/Source/cmake/modules")

include(hunter_assert_lists_equal)
include(hunter_status_debug)
Expand Down Expand Up @@ -46,7 +46,7 @@ ExternalProject_Add(
CONFIGURE_COMMAND
""
BUILD_COMMAND
. @HUNTER_ROOT@/scripts/clear-all.sh &&
. @HUNTER_ROOT@/Source/scripts/clear-all.sh &&
xcodebuild -target ios-sim -configuration Release
BUILD_IN_SOURCE
1
Expand Down
2 changes: 1 addition & 1 deletion cmake/schemes/url_sha1_no_install.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(ExternalProject) # ExternalProject_Add
# Do not install to CMAKE_INSTALL_PREFIX
# (for cmake modules and header-only libraries)

list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/Source/cmake/modules")

include(hunter_assert_lists_equal)
include(hunter_fatal_error)
Expand Down
2 changes: 1 addition & 1 deletion cmake/schemes/url_sha1_openssl.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(ExternalProject) # ExternalProject_Add

# Scheme for download and install OpenSSL library

list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/Source/cmake/modules")

include(hunter_assert_lists_equal)
include(hunter_status_debug)
Expand Down
4 changes: 2 additions & 2 deletions cmake/schemes/url_sha1_openssl_ios.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(ExternalProject) # ExternalProject_Add

# Scheme for download and install OpenSSL iOS library

list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/Source/cmake/modules")

include(hunter_assert_lists_equal)
include(hunter_status_debug)
Expand Down Expand Up @@ -139,7 +139,7 @@ foreach(variant @IPHONEOS_ARCHS@ @IPHONESIMULATOR_ARCHS@)
"${iphone_minversion}"
"-arch ${variant}"
BUILD_COMMAND
. @HUNTER_ROOT@/scripts/clear-all.sh &&
. @HUNTER_ROOT@/Source/scripts/clear-all.sh &&
export CROSS_TOP=${CROSS_TOP} &&
export CROSS_SDK=${CROSS_SDK} &&
make
Expand Down
2 changes: 1 addition & 1 deletion cmake/schemes/url_sha1_release_debug.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(ExternalProject) # ExternalProject_Add

# Scheme for separated Release/Debug builds (like make)

list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/cmake/modules")
list(APPEND CMAKE_MODULE_PATH "@HUNTER_ROOT@/Source/cmake/modules")

include(hunter_assert_lists_equal)
include(hunter_fatal_error)
Expand Down
2 changes: 1 addition & 1 deletion examples/Boost-filesystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set(CMAKE_BUILD_TYPE Release)
# Let hunter be more verbose
set(HUNTER_STATUS_DEBUG ON CACHE BOOL "")

# emulate ${HUNTER_ROOT}/cmake/Hunter
# emulate ${HUNTER_ROOT}/Source/cmake/Hunter
include("../common.cmake")
include(hunter_add_package)

Expand Down
2 changes: 1 addition & 1 deletion examples/Boost-ios/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(CMAKE_BUILD_TYPE Debug)
# Let hunter be more verbose
set(HUNTER_STATUS_DEBUG ON CACHE BOOL "")

# emulate ${HUNTER_ROOT}/cmake/Hunter
# emulate ${HUNTER_ROOT}/Source/cmake/Hunter
include("../common.cmake")
include(hunter_add_package)

Expand Down
2 changes: 1 addition & 1 deletion examples/Boost-stdlibcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(CMAKE_VERBOSE_MAKEFILE YES)
# Let hunter be more verbose
set(HUNTER_STATUS_DEBUG ON CACHE BOOL "")

# emulate ${HUNTER_ROOT}/cmake/Hunter
# emulate ${HUNTER_ROOT}/Source/cmake/Hunter
include("../common.cmake")
include(hunter_add_package)

Expand Down
2 changes: 1 addition & 1 deletion examples/Boost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(download-boost)
# Let hunter be more verbose
set(HUNTER_STATUS_DEBUG ON CACHE BOOL "")

# emulate ${HUNTER_ROOT}/cmake/Hunter
# emulate ${HUNTER_ROOT}/Source/cmake/Hunter
include("../common.cmake")
include(hunter_add_package)

Expand Down
2 changes: 1 addition & 1 deletion examples/GTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(download-gtest)
# Let hunter be more verbose
set(HUNTER_STATUS_DEBUG ON CACHE BOOL "")

# emulate ${HUNTER_ROOT}/cmake/Hunter
# emulate ${HUNTER_ROOT}/Source/cmake/Hunter
include("../common.cmake")
include(hunter_add_package)

Expand Down
2 changes: 1 addition & 1 deletion examples/Sugar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(download-sugar)
# Let hunter be more verbose
set(HUNTER_STATUS_DEBUG ON CACHE BOOL "")

# emulate ${HUNTER_ROOT}/cmake/Hunter
# emulate ${HUNTER_ROOT}/Source/cmake/Hunter
include("../common.cmake")
include(hunter_add_package)

Expand Down
4 changes: 2 additions & 2 deletions examples/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

cmake_minimum_required(VERSION 2.8.8)

get_filename_component(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
include("${HUNTER_ROOT}/cmake/Hunter")
get_filename_component(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
include("${HUNTER_ROOT}/Source/cmake/Hunter")

# rewrite base for testing
set(HUNTER_BASE ${PROJECT_BINARY_DIR}/_hunter_base)

0 comments on commit aa9e3b7

Please sign in to comment.