forked from conan-io/conan-center-index
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'conan-io:master' into rocksdb/add_v6.0.2
- Loading branch information
Showing
331 changed files
with
7,174 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 2.8.11) | ||
project(cmake_wrapper) | ||
|
||
include(conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
add_subdirectory(source_subfolder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sources: | ||
"4.9.1": | ||
url: "https://github.com/Ultimaker/libArcus/archive/refs/tags/4.9.1.tar.gz" | ||
sha256: "18d939fd2428c72fdce35a286c196438327cfc3c8476e463e5ca46570168c9ce" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
import textwrap | ||
|
||
required_conan_version = ">=1.33.0" | ||
|
||
|
||
class ArcusConan(ConanFile): | ||
name = "arcus" | ||
description = "This library contains C++ code and Python3 bindings for " \ | ||
"creating a socket in a thread and using this socket to send " \ | ||
"and receive messages based on the Protocol Buffers library." | ||
license = "LGPL-3.0-or-later" | ||
topics = ("arcus", "protobuf", "socket", "cura") | ||
homepage = "https://github.com/Ultimaker/libArcus" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
|
||
settings = "os", "arch", "compiler", "build_type" | ||
options = { | ||
"shared": [True, False], | ||
"fPIC": [True, False], | ||
|
||
} | ||
default_options = { | ||
"shared": False, | ||
"fPIC": True, | ||
} | ||
|
||
exports_sources = "CMakeLists.txt" | ||
generators = "cmake", "cmake_find_package" | ||
_cmake = None | ||
|
||
@property | ||
def _source_subfolder(self): | ||
return "source_subfolder" | ||
|
||
def config_options(self): | ||
if self.settings.os == "Windows": | ||
del self.options.fPIC | ||
|
||
def configure(self): | ||
if self.options.shared: | ||
del self.options.fPIC | ||
|
||
def requirements(self): | ||
self.requires("protobuf/3.17.1") | ||
|
||
def validate(self): | ||
if self.settings.compiler.get_safe("cppstd"): | ||
tools.check_min_cppstd(self, 11) | ||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version], | ||
destination=self._source_subfolder, strip_root=True) | ||
|
||
def _patch_sources(self): | ||
# Do not force PIC | ||
tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), | ||
"set(CMAKE_POSITION_INDEPENDENT_CODE ON)", | ||
"") | ||
tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), | ||
"set_target_properties(Arcus PROPERTIES COMPILE_FLAGS -fPIC)", | ||
"") | ||
# TODO: this patch could be removed when CMake variables fixed in protobuf recipe | ||
tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), | ||
"target_link_libraries(Arcus PUBLIC ${PROTOBUF_LIBRARIES})", | ||
"target_link_libraries(Arcus PUBLIC protobuf::libprotobuf)") | ||
|
||
def _configure_cmake(self): | ||
if self._cmake: | ||
return self._cmake | ||
self._cmake = CMake(self) | ||
self._cmake.definitions["BUILD_PYTHON"] = False | ||
self._cmake.definitions["BUILD_EXAMPLES"] = False | ||
self._cmake.definitions["BUILD_STATIC"] = not self.options.shared | ||
if self.settings.compiler == "Visual Studio": | ||
self._cmake.definitions["MSVC_STATIC_RUNTIME"] = str(self.settings.compiler.runtime).startswith("MT") | ||
self._cmake.configure() | ||
return self._cmake | ||
|
||
def build(self): | ||
self._patch_sources() | ||
cmake = self._configure_cmake() | ||
cmake.build() | ||
|
||
def package(self): | ||
self.copy("LICENSE", dst="licenses", src=self._source_subfolder) | ||
cmake = self._configure_cmake() | ||
cmake.install() | ||
tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) | ||
self._create_cmake_module_alias_targets( | ||
os.path.join(self.package_folder, self._module_file_rel_path), | ||
{"Arcus": "Arcus::Arcus"} | ||
) | ||
|
||
@staticmethod | ||
def _create_cmake_module_alias_targets(module_file, targets): | ||
content = "" | ||
for alias, aliased in targets.items(): | ||
content += textwrap.dedent("""\ | ||
if(TARGET {aliased} AND NOT TARGET {alias}) | ||
add_library({alias} INTERFACE IMPORTED) | ||
set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased}) | ||
endif() | ||
""".format(alias=alias, aliased=aliased)) | ||
tools.save(module_file, content) | ||
|
||
@property | ||
def _module_subfolder(self): | ||
return os.path.join("lib", "cmake") | ||
|
||
@property | ||
def _module_file_rel_path(self): | ||
return os.path.join(self._module_subfolder, | ||
"conan-official-{}-targets.cmake".format(self.name)) | ||
|
||
def package_info(self): | ||
self.cpp_info.names["cmake_find_package"] = "Arcus" | ||
self.cpp_info.names["cmake_find_package_multi"] = "Arcus" | ||
self.cpp_info.builddirs.append(self._module_subfolder) | ||
self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] | ||
self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path] | ||
self.cpp_info.libs = ["Arcus"] | ||
if self.settings.os in ["Linux", "FreeBSD"]: | ||
self.cpp_info.system_libs.append("pthread") | ||
elif self.settings.os == "Windows": | ||
self.cpp_info.system_libs.append("ws2_32") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
find_package(Arcus REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} Arcus) | ||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake", "cmake_find_package_multi" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self.settings): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <Arcus/Socket.h> | ||
|
||
int main() { | ||
Arcus::Socket socket; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
"4.9.1": | ||
folder: all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/src/arg_int.c b/src/arg_int.c | ||
index 29c20e5..bc10012 100644 | ||
--- a/src/arg_int.c | ||
+++ b/src/arg_int.c | ||
@@ -30,6 +30,7 @@ USA. | ||
|
||
#include "argtable2.h" | ||
#include <limits.h> | ||
+#include <ctype.h> | ||
|
||
/* local error codes */ | ||
enum {EMINCOUNT=1,EMAXCOUNT,EBADINT,EOVERFLOW}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sources: | ||
0.0.5: | ||
url: https://github.com/werto87/confu_json/archive/refs/tags/v0.0.5.tar.gz | ||
sha256: bc506d4b7836a7689b1c6a2d89bb0c3441f774c8f845fef79d85c71099df5bf9 |
Oops, something went wrong.