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")
19 set(USE_WINDOWS_PACKAGING 1)
21 set(USE_POSIX_PACKAGING 1)
25 #set(GROUP_CODE "The Golden Code")
31 include(ProjectSourceGroup)
34 set(CMAKE_BUILD_TYPE Release)
40 project(lyx-${qt_postfix})
41 find_package(Qt4 REQUIRED)
43 find_package(ZLIB REQUIRED)
44 find_package(ICONV REQUIRED)
45 add_definitions(-DHAVE_ICONV=1)
48 set(aspell TRUE CACHE TYPE STRING)
49 find_package(ASPELL REQUIRED)
57 set(nls TRUE CACHE TYPE STRING)
58 add_definitions(-DENABLE_NLS=1)
59 message("----- Building with ENABLE_NLS")
61 message("----- No nls, to enable use -Dnls=1")
65 add_definitions(-DUSE_ASPELL=1)
66 message("----- Building with USE_ASPELL")
68 message("----- No aspell, to get more information use -Daspell=1")
74 include(ConfigureChecks.cmake)
75 configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
80 add_definitions(-DBOOST_USER_CONFIG=<\;config.h>\;)
82 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
83 SET(CMAKE_EXE_LINKER_FLAGS /MANIFEST)
86 ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
89 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
92 if(MSVC AND NOT disable-pch)
93 configure_file(${CMAKE_SOURCE_DIR}/pcheaders.h ${CMAKE_BINARY_DIR}/pcheaders.h)
94 configure_file(${CMAKE_SOURCE_DIR}/config.C.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_pch.C)
95 macro(lyx_add_msvc_pch name_)
96 SET_SOURCE_FILES_PROPERTIES(${${name_}_sources} PROPERTIES COMPILE_FLAGS "/Yuconfig.h /Fp\$(IntDir)/config.pch")
97 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/config_pch.C PROPERTIES COMPILE_FLAGS "/Ycconfig.h /Fp\$(IntDir)/config.pch")
98 add_definitions(/DLYX_PRECOMPILED_HEADERS)
99 set(${name_}_sources ${${name_}_sources} ${CMAKE_BINARY_DIR}/config_pch.C ${CMAKE_BINARY_DIR}/pcheaders.h)
100 endmacro(lyx_add_msvc_pch)
101 else(MSVC AND NOT disable-pch)
102 set(disable-pch TRUE CACHE TYPE STRING)
103 macro(lyx_add_msvc_pch)
104 endmacro(lyx_add_msvc_pch)
105 endif(MSVC AND NOT disable-pch)
108 #TODO: insource is not the best place
109 configure_file(${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py.in
110 ${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py)
119 add_subdirectory(boost)
120 add_subdirectory(intl)
121 add_subdirectory(src)