Add packages and update others

This commit is contained in:
2026-02-11 14:04:58 +01:00
parent 6c90c821bf
commit edff40e77a
17 changed files with 685 additions and 2 deletions

View File

@@ -32,10 +32,12 @@ jobs:
{ name: "vulkan-validationlayers", version: "1.4.313.0", location: "all", needs_pkg: "vulkan-utility-libraries" }, { name: "vulkan-validationlayers", version: "1.4.313.0", location: "all", needs_pkg: "vulkan-utility-libraries" },
{ name: "shaderc", version: "2025.3", location: "all", needs_pkg: "" }, { name: "shaderc", version: "2025.3", location: "all", needs_pkg: "" },
{ name: "unordered_dense", version: "4.8.1", location: "all", needs_pkg: "" }, { name: "unordered_dense", version: "4.8.1", location: "all", needs_pkg: "" },
{ name: "mimalloc", version: "3.1.5", location: "all", needs_pkg: "" }, { name: "mimalloc", version: "3.2.8", location: "all", needs_pkg: "" },
{ name: "meshoptimizer", version: "1.0", location: "all", needs_pkg: "" }, { name: "meshoptimizer", version: "1.0", location: "all", needs_pkg: "" },
{ name: "sqlite3", version: "3.51.0", location: "all", needs_pkg: "" }, { name: "sqlite3", version: "3.51.0", location: "all", needs_pkg: "" },
{ name: "rapidhash", version: "3.0", location: "all", needs_pkg: "" } { name: "rapidhash", version: "3.0", location: "all", needs_pkg: "" },
{ name: "cli11", version: "2.6.1", location: "all", needs_pkg: "" },
{ name: "assimp", version: "6.0.4", location: "all", needs_pkg: "" }
] ]
name: "Package ${{matrix.package.name }}/${{ matrix.package.version }}" name: "Package ${{matrix.package.name }}/${{ matrix.package.version }}"
steps: steps:

View File

@@ -0,0 +1,43 @@
find_package(minizip REQUIRED CONFIG)
link_libraries(minizip::minizip)
find_package(pugixml REQUIRED CONFIG)
link_libraries(pugixml::pugixml)
find_package(utf8cpp REQUIRED CONFIG)
link_libraries(utf8cpp::utf8cpp)
find_package(ZLIB REQUIRED CONFIG)
link_libraries(ZLIB::ZLIB)
if(WITH_CLIPPER)
find_package(clipper REQUIRED CONFIG)
link_libraries(clipper::clipper)
endif()
if(WITH_DRACO)
find_package(draco REQUIRED CONFIG)
link_libraries(draco::draco)
add_definitions(-DASSIMP_ENABLE_DRACO)
endif()
if(WITH_KUBAZIP)
find_package(zip REQUIRED CONFIG)
link_libraries(zip::zip)
endif()
if(WITH_OPENDDL)
find_package(openddlparser REQUIRED CONFIG)
link_libraries(openddlparser::openddlparser)
endif()
if(WITH_POLY2TRI)
find_package(poly2tri REQUIRED CONFIG)
link_libraries(poly2tri::poly2tri)
endif()
if(WITH_PUGIXML)
endif()
if(WITH_RAPIDJSON)
find_package(RapidJSON REQUIRED CONFIG)
link_libraries(rapidjson::rapidjson)
endif()
if(WITH_STB)
find_package(stb REQUIRED CONFIG)
link_libraries(stb::stb)
endif()

10
assimp/5.x/conandata.yml Normal file
View File

@@ -0,0 +1,10 @@
sources:
"6.0.4":
url: "https://github.com/assimp/assimp/archive/refs/tags/v6.0.4.tar.gz"
sha256: "afa5487efdd285661afa842c85187cd8c541edad92e8d4aa85be4fca7476eccc"
"6.0.2":
url: "https://github.com/assimp/assimp/archive/refs/tags/v6.0.2.tar.gz"
sha256: "d1822d9a19c9205d6e8bc533bf897174ddb360ce504680f294170cc1d6319751"
"5.4.3":
url: "https://github.com/assimp/assimp/archive/refs/tags/v5.4.3.tar.gz"
sha256: "66dfbaee288f2bc43172440a55d0235dfc7bf885dda6435c038e8000e79582cb"

329
assimp/5.x/conanfile.py Normal file
View File

@@ -0,0 +1,329 @@
from pathlib import Path
from conan import ConanFile
from conan.tools.build import stdcpp_library, check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import collect_libs, copy, get, replace_in_file, rmdir, save
from conan.tools.microsoft import is_msvc, is_msvc_static_runtime
from conan.tools.scm import Version
import os
required_conan_version = ">=2"
class AssimpConan(ConanFile):
name = "assimp"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/assimp/assimp"
description = (
"A library to import and export various 3d-model-formats including "
"scene-post-processing to generate missing render data."
)
topics = ("assimp", "3d", "game development", "3mf", "collada")
license = "BSD-3-Clause"
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
"double_precision": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"double_precision": False,
}
_format_option_map = {
"with_3d": ("ASSIMP_BUILD_3D_IMPORTER", "5.0.0"),
"with_3ds": ("ASSIMP_BUILD_3DS_IMPORTER", "5.0.0"),
"with_3ds_exporter": ("ASSIMP_BUILD_3DS_EXPORTER", "5.0.0"),
"with_3mf": ("ASSIMP_BUILD_3MF_IMPORTER", "5.0.0"),
"with_3mf_exporter": ("ASSIMP_BUILD_3MF_EXPORTER", "5.0.0"),
"with_ac": ("ASSIMP_BUILD_AC_IMPORTER", "5.0.0"),
"with_amf": ("ASSIMP_BUILD_AMF_IMPORTER", "5.0.0"),
"with_ase": ("ASSIMP_BUILD_ASE_IMPORTER", "5.0.0"),
"with_assbin": ("ASSIMP_BUILD_ASSBIN_IMPORTER", "5.0.0"),
"with_assbin_exporter": ("ASSIMP_BUILD_ASSBIN_EXPORTER", "5.0.0"),
"with_assxml_exporter": ("ASSIMP_BUILD_ASSXML_EXPORTER", "5.0.0"),
"with_assjson_exporter": ("ASSIMP_BUILD_ASSJSON_EXPORTER", "5.0.0"),
"with_b3d": ("ASSIMP_BUILD_B3D_IMPORTER", "5.0.0"),
"with_blend": ("ASSIMP_BUILD_BLEND_IMPORTER", "5.0.0"),
"with_bvh": ("ASSIMP_BUILD_BVH_IMPORTER", "5.0.0"),
"with_ms3d": ("ASSIMP_BUILD_MS3D_IMPORTER", "5.0.0"),
"with_cob": ("ASSIMP_BUILD_COB_IMPORTER", "5.0.0"),
"with_collada": ("ASSIMP_BUILD_COLLADA_IMPORTER", "5.0.0"),
"with_collada_exporter": ("ASSIMP_BUILD_COLLADA_EXPORTER", "5.0.0"),
"with_csm": ("ASSIMP_BUILD_CSM_IMPORTER", "5.0.0"),
"with_dxf": ("ASSIMP_BUILD_DXF_IMPORTER", "5.0.0"),
"with_fbx": ("ASSIMP_BUILD_FBX_IMPORTER", "5.0.0"),
"with_fbx_exporter": ("ASSIMP_BUILD_FBX_EXPORTER", "5.0.0"),
"with_gltf": ("ASSIMP_BUILD_GLTF_IMPORTER", "5.0.0"),
"with_gltf_exporter": ("ASSIMP_BUILD_GLTF_EXPORTER", "5.0.0"),
"with_hmp": ("ASSIMP_BUILD_HMP_IMPORTER", "5.0.0"),
"with_ifc": ("ASSIMP_BUILD_IFC_IMPORTER", "5.0.0"),
"with_irr": ("ASSIMP_BUILD_IRR_IMPORTER", "5.0.0"),
"with_irrmesh": ("ASSIMP_BUILD_IRRMESH_IMPORTER", "5.0.0"),
"with_lwo": ("ASSIMP_BUILD_LWO_IMPORTER", "5.0.0"),
"with_lws": ("ASSIMP_BUILD_LWS_IMPORTER", "5.0.0"),
"with_md2": ("ASSIMP_BUILD_MD2_IMPORTER", "5.0.0"),
"with_md3": ("ASSIMP_BUILD_MD3_IMPORTER", "5.0.0"),
"with_md5": ("ASSIMP_BUILD_MD5_IMPORTER", "5.0.0"),
"with_mdc": ("ASSIMP_BUILD_MDC_IMPORTER", "5.0.0"),
"with_mdl": ("ASSIMP_BUILD_MDL_IMPORTER", "5.0.0"),
"with_mmd": ("ASSIMP_BUILD_MMD_IMPORTER", "5.0.0"),
"with_ndo": ("ASSIMP_BUILD_NDO_IMPORTER", "5.0.0"),
"with_nff": ("ASSIMP_BUILD_NFF_IMPORTER", "5.0.0"),
"with_obj": ("ASSIMP_BUILD_OBJ_IMPORTER", "5.0.0"),
"with_obj_exporter": ("ASSIMP_BUILD_OBJ_EXPORTER", "5.0.0"),
"with_off": ("ASSIMP_BUILD_OFF_IMPORTER", "5.0.0"),
"with_ogre": ("ASSIMP_BUILD_OGRE_IMPORTER", "5.0.0"),
"with_opengex": ("ASSIMP_BUILD_OPENGEX_IMPORTER", "5.0.0"),
"with_opengex_exporter": ("ASSIMP_BUILD_OPENGEX_EXPORTER", "5.0.0"),
"with_pbrt_exporter": ("ASSIMP_BUILD_PBRT_EXPORTER", "5.1.0"),
"with_ply": ("ASSIMP_BUILD_PLY_IMPORTER", "5.0.0"),
"with_ply_exporter": ("ASSIMP_BUILD_PLY_EXPORTER", "5.0.0"),
"with_q3bsp": ("ASSIMP_BUILD_Q3BSP_IMPORTER", "5.0.0"),
"with_q3d": ("ASSIMP_BUILD_Q3D_IMPORTER", "5.0.0"),
"with_raw": ("ASSIMP_BUILD_RAW_IMPORTER", "5.0.0"),
"with_sib": ("ASSIMP_BUILD_SIB_IMPORTER", "5.0.0"),
"with_smd": ("ASSIMP_BUILD_SMD_IMPORTER", "5.0.0"),
"with_step": ("ASSIMP_BUILD_STEP_IMPORTER", "5.0.0"),
"with_step_exporter": ("ASSIMP_BUILD_STEP_EXPORTER", "5.0.0"),
"with_stl": ("ASSIMP_BUILD_STL_IMPORTER", "5.0.0"),
"with_stl_exporter": ("ASSIMP_BUILD_STL_EXPORTER", "5.0.0"),
"with_terragen": ("ASSIMP_BUILD_TERRAGEN_IMPORTER", "5.0.0"),
"with_x": ("ASSIMP_BUILD_X_IMPORTER", "5.0.0"),
"with_x_exporter": ("ASSIMP_BUILD_X_EXPORTER", "5.0.0"),
"with_x3d": ("ASSIMP_BUILD_X3D_IMPORTER", "5.0.0"),
"with_x3d_exporter": ("ASSIMP_BUILD_X3D_EXPORTER", "5.0.0"),
"with_xgl": ("ASSIMP_BUILD_XGL_IMPORTER", "5.0.0"),
"with_m3d": ("ASSIMP_BUILD_M3D_IMPORTER", "5.1.0"),
"with_m3d_exporter": ("ASSIMP_BUILD_M3D_EXPORTER", "5.1.0"),
"with_iqm": ("ASSIMP_BUILD_IQM_IMPORTER", "5.2.0"),
}
options.update(dict.fromkeys(_format_option_map, [True, False]))
default_options.update(dict.fromkeys(_format_option_map, True))
def export_sources(self):
copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
for option, (_, min_version) in self._format_option_map.items():
if Version(self.version) < Version(min_version):
delattr(self.options, option)
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def layout(self):
cmake_layout(self, src_folder="src")
@property
def _depends_on_kuba_zip(self):
return self.options.with_3mf_exporter
@property
def _depends_on_poly2tri(self):
return self.options.with_blend or self.options.with_ifc
@property
def _depends_on_rapidjson(self):
return self.options.with_gltf or self.options.with_gltf_exporter
@property
def _depends_on_draco(self):
return self.options.with_gltf or self.options.with_gltf_exporter
@property
def _depends_on_clipper(self):
return self.options.with_ifc
@property
def _depends_on_stb(self):
return self.options.with_m3d or self.options.with_m3d_exporter or \
self.options.with_pbrt_exporter
@property
def _depends_on_openddlparser(self):
return self.options.with_opengex
def requirements(self):
# TODO: unvendor others libs:
# - Open3DGC
self.requires("minizip/1.2.13")
self.requires("pugixml/1.14")
self.requires("utfcpp/4.0.1")
self.requires("zlib/[>=1.2.11 <2]")
if self._depends_on_kuba_zip:
self.requires("kuba-zip/0.3.0")
if self._depends_on_poly2tri:
self.requires("poly2tri/cci.20130502")
if self._depends_on_rapidjson:
self.requires("rapidjson/cci.20230929")
if self._depends_on_draco:
self.requires("draco/1.5.6")
if self._depends_on_clipper:
self.requires("clipper/6.4.2")
if self._depends_on_stb:
self.requires("stb/cci.20230920")
if self._depends_on_openddlparser:
self.requires("openddl-parser/0.5.1")
def validate_build(self):
check_min_cppstd(self, 17)
def validate(self):
check_min_cppstd(self, 11)
def build_requirements(self):
self.tool_requires("cmake/[>=3.22]")
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
self._patch_sources()
def generate(self):
tc = CMakeToolchain(self)
tc.variables["ASSIMP_ANDROID_JNIIOSYSTEM"] = False
tc.variables["ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT"] = False
tc.variables["ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT"] = False
tc.variables["ASSIMP_BUILD_ASSIMP_TOOLS"] = False
tc.variables["ASSIMP_BUILD_DOCS"] = False
tc.variables["ASSIMP_BUILD_DRACO"] = False
tc.variables["ASSIMP_BUILD_FRAMEWORK"] = False
tc.variables["ASSIMP_BUILD_MINIZIP"] = False
tc.variables["ASSIMP_BUILD_SAMPLES"] = False
tc.variables["ASSIMP_BUILD_TESTS"] = False
tc.variables["ASSIMP_BUILD_ZLIB"] = False
tc.variables["ASSIMP_DOUBLE_PRECISION"] = self.options.double_precision
tc.variables["ASSIMP_HUNTER_ENABLED"] = False
tc.variables["ASSIMP_IGNORE_GIT_HASH"] = True
tc.variables["ASSIMP_INJECT_DEBUG_POSTFIX"] = False
tc.variables["ASSIMP_INSTALL"] = True
tc.variables["ASSIMP_INSTALL_PDB"] = False
tc.variables["ASSIMP_NO_EXPORT"] = False
tc.variables["ASSIMP_OPT_BUILD_PACKAGES"] = False
tc.variables["ASSIMP_RAPIDJSON_NO_MEMBER_ITERATOR"] = False
tc.variables["ASSIMP_UBSAN"] = False
tc.variables["ASSIMP_WARNINGS_AS_ERRORS"] = False
tc.variables["USE_STATIC_CRT"] = is_msvc_static_runtime(self)
tc.cache_variables["ASSIMP_BUILD_USE_CCACHE"] = False
for option, (definition, _) in self._format_option_map.items():
value = self.options.get_safe(option)
if value is not None:
tc.variables[definition] = value
if self.settings.os == "Windows":
tc.preprocessor_definitions["NOMINMAX"] = 1
tc.cache_variables["CMAKE_PROJECT_Assimp_INCLUDE"] = "conan_deps.cmake"
tc.cache_variables["WITH_CLIPPER"] = self._depends_on_clipper
tc.cache_variables["WITH_DRACO"] = self._depends_on_draco
tc.cache_variables["WITH_KUBAZIP"] = self._depends_on_kuba_zip
tc.cache_variables["WITH_OPENDDL"] = self._depends_on_openddlparser
tc.cache_variables["WITH_POLY2TRI"] = self._depends_on_poly2tri
tc.cache_variables["WITH_RAPIDJSON"] = self._depends_on_rapidjson
tc.cache_variables["WITH_STB"] = self._depends_on_stb
tc.generate()
cd = CMakeDeps(self)
cd.set_property("rapidjson", "cmake_target_name", "rapidjson::rapidjson")
cd.set_property("utfcpp", "cmake_target_name", "utf8cpp::utf8cpp")
cd.generate()
def _patch_sources(self):
# Don't force several compiler and linker flags
for pattern in [
"-fPIC",
"-g ",
"SET(CMAKE_POSITION_INDEPENDENT_CODE ON)",
'SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")',
'SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")',
]:
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), pattern, "")
for pattern in ["-Werror", "/WX"]:
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), pattern, "")
replace_in_file(self, os.path.join(self.source_folder, "code", "CMakeLists.txt"), pattern, "")
# Make sure vendored libs are not used by accident by removing their subdirs
allow_vendored = ["Open3DGC", "earcut-hpp"]
for contrib_dir in Path(self.source_folder).joinpath("contrib").iterdir():
if contrib_dir.is_dir() and contrib_dir.name not in allow_vendored:
rmdir(self, contrib_dir)
# Do not include add vendored library sources to the build
# https://github.com/assimp/assimp/blob/v5.3.1/code/CMakeLists.txt#L1151-L1159
code_cmakelists = Path(self.source_folder).joinpath("code", "CMakeLists.txt")
content = code_cmakelists.read_text(encoding="utf-8")
for vendored_lib in [
"unzip_compile",
"Poly2Tri",
"Clipper",
"openddl_parser",
# "open3dgc",
"ziplib",
"Pugixml",
"stb",
]:
content = content.replace("${%s_SRCS}" % vendored_lib, "")
code_cmakelists.write_text(content, encoding="utf-8")
# Make vendored headers redirect to external ones.
for contrib_header, include in [
(os.path.join("clipper", "clipper.hpp"), "polyclipping/clipper.hpp"),
(os.path.join("poly2tri", "poly2tri", "poly2tri.h"), "poly2tri/poly2tri.h"),
(os.path.join("stb", "stb_image.h"), "stb_image.h"),
(os.path.join("utf8cpp", "source", "utf8.h"), "utf8.h"),
(os.path.join("zip", "src", "zip.h"), "zip/zip.h"),
]:
save(self, os.path.join(self.source_folder, "contrib", contrib_header),
f"#include <{include}>\n")
rmdir(self, os.path.join(self.source_folder, "contrib", "utf8cpp"))
# minizip is provided via conan_deps.cmake, no need to use pkgconfig
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"),
"use_pkgconfig(UNZIP minizip)", "set(UNZIP_FOUND TRUE)")
# ZLIB is unvendored, no need to install it
# https://github.com/assimp/assimp/blob/v5.3.1/CMakeLists.txt#L483-L487
# https://github.com/assimp/assimp/blob/v5.1.6/CMakeLists.txt#L463-L466
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"),
"INSTALL( TARGETS zlib", "set(_ #")
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
cmake = CMake(self)
cmake.install()
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
def package_info(self):
self.cpp_info.set_property("cmake_file_name", "assimp")
self.cpp_info.set_property("cmake_target_name", "assimp::assimp")
self.cpp_info.set_property("pkg_config_name", "assimp")
# Always ever just 1 library, but with some suffix variations
# that make it hard to map manually
self.cpp_info.libs = collect_libs(self)
if is_msvc(self) and self.options.shared:
self.cpp_info.defines.append("ASSIMP_DLL")
if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs = ["rt", "m", "pthread"]
elif self.settings.os == "WindowsStore":
self.cpp_info.system_libs.append("advapi32")
self.cpp_info.defines.append("WindowsStore")
if not self.options.shared:
libcxx = stdcpp_library(self)
if libcxx:
self.cpp_info.system_libs.append(libcxx)

View File

@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES C CXX)
find_package(assimp REQUIRED CONFIG)
add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE assimp::assimp)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
add_executable(${PROJECT_NAME}_c test_package.c)
target_link_libraries(${PROJECT_NAME}_c PRIVATE assimp::assimp)

View File

@@ -0,0 +1,29 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, cmake_layout
import os
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
test_type = "explicit"
def layout(self):
cmake_layout(self)
def requirements(self):
self.requires(self.tested_reference_str)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")
bin_c_path = os.path.join(self.cpp.build.bindirs[0], "test_package_c")
self.run(bin_c_path, env="conanrun")

View File

@@ -0,0 +1,17 @@
#include <stdio.h>
#include <assimp/cimport.h>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
int main(int argc, char **argv) {
const C_STRUCT aiScene *scene = aiImportFile("",
aiProcess_CalcTangentSpace |
aiProcess_Triangulate |
aiProcess_JoinIdenticalVertices |
aiProcess_SortByPType);
aiReleaseImport(scene);
return 0;
}

View File

@@ -0,0 +1,16 @@
#include <iostream>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
int main(int argc, char **argv) {
Assimp::Importer importer;
const aiScene* scene = importer.ReadFile("",
aiProcess_CalcTangentSpace |
aiProcess_Triangulate |
aiProcess_JoinIdenticalVertices |
aiProcess_SortByPType);
return 0;
}

7
assimp/config.yml Normal file
View File

@@ -0,0 +1,7 @@
versions:
"6.0.4":
folder: "5.x"
"6.0.2":
folder: "5.x"
"5.4.3":
folder: "5.x"

43
cli11/all/conandata.yml Normal file
View File

@@ -0,0 +1,43 @@
sources:
"2.6.1":
url: "https://github.com/CLIUtils/CLI11/archive/v2.6.1.tar.gz"
sha256: "377691f3fac2b340f12a2f79f523c780564578ba3d6eaf5238e9f35895d5ba95"
"2.6.0":
url: "https://github.com/CLIUtils/CLI11/archive/v2.6.0.tar.gz"
sha256: "8c11bc049090a66cb71c3e90350cddaa792b2a45e0a7841799900b95ca38b101"
"2.5.0":
url: "https://github.com/CLIUtils/CLI11/archive/v2.5.0.tar.gz"
sha256: "17e02b4cddc2fa348e5dbdbb582c59a3486fa2b2433e70a0c3bacb871334fd55"
"2.4.2":
url: "https://github.com/CLIUtils/CLI11/archive/v2.4.2.tar.gz"
sha256: "f2d893a65c3b1324c50d4e682c0cdc021dd0477ae2c048544f39eed6654b699a"
"2.4.1":
url: "https://github.com/CLIUtils/CLI11/archive/v2.4.1.tar.gz"
sha256: "73b7ec52261ce8fe980a29df6b4ceb66243bb0b779451dbd3d014cfec9fdbb58"
"2.4.0":
url: "https://github.com/CLIUtils/CLI11/archive/v2.4.0.tar.gz"
sha256: "d2ce8d5318d2a7a7d1120e2a18caac49cd65423d5d4158cbbc0267e6768af522"
"2.3.2":
url: "https://github.com/CLIUtils/CLI11/archive/v2.3.2.tar.gz"
sha256: "aac0ab42108131ac5d3344a9db0fdf25c4db652296641955720a4fbe52334e22"
"2.3.1":
url: "https://github.com/CLIUtils/CLI11/archive/v2.3.1.tar.gz"
sha256: "378da73d2d1d9a7b82ad6ed2b5bda3e7bc7093c4034a1d680a2e009eb067e7b2"
"2.3.0":
url: "https://github.com/CLIUtils/CLI11/archive/v2.3.0.tar.gz"
sha256: "b6e116ca1555e2b7f2743fd41e3bd18149baae791acd98eb653e5b07e0f20561"
"2.2.0":
url: "https://github.com/CLIUtils/CLI11/archive/v2.2.0.tar.gz"
sha256: "d60440dc4d43255f872d174e416705f56ba40589f6eb07727f76376fb8378fd6"
"2.1.2":
url: "https://github.com/CLIUtils/CLI11/archive/v2.1.2.tar.gz"
sha256: "26291377e892ba0e5b4972cdfd4a2ab3bf53af8dac1f4ea8fe0d1376b625c8cb"
"2.1.1":
url: "https://github.com/CLIUtils/CLI11/archive/v2.1.1.tar.gz"
sha256: "d69023d1d0ab6a22be86b4f59d449422bc5efd9121868f4e284d6042e52f682e"
"2.0.0":
url: "https://github.com/CLIUtils/CLI11/archive/v2.0.0.tar.gz"
sha256: "2c672f17bf56e8e6223a3bfb74055a946fa7b1ff376510371902adb9cb0ab6a3"
"1.9.1":
url: "https://github.com/CLIUtils/CLI11/archive/v1.9.1.tar.gz"
sha256: "c780cf8cf3ba5ec2648a7eeb20a47e274493258f38a9b417628e0576f473a50b"

96
cli11/all/conanfile.py Normal file
View File

@@ -0,0 +1,96 @@
from conan import ConanFile
from conan.tools.files import get, copy, rmdir
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.build import check_min_cppstd
from conan.tools.scm import Version
import os
required_conan_version = ">=1.52.0"
class CLI11Conan(ConanFile):
name = "cli11"
description = "A command line parser for C++11 and beyond."
license = "BSD-3-Clause"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/CLIUtils/CLI11"
topics = "cli-parser", "cpp11", "no-dependencies", "cli"
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True
options = {
"header_only": [True, False]
}
default_options = {
"header_only": True
}
@property
def _min_cppstd(self):
return "11"
@property
def _supports_compilation(self):
return Version(self.version) >= "2.3"
def configure(self):
if not self._supports_compilation:
# TODO: Back to config_options after Conan 1 freeze
del self.options.header_only
elif not self.options.header_only:
self.package_type = "static-library"
def layout(self):
cmake_layout(self, src_folder="src")
def package_id(self):
if not self._supports_compilation or self.info.options.header_only:
self.info.clear()
def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def generate(self):
tc = CMakeToolchain(self)
if self._supports_compilation:
tc.variables["CLI11_PRECOMPILED"] = not self.options.header_only
tc.variables["CLI11_BUILD_EXAMPLES"] = False
tc.variables["CLI11_BUILD_TESTS"] = False
tc.variables["CLI11_BUILD_DOCS"] = False
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
cmake = CMake(self)
cmake.install()
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
# since 2.1.1
rmdir(self, os.path.join(self.package_folder, "share"))
def package_info(self):
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
if self._supports_compilation and not self.options.get_safe("header_only"):
self.cpp_info.libdirs = ["lib"]
self.cpp_info.libs = ["CLI11"]
self.cpp_info.defines = ["CLI11_COMPILE"]
self.cpp_info.set_property("cmake_file_name", "CLI11")
self.cpp_info.set_property("cmake_target_name", "CLI11::CLI11")
self.cpp_info.set_property("pkg_config_name", "CLI11")
# TODO: to remove in conan v2 once cmake_find_package_* generators removed
self.cpp_info.names["cmake_find_package"] = "CLI11"
self.cpp_info.names["cmake_find_package_multi"] = "CLI11"
self.cpp_info.names["pkg_config"] = "CLI11"

View File

@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES CXX)
find_package(CLI11 REQUIRED CONFIG)
add_executable(${CMAKE_PROJECT_NAME} test_package.cpp)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE CLI11::CLI11)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)

View File

@@ -0,0 +1,26 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import cmake_layout, CMake
import os
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
test_type = "explicit"
def requirements(self):
self.requires(self.tested_reference_str)
def layout(self):
cmake_layout(self)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")

View File

@@ -0,0 +1,11 @@
#include <CLI/CLI.hpp>
#include <iostream>
int main(int argc, char **argv) {
CLI::App app("Test App");
CLI11_PARSE(app, argc, argv);
std::cout << app.help() << '\n';
return 0;
}

29
cli11/config.yml Normal file
View File

@@ -0,0 +1,29 @@
versions:
"2.6.1":
folder: all
"2.6.0":
folder: all
"2.5.0":
folder: all
"2.4.2":
folder: all
"2.4.1":
folder: all
"2.4.0":
folder: all
"2.3.2":
folder: all
"2.3.1":
folder: all
"2.3.0":
folder: all
"2.2.0":
folder: all
"2.1.2":
folder: all
"2.1.1":
folder: all
"2.0.0":
folder: all
"1.9.1":
folder: all

View File

@@ -1,4 +1,7 @@
sources: sources:
"3.2.8":
url: "https://github.com/microsoft/mimalloc/archive/v3.2.8.tar.gz"
sha256: "68163666575518c213a6593850099adce3863b340ca2751103dbd1f253664e05"
"3.1.5": "3.1.5":
url: "https://github.com/microsoft/mimalloc/archive/v3.1.5.tar.gz" url: "https://github.com/microsoft/mimalloc/archive/v3.1.5.tar.gz"
sha256: "1c6949032069d5ebea438ec5cedd602d06f40a92ddf0f0d9dcff0993e5f6635c" sha256: "1c6949032069d5ebea438ec5cedd602d06f40a92ddf0f0d9dcff0993e5f6635c"

View File

@@ -1,4 +1,6 @@
versions: versions:
"3.2.8":
folder: all
"3.1.5": "3.1.5":
folder: all folder: all
"2.2.4": "2.2.4":