File tree Expand file tree Collapse file tree 3 files changed +11
-23
lines changed Expand file tree Collapse file tree 3 files changed +11
-23
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,3 @@ project(pdf2htmlEX-android)
24
24
find_package (pdf2htmlEX REQUIRED CONFIG )
25
25
26
26
add_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 {
68
68
version ' 3.22.1'
69
69
}
70
70
ndkVersion ' 26.3.11579264'
71
- sourceSets. main. assets. srcDirs + = " build/assets"
71
+ sourceSets. main. assets. srcDirs + = " build/conan/armv8/ assets"
72
72
sourceSets. androidTest. assets. srcDirs = [ getProject(). parent. getLayout(). getProjectDirectory(). dir(" test/androidTestAssets" ) ]
73
73
}
74
74
75
- // Assets delivered by conan are gathered by CMake
75
+ // Make sure the assets are installed and ready when needed
76
76
afterEvaluate {
77
77
tasks. named(" generateDebugAssets" ). configure {
78
- dependsOn(tasks. named(" mergeDebugNativeLibs " ))
78
+ dependsOn(tasks. named(" conanInstall-armv8 " ))
79
79
}
80
80
tasks. named(" generateReleaseAssets" ). configure {
81
- dependsOn(tasks. named(" mergeReleaseNativeLibs " ))
81
+ dependsOn(tasks. named(" conanInstall-armv8 " ))
82
82
}
83
83
}
84
84
Original file line number Diff line number Diff line change
1
+ import os
2
+
1
3
from conan import ConanFile
2
4
from conan .tools .cmake import CMakeToolchain , CMakeDeps
3
5
@@ -12,10 +14,10 @@ def generate(self):
12
14
deps = CMakeDeps (self )
13
15
deps .generate ()
14
16
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 ]
20
17
tc .generate ()
21
18
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