]> danny-edel.de - dspdfviewer.git/commitdiff
Add CMake option UsePrerenderedPDF
authorDanny Edel <mail@danny-edel.de>
Mon, 4 Apr 2016 12:29:30 +0000 (14:29 +0200)
committerDanny Edel <mail@danny-edel.de>
Mon, 4 Apr 2016 12:29:30 +0000 (14:29 +0200)
CHANGELOG.md
CMakeLists.txt
testing/CMakeLists.txt

index 92dc639c9beb5c7a5f67220b1005e21ecf58c535..f1d737126cfe3dbc50d90736a23ed9f93e3bd7b8 100644 (file)
@@ -19,6 +19,9 @@ Changes in behaviour:
     environment does not have that pass -DRunDualScreenTests=OFF at
     CMake time.  This can be useful if you run the test suite under
     XvFB.
+  * Instead of offering pre-rendered PDFs for download, they are now
+    included in the source tree.  The option `DownloadTestPDF` has
+    been replaced with `UsePrerenderedPDF` accordingly.
 
 New features:
 * Memory usage now configurable
index 21643c9113d2bab98ba8a68ddb1f57319615b49b..02bdea7394cc8925797547a7781b78e9362b6b92 100644 (file)
@@ -38,7 +38,9 @@ option(BuildTests "Build unit tests (this requires pdflatex or internet access a
 option(RunDualScreenTests "Also run tests that require two screens to be connected" ON)
 option(BoostStaticLink "Link statically against the boost libraries" OFF)
 option(WindowsStaticLink "Windows/MSVC only: Link statically against the dependencies and set /MT instead of /MD" ON)
-option(DownloadTestPDF "Download test PDFs from http://danny-edel.de, rather then building them using latex-beamer" OFF)
+option(UsePrerenderedPDF
+       "Use prerendered PDFs included in the source for testing, "
+       "instead of building with pdflatex" OFF)
 option(CodeCoverage "Add coverage analysis code to the program. Will slow it down. A lot. Only supported on GCC right now." OFF)
 
 include(cmake/platforms.cmake)
index c40c1037af6aaaaf603e3bf46c74f51557ffb2fd..cf8ead2d70256897b4f2c78203f20d91c4551ca5 100644 (file)
@@ -15,21 +15,20 @@ list(APPEND PDFFILENAMES
 )
 
 if(DownloadTestPDF)
-       file(DOWNLOAD http://danny-edel.de/colored-rectangles.pdf ${CMAKE_CURRENT_BINARY_DIR}/colored-rectangles.pdf
-               TIMEOUT 30
-               SHOW_PROGRESS
-               EXPECTED_MD5 de9617fb1c00d6185e90314124e2c2f5
-               )
-       file(DOWNLOAD http://danny-edel.de/images.pdf ${CMAKE_CURRENT_BINARY_DIR}/images.pdf
-               TIMEOUT 30
-               SHOW_PROGESS
-               EXPECTED_MD5 5c72e0954d457e3e9a1287ff299e307a
-               )
-       file(DOWNLOAD http://danny-edel.de/many-many-pages.pdf ${CMAKE_CURRENT_BINARY_DIR}/many-many-pages.pdf
-               TIMEOUT 30
-               SHOW_PROGRESS
-               EXPECTED_MD5 22d934fbc13a93adc5e91bfec866229e
-               )
+       message(WARNING "DownloadTestPDF option has been deprectated, since "
+               "prerendered PDFs are now included in the source.  Use the option
+               -DUsePrerenderedPDF=ON from now on.")
+       set(UsePrerenderedPDF ON)
+endif()
+
+if(UsePrerenderedPDF)
+       foreach(pdffile IN LISTS PDFFILENAMES)
+               file(
+                       COPY "pdfs/${pdffile}"
+                       DESTINATION .
+                       )
+               message(STATUS "Using pre-rendered ${pdffile}")
+       endforeach()
 else()
        # Compile from source
        find_program(PDFLATEX