remove lengthcommon.cpp and use it as a link from the upper dir
[lyx.git] / INSTALL.cmake
blobe96e79276281a875e6a922713917669694c3a20a
1 =========================
2 Building LyX with CMake
3 =========================
5 July, 2007
9 All systems
10 ===========
12     * CMake 2.4 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       
16     * Faster build process: with file merging enabled compilation 
17       is up to 5 times faster: '-Dmerge=1'.
18       To force a complete regeneration of the created files use
19       '-Dmerge_rebuild=1'.
23 Windows only
24 =============
26     Install the windows supplementary modules
27      * as described in INSTALL.scons
28      * install win32libs with the 'KDE on Windows' installer
29        http://download.cegit.de/kde-windows/installer/
30        (there are also Qt packages for msvc and mingw)
31     
32     If cmake couldn't find these modules set GNUWIN32_DIR, eg. 
33     -DGNUWIN32_DIR=c:\gnuwin32. By default cmake searches in your 
34     program folder
37 Building Visual C++ 2005 project files
38 --------------------------------------
40     * install Visual C++ 2005
41     * install Platform SDK 2005, "Core" and "Web Workshop"
42     * add include and library paths of the SDK to the IDE search paths.
43       Menu entry: Tools->Options->'VC++ directories'->'Library files' and 'Include files'
44     * create a build directory, e.g. ..\trunk\..\build
45     * call in the build directory 'cmake ..\trunk\development\cmake'
46     * start lyx.sln
47     
48     * Warnings: The default warning level of the msvc cmake builds 
49       is /W3. To enable /W4 use
50         '-DWALL=1 '
51       and 
52         '-DDISABLEWALL=1'
53       switches back to to /W3, 
54       To disable a specific warning add it to MSVC_W_DISABLE in
55       cmake/CMakeLists.txt. To make the warning an error add it
56       to MSVC_W_ERROR.
57       
58     * Memory leak detection
59       For MSVC the usage of 'Visual Leak Detection' could be enabled
60       (http://dmoulding.googlepages.com/vld): -Dvld=1
61       
62       Building vld requires the 'Debugging Tools For Windows' (~16MB)
63       http://www.microsoft.com/whdc/devtools/debugging/default.mspx
64       Eventually you have to copy dbghelp.dll from your Visual Studio
65       Common7\IDE folder into the binary directory. 
66       'vld.ini' is part of lyx.proj where you can configure vld.
67       
68       The docu for vld could be found in development/Win32/vld, or
69       http://www.codeproject.com/tools/visualleakdetector.asp
70       
71       
72 Some tips:
74     * rename Microsoft Visual Studio 8\VC\vcpackages\feacp.dll 
75       to disable Intellisense
76     * the Release build links much faster 
77     * for the 'Debug' and 'Release' build all precompiled headers are enabled
78       to compile without pch (non file merge mode) This is usefull to check 
79       if all necessary headers are included.
80         * use 'MinSizeRel' which only precompiles the STL and Boost headers
81         * use 'RelWithDebInfo' which does not use any precompiled headers
85 GCC/Windows (Win2k only works with MSYS, XP?)
86 ----------------------------------------------
88     * create a build directory, e.g. .../trunk/../build
89     * call: export QMAKESPEC=win32-g++ (MSYS) or set QMAKESPEC=win32-g++ (CMD)
90     * call in the build directory 'cmake ..\trunk\development\cmake'
94 Building with GCC/Linux
95 ------------------------
97     * create a build directory, e.g. .../trunk/../build
98     * call in the build directory 'cmake ../trunk/development/cmake'
99     * compiler and linker options could be suppressd by '-Dquiet=1' 
103 Building with Xcode/Mac
104 -----------------------
106     * create a build directory, e.g. .../trunk/../build
107     * call in the build directory 'cmake .../trunk/development/cmake -G Xcode'
108     * open .../trunk/../build/lyx-qt4.xcodeproj
111 Some tips:
113     * Xcode prefers UTF8 when opening source files, though LyX usually uses
114       Latin1. To fix that select all source files in Xcode and click "Get Info"
115       in the context menu. Change the encoding to Latin1.
116     * You can run and debug LyX from Xcode. For LyX to find its resources, there
117       are two possibilities:
118         a) Put a resource directory, e.g. a link to the lib directory of the 
119            source tree, at .../trunk/../build/bin/Resources
120         b) Select the lyx-qt4 executable in Xcode, click on "Get Info" in the 
121            context menu and add "-sysdir a_valid_LyX_resource_directory" 
122            pointing e.g. to a valid Contents/Resources of a LyX.app directory.
123     * LyX on Mac doesn't look for fonts in the resource directory if the
124       executable is not in an .app bundle. Instead you have to create a
125       symbolic link to the fonts directory in the place where the executable
126       is: ln -s .../trunk/lib/fonts .../trunk/../build/bin/Debug/
127       If you don't do that math character will not show up correctly.
128     * CMake properly finds the Qt4 library bundles from Trolltech's binary
129       Qt4 package for Mac. So no need to compile Qt on your own.
134 To generate other build files call 'cmake' 
135 which shows a list of possibilities.
138 The build process tries to find aspell on Windows
139 in %ProgramFiles%/GnuWin32/ and in /usr/ or in /usr/local 
140 under Linux. If it could not find aspell, spell checking
141 will be disabled.