-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#14185) libstudxml: add 1.1.0-b.10+1 & bump dependencies
* move 1.0.1 to 1.0.x folder * bump dependencies * add libstudxml/1.1.0-b.10+1 * partial conan v2 migration of 1.0.x * small change * fix conversion of Version to int * improve support of compiler=msvc in 1.0.x
- Loading branch information
Showing
19 changed files
with
311 additions
and
60 deletions.
There are no files selected for viewing
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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 3.1) | ||
project(test_package LANGUAGES CXX) | ||
|
||
find_package(libstudxml REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE libstudxml::libstudxml) |
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,26 @@ | ||
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") |
File renamed without changes.
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,8 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package | ||
${CMAKE_CURRENT_BINARY_DIR}/test_package) |
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,40 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(libstudxml LANGUAGES C CXX) | ||
|
||
find_package(EXPAT REQUIRED MODULE) | ||
|
||
add_library(studxml | ||
${LIBSTUDXML_SRC_DIR}/libstudxml/parser.cxx | ||
${LIBSTUDXML_SRC_DIR}/libstudxml/qname.cxx | ||
${LIBSTUDXML_SRC_DIR}/libstudxml/serializer.cxx | ||
${LIBSTUDXML_SRC_DIR}/libstudxml/value-traits.cxx | ||
${LIBSTUDXML_SRC_DIR}/libstudxml/details/genx/char-props.c | ||
${LIBSTUDXML_SRC_DIR}/libstudxml/details/genx/genx.c | ||
) | ||
target_include_directories(studxml PUBLIC ${LIBSTUDXML_SRC_DIR}) | ||
target_link_libraries(studxml PUBLIC EXPAT::EXPAT) | ||
|
||
if(BUILD_SHARED_LIBS) | ||
target_compile_definitions(studxml | ||
PRIVATE LIBSTUDXML_SHARED_BUILD | ||
INTERFACE LIBSTUDXML_SHARED | ||
) | ||
else() | ||
target_compile_definitions(studxml | ||
PRIVATE LIBSTUDXML_STATIC_BUILD | ||
INTERFACE LIBSTUDXML_STATIC | ||
) | ||
endif() | ||
|
||
include(GNUInstallDirs) | ||
install( | ||
TARGETS studxml | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
) | ||
install( | ||
DIRECTORY ${LIBSTUDXML_SRC_DIR}/libstudxml | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
FILES_MATCHING REGEX "(.*).(h|hxx|ixx|txx)$" | ||
) |
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: | ||
"1.1.0-b.10+1": | ||
url: "https://git.codesynthesis.com/cgit/libstudxml/libstudxml/snapshot/v1.1.0-b.10%2b1.tar.xz" | ||
sha256: "6773bb700b0b61fb117f0737f3c754d2be67d70766d63430b8a95bf147cc0368" |
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,78 @@ | ||
from conan import ConanFile | ||
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout | ||
from conan.tools.files import copy, get, replace_in_file, rmdir | ||
import os | ||
|
||
required_conan_version = ">=1.53.0" | ||
|
||
|
||
class LibStudXmlConan(ConanFile): | ||
name = "libstudxml" | ||
description = "A streaming XML pull parser and streaming XML serializer implementation for modern, standard C++." | ||
topics = ("xml", "xml-parser", "serialization") | ||
url = "https://github.com/conan-io/conan-center-index" | ||
homepage = "https://www.codesynthesis.com/projects/libstudxml/" | ||
license = "MIT" | ||
|
||
settings = "os", "arch", "compiler", "build_type" | ||
options = { | ||
"shared": [True, False], | ||
"fPIC": [True, False], | ||
} | ||
default_options = { | ||
"shared": False, | ||
"fPIC": True, | ||
} | ||
|
||
exports_sources = "CMakeLists.txt" | ||
|
||
def config_options(self): | ||
if self.settings.os == "Windows": | ||
del self.options.fPIC | ||
|
||
def configure(self): | ||
if self.options.shared: | ||
self.options.rm_safe("fPIC") | ||
|
||
def layout(self): | ||
cmake_layout(self, src_folder="src") | ||
|
||
def requirements(self): | ||
self.requires("expat/2.5.0", transitive_headers=True, transitive_libs=True) | ||
|
||
def source(self): | ||
get(self, **self.conan_data["sources"][self.version], | ||
destination=self.source_folder, strip_root=True) | ||
|
||
def generate(self): | ||
tc = CMakeToolchain(self) | ||
tc.variables["LIBSTUDXML_SRC_DIR"] = self.source_folder.replace("\\", "/") | ||
tc.generate() | ||
deps = CMakeDeps(self) | ||
deps.generate() | ||
|
||
def _patch_sources(self): | ||
# unvendor expat | ||
rmdir(self, os.path.join(self.source_folder, "libstudxml", "details", "expat")) | ||
replace_in_file( | ||
self, | ||
os.path.join(self.source_folder, "libstudxml", "parser.hxx"), | ||
"#ifndef LIBSTUDXML_EXTERNAL_EXPAT", | ||
"#if 0", | ||
) | ||
|
||
def build(self): | ||
self._patch_sources() | ||
cmake = CMake(self) | ||
cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) | ||
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() | ||
|
||
def package_info(self): | ||
self.cpp_info.set_property("pkg_config_name", "libstudxml") | ||
self.cpp_info.libs = ["studxml"] | ||
self.cpp_info.defines = ["LIBSTUDXML_SHARED" if self.options.shared else "LIBSTUDXML_STATIC"] |
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 3.1) | ||
project(test_package LANGUAGES CXX) | ||
|
||
find_package(libstudxml REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE libstudxml::libstudxml) |
Oops, something went wrong.