]> git.lyx.org Git - lyx.git/blob - development/cmake/build5-2010.bat
Customization: correct some color names.
[lyx.git] / development / cmake / build5-2010.bat
1 echo off
2
3 echo -------------------------------------------------------------------------------------
4 echo -
5 echo Usage build.bat devel/install
6 echo     devel   - Builds Visual Studio project files for development on LyX
7 echo     install - Builds Visual Studio project files with all enabled for installation
8 echo
9 echo -------------------------------------------------------------------------------------
10 echo -
11 echo Call this script from a build directory or set variables (or edit this file)
12 echo     LYX_SOURCE
13 echo     LXY_BUILD
14 echo
15 echo Be sure you've set qmake in PATH.
16 echo -
17 echo GNUWin32 will be downloaded if you don't set the variable GNUWIN32_DIR
18 echo -------------------------------------------------------------------------------------
19 echo -
20 echo -
21
22 if [%1]==[] (
23         echo ERROR: no options.
24     echo Exiting now.
25         goto :eof
26 )
27
28 REM Uncomment the following line if you want to compile in parallel.
29 REM This uses N cl.exe processes, where N is the number of cores.
30 set CL=/MP
31
32 REM Save path
33 set CALLED_FROM=%CD%
34
35 REM Add path to qmake here or set PATH correctly on your system.
36 set PATH=C:\Qt\Qt5-5-1-2010\5.5\msvc2010\bin;%PATH%
37
38 REM Edit pathes here or set the environment variables on you system.
39 set GNUWIN32_DIR=D:\LyXGit\Master\lyx-windows-deps-msvc2010
40 set LYX_SOURCE=D:\LyXGit\Master\
41 set LYX_BUILD=D:\LyXGit\Master\compile-2010
42
43 if [%LYX_SOURCE%]==[] (
44         set LYX_SOURCE=%~DP0\..\..
45 )
46 echo LyX source: "%LYX_SOURCE%"
47
48 if [%LYX_BUILD%]==[] (
49         set LYX_BUILD=%CD%
50 )
51 echo LyX build : "%LYX_BUILD%"
52
53 if [%GNUWIN32_DIR%]==[] (
54         echo GNUWIN32_DIR not set.
55         echo Downloading win32 deps.
56         set DEPENDENCIES_DOWNLOAD="-DLYX_DEPENDENCIES_DOWNLOAD=1"
57 ) else set PATH="%GNUWIN32_DIR%\bin";%PATH%
58
59 if not exist %LYX_BUILD% (
60         echo creating "%LYX_BUILD%"
61         mkdir "%LYX_BUILD%"
62         if not exist %LYX_BUILD% (
63                 echo Exiting script.
64                 goto :eof
65         )
66 )
67
68 REM MSVC 2010 tools
69 call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
70
71 cd "%LYX_BUILD%"
72
73 REM start with a new cmake run
74 ::del CMakeCache.txt
75
76 if "%1%" == "devel" (
77         REM Build solution to develop LyX
78         REM you can add the option "-GNinja" for a faster compilation
79         cmake %LYX_SOURCE% -GNinja -G"Visual Studio 10" -DLYX_USE_QT=QT5 -DLYX_ENABLE_EXPORT_TESTS=1 -DLYX_MERGE_FILES=0 -DLYX_NLS=1 -DLYX_INSTALL=0 -DLYX_RELEASE=0 -DLYX_CONSOLE=FORCE -DLYX_3RDPARTY_BUILD=1 %DEPENDENCIES_DOWNLOAD%
80         msbuild lyx.sln /p:Configuration=Debug /t:LyX /t:tex2lyx
81 )
82
83 if "%1%" == "install" (
84         REM Build solution to develop LyX
85         REM set -DLYX_MERGE_REBUILD and -DLYX_MERGE_FILES to 1 for a version released with an installer
86         cmake %LYX_SOURCE% -GNinja -G"Visual Studio 10" -DLYX_USE_QT=QT5 -DLYX_MERGE_FILES=1 -DLYX_NLS=1 -DLYX_INSTALL=1 -DLYX_RELEASE=1 -DLYX_CONSOLE=OFF %DEPENDENCIES_DOWNLOAD%
87         msbuild lyx.sln         /p:Configuration=Release /t:ALL_BUILD
88         msbuild INSTALL.vcxproj /p:Configuration=Release
89 )
90
91 REM go back to the dir where the script was called from
92 cd /D %CALLED_FROM%
93
94 :eof