Update Boost and ICU, bump to Conan 2.0
Updated Boost and ICU versions, bumped the support to Conan 2.0. The minimum supported compilers for conan are now: * msvc 2017 * gcc 8 * clang 8
This commit is contained in:
23
.github/workflows/build-unix.yml
vendored
23
.github/workflows/build-unix.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: openE57
|
name: openE57-unix
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-20.04, macos-latest]
|
os: [ubuntu-22.04, macos-latest]
|
||||||
build_type: [Debug, Release]
|
build_type: [Debug, Release]
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -21,25 +21,28 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Perform checkout
|
- name: Perform checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Python environment
|
- name: Install Python environment
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
|
||||||
- name: Install conan
|
- name: Install conan
|
||||||
run: |
|
run: |
|
||||||
pip install conan --upgrade
|
pip install conan --upgrade
|
||||||
conan profile new default --detect
|
|
||||||
conan profile update settings.build_type=${{ matrix.build_type }} default
|
- name: Create default profile
|
||||||
|
run: |
|
||||||
|
conan profile detect --force
|
||||||
|
|
||||||
- name: Linux build
|
- name: Linux build
|
||||||
if: matrix.os == 'ubuntu-20.04'
|
if: matrix.os == 'ubuntu-22.04'
|
||||||
run: |
|
run: |
|
||||||
conan profile update settings.compiler.libcxx=libstdc++11 default
|
conan create . -o openE57/*:with_tools=True -s build_type=${{ matrix.build_type }} -s compiler.cppstd=17 --build=missing
|
||||||
conan create . -o openE57:with_tools=True --build=missing
|
|
||||||
|
|
||||||
- name: Mac build
|
- name: Mac build
|
||||||
if: matrix.os == 'macos-latest'
|
if: matrix.os == 'macos-latest'
|
||||||
run: |
|
run: |
|
||||||
conan create . --build=missing
|
conan create . -s build_type=${{ matrix.build_type }} -s compiler.cppstd=17 --build=missing
|
||||||
|
|
||||||
|
|||||||
39
.github/workflows/build-win.yml
vendored
39
.github/workflows/build-win.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: openE57
|
name: openE57-windows
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -11,20 +11,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest]
|
os: [windows-latest]
|
||||||
build_type: [Release, Debug]
|
build_type: [Release, Debug]
|
||||||
runtime_type: [MT, MTd, MD, MDd]
|
runtime_type: [static, dynamic]
|
||||||
exclude:
|
|
||||||
- os: windows-latest
|
|
||||||
build_type: Release
|
|
||||||
runtime_type: MTd
|
|
||||||
- os: windows-latest
|
|
||||||
build_type: Release
|
|
||||||
runtime_type: MDd
|
|
||||||
- os: windows-latest
|
|
||||||
build_type: Debug
|
|
||||||
runtime_type: MT
|
|
||||||
- os: windows-latest
|
|
||||||
build_type: Debug
|
|
||||||
runtime_type: MD
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
@@ -35,29 +22,27 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Perform checkout
|
- name: Perform checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Python environment
|
- name: Install Python environment
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
|
||||||
- name: Install conan
|
- name: Install conan
|
||||||
run: |
|
run: |
|
||||||
pip install conan --upgrade
|
pip install conan --upgrade
|
||||||
conan remote clean
|
|
||||||
conan remote add conancenter https://center.conan.io True --insert
|
- name: Create default profile
|
||||||
|
|
||||||
- name: Configure conan profile
|
|
||||||
run: |
|
run: |
|
||||||
conan profile new ${{ matrix.build_type }}-${{ matrix.runtime_type }} --detect
|
conan profile detect --force
|
||||||
conan profile update settings.build_type=${{ matrix.build_type }} ${{ matrix.build_type }}-${{ matrix.runtime_type }}
|
|
||||||
conan profile update settings.compiler.runtime=${{ matrix.runtime_type }} ${{ matrix.build_type }}-${{ matrix.runtime_type }}
|
|
||||||
|
|
||||||
- name: Windows Release build
|
- name: Windows Release build
|
||||||
if: matrix.build_type == 'Release'
|
if: matrix.build_type == 'Release'
|
||||||
run: |
|
run: |
|
||||||
conan create . -o openE57:with_tools=True --build=missing --profile ${{ matrix.build_type }}-${{ matrix.runtime_type }}
|
conan create . -o openE57/*:with_tools=True --build=missing -s build_type=${{ matrix.build_type }} -s compiler.cppstd=17 -s compiler.runtime=${{ matrix.runtime_type }}
|
||||||
|
|
||||||
- name: Windows Debug build
|
- name: Windows Debug build
|
||||||
if: matrix.build_type == 'Debug'
|
if: matrix.build_type == 'Debug'
|
||||||
run: |
|
run: |
|
||||||
conan create . --build=missing --profile ${{ matrix.build_type }}-${{ matrix.runtime_type }}
|
conan create . --build=missing -s build_type=${{ matrix.build_type }} -s compiler.cppstd=17 -s compiler.runtime=${{ matrix.runtime_type }}
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -36,4 +36,6 @@ build/
|
|||||||
tmp/
|
tmp/
|
||||||
bin/*
|
bin/*
|
||||||
.devcontainer/
|
.devcontainer/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
|
test_package/CMakeUserPresets.json
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
# openE57
|
# openE57
|
||||||
|
|
||||||

|
[](https://github.com/openE57/openE57/actions/workflows/build-win.yml)
|
||||||
|
[](https://github.com/openE57/openE57/actions/workflows/build-unix.yml)
|
||||||
|
|
||||||
openE57 is a forked version of the original LibE57 (http://www.libe57.org) project, with the intent to refine and optimize the source code in a modern C++ idiomatic way and remove unnecessary dependencies (e.g. Boost) in favour of the C++ Standard Library.
|
openE57 is a forked version of the original LibE57 (http://www.libe57.org) project, with the intent to refine and optimize the source code in a modern C++ idiomatic way and remove unnecessary dependencies (e.g. Boost) in favour of the C++ Standard Library.
|
||||||
|
|
||||||
@@ -19,9 +20,9 @@ At the current state, Boost is still required when building the tools as in the
|
|||||||
|
|
||||||
You need the following tools to build this library:
|
You need the following tools to build this library:
|
||||||
|
|
||||||
* A C++17 compiler (MSVC 2017+, gcc 7+, clang 7+)
|
* A C++17 compiler (MSVC 2017+, gcc 8+, clang 8+)
|
||||||
* A recent version of CMake (3.15+)
|
* A recent version of CMake (3.15+)
|
||||||
* A recent version of conan (1.28+)
|
* A recent version of conan (2.0+)
|
||||||
|
|
||||||
## Build Instructions
|
## Build Instructions
|
||||||
|
|
||||||
|
|||||||
69
conanfile.py
69
conanfile.py
@@ -1,11 +1,18 @@
|
|||||||
from conans import ConanFile, tools, CMake
|
|
||||||
from conan.tools.microsoft import msvc_runtime_flag
|
|
||||||
from conans.errors import ConanInvalidConfiguration
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from conan import ConanFile
|
||||||
|
from conan.errors import ConanInvalidConfiguration
|
||||||
|
from conan.tools.build import check_min_cppstd
|
||||||
|
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
|
||||||
|
from conan.tools.files import copy, export_conandata_patches, get, replace_in_file
|
||||||
|
from conan.tools.microsoft import is_msvc, is_msvc_static_runtime
|
||||||
|
from conan.tools.scm import Version
|
||||||
|
|
||||||
|
required_conan_version = ">=2.0.0"
|
||||||
|
|
||||||
class Opene57Conan(ConanFile):
|
class Opene57Conan(ConanFile):
|
||||||
name = "opene57"
|
name = "opene57"
|
||||||
version = "1.6.3"
|
version = "1.6.5"
|
||||||
description = "A C++ library for reading and writing E57 files, " \
|
description = "A C++ library for reading and writing E57 files, " \
|
||||||
"fork of the original libE57 (http://libe57.org)"
|
"fork of the original libE57 (http://libe57.org)"
|
||||||
topics = ("e57", "libe57", "3d", "astm")
|
topics = ("e57", "libe57", "3d", "astm")
|
||||||
@@ -25,8 +32,6 @@ class Opene57Conan(ConanFile):
|
|||||||
"shared": False,
|
"shared": False,
|
||||||
"fPIC": True
|
"fPIC": True
|
||||||
}
|
}
|
||||||
generators = "cmake", "cmake_find_package"
|
|
||||||
_cmake = None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _source_subfolder(self):
|
def _source_subfolder(self):
|
||||||
@@ -39,9 +44,9 @@ class Opene57Conan(ConanFile):
|
|||||||
@property
|
@property
|
||||||
def _minimum_compilers_version(self):
|
def _minimum_compilers_version(self):
|
||||||
return {
|
return {
|
||||||
"Visual Studio": "15",
|
"msvc": "15",
|
||||||
"gcc": "7",
|
"gcc": "8",
|
||||||
"clang": "6",
|
"clang": "8",
|
||||||
"apple-clang": "10",
|
"apple-clang": "10",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,52 +66,50 @@ class Opene57Conan(ConanFile):
|
|||||||
raise ConanInvalidConfiguration("OpenE57 cannot be built as shared library yet")
|
raise ConanInvalidConfiguration("OpenE57 cannot be built as shared library yet")
|
||||||
|
|
||||||
if self.settings.compiler.get_safe("cppstd"):
|
if self.settings.compiler.get_safe("cppstd"):
|
||||||
tools.check_min_cppstd(self, 17)
|
check_min_cppstd(self, 17)
|
||||||
|
|
||||||
minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False)
|
minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False)
|
||||||
if not minimum_version:
|
if not minimum_version:
|
||||||
self.output.warn("C++17 support required. Your compiler is unknown. Assuming it supports C++17.")
|
self.output.warn("C++17 support required. Your compiler is unknown. Assuming it supports C++17.")
|
||||||
elif tools.Version(self.settings.compiler.version) < minimum_version:
|
elif Version(self.settings.compiler.version) < minimum_version:
|
||||||
raise ConanInvalidConfiguration("C++17 support required, which your compiler does not support.")
|
raise ConanInvalidConfiguration("C++17 support required, which your compiler does not support.")
|
||||||
|
|
||||||
def requirements(self):
|
def requirements(self):
|
||||||
if self.options.with_tools:
|
if self.options.with_tools:
|
||||||
self.requires("boost/1.80.0")
|
self.requires("boost/1.83.0")
|
||||||
|
|
||||||
if self.options.with_docs:
|
if self.options.with_docs:
|
||||||
self.requires("doxygen/1.9.4")
|
self.requires("doxygen/1.9.4")
|
||||||
|
|
||||||
if self.settings.os == "Linux" or tools.is_apple_os(self.settings.os):
|
if self.settings.os != "Windows":
|
||||||
self.requires("icu/72.1")
|
self.requires("icu/74.1")
|
||||||
|
|
||||||
self.requires("xerces-c/3.2.4")
|
self.requires("xerces-c/3.2.4")
|
||||||
|
|
||||||
def _configure_cmake(self):
|
def generate(self):
|
||||||
if self._cmake:
|
tc = CMakeToolchain(self)
|
||||||
return self._cmake
|
tc.variables["PROJECT_VERSION"] = self.version
|
||||||
self._cmake = CMake(self)
|
tc.variables["BUILD_EXAMPLES"] = False
|
||||||
self._cmake.definitions["PROJECT_VERSION"] = self.version
|
tc.variables["BUILD_TOOLS"] = self.options.with_tools
|
||||||
self._cmake.definitions["BUILD_EXAMPLES"] = False
|
tc.variables["BUILD_TESTS"] = False
|
||||||
self._cmake.definitions["BUILD_TOOLS"] = self.options.with_tools
|
if is_msvc(self):
|
||||||
self._cmake.definitions["BUILD_TESTS"] = False
|
tc.variables["BUILD_WITH_MT"] = is_msvc_static_runtime(self)
|
||||||
if self.settings.compiler == "Visual Studio":
|
tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared
|
||||||
self._cmake.definitions["BUILD_WITH_MT"] = "MT" in msvc_runtime_flag(self)
|
tc.generate()
|
||||||
else:
|
deps = CMakeDeps(self)
|
||||||
self._cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True)
|
deps.generate()
|
||||||
self._cmake.configure(build_folder=self._build_subfolder)
|
|
||||||
return self._cmake
|
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
cmake = self._configure_cmake()
|
cmake = CMake(self)
|
||||||
|
cmake.configure()
|
||||||
cmake.build()
|
cmake.build()
|
||||||
|
|
||||||
def package(self):
|
def package(self):
|
||||||
self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
|
copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
|
||||||
self.copy(pattern="LICENSE.libE57", dst="licenses", src=self._source_subfolder)
|
copy(self, "LICENSE.libE57", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
|
||||||
cmake = self._configure_cmake()
|
cmake = CMake(self)
|
||||||
cmake.install()
|
cmake.install()
|
||||||
os.remove(os.path.join(self.package_folder, "CHANGELOG.md"))
|
os.remove(os.path.join(self.package_folder, "CHANGELOG.md"))
|
||||||
tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.dll")
|
|
||||||
|
|
||||||
def package_info(self):
|
def package_info(self):
|
||||||
if self.options.with_tools:
|
if self.options.with_tools:
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR)
|
||||||
project(opene57_example CXX)
|
project(opene57_example CXX)
|
||||||
|
|
||||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
find_package(opene57 REQUIRED CONFIG)
|
||||||
conan_basic_setup(TARGETS)
|
|
||||||
|
|
||||||
find_package(opene57 REQUIRED)
|
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} example.cpp)
|
add_executable(${PROJECT_NAME} example.cpp)
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE opene57::opene57)
|
target_link_libraries(${PROJECT_NAME} PRIVATE opene57::opene57)
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${opene57_INCLUDE_DIRS})
|
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
|
||||||
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
|
|
||||||
@@ -1,18 +1,26 @@
|
|||||||
import shutil,os
|
from conan import ConanFile
|
||||||
from conan.tools.microsoft import msvc_runtime_flag
|
from conan.tools.build import can_run
|
||||||
from conans import ConanFile, CMake, tools
|
from conan.tools.cmake import cmake_layout, CMake
|
||||||
|
import os
|
||||||
|
|
||||||
class TestOpene57Conan(ConanFile):
|
|
||||||
settings = "os", "compiler", "build_type", "arch"
|
class TestPackageConan(ConanFile):
|
||||||
generators = "cmake", "cmake_find_package"
|
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):
|
def build(self):
|
||||||
if not tools.cross_building(self):
|
cmake = CMake(self)
|
||||||
cmake = CMake(self)
|
cmake.configure()
|
||||||
cmake.configure()
|
cmake.build()
|
||||||
cmake.build()
|
|
||||||
|
|
||||||
def test(self):
|
def test(self):
|
||||||
if not tools.cross_building(self):
|
if can_run(self):
|
||||||
bin_path = os.path.join("bin", "opene57_example")
|
bin_path = os.path.join(self.cpp.build.bindir, "opene57_example")
|
||||||
self.run(bin_path, run_environment=True)
|
self.run(bin_path, env="conanrun")
|
||||||
Reference in New Issue
Block a user