Skip to content

Commit 11518a0

Browse files
committed
Add conan package build
1 parent ba0f995 commit 11518a0

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/.vs/
66
/out/
77
/cmake-build-debug-wsl-coverage/
8+
CMakeUserPresets.json

CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
77
set(CMAKE_CXX_EXTENSIONS OFF)
88
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
99

10-
if (NOT CMAKE_BUILD_TYPE)
11-
message(FATAL_ERROR "Missing CMAKE_BUILD_TYPE!")
12-
endif ()
13-
1410
include(GNUInstallDirs)
1511

1612
add_library(

conanfile.py

+24-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
1-
# This file is managed by Conan, contents will be overwritten.
2-
# To keep your changes, remove these comment lines, but the plugin won't be able to modify your requirements
3-
41
from conan import ConanFile
5-
from conan.tools.cmake import cmake_layout, CMakeToolchain
2+
from conan.tools.cmake import cmake_layout, CMakeToolchain, CMakeDeps, CMake
3+
4+
class msgpack23(ConanFile):
5+
name = "msgpack23"
6+
version = "1.0"
7+
8+
license = "MIT"
9+
author = "Rene Windegger <[email protected]>"
10+
url = "https://github.com/rwindegger/msgpack23"
11+
description = "A modern, header-only C++ library for MessagePack serialization and deserialization."
12+
topics = ("msgpack", "serialization", "MessagePack")
613

7-
class ConanApplication(ConanFile):
8-
package_type = "application"
914
settings = "os", "compiler", "build_type", "arch"
10-
generators = "CMakeDeps"
15+
16+
exports_sources = ( "CMakeLists.txt", "include/*", "tests/*", "cmake/*" )
1117

1218
def layout(self):
1319
cmake_layout(self)
1420

1521
def generate(self):
22+
deps = CMakeDeps(self)
23+
deps.generate()
1624
tc = CMakeToolchain(self)
17-
tc.user_presets_path = False
1825
tc.generate()
1926

27+
def build(self):
28+
cmake = CMake(self)
29+
cmake.configure()
30+
cmake.build()
31+
32+
def package(self):
33+
cmake = CMake(self)
34+
cmake.install()
35+
2036
def requirements(self):
2137
requirements = self.conan_data.get('requirements', [])
2238
for requirement in requirements:

0 commit comments

Comments
 (0)