cmake: add option to download msvc 10 3rd party libraries

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37370 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2011-01-30 10:23:29 +00:00
parent e5f51200a3
commit 40dcf20b5d
2 changed files with 42 additions and 5 deletions

View 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

View 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)