Skip to content

Commit

Permalink
Update pdf2htmlEX and it's asset collection mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Aug 15, 2024
1 parent 09b6a2e commit 53769d1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
17 changes: 3 additions & 14 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ function(copy_assets sourcevar dstsubdir)
endif()
endfunction()

copy_assets("pdf2htmlex_RES_DIRS_DEBUG" "pdf2htmlEX")
copy_assets("pdf2htmlex_RES_DIRS_RELEASE" "pdf2htmlEX")
copy_assets("pdf2htmlex_RES_DIRS_RELWITHDEBINFO" "pdf2htmlEX")
copy_assets("pdf2htmlex_RES_DIRS_MINSIZEREL" "pdf2htmlEX")

copy_assets("poppler-data_RES_DIRS_DEBUG" "poppler-data")
copy_assets("poppler-data_RES_DIRS_RELEASE" "poppler-data")
copy_assets("poppler-data_RES_DIRS_RELWITHDEBINFO" "poppler-data")
copy_assets("poppler-data_RES_DIRS_MINSIZEREL" "poppler-data")

copy_assets("fontconfig_RES_DIRS_DEBUG" "fontconfig")
copy_assets("fontconfig_RES_DIRS_RELEASE" "fontconfig")
copy_assets("fontconfig_RES_DIRS_RELWITHDEBINFO" "fontconfig")
copy_assets("fontconfig_RES_DIRS_MINSIZEREL" "fontconfig")
copy_assets("PDF2HTMLEX_RES_DIR" "pdf2htmlEX")
copy_assets("POPPLER_DATA_RES_DIR" "poppler-data")
copy_assets("FONTCONFIG_RES_DIR" "fontconfig")
22 changes: 22 additions & 0 deletions app/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMakeDeps

required_conan_version = ">=2.0.6"


class pdf2htmlEXConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
# Remove pdf2htmlex dep once https://github.com/opendocument-app/OpenDocument.core/pull/380 is merged
requires = "odrcore/4.1.1@", "pdf2htmlex/0.18.8.rc1-20240814-git"

def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)

# @TODO: figure out how to use POPPLER_DATA_DIR exported by poppler-data
tc.variables["POPPLER_DATA_RES_DIR"] = self.dependencies['poppler-data'].cpp_info.resdirs[0]
tc.variables["PDF2HTMLEX_RES_DIR"] = self.dependencies['pdf2htmlex'].cpp_info.resdirs[0]
tc.variables["FONTCONFIG_RES_DIR"] = self.dependencies['fontconfig'].cpp_info.resdirs[0]
tc.generate()

8 changes: 0 additions & 8 deletions app/conanfile.txt

This file was deleted.

0 comments on commit 53769d1

Please sign in to comment.