]> git.lyx.org Git - lyx.git/blob - development/cmake/CMakeLists.txt
remove qt3 frontend
[lyx.git] / development / cmake / CMakeLists.txt
1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
3 #
4 # Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net>
5 #
6
7 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
8 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
9
10 set (EXECUTABLE_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/bin)
11
12 set(PACKAGE lyx)
13 set(PACKAGE_VERSION 1.5.0svn)
14 set(LYX_DATE "not released yet")
15 #TODO
16 set(VERSION_INFO "CMake Build")
17
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)
22
23 if(WIN32)
24         set(USE_WINDOWS_PACKAGING 1)
25 else(WIN32)
26         set(USE_POSIX_PACKAGING 1)
27 endif(WIN32)
28
29 if(NOT GROUP_CODE)
30         #set(GROUP_CODE "The Golden Code")
31         set(GROUP_CODE flat)
32 endif(NOT GROUP_CODE)
33
34 include(LyXPaths)
35 include(LyXMacros)
36 include(ProjectSourceGroup)
37
38 if(release)
39         set(CMAKE_BUILD_TYPE Release)
40         set(release)
41 endif(release)  
42
43
44 set(qt_postfix qt4)
45 project(lyx-${qt_postfix})
46 find_package(Qt4 REQUIRED)
47
48 find_package(ZLIB REQUIRED)
49 find_package(ICONV REQUIRED)
50 add_definitions(-DHAVE_ICONV=1)
51
52 if(all OR aspell)
53         set(aspell TRUE CACHE TYPE STRING)
54         find_package(ASPELL REQUIRED)
55 else(all OR aspell)
56         find_package(ASPELL)
57 endif(all OR aspell)
58 set(aspell)
59
60 message("")
61 if(nls OR all)
62         set(nls TRUE CACHE TYPE STRING)
63         add_definitions(-DENABLE_NLS=1)
64         message("----- Building with ENABLE_NLS")
65 else(nls OR all)        
66         message("----- No nls, to enable use -Dnls=1")
67 endif(nls OR all)
68 set(nls)
69 if(ASPELL_FOUND)
70         add_definitions(-DUSE_ASPELL=1)
71         message("----- Building with USE_ASPELL")
72 else(ASPELL_FOUND)      
73         message("----- No aspell, to get more information use -Daspell=1")
74 endif(ASPELL_FOUND)
75 message("")
76 set(all)
77
78 # create config.h
79 include(ConfigureChecks.cmake)
80 configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
81
82
83 if(MSVC)
84         if(MSVC_IDE)
85                 add_definitions(-DBOOST_USER_CONFIG=&lt\;config.h&gt\;)
86         else(MSVC_IDE)
87                 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
88                 SET(CMAKE_EXE_LINKER_FLAGS /MANIFEST)
89         endif(MSVC_IDE)
90
91         SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Zi -wd4996 -wd4800" CACHE STRING "runtime-library flags" FORCE)
92         SET(CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAGS_RELEASE} -wd4996 -wd4800" CACHE STRING "runtime-library flags" FORCE)
93         SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
94         SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
95 else(MSVC)
96         add_definitions(-DBOOST_USER_CONFIG="<config.h>")
97 endif(MSVC)
98
99
100 #TODO: insource is not the best place
101 configure_file(${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py.in 
102                ${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py)
103      
104 include_directories( 
105         ${CMAKE_BINARY_DIR} 
106         ${TOP_SRC_DIR}/src 
107         ${TOP_SRC_DIR}/boost 
108         ${QT_INCLUDES} 
109 )
110
111 add_subdirectory(boost)
112 add_subdirectory(intl)
113 add_subdirectory(src)