]> git.lyx.org Git - features.git/blob - development/cmake/README.cmake
284758b0be6b000f5acc44217e73b8876af07434
[features.git] / development / cmake / README.cmake
1 Building LyX with CMake
2
3 For all builds:
4 - CMake 2.4 or CVS version from www.cmake.org
5 - install Qt 4 and make sure qmake 4 is found
6   (add the folder with qmake to the environment variable PATH)
7 - by default it builds the Qt4 frontend
8 - with GNUWIN32_DIR you could point to your gnuwin32 packages
9   (eg. -DGNUWIN32_DIR=c:\gnuwin32) by default it searches in your 
10   program  folder
11
12 Building Visual C++ 2005 project files:
13 - install Visual C++ 2005
14 - install Platform SDK 2005, "Core" and "Web Workshop"
15 - add include and library paths of the SDK to the IDE search paths,
16   menu: Tools->Options->VC++ directories->Library files + Include files
17 - install zlib (www.zlib.net) into %ProgramFiles%/GnuWin32/include+lib
18   or %ProgramFiles%/zlib/include+lib
19 - create a build directory, e.g. .../trunk/../build
20 - call in the build directory 'cmake ..\trunk\development\cmake'
21 - start lyx.sln
22 - Warnings:
23         The default warning level of the msvc cmake builds is now /W4.
24         The cmake option 
25                 -DDISABLEWALL=1 
26         switches to /W3, 
27                 -DWALL=1 
28         re enables /W4.
29         To disable a specific warning add it to MSVC_W_DISABLE of
30         cmake/CMakeLists.txt. To make the warning an error add it
31         to MSVC_W_ERROR of the same file.
32
33 TIPS: - rename Microsoft Visual Studio 8\VC\vcpackages\feacp.dll 
34         to disable Intellisense
35       - the Release build links much faster
36       - for the 'Debug' and 'Release' build all precompiled headers are enabled
37         to compile without pch (to check if all necessary headers are included)
38           * use 'MinSizeRel' which only precompiles the STL and Boost headers
39           * use 'RelWithDebInfo' which does not use any precompiled headers
40
41
42 Building with GCC/Linux:
43 - create a build directory, e.g. .../trunk/../build
44 - call in the build directory 'cmake ..\trunk\development\cmake'
45
46 Building with GCC/Windows (Win2k only works with MSYS, XP?):
47 - install zlib (www.zlib.net) into %ProgramFiles%/GnuWin32/include+lib
48 - create a build directory, e.g. .../trunk/../build
49 - call: export QMAKESPEC=win32-g++ (MSYS) or set QMAKESPEC=win32-g++ (CMD)
50 - call in the build directory 'cmake ..\trunk\development\cmake'
51
52 Building with Xcode/Mac:
53 - create a build directory, e.g. .../trunk/../build
54 - call in the build directory 'cmake .../trunk/development/cmake -G Xcode'
55 - open .../trunk/../build/lyx-qt4.xcodeproj
56
57 TIPS: - Xcode prefers UTF8 when opening source files, though LyX usually uses
58         Latin1. To fix that select all source files in Xcode and click "Get Info"
59         in the context menu. Change the encoding to Latin1.
60       - You can run and debug LyX from Xcode. For LyX to find its resources, there
61         are two possibilities:
62         a) Put a resource directory, e.g. a link to the lib directory of the 
63            source tree, at .../trunk/../build/bin/Resources
64         b) Select the lyx-qt4 executable in Xcode, click on "Get Info" in the 
65            context menu and add "-sysdir a_valid_LyX_resource_directory" 
66            pointing e.g. to a valid Contents/Resources of a LyX.app directory.
67       - LyX on Mac doesn't look for fonts in the resource directory if the
68         executable is not in an .app bundle. Instead you have to create a
69         symbolic link to the fonts directory in the place where the executable
70         is: ln -s .../trunk/lib/fonts .../trunk/../build/bin/Debug/
71         If you don't do that math character will not show up correctly.
72       - CMake properly finds the Qt4 library bundles from Trolltech's binary
73         Qt4 package for Mac. So no need to compile Qt on your own.
74
75
76 To generate other build files call 'cmake'
77 which shows a list of possibilities.
78
79
80 The build process tries to find aspell on Windows
81 in %ProgramFiles%/GnuWin32/ and in /usr/ or in /usr/local 
82 under Linux. If it is not found the support is disabled.