]> git.lyx.org Git - lyx.git/blob - development/cmake/build.bat
don't hard code private pathes
[lyx.git] / development / cmake / build.bat
1 echo off
2
3 echo -------------------------------------------------------------------------------------
4 echo -
5 echo Usage build.bat devel/install/deploy STUDIO(optional)
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     deploy  - Builds Makefiles and installs LyX
9 echo     STUDIO  - Used Visual Studio version, default is "Visual Studio 10"
10 echo               use "Visual Studio 9 2008" for Visual Studio 9
11 echo
12 echo -------------------------------------------------------------------------------------
13 echo -
14 echo Call this script from a build directory or set variables (or edit this file)
15 echo     LYX_SOURCE
16 echo     LXY_BUILD
17 echo
18 echo Be sure you've set qmake in PATH.
19 echo -
20 echo GNUWin32 will be downloaded if you don't set the variable GNUWIN32_DIR
21 echo -------------------------------------------------------------------------------------
22 echo -
23 echo -
24
25 if [%1]==[] (
26         echo ERROR: no options.
27     echo Exiting now.
28         goto :eof
29 )
30
31 REM Add path to qmake here or set PATH correctly on your system.
32 set PATH="D:\Qt\bin";%PATH%
33
34 REM Edit pathes here or set the environment variables on you system.
35 ::set GNUWIN32_DIR=D:\LyXSVN\lyx-devel\lyx-windows-deps-msvc2010
36 ::set LYX_SOURCE=D:\LyXSVN\lyx-devel
37 ::set LYX_BUILD=D:\LyXSVN\lyx-devel\compile-result
38
39 if [%LYX_SOURCE%]==[] (
40         set LYX_SOURCE=%~DP0\..\..
41 )
42 echo LyX source: "%LYX_SOURCE%"
43
44 if [%LYX_BUILD%]==[] (
45         set LYX_BUILD=%CD%
46 )
47 echo LyX build : "%LYX_BUILD%"
48
49 if [%GNUWIN32_DIR%]==[] (
50         echo GNUWIN32_DIR not set.
51         echo Downloading win32 deps.
52         set DEPENDENCIES_DOWNLOAD="-DLYX_DEPENDENCIES_DOWNLOAD=1"
53 ) else set PATH="%GNUWIN32_DIR%\bin";%PATH%
54
55 if not exist %LYX_BUILD% (
56         echo creating "%LYX_BUILD%"
57         mkdir "%LYX_BUILD%"
58         if not exist %LYX_BUILD% (
59                 echo Exiting script.
60                 goto :eof
61         )
62 )
63
64 cd "%LYX_BUILD%"
65
66 REM start with a new cmake run
67 ::del CMakeCache.txt
68
69 if [%2]==[] (
70         set USED_STUDIO="Visual Studio 10"
71 ) else (
72         set USED_STUDIO=%2%
73 )
74
75
76 if "%1%" == "devel" (
77         REM Build solution to develop LyX
78         cmake %LYX_SOURCE% -G%USED_STUDIO% -DLYX_MERGE_FILES=0 -DLYX_NLS=1 -DLYX_INSTALL=0 -DLYX_RELEASE=0 -DLYX_CONSOLE=FORCE %DEPENDENCIES_DOWNLOAD%
79         msbuild lyx.sln /p:Configuration=Debug /t:LyX /t:tex2lyx
80 )
81
82 if "%1%" == "install" (
83         REM Build solution to develop LyX
84         cmake %LYX_SOURCE% -G%USED_STUDIO% -DLYX_MERGE_FILES=1 -DLYX_INSTALL=1 %DEPENDENCIES_DOWNLOAD% 
85         msbuild lyx.sln         /p:Configuration=Release /t:ALL_BUILD
86         msbuild INSTALL.vcxproj /p:Configuration=Release 
87 )
88
89 REM Edit the path according to your system.
90 cd "%LYX_SOURCE%\development\cmake"
91
92 :eof