forked from ruslo/hunter
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
4 changed files
with
57 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,27 @@ | ||
# cmake/projects/Example/hunter.cmake | ||
|
||
# !!! DO NOT PLACE HEADER GUARDS HERE !!! | ||
|
||
# Load used modules | ||
include(hunter_add_version) | ||
include(hunter_download) | ||
include(hunter_pick_scheme) | ||
include(hunter_cacheable) | ||
|
||
# List of versions here... | ||
hunter_add_version( | ||
PACKAGE_NAME | ||
enet | ||
VERSION | ||
"1.3.13-p1" | ||
URL | ||
"https://github.com/hunter-packages/enet/archive/v1.3.13-p1.tar.gz" | ||
SHA1 | ||
40f97cc8d5e41f36fab05c9170836fb55d64191e | ||
) | ||
|
||
# Pick a download scheme | ||
hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects | ||
|
||
hunter_cacheable(enet) | ||
hunter_download(PACKAGE_NAME enet) |
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 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
# Emulate HunterGate: | ||
# * https://github.com/hunter-packages/gate | ||
include("../common.cmake") | ||
|
||
project(example-enet) | ||
|
||
hunter_add_package(enet) | ||
|
||
find_package(enet CONFIG REQUIRED) | ||
|
||
add_executable(example-enet main.c) | ||
target_link_libraries(example-enet enet::enet) |
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,15 @@ | ||
#include <enet/enet.h> | ||
#include <stdio.h> | ||
|
||
int | ||
main (int argc, char ** argv) | ||
{ | ||
if (enet_initialize () != 0) | ||
{ | ||
fprintf (stderr, "An error occurred while initializing ENet.\n"); | ||
return EXIT_FAILURE; | ||
} | ||
atexit (enet_deinitialize); | ||
|
||
return 0; | ||
} |