1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
4 # Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net>
7 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
8 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
10 set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
13 set(PACKAGE_VERSION 1.5.0svn)
14 set(LYX_DATE "not released yet")
16 set(VERSION_INFO "CMake Build")
18 #TODO: add command line option
19 # enable by default because the cmake
20 # build is mostly used for development
21 set(ENABLE_ASSERTIONS 1)
24 set(USE_WINDOWS_PACKAGING 1)
26 set(USE_POSIX_PACKAGING 1)
30 #set(GROUP_CODE "The Golden Code")
36 include(ProjectSourceGroup)
39 set(CMAKE_BUILD_TYPE Release)
45 project(lyx-${qt_postfix})
46 find_package(Qt4 REQUIRED)
48 find_package(ZLIB REQUIRED)
49 find_package(ICONV REQUIRED)
50 add_definitions(-DHAVE_ICONV=1)
53 set(aspell TRUE CACHE TYPE STRING)
54 find_package(ASPELL REQUIRED)
62 set(nls TRUE CACHE TYPE STRING)
63 add_definitions(-DENABLE_NLS=1)
64 message("----- Building with ENABLE_NLS")
66 message("----- No nls, to enable use -Dnls=1")
70 add_definitions(-DUSE_ASPELL=1)
71 message("----- Building with USE_ASPELL")
73 message("----- No aspell, to get more information use -Daspell=1")
79 include(ConfigureChecks.cmake)
80 configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
85 add_definitions(-DBOOST_USER_CONFIG=<\;config.h>\;)
87 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
88 SET(CMAKE_EXE_LINKER_FLAGS /MANIFEST)
91 ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
94 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
97 if(MSVC AND NOT disable-pch)
98 configure_file(${CMAKE_SOURCE_DIR}/pcheaders.h ${CMAKE_BINARY_DIR}/pcheaders.h)
99 configure_file(${CMAKE_SOURCE_DIR}/config.C.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_pch.C)
100 macro(lyx_add_msvc_pch name_)
101 SET_SOURCE_FILES_PROPERTIES(${${name_}_sources} PROPERTIES COMPILE_FLAGS "/Yuconfig.h /Fp\$(IntDir)/config.pch")
102 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/config_pch.C PROPERTIES COMPILE_FLAGS "/Ycconfig.h /Fp\$(IntDir)/config.pch")
103 add_definitions(/DLYX_PRECOMPILED_HEADERS)
104 set(${name_}_sources ${${name_}_sources} ${CMAKE_BINARY_DIR}/config_pch.C ${CMAKE_BINARY_DIR}/pcheaders.h)
105 endmacro(lyx_add_msvc_pch)
106 else(MSVC AND NOT disable-pch)
107 set(disable-pch TRUE CACHE TYPE STRING)
108 macro(lyx_add_msvc_pch)
109 endmacro(lyx_add_msvc_pch)
110 endif(MSVC AND NOT disable-pch)
113 #TODO: insource is not the best place
114 configure_file(${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py.in
115 ${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py)
124 add_subdirectory(boost)
125 add_subdirectory(intl)
126 add_subdirectory(src)