Skip to content

Commit 3a8add2

Browse files
committed
Package up everything into a nice zip
1 parent 2ca0f79 commit 3a8add2

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,37 +59,43 @@ MESSAGE ( STATUS "external downloads will be stored/expected in: ${EXTERNALS_DOW
5959

6060
SET ( VIEWER_BUILD_DIR ${CMAKE_BINARY_DIR}/viewer )
6161
FILE ( MAKE_DIRECTORY ${VIEWER_BUILD_DIR})
62+
SET ( VIEWERZIP ${CMAKE_BINARY_DIR}/Viewer.js-${VIEWERJS_VERSION}.zip)
63+
SET ( WEBODF_SOURCE_DIR ${CMAKE_BINARY_DIR}/WebODF-Prefix/src/WebODF )
64+
SET ( WEBODF_BUILD_DIR ${CMAKE_BINARY_DIR}/WebODF-Prefix/src/WebODF-build )
65+
SET ( PDFJS_SOURCE_DIR ${CMAKE_BINARY_DIR}/PDFjs-Prefix/src/PDFjs )
6266

6367
ExternalProject_Add(
6468
WebODF
6569
GIT_REPOSITORY git@gitorious.org:webodf/webodf.git
6670
UPDATE_COMMAND git pull origin master
6771
BUILD_COMMAND make viewerbuilddir-target
68-
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/WebODF-Prefix/src/WebODF-build/viewer/ ${VIEWER_BUILD_DIR}
72+
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBODF_BUILD_DIR}/viewer/ ${VIEWER_BUILD_DIR}
6973
)
7074

7175
ExternalProject_Add(
7276
PDFjs
7377
GIT_REPOSITORY git@github.com:mozilla/pdf.js.git
7478
UPDATE_COMMAND git pull
7579
CONFIGURE_COMMAND ""
76-
BUILD_COMMAND node ${CMAKE_BINARY_DIR}/PDFjs-Prefix/src/PDFjs/make.js generic
77-
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/PDFjs-Prefix/src/PDFjs/build/generic/build/pdf.js ${VIEWER_BUILD_DIR}/pdf.js
80+
BUILD_COMMAND node ${PDFJS_SOURCE_DIR}/make.js generic
81+
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${PDFJS_SOURCE_DIR}/build/generic/build/pdf.js ${VIEWER_BUILD_DIR}/pdf.js
7882
)
7983

8084
add_custom_command(
81-
OUTPUT ${VIEWER_BUILD_DIR}/PDFViewerPlugin.js
85+
OUTPUT ${VIEWERZIP}
8286
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/PluginLoader.js ${VIEWER_BUILD_DIR}/PluginLoader.js
8387
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/PDFViewerPlugin.js ${VIEWER_BUILD_DIR}/PDFViewerPlugin.js
8488
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/TextLayerBuilder.js ${VIEWER_BUILD_DIR}/TextLayerBuilder.js
8589
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/PDFViewerPlugin.css ${VIEWER_BUILD_DIR}/PDFViewerPlugin.css
86-
COMMAND ${CMAKE_COMMAND} -E echo ${VIEWER_BUILD_DIR}
90+
COMMAND node ARGS ${WEBODF_SOURCE_DIR}/webodf/lib/runtime.js ${WEBODF_SOURCE_DIR}/webodf/tools/zipdir.js
91+
${VIEWER_BUILD_DIR}
92+
${VIEWERZIP}
8793
)
8894

8995

9096
add_custom_target(Viewer ALL
9197
DEPENDS
92-
${VIEWER_BUILD_DIR}/PDFViewerPlugin.js
98+
${VIEWERZIP}
9399
WebODF
94100
PDFjs
95101
)

0 commit comments

Comments
 (0)