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