]> git.lyx.org Git - lyx.git/blob - development/cmake/CMakeLists.txt
correct filenames
[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 if(NOT GROUP_CODE)
11         #set(GROUP_CODE "The Golden Code")
12         set(GROUP_CODE flat)
13 endif(NOT GROUP_CODE)
14
15 include(LyXPaths)
16 include(LyXMacros)
17 include(ProjectSourceGroup)
18
19 if(release)
20         set(CMAKE_BUILD_TYPE Release)
21         set(release)
22 endif(release)  
23
24
25 if(qt3)
26         set(qt_postfix qt3)
27         project(lyx-${qt_postfix})
28         set(QT_MT_REQUIRED TRUE)
29         find_package(Qt3 REQUIRED)
30         set(qt3)
31         set(build_qt3_frontend TRUE)
32         if(QT_FOUND)
33                 message("-- Found Qt3: ${QT_QT_LIBRARY}")
34         else(QT_FOUND)
35                  MESSAGE( FATAL_ERROR "Qt3 not found")
36         endif(QT_FOUND)
37 else(qt3)
38         set(qt_postfix qt4)
39         project(lyx-${qt_postfix})
40         find_package(Qt4 REQUIRED)
41         
42 endif(qt3)      
43
44 find_package(ZLIB REQUIRED)
45 find_package(ICONV REQUIRED)
46 add_definitions(-DHAVE_ICONV=1)
47
48 if(all OR aspell)
49         find_package(ASPELL REQUIRED)
50 else(all OR aspell)
51         find_package(ASPELL)
52 endif(all OR aspell)
53 set(aspell)
54
55 message("")
56 if(nls OR all)
57         add_definitions(-DENABLE_NLS=1)
58         message("----- Building with ENABLE_NLS")
59 else(nls OR all)        
60         message("----- No nls, to enable use -Dnls=1")
61 endif(nls OR all)
62 set(nls)
63 if(ASPELL_FOUND)
64         add_definitions(-DUSE_ASPELL=1)
65         message("----- Building with USE_ASPELL")
66 else(ASPELL_FOUND)      
67         message("----- No aspell, to get more information use -Daspell=1")
68 endif(ASPELL_FOUND)
69 message("")
70 set(all)
71
72 # create config.h
73 include(ConfigureChecks.cmake)
74 configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
75
76
77 if(MSVC)
78         if(MSVC_IDE)
79                 add_definitions(-DBOOST_USER_CONFIG=&lt\;config.h&gt\;)
80         else(MSVC_IDE)
81                 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
82                 SET(CMAKE_EXE_LINKER_FLAGS /MANIFEST)
83         endif(MSVC_IDE)
84
85         SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Zi -wd4996 -wd4800" CACHE STRING "runtime-library flags" FORCE)
86         SET(CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAGS_RELEASE} -wd4996 -wd4800" CACHE STRING "runtime-library flags" FORCE)
87         SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
88         SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
89 else(MSVC)
90         add_definitions(-DBOOST_USER_CONFIG="<config.h>")
91 endif(MSVC)
92
93      
94 include_directories( 
95         ${CMAKE_BINARY_DIR} 
96         ${TOP_SRC_DIR}/src 
97         ${TOP_SRC_DIR}/boost 
98         ${QT_INCLUDES} 
99 )
100
101 add_subdirectory(boost)
102 add_subdirectory(intl)
103 add_subdirectory(src)