forked from ruslo/hunter
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial tinyrefl commit * Add url * Add default version * Change to cmake scheme * Switch back to version 0.4.1 * First working version * Cleanup for PR * Add PR number * Update tinyrefl release version
- Loading branch information
Showing
6 changed files
with
84 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,25 @@ | ||
# !!! DO NOT PLACE HEADER GUARDS HERE !!! | ||
|
||
include(hunter_add_version) | ||
include(hunter_cacheable) | ||
include(hunter_cmake_args) | ||
include(hunter_download) | ||
include(hunter_pick_scheme) | ||
|
||
hunter_add_version( | ||
PACKAGE_NAME | ||
tinyrefl | ||
VERSION | ||
0.4.1-p0 | ||
URL | ||
"https://github.com/cpp-pm/tinyrefl/archive/v0.4.1-p0.zip" | ||
SHA1 | ||
8aa103cf3d0064cacca3188ef259d82dc9e9fa67 | ||
) | ||
|
||
hunter_pick_scheme(DEFAULT url_sha1_cmake) | ||
hunter_cacheable(tinyrefl) | ||
hunter_download( | ||
PACKAGE_NAME tinyrefl | ||
PACKAGE_INTERNAL_DEPS_ID "1" | ||
) |
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,21 @@ | ||
.. spelling:: | ||
|
||
tinyrefl | ||
|
||
.. index:: | ||
single: unsorted ; tinyrefl | ||
|
||
.. _pkg.tinyrefl: | ||
|
||
tinyrefl | ||
======== | ||
|
||
- `Official <https://gitlab.com/Manu343726/tinyrefl/-/wikis/home>`__ | ||
- `Hunterized <https://github.com/cpp-pm/tinyrefl>`__ | ||
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/tinyrefl/CMakeLists.txt>`__ | ||
- Added by `Joerg-Christian Boehme <https://github.com/Bjoe>`__ (`pr-137 <https://github.com/cpp-pm/hunter/pull/137>`__) | ||
|
||
.. literalinclude:: /../examples/tinyrefl/CMakeLists.txt | ||
:language: cmake | ||
:start-after: # DOCUMENTATION_START { | ||
:end-before: # DOCUMENTATION_END } |
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,20 @@ | ||
# Copyright (c) 2016-2018, Ruslan Baratov | ||
# All rights reserved. | ||
|
||
cmake_minimum_required(VERSION 3.2) | ||
|
||
# Emulate HunterGate: | ||
# * https://github.com/hunter-packages/gate | ||
include("../common.cmake") | ||
|
||
project(tinyrefl) | ||
|
||
# DOCUMENTATION_START { | ||
hunter_add_package(tinyrefl) | ||
find_package(tinyrefl CONFIG REQUIRED) | ||
find_package(tinyrefl_tool CONFIG REQUIRED) | ||
|
||
add_executable(boo boo.cpp) | ||
tinyrefl_tool(TARGET boo HEADERS example.hpp) | ||
target_link_libraries(boo PUBLIC tinyrefl::tinyrefl) | ||
# DOCUMENTATION_END } |
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,8 @@ | ||
#include <tinyrefl/api.hpp> | ||
|
||
#include "example.hpp" | ||
#include "example.hpp.tinyrefl" // This header is generated via tinyrefl_tool() in cmake. | ||
|
||
int main() { | ||
static_assert(tinyrefl::has_metadata<example::A>(), ""); | ||
} |
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,9 @@ | ||
namespace example | ||
{ | ||
|
||
struct A | ||
{ | ||
int a = 42; | ||
}; | ||
|
||
} |