forked from ruslo/hunter
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Seb Horsewell <[email protected]>
- Loading branch information
Showing
5 changed files
with
79 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,26 @@ | ||
# Copyright (c) 2022 | ||
# All rights reserved. | ||
|
||
# !!! DO NOT PLACE HEADER GUARDS HERE !!! | ||
|
||
include(hunter_add_version) | ||
include(hunter_cacheable) | ||
include(hunter_cmake_args) | ||
include(hunter_download) | ||
include(hunter_pick_scheme) | ||
include(hunter_source_subdir) | ||
|
||
hunter_add_version( | ||
PACKAGE_NAME | ||
eventpp | ||
VERSION | ||
"0.1.2-for-hunter-pm" | ||
URL | ||
"https://github.com/wqking/eventpp/archive/refs/tags/v0.1.2-for-hunter-pm.tar.gz" | ||
SHA1 | ||
0b3d8408c0f5868dfc35b9cd05b0a2da823b73bf | ||
) | ||
|
||
hunter_pick_scheme(DEFAULT url_sha1_cmake) | ||
hunter_cacheable(eventpp) | ||
hunter_download(PACKAGE_NAME eventpp) |
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,19 @@ | ||
.. spelling:: | ||
|
||
eventpp | ||
|
||
.. index:: messaging ; eventpp | ||
|
||
.. _pkg.eventpp: | ||
|
||
eventpp | ||
======= | ||
|
||
- `Official <https://github.com/wqking/eventpp>`__ | ||
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/eventpp/CMakeLists.txt>`__ | ||
- Added by `bazfp <https://github.com/bazfp>`__ | ||
|
||
.. literalinclude:: /../examples/eventpp/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,19 @@ | ||
# Copyright (c) 2022 | ||
# All rights reserved. | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
|
||
# Emulate HunterGate: | ||
# * https://github.com/hunter-packages/gate | ||
include("../common.cmake") | ||
|
||
project(eventpp-example) | ||
|
||
# DOCUMENTATION_START { | ||
hunter_add_package(eventpp) | ||
find_package(eventpp CONFIG REQUIRED) | ||
|
||
add_executable(main main.cpp) | ||
target_link_libraries(main eventpp::eventpp) | ||
include_directories(${EVENTPP_INCLUDE_DIR}) | ||
# 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,14 @@ | ||
#include <eventpp/eventdispatcher.h> | ||
#include <eventpp/callbacklist.h> | ||
|
||
#include <iostream> | ||
|
||
int main() | ||
{ | ||
eventpp::EventDispatcher<int, void()> dispatcher; | ||
dispatcher.appendListener(3, []() | ||
{ std::cout << "Got event 3." << std::endl; }); | ||
// dispatch event 3 | ||
dispatcher.dispatch(3); | ||
return 0; | ||
} |