From b7ff9d1162382d6754946fc211f3c9a23841b6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bodn=C3=A1r=20Zsombor?= <bodzsoaa@sch.bme.hu> Date: Tue, 2 Feb 2021 20:31:34 +0100 Subject: [PATCH] Add conan support --- CMakeLists.txt | 5 +++++ conanfile.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 conanfile.py diff --git a/CMakeLists.txt b/CMakeLists.txt index a92b66b..aeb566d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,11 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_DEBUG_POSTFIX _d) + +include(conanbuildinfo.cmake) +conan_basic_setup() + find_package( Qt6 COMPONENTS Core Gui Network Concurrent diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..4b27256 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,42 @@ +from conans import ConanFile, CMake + + +class LibmuebConan(ConanFile): + name = "libmueb" + version = "4.0" + description = "SchĂśnherz MĂĄtrix network library written in C++ using Qt" + url = "https://git.sch.bme.hu/matrix-group/libmueb-qt" + license = "LGPL-3.0-or-later" + author = "Zsombor BodnĂĄr (bodzsoaa@sch.bme.hu)" + topics = ("C++", "Qt 6", "SchĂśnherz MĂĄtrix") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True], "fPIC": [True]} + default_options = {"shared": True, "fPIC": True} + requires = "qt/[^6.0.0]@bincrafters/stable" + generators = "cmake" + exports_sources = "CMakeLists.txt", "!CMakeLists.txt.user", "include/*", "src/*" + + def configure(self): + if self.settings.compiler == "Visual Studio": + del self.settings.compiler.runtime + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + self.copy("*.h", dst="include", src="include") + self.copy("*.lib", dst="lib", keep_path=False) + self.copy("*.dll", dst="bin", keep_path=False) + self.copy("*.dylib*", dst="lib", keep_path=False) + self.copy("*.so", dst="lib", keep_path=False) + self.copy("*.a", dst="lib", keep_path=False) + + def package_info(self): + self.cpp_info.release.libs = ["muebreceiver", "muebtransmitter"] + self.cpp_info.debug.libs = ["muebreceiver_d", "muebtransmitter_d"] -- GitLab