-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
6 changed files
with
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sources: | ||
"2.0": | ||
commit: "348869fcda83f8b8b521c7654f83fea07ebe7a0a" |
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,29 @@ | ||
from conan import ConanFile | ||
from conan.tools.files import copy | ||
from conan.tools.scm import Git | ||
import os | ||
|
||
required_conan_version = ">=2.0.0" | ||
|
||
class RocketConan(ConanFile): | ||
name = "rocket" | ||
description = "Fast single header signal/slots library for C++" | ||
license = "public domain" | ||
topics = ("signal-slots", "observer-pattern") | ||
homepage = "https://github.com/tripleslash/rocket" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
package_type = "header-library" | ||
|
||
def source(self): | ||
git = Git(self) | ||
git.clone(url="https://github.com/tripleslash/rocket.git", target=".") | ||
git.checkout(**self.conan_data["sources"][self.version]) | ||
|
||
def build(self): | ||
pass | ||
|
||
def package(self): | ||
copy(self, "rocket.hpp", self.build_folder, os.path.join(self.package_folder, "include")) | ||
|
||
def package_info(self): | ||
self.cpp_info.libs = ["rocket"] |
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 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(PackageTest) | ||
|
||
find_package(rocket CONFIG REQUIRED) | ||
|
||
add_executable(example src/example.cpp) | ||
target_link_libraries(example rocket::rocket) |
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 @@ | ||
import os | ||
|
||
from conan import ConanFile | ||
from conan.tools.cmake import CMake, cmake_layout | ||
from conan.tools.build import can_run | ||
|
||
|
||
class RocketTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "CMakeDeps", "CMakeToolchain" | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def test(self): | ||
if can_run(self): | ||
cmd = os.path.join(self.cpp.build.bindir, "example") | ||
self.run(cmd, env="conanrun") |
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,13 @@ | ||
#include <cstdlib> | ||
|
||
#include "rocket.hpp" | ||
|
||
int main() | ||
{ | ||
rocket::signal<int(int)> test; | ||
test.connect([](int x) | ||
{ return x * 3; }); | ||
|
||
constexpr int value = 2; | ||
return test(value) == value*3 ? EXIT_SUCCESS : EXIT_FAILURE; | ||
} |
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,3 @@ | ||
versions: | ||
"2.0": | ||
folder: "all" |