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>")
98 set(pch TRUE CACHE TYPE STRING)
100 macro(lyx_add_msvc_pch _sources)
101 SET_SOURCE_FILES_PROPERTIES(${${_sources}} PROPERTIES COMPILE_FLAGS
102 "/Yuconfig.h /Fp${CMAKE_BINARY_DIR}/config.pch /Fd${CMAKE_BINARY_DIR}/pchlib.pdb")
103 add_definitions(-DLYX_PRECOMPILED_HEADERS)
104 endmacro(lyx_add_msvc_pch)
106 configure_file(config.C.cmake ${CMAKE_BINARY_DIR}/config.C)
107 configure_file(pcheaders.h ${CMAKE_BINARY_DIR}/pcheaders.h)
108 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/config.C PROPERTIES COMPILE_FLAGS
109 "/Ycconfig.h /Fp${CMAKE_BINARY_DIR}/config.pch /Fd${CMAKE_BINARY_DIR}/pchlib.pdb -DLYX_PRECOMPILED_HEADERS")
111 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${TOP_SRC_DIR}/src/support ${ICONV_INCLUDE_DIR})
112 add_library(pchlib STATIC ${CMAKE_BINARY_DIR}/config.C ${CMAKE_BINARY_DIR}/pcheaders.h)
114 set(pchlibname pchlib )
115 set(PRECOMPILED_HEADERS TRUE)
117 macro(lyx_add_msvc_pch)
118 endmacro(lyx_add_msvc_pch)
119 set(pchlibname boost_signals) # dummy
123 #TODO: insource is not the best place
124 configure_file(${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py.in
125 ${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py)
134 add_subdirectory(boost)
135 add_subdirectory(intl)
136 add_subdirectory(src)