forked from civetweb/civetweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
61 lines (53 loc) · 1.84 KB
/
conanfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from conans import ConanFile, tools, CMake
import os
class civetwebConan(ConanFile):
name = "civetweb"
version = "1.10"
license = "MIT"
url = "https://github.com/civetweb/civetweb"
description = "Embedded C/C++ web server"
settings = "os", "compiler", "build_type", "arch"
exports_sources = "*"
requires = "OpenSSL/1.0.2@conan/stable"
generators = "cmake"
options = {
"shared" : [True, False],
"enable_ssl" : [True, False],
"enable_websockets" : [True, False],
"enable_cxx" : [True, False]
}
default_options = (
"shared=False",
"enable_ssl=True",
"enable_websockets=True",
"enable_cxx=True",
)
def optionBool(self, b):
if b:
return "ON"
else:
return "OFF"
def parseOptionsToCMake(self):
cmakeOpts = {
"CIVETWEB_BUILD_TESTING" : "OFF",
"CIVETWEB_ENABLE_LUA" : "OFF",
"CIVETWEB_ENABLE_SERVER_EXECUTABLE" : "OFF",
"CIVETWEB_INSTALL_EXECUTABLE" : "OFF",
"CIVETWEB_ENABLE_ASAN" : "OFF"
}
cmakeOpts["BUILD_SHARED_LIBS"] = self.optionBool(self.options.shared)
cmakeOpts["CIVETWEB_ENABLE_SSL"] = self.optionBool(self.options.enable_ssl)
cmakeOpts["CIVETWEB_ENABLE_WEBSOCKETS"] = self.optionBool(self.options.enable_websockets)
cmakeOpts["CIVETWEB_ENABLE_CXX"] = self.optionBool(self.options.enable_cxx)
return cmakeOpts
def build(self):
cmake = CMake(self)
os.makedirs("./buildit")
cmake.configure(defs=self.parseOptionsToCMake(), build_dir="./buildit")
cmake.build()
cmake.install()
def package(self):
# nothing to do here now
pass
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)