]> git.lyx.org Git - features.git/commitdiff
cmake: add option to download msvc 10 3rd party libraries
authorPeter Kümmel <syntheticpp@gmx.net>
Sun, 30 Jan 2011 10:23:29 +0000 (10:23 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sun, 30 Jan 2011 10:23:29 +0000 (10:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37370 a592a061-630c-0410-9148-cb99ea01b6c8

INSTALL.cmake
development/cmake/CMakeLists.txt

index d50dc9b8078c4e89325276a7be688ea9662e4022..c093097a1ec8432e2041b042547bc454778c8f3c 100644 (file)
@@ -21,7 +21,8 @@ Building LyX with CMake
     
         On Windows install the supplementary modules:
         * Visual Studio 2008: ftp://ftp.lyx.org/pub/lyx/contrib/lyx-windows-deps-msvc2008.zip
-        * Visual Studio 2010: ftp://ftp.devel.lyx.org/pub/contrib/windows/bin/     
+        * Visual Studio 2010: ftp://ftp.devel.lyx.org/pub/contrib/windows/bin
+                              or use the option LYX_3RDPARTY_DOWNLOAD
         
         If cmake couldn't find these modules set GNUWIN32_DIR, eg. 
         -DGNUWIN32_DIR=c:\gnuwin32. By default cmake searches in your 
@@ -148,7 +149,8 @@ Build options
     -- LYX_CONSOLE              = ON     : Show console on Windows
     -- LYX_VLD                  = OFF    : Use VLD with MSVC
     -- LYX_WALL                 = OFF    : Enable all warnings
-    -- LYX_LYX_CONFIGURE_CHECKS = OFF    : Also run configure checks for MSVC
+    -- LYX_CONFIGURE_CHECKS     = OFF    : Also run configure checks for MSVC
+    -- LYX_3RDPARTY_DOWNLOAD    = OFF    : Download precompiled 3rd party libraries for MSVC 10
 
     
 
index ffa17e363837a38aa93385b36548ab33d891130c..7ea2eafecbc80a692329b914195974e6562ba8f8 100644 (file)
@@ -66,8 +66,8 @@ LYX_OPTION(CONCEPT_CHECKS "Enable concept-checks" OFF GCC)
 LYX_OPTION(CONSOLE "Show console on Windows" ON MSVC)
 LYX_OPTION(VLD "Use VLD with MSVC" OFF MSVC)
 LYX_OPTION(WALL "Enable all warnings" OFF MSVC)
-LYX_OPTION(LYX_CONFIGURE_CHECKS "Also run configure checks for MSVC" OFF MSVC)
-
+LYX_OPTION(CONFIGURE_CHECKS "Also run configure checks for MSVC" OFF MSVC)
+LYX_OPTION(3RDPARTY_DOWNLOAD "Download precompiled 3rd party libraries for MSVC 10" OFF MSVC)
 
 # Check option dependencies
 if(LYX_CPACK)
@@ -76,7 +76,9 @@ endif()
 
 if(LYX_INSTALL)
        set(LYX_NLS ON)
-       set(LYX_ASPELL ON)
+       if(NOT LYX_3RDPARTY_DOWNLOAD)
+               set(LYX_ASPELL ON)
+       endif()
        if (WIN32)
                set(LYX_HUNSPELL ON)
        endif()
@@ -92,6 +94,39 @@ else()
        set(LYX_MERGE_REBUILD OFF)
 endif()
 
+if(LYX_3RDPARTY_DOWNLOAD)
+       message(STATUS)
+       set(LYX_3RDPARTY_DIR ${CMAKE_BINARY_DIR}/msvc10-deps)
+       message(STATUS "Using downloaded 3rd party libraries in ${LYX_3RDPARTY_DIR}")
+       set(3rdparty_files
+               crt-msvc2010-x86.zip 
+               dict-hunspell-all.zip 
+               dtl-modified-msvc2010-x86.zip 
+               dvipost-1.1-modified-msvc2010-x86.zip 
+               gettext-tools-0.18.1-x86.zip 
+               ghostscript-8.71-msvc2010-x86.zip 
+               hunspell-1.2.11-msvc2010-x86.zip 
+               iconv-1.13.1-msvc2010-x86.zip 
+               imagemagick-6.6.3-0-modified-msvc2010-x86.zip 
+               libintl-0.18.1-msvc2010-x86.zip 
+               netpbm-pnmcrop-10.27-x86.zip 
+               pdftools-msvc2010-x86.zip 
+               pdfview-x86.zip 
+               python-2.6.5-msvc2010-x86.zip 
+               thes-mythes-all.zip 
+               zlib-1.2.5-msvc2010-x86.zip)
+       foreach(it ${3rdparty_files})
+               set(already_downloaded already_downloaded-NOTFOUND CACHE PATH "downloaded" FORCE)
+               find_file(already_downloaded ${it} "${LYX_3RDPARTY_DIR}/downloads")
+               if(NOT already_downloaded)
+                       message(STATUS "Downloading ${it} ...")
+                       file(DOWNLOAD ftp://ftp.devel.lyx.org/pub/contrib/windows/bin/${it} ${LYX_3RDPARTY_DIR}/downloads/${it} SHOW_PROGRESS)
+                       execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${LYX_3RDPARTY_DIR}/downloads/${it}
+                                     WORKING_DIRECTORY ${LYX_3RDPARTY_DIR})
+               endif()
+       endforeach()
+       set(GNUWIN32_DIR ${LYX_3RDPARTY_DIR})
+endif()
 
 
 message(STATUS)