]> git.lyx.org Git - lyx.git/blob - INSTALL.cmake
02c1216112a178a2f0c5b905e0e6787834aeba62
[lyx.git] / INSTALL.cmake
1 =========================
2 Building LyX with CMake
3 =========================
4
5 July, 2007
6
7
8
9 All systems
10 ===========
11
12     * CMake or CVS version from www.cmake.org
13     * Install Qt 4 and make sure qmake 4 is found
14       (add the folder with qmake to the environment variable PATH,
15        e.g. set PATH=<your path to qt>\bin;%PATH%).
16       
17
18 Windows only
19 =============
20
21     Install the windows supplementary modules:
22       Download ftp://ftp.lyx.org/pub/lyx/contrib/lyx-windows-deps-msvc2008.zip
23       and extract in the root directory of your LyX files (so you will get
24       a directory called lyx-windows-deps-msvc2008 next to the other directories
25       like src, development etc.).
26      
27     If cmake couldn't find these modules set GNUWIN32_DIR, eg. 
28     -DGNUWIN32_DIR=c:\gnuwin32. By default cmake searches in your 
29     program folder. Or use the cmake GUI to set the GNUWIN32_DIR path.
30
31
32 Building Visual C++ project files
33 --------------------------------------
34
35     * Install Visual C++ 2005 or 2008  (Express version also works)
36     * When building Qt: install Platform SDK 2008, "Core" and "Web Workshop"
37     * Add include and library paths of the SDK to the IDE search paths.
38       Menu entry: Tools->Options->'VC++ directories'->'Library files' and 'Include files'
39     * Create a build directory, e.g. ..\trunk\..\build
40     * Call in the build directory 'cmake ..\trunk\development\cmake'
41     * Start lyx.sln
42     
43     * Warnings: The default warning level of the msvc cmake builds 
44       is /W3. To enable /W4 use
45         '-DWALL=1 '
46       and 
47         '-DDISABLEWALL=1'
48       switches back to to /W3, 
49       To disable a specific warning add it to MSVC_W_DISABLE in
50       cmake/CMakeLists.txt. To make the warning an error add it
51       to MSVC_W_ERROR.
52       
53     * Memory leak detection
54       For MSVC the usage of 'Visual Leak Detection' could be enabled
55       (http://dmoulding.googlepages.com/vld): -Dvld=1
56       
57       Building vld requires the 'Debugging Tools For Windows' (~16MB)
58       http://www.microsoft.com/whdc/devtools/debugging/default.mspx
59       Eventually you have to copy dbghelp.dll from your Visual Studio
60       Common7\IDE folder into the binary directory. 
61       'vld.ini' is part of lyx.proj where you can configure vld.
62       
63       The docu for vld could be found in development/Win32/vld, or
64       http://www.codeproject.com/tools/visualleakdetector.asp
65       
66       
67 Some tips:
68
69     * the Release build links much faster 
70     * for the 'Debug' and 'Release' build all precompiled headers are enabled
71       to compile without pch (non file merge mode) This is usefull to check 
72       if all necessary headers are included.
73         * use 'MinSizeRel' which only precompiles the STL and Boost headers
74         * use 'RelWithDebInfo' which does not use any precompiled headers
75
76
77
78 GCC/Windows (Win2k only works with MSYS, XP?)
79 ----------------------------------------------
80
81     * create a build directory, e.g. .../trunk/../build
82     * call: export QMAKESPEC=win32-g++ (MSYS) or set QMAKESPEC=win32-g++ (CMD)
83     * call in the build directory 'cmake ..\trunk\development\cmake'
84
85
86
87 Building with GCC/Linux
88 ------------------------
89
90     * create a build directory, e.g. .../trunk/../build
91     * call in the build directory 'cmake ../trunk/development/cmake'
92     * compiler and linker options could be suppressd by '-Dquiet=1' 
93
94
95
96 Ubuntu packages
97 ----------------
98     You need additionally these packages:
99       * g++
100       * cmake
101       * qt4-dev-tools
102
103
104
105 Building with Xcode/Mac
106 -----------------------
107
108     * create a build directory, e.g. .../trunk/../build
109     * call in the build directory 'cmake .../trunk/development/cmake -G Xcode'
110     * open .../trunk/../build/lyx-qt4.xcodeproj
111
112
113 Some tips:
114
115     * Xcode prefers UTF8 when opening source files, though LyX usually uses
116       Latin1. To fix that select all source files in Xcode and click "Get Info"
117       in the context menu. Change the encoding to Latin1.
118     * You can run and debug LyX from Xcode. For LyX to find its resources, there
119       are two possibilities:
120         a) Put a resource directory, e.g. a link to the lib directory of the 
121            source tree, at .../trunk/../build/bin/Resources
122         b) Select the lyx-qt4 executable in Xcode, click on "Get Info" in the 
123            context menu and add "-sysdir a_valid_LyX_resource_directory" 
124            pointing e.g. to a valid Contents/Resources of a LyX.app directory.
125     * LyX on Mac doesn't look for fonts in the resource directory if the
126       executable is not in an .app bundle. Instead you have to create a
127       symbolic link to the fonts directory in the place where the executable
128       is: ln -s .../trunk/lib/fonts .../trunk/../build/bin/Debug/
129       If you don't do that math character will not show up correctly.
130     * CMake properly finds the Qt4 library bundles from Trolltech's binary
131       Qt4 package for Mac. So no need to compile Qt on your own.
132
133
134
135 Experts only:
136
137     * Faster build process: with file merging enabled compilation 
138       is up to 5 times faster: '-Dmerge=1'.
139       To force a complete regeneration of the created files use
140       '-Dmerge_rebuild=1'.
141
142     * install win32libs with the 'KDE on Windows' installer
143        http://download.cegit.de/kde-windows/installer/
144        - use the msvc packages
145        - a release version of Qt is also available by the installer
146     
147
148
149 To generate other build files call 'cmake' 
150 which shows a list of possibilities.
151
152
153 The build process tries to find aspell on Windows
154 in %ProgramFiles%/GnuWin32/ and in /usr/ or in /usr/local 
155 under Linux. If it could not find aspell, spell checking
156 will be disabled.