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

Commit

Permalink
Add example 'Boost-custom-args'
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
ruslo committed Nov 17, 2017
1 parent 6e9ecde commit 33f2225
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/Boost-custom-args/CMakeLists.txt
@@ -0,0 +1,17 @@
# Copyright (c) 2013-2017, Ruslan Baratov
# All rights reserved.

cmake_minimum_required(VERSION 3.0)
set(TESTING_CONFIG_OPT FILEPATH ${CMAKE_CURRENT_LIST_DIR}/config.cmake)

# Emulate HunterGate:
# * https://github.com/hunter-packages/gate
include("../common.cmake")

project(download-boost)

hunter_add_package(Boost)
find_package(Boost CONFIG REQUIRED)

add_executable(foo foo.cpp)
target_link_libraries(foo PUBLIC Boost::boost)
7 changes: 7 additions & 0 deletions examples/Boost-custom-args/config.cmake
@@ -0,0 +1,7 @@
hunter_config(
Boost
VERSION ${HUNTER_Boost_VERSION}
CMAKE_ARGS
CONFIG_MACRO=BOOST_REGEX_MATCH_EXTRA;BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
CONFIG_MACRO_BOOST_MPL_LIMIT_LIST_SIZE=3
)
21 changes: 21 additions & 0 deletions examples/Boost-custom-args/foo.cpp
@@ -0,0 +1,21 @@
#include <boost/config.hpp>
#include <boost/predef.h>

#if !defined(BOOST_REGEX_MATCH_EXTRA)
# error "BOOST_REGEX_MATCH_EXTRA not defined"
#endif

#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS)
# error "BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS not defined"
#endif

#if !defined(BOOST_MPL_LIMIT_LIST_SIZE)
# error "BOOST_MPL_LIMIT_LIST_SIZE not defined"
#endif

#if (BOOST_MPL_LIMIT_LIST_SIZE) != 3
# error "BOOST_MPL_LIMIT_LIST_SIZE is not 3"
#endif

int main() {
}

0 comments on commit 33f2225

Please sign in to comment.