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