Skip to content

Commit

Permalink
Update conan recipe (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand authored Dec 26, 2024
1 parent dd7c5f0 commit f371f9e
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import os

from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake
from conan.tools.env import Environment
from conan.tools.env.environment import EnvVars
from conan.tools.files import copy


class OpenDocumentCoreConan(ConanFile):
Expand All @@ -27,8 +23,18 @@ class OpenDocumentCoreConan(ConanFile):
default_options = {
"shared": False,
"fPIC": True,
"with_pdf2htmlEX": True,
"with_wvWare": True,
}

exports_sources = ["cli/*", "cmake/*", "src/*", "CMakeLists.txt"]

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
del self.options.with_pdf2htmlEX
del self.options.with_wvWare

def requirements(self):
self.requires("pugixml/1.14")
self.requires("cryptopp/8.9.0")
Expand All @@ -37,9 +43,9 @@ def requirements(self):
self.requires("vincentlaucsb-csv-parser/2.3.0")
self.requires("uchardet/0.0.8")
self.requires("utfcpp/4.0.4")
if self.options.get_safe("with_pdf2htmlEX"):
self.requires("pdf2htmlex/0.18.8.rc1-20240905-git")
if self.options.get_safe("with_wvWare"):
if self.options.get_safe("with_pdf2htmlEX", False):
self.requires("pdf2htmlex/0.18.8.rc1-git-6f85c88")
if self.options.get_safe("with_wvWare", False):
self.requires("wvware/1.2.9")

def build_requirements(self):
Expand All @@ -49,15 +55,6 @@ def validate_build(self):
if self.settings.get_safe("compiler.cppstd"):
check_min_cppstd(self, 20)

exports_sources = ["cli/*", "cmake/*", "src/*", "CMakeLists.txt"]

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

self.options.with_pdf2htmlEX = self.settings.os not in ["Windows", "Macos"]
self.options.with_wvWare = self.settings.os not in ["Windows", "Macos"]

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
Expand Down

0 comments on commit f371f9e

Please sign in to comment.