forked from ruslo/hunter
-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39cad40
commit 45c9faa
Showing
4 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright (c) 2015, David Hirvonen | ||
# All rights reserved. | ||
|
||
# !!! DO NOT PLACE HEADER GUARDS HERE !!! | ||
|
||
# Load used modules | ||
include(hunter_add_version) | ||
include(hunter_cmake_args) | ||
include(hunter_download) | ||
include(hunter_pick_scheme) | ||
include(hunter_cacheable) | ||
include(hunter_source_subdir) | ||
|
||
hunter_cacheable(CMakeInSubdir) | ||
|
||
# List of versions here... | ||
hunter_add_version( | ||
PACKAGE_NAME | ||
CMakeInSubdir | ||
VERSION | ||
"0.0.1" | ||
URL | ||
"https://github.com/NeroBurner/cmake_in_subdir/archive/v0.0.1.tar.gz" | ||
SHA1 | ||
5791cd5e7e12c30ba1507f1ff29688aa1b9333f5 | ||
) | ||
|
||
# set the sub-directory the projects CMakeLists.txt is in | ||
hunter_source_subdir( | ||
CMakeInSubdir | ||
SOURCE_SUBDIR "cpp") | ||
|
||
# disable Eigen tests. Testcreation tries to find package 'Boost' | ||
hunter_cmake_args( | ||
CMakeInSubdir | ||
CMAKE_ARGS | ||
HUNTER_INSTALL_LICENSE_FILES=LICENSE | ||
) | ||
|
||
# Pick a download scheme | ||
hunter_pick_scheme(DEFAULT url_sha1_cmake) | ||
|
||
# Download package. | ||
# Two versions of library will be build: | ||
# * libexample_A.a | ||
# * libexample_Ad.a | ||
hunter_download(PACKAGE_NAME CMakeInSubdir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright (c) 2015, Ruslan Baratov | ||
# All rights reserved. | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
|
||
# Emulate HunterGate: | ||
# * https://github.com/hunter-packages/gate | ||
include("../common.cmake") | ||
|
||
project(download-CMakeInSubdir) | ||
|
||
# DOCUMENTATION_START { | ||
hunter_add_package(CMakeInSubdir) | ||
find_package(CIS CONFIG REQUIRED) | ||
|
||
add_executable(foo foo.cpp) | ||
target_link_libraries(foo CIS::CMakeInSubdir) | ||
# DOCUMENTATION_END } | ||
|
||
# Test double library creation | ||
find_package(CIS CONFIG REQUIRED) | ||
|
||
string(COMPARE EQUAL "${CMakeInSubdir_LICENSES}" "" is_empty) | ||
if(is_empty) | ||
message(FATAL_ERROR "Licenses not found") | ||
endif() | ||
|
||
message("CMakeInS licenses:") | ||
foreach(x ${Eigen_LICENSES}) | ||
message("* ${x}") | ||
if(NOT EXISTS "${Eigen_LICENSES}") | ||
message(FATAL_ERROR "File not found") | ||
endif() | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <cis.hpp> | ||
|
||
#include <iostream> | ||
int main() | ||
{ | ||
std::cout << "CMakeInSubdir version: " << cmake_in_subdir::CIS_VERSION << std::endl; | ||
} |