Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from conans import ConanFile, CMake, tools


class CsSignalConan(ConanFile):
name = "cs_signal"
version = "1.2.3"
license = "BSD2"
author = "Paul M. Bendixen paulbendixen@gmail.com"
url = ""
description = "A library for thread aware Signal/Slot delivery"
topics = ("CopperSpice", "Signal", "Slot")
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True], "fPIC": [True, False]}
default_options = {"shared": True, "fPIC": True}
generators = "cmake"
exports_sources = "*"

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def validate(self):
tools.check_min_cppstd(self,"17")

def _configure(self):
cmake = CMake(self)
cmake.configure()
return cmake

def build(self):
cmake = self._configure()
cmake.build()

def package(self):
cmake = self._configure()
cmake.install()

def package_info(self):
self.cpp_info.libs = ["CsSignal"]

15 changes: 15 additions & 0 deletions test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.1)
project(PackageTest CXX)

find_package( Threads REQUIRED )
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_executable(example main.cpp peach.cpp )
target_link_libraries(example ${CONAN_LIBS} Threads::Threads)

# CTest is a testing tool that can be used to test your project.
# enable_testing()
# add_test(NAME example
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
# COMMAND example)
25 changes: 25 additions & 0 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os

from conans import ConanFile, CMake, tools


class CsSignalTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"

def build(self):
cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is
# in "test_package"
cmake.configure()
cmake.build()

def imports(self):
self.copy("*.dll", dst="bin", src="bin")
self.copy("*.dylib*", dst="bin", src="lib")
self.copy('*.so*', dst='bin', src='lib')

def test(self):
if not tools.cross_building(self):
os.chdir("bin")
self.run(".%sexample" % os.sep)
Loading