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