+
+Generating build system files
+------------------------------
+
+ CMake is a build system file generator. On all systems it could
+ generate files for several build systems, for instance Makefiles
+ for make, project files for Visual Studio, Xcode, Eclipse.
+
+ Running cmake without any argument lists all supported build
+ systems on your system. Passing one of them as -G"<build system name>"
+ argument when running cmake selects this.
+
+
+
+Building out-of-source
+-----------------------
+
+ The standard way of using CMake is to build in a folder that doesn't reside
+ in the source tree. This has the advantage that a complete fresh build could
+ be done by simply deleting all files in the build folder and re-running cmake
+ again.
+
+ Another benefit of out-of-source builds is that several builds (debug, release,
+ command-line builds, IDE project files) could all use the same source tree.
+
+ Therefore when using CMake create a folder outside of the source tree and
+ select this folder when using CMake's GUI, cmake-gui, or go into this folder
+ when you call cmake from the shell.
+
+ Before performing an out-of-source build, ensure that all CMake generated
+ in-source build information is removed from the source directory,
+ e.g., CMakeFiles directory, CMakeCache.txt.
+
+
+
+Using cmake
+------------
+
+ When calling cmake you must pass the path to the source tree (absolute or relative)
+ and optionally the generator (each system has its own default). Additional arguments
+ could be passed with the -D prefix.
+
+ Here some examples, assuming the build folder is in the same folder as the source tree:
+
+ * Makefiles on Linux
+ cmake ../trunk
+
+ * Project files for QtCreator:
+ Open the trunk/CMakeLists.txt file and select the build folder
+ or create the files in the command line using the -G"CodeBlocks *" option, eg
+ cmake ../trunk -G"CodeBlocks - Unix Makefiles"
+
+ * Project files for Xcode
+ cmake ../trunk -GXcode
+
+ * Project files for Visual Studio 10
+ cmake ..\trunk -G"Visual Studio 10"
+
+ * NMake files for Visual Studio
+ cmake ..\trunk -G"NMake Makefiles"
+
+ * Makefiles for MinGW
+ cmake ..\trunk -G"MinGW Makefiles"
+
+
+ Daily work:
+
+ * Re-running cmake is simple
+ cmake .
+
+ * Adding new files
+ The cmake build system scans the directories, so no need to update any file,
+ just re-run cmake. Also the mocing rules are generated.
+
+ * Unused source code file
+ Because cmake scans the directories for *.cpp and *.h files it will also
+ add files to the build system that are not mentioned to build. To exclude
+ them change their ending and re-run cmake.
+
+
+
+
+Build options
+--------------
+
+ Options could be passed by the -D prefix when running cmake.
+ Available options will be listed on each cmake run.
+ -Dhelp=1 lists all available options:
+
+ # Available on all systems/compilers
+ -- LYX_CPACK = OFF : Use the CPack management (Implies LYX_INSTALL option)
+ -- LYX_INSTALL = OFF : Build install projects/rules (implies a bunch of other options)
+ -- LYX_NLS = ON : Use nls
+ -- LYX_ASPELL = OFF : Require aspell
+ -- LYX_ENCHANT = OFF : Require Enchant
+ -- LYX_HUNSPELL = OFF : Require Hunspell
+ -- LYX_RELEASE = OFF : Build release version, build debug when disabled
+ -- LYX_PACKAGE_SUFFIX = ON : Use version suffix for packaging
+ -- LYX_PCH = OFF : Use precompiled headers
+ -- LYX_MERGE_FILES = OFF : Merge source files into one compilation unit
+ -- LYX_MERGE_REBUILD = OFF : Rebuild generated files from merged files build
+ -- LYX_QUIET = OFF : Don't generate verbose makefiles
+ -- LYX_INSTALL_PREFIX = OFF : Install path for LyX
+
+ # GCC specific
+ -- LYX_PROFILE = OFF : Build profile version
+ -- LYX_EXTERNAL_BOOST = OFF : Use external boost
+ -- LYX_PROGRAM_SUFFIX = ON : Append version suffix to binaries
+ -- LYX_DEBUG_GLIBC = OFF : Enable libstdc++ debug mode
+ -- LYX_DEBUG_GLIBC_PEDANTIC = OFF : Enable libstdc++ pedantic debug mode
+ -- LYX_STDLIB_DEBUG = OFF : Use debug stdlib
+
+ # MSVC specific
+ -- LYX_CONSOLE = ON : Show console on Windows
+ -- LYX_VLD = OFF : Use VLD with MSVC
+ -- LYX_WALL = OFF : Enable all warnings
+ -- LYX_DEPENDENCIES_DOWNLOAD= OFF : Download precompiled 3rd party libraries for MSVC 10
+
+
+
+Using the merged files build
+-----------------------------
+
+ When the option 'LYX_MERGE_FILES' is used then for each library a file
+ is generated that includes all source files of this library, this speeds
+ up compilation by a factor of about 5.
+
+ When you heavily work on one file you could comment out the relevant
+ define in the '_allinone_const.C' file, so only the file _allinone_touched.C'
+ will be re-compiled again and again.
+
+
+ - Adding new files
+ When you add new files the merging files have to be rebuilt:
+ cmake -DLYX_MERGE_REBUILD=1 .
+ Or start over by completely cleaning the build folder.
+
+ - Starting over with the same configuration
+ Delete all files except CMakeCache.txt and call
+ cmake .
+
+
+
+Visual Studio C++
+------------------
+