(#8571) civetweb: add version 1.15

This commit is contained in:
toge
2021-12-31 03:04:50 +09:00
committed by GitHub
parent 9242550f25
commit 445ba06643
5 changed files with 29 additions and 15 deletions

View File

@@ -1,14 +1,17 @@
sources:
"1.13":
url: "https://github.com/civetweb/civetweb/archive/v1.13.tar.gz"
sha256: "a7ccc76c2f1b5f4e8d855eb328ed542f8fe3b882a6da868781799a98f4acdedc"
"1.15":
url: "https://github.com/civetweb/civetweb/archive/v1.15.tar.gz"
sha256: "90a533422944ab327a4fbb9969f0845d0dba05354f9cacce3a5005fa59f593b9"
"1.14":
url: "https://github.com/civetweb/civetweb/archive/v1.14.tar.gz"
sha256: "d02d7ab091c8b4edf21fc13a03c6db08a8a8b8605e35e0073251b9d88443c653"
patches:
"1.13":
- patch_file: "patches/0001-fix-install-bundle.patch"
base_path: "source_subfolder"
url: "https://github.com/civetweb/civetweb/archive/v1.13.tar.gz"
sha256: "a7ccc76c2f1b5f4e8d855eb328ed542f8fe3b882a6da868781799a98f4acdedc"
patches:
"1.14":
- patch_file: "patches/0001-fix-install-bundle.patch"
base_path: "source_subfolder"
"1.13":
- patch_file: "patches/0001-fix-install-bundle.patch"
base_path: "source_subfolder"

View File

@@ -11,9 +11,8 @@ class CivetwebConan(ConanFile):
homepage = "https://github.com/civetweb/civetweb"
url = "https://github.com/conan-io/conan-center-index"
description = "Embedded C/C++ web server"
topics = ("conan", "civetweb", "web-server", "embedded")
exports_sources = ["CMakeLists.txt", "patches/**"]
generators = "cmake", "cmake_find_package"
topics = ("civetweb", "web-server", "embedded")
generators = "cmake", "cmake_find_package", "cmake_find_package_multi"
settings = "os", "compiler", "build_type", "arch"
options = {
"shared" : [True, False],
@@ -44,6 +43,11 @@ class CivetwebConan(ConanFile):
def _build_subfolder(self):
return "build_subfolder"
def export_sources(self):
self.copy("CMakeLists.txt")
for patch in self.conan_data.get("patches", {}).get(self.version, []):
self.copy(patch["patch_file"])
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
@@ -59,7 +63,7 @@ class CivetwebConan(ConanFile):
def requirements(self):
if self.options.with_ssl:
self.requires("openssl/1.1.1l")
self.requires("openssl/1.1.1m")
def validate(self):
if self.options.get_safe("ssl_dynamic_loading") and not self.options["openssl"].shared:
@@ -107,8 +111,10 @@ class CivetwebConan(ConanFile):
def package_info(self):
self.cpp_info.names["cmake_find_package"] = "civetweb"
self.cpp_info.names["cmake_find_package_multi"] = "civetweb"
self.cpp_info.set_property("cmake_target_name", "civetweb::civetweb")
self.cpp_info.components["_civetweb"].names["cmake_find_package"] = "civetweb"
self.cpp_info.components["_civetweb"].names["cmake_find_package_multi"] = "civetweb"
self.cpp_info.components["_civetweb"].set_property("cmake_target_name", "civetweb::civetweb")
self.cpp_info.components["_civetweb"].libs = ["civetweb"]
if self.settings.os == "Linux":
self.cpp_info.components["_civetweb"].system_libs.extend(["rt", "pthread"])
@@ -126,6 +132,7 @@ class CivetwebConan(ConanFile):
if self.options.with_cxx:
self.cpp_info.components["civetweb-cpp"].names["cmake_find_package"] = "civetweb-cpp"
self.cpp_info.components["civetweb-cpp"].names["cmake_find_package_multi"] = "civetweb-cpp"
self.cpp_info.components["civetweb-cpp"].set_property("cmake_target_name", "civetweb::civetweb-cpp")
self.cpp_info.components["civetweb-cpp"].libs = ["civetweb-cpp"]
self.cpp_info.components["civetweb-cpp"].requires = ["_civetweb"]
if self.settings.os == "Linux":

View File

@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 3.1)
project(test_package CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
conan_basic_setup(TARGETS)
find_package(civetweb CONFIG REQUIRED)
add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
target_link_libraries(${PROJECT_NAME} civetweb::civetweb)

View File

@@ -4,7 +4,7 @@ from conans import ConanFile, tools, CMake
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
generators = "cmake", "cmake_find_package_multi"
def build(self):
cmake = CMake(self)
@@ -12,6 +12,6 @@ class TestPackageConan(ConanFile):
cmake.build()
def test(self):
if not tools.cross_building(self.settings):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)

View File

@@ -1,5 +1,7 @@
versions:
"1.13":
"1.15":
folder: all
"1.14":
folder: all
"1.13":
folder: all