File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,17 +24,3 @@ project(pdf2htmlEX-android)
2424find_package (pdf2htmlEX REQUIRED CONFIG )
2525
2626add_subdirectory (src/main/cpp )
27-
28- FILE (MAKE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR} /build/assets" )
29- function (copy_assets sourcevar dstsubdir )
30- if (DEFINED "${sourcevar} " )
31- FILE (REMOVE_RECURSE "${CMAKE_CURRENT_LIST_DIR} /build/assets/${dstsubdir} " )
32- FILE (CREATE_LINK "${${sourcevar} }" "${CMAKE_CURRENT_LIST_DIR} /build/assets/${dstsubdir} " COPY_ON_ERROR SYMBOLIC )
33- endif ()
34- endfunction ()
35-
36- copy_assets ("PDF2HTMLEX_RES_DIR" "pdf2htmlEX" )
37- copy_assets ("POPPLER_DATA_RES_DIR" "poppler-data" )
38- copy_assets ("FONTCONFIG_RES_DIR" "fontconfig" )
39-
40- #@TODO: fontforge cidfiles
Original file line number Diff line number Diff line change @@ -68,17 +68,17 @@ android {
6868 version ' 3.22.1'
6969 }
7070 ndkVersion ' 26.3.11579264'
71- sourceSets. main. assets. srcDirs + = " build/assets"
71+ sourceSets. main. assets. srcDirs + = " build/conan/armv8/ assets"
7272 sourceSets. androidTest. assets. srcDirs = [ getProject(). parent. getLayout(). getProjectDirectory(). dir(" test/androidTestAssets" ) ]
7373}
7474
75- // Assets delivered by conan are gathered by CMake
75+ // Make sure the assets are installed and ready when needed
7676afterEvaluate {
7777 tasks. named(" generateDebugAssets" ). configure {
78- dependsOn(tasks. named(" mergeDebugNativeLibs " ))
78+ dependsOn(tasks. named(" conanInstall-armv8 " ))
7979 }
8080 tasks. named(" generateReleaseAssets" ). configure {
81- dependsOn(tasks. named(" mergeReleaseNativeLibs " ))
81+ dependsOn(tasks. named(" conanInstall-armv8 " ))
8282 }
8383}
8484
Original file line number Diff line number Diff line change 1+ import os
2+
13from conan import ConanFile
24from conan .tools .cmake import CMakeToolchain , CMakeDeps
35
@@ -12,10 +14,10 @@ def generate(self):
1214 deps = CMakeDeps (self )
1315 deps .generate ()
1416 tc = CMakeToolchain (self )
15-
16- # @TODO: figure out how to use POPPLER_DATA_DIR exported by poppler-data
17- tc .variables ["POPPLER_DATA_RES_DIR" ] = self .dependencies ['poppler-data' ].cpp_info .resdirs [0 ]
18- tc .variables ["PDF2HTMLEX_RES_DIR" ] = self .dependencies ['pdf2htmlex' ].cpp_info .resdirs [0 ]
19- tc .variables ["FONTCONFIG_RES_DIR" ] = self .dependencies ['fontconfig' ].cpp_info .resdirs [0 ]
2017 tc .generate ()
2118
19+ asset_dir = os .path .join (self .build_folder , 'assets' )
20+ os .mkdir (asset_dir )
21+ os .symlink (self .dependencies ['pdf2htmlex' ].cpp_info .resdirs [0 ], os .path .join (asset_dir , 'pdf2htmlEX' ))
22+ os .symlink (self .dependencies ['poppler-data' ].cpp_info .resdirs [0 ], os .path .join (asset_dir , 'poppler-data' ))
23+ os .symlink (self .dependencies ['fontconfig' ].cpp_info .resdirs [0 ], os .path .join (asset_dir , 'fontconfig' ))
You can’t perform that action at this time.
0 commit comments