]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/conanfile.py
3 from conans
import ConanFile
, tools
, CMake
6 class civetwebConan(ConanFile
):
9 url
= "https://github.com/civetweb/civetweb"
10 description
= "Embedded C/C++ web server"
11 author
= "Bernhard Lehner <bel2125@gmail.com>"
12 topics
= ("conan", "civetweb", "web-server", "embedded")
13 exports
= ("LICENSE.md", "README.md")
14 exports_sources
= ("src/*", "cmake/*", "include/*", "CMakeLists.txt")
16 settings
= "os", "compiler", "build_type", "arch"
18 "shared" : [True, False],
19 "fPIC" : [True, False],
20 "enable_ssl" : [True, False],
21 "enable_websockets" : [True, False],
22 "enable_ipv6" : [True, False],
23 "enable_cxx" : [True, False]
29 "enable_websockets" : True,
34 def config_options(self
):
35 if self
.settings
.os
== 'Windows':
39 if not self
.options
.enable_cxx
:
40 del self
.settings
.compiler
.libcxx
42 def requirements(self
):
43 if self
.options
.enable_ssl
:
44 self
.requires("OpenSSL/1.0.2q@conan/stable")
46 def _configure_cmake(self
):
49 cmake
.definitions
["CIVETWEB_ENABLE_SSL"] = self
.options
.enable_ssl
50 cmake
.definitions
["CIVETWEB_ENABLE_WEBSOCKETS"] = self
.options
.enable_websockets
51 cmake
.definitions
["CIVETWEB_ENABLE_IPV6"] = self
.options
.enable_ipv6
52 cmake
.definitions
["CIVETWEB_ENABLE_CXX"] = self
.options
.enable_cxx
53 cmake
.definitions
["CIVETWEB_BUILD_TESTING"] = False
54 cmake
.definitions
["CIVETWEB_ENABLE_ASAN"] = False
55 cmake
.configure(build_dir
="build_subfolder")
59 tools
.replace_in_file(file_path
="CMakeLists.txt",
60 search
="project (civetweb)",
61 replace
="""project (civetweb)
62 include(conanbuildinfo.cmake)
63 conan_basic_setup()""")
64 cmake
= self
._configure
_cmake
()
68 self
.copy("LICENSE.md", dst
="licenses")
69 cmake
= self
._configure
_cmake
()
72 def package_info(self
):
73 self
.cpp_info
.libs
= tools
.collect_libs(self
)
74 if self
.settings
.os
== "Linux":
75 self
.cpp_info
.libs
.extend(["dl", "rt", "pthread"])
76 if self
.options
.enable_cxx
:
77 self
.cpp_info
.libs
.append("m")
78 elif self
.settings
.os
== "Macos":
79 self
.cpp_info
.exelinkflags
.append("-framework Cocoa")
80 self
.cpp_info
.sharedlinkflags
= self
.cpp_info
.exelinkflags
81 self
.cpp_info
.defines
.append("USE_COCOA")
82 elif self
.settings
.os
== "Windows":
83 self
.cpp_info
.libs
.append("Ws2_32")
84 if self
.options
.enable_websockets
:
85 self
.cpp_info
.defines
.append("USE_WEBSOCKET")
86 if self
.options
.enable_ipv6
:
87 self
.cpp_info
.defines
.append("USE_IPV6")
88 if not self
.options
.enable_ssl
:
89 self
.cpp_info
.defines
.append("NO_SSL")