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