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