]> git.lyx.org Git - lyx.git/blob - development/cmake/CMakeLists.txt
check for ICONV_CONST
[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 Release)
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 find_package(ICONV REQUIRED)
34 add_definitions(-DHAVE_ICONV=1)
35
36 if(all OR aspell)
37         find_package(ASPELL REQUIRED)
38 else(all OR aspell)
39         find_package(ASPELL)
40 endif(all OR aspell)
41 set(aspell)
42
43 message("")
44 if(nls OR all)
45         add_definitions(-DENABLE_NLS=1)
46         message("----- Building with ENABLE_NLS")
47 else(nls OR all)        
48         message("----- No nls, to enable use -Dnls=1")
49 endif(nls OR all)
50 set(nls)
51 if(ASPELL_FOUND)
52         add_definitions(-DUSE_ASPELL=1)
53         message("----- Building with USE_ASPELL")
54 else(ASPELL_FOUND)      
55         message("----- No aspell, to get more information use -Daspell=1")
56 endif(ASPELL_FOUND)
57 message("")
58 set(all)
59
60 # create config.h
61 include(ConfigureChecks.cmake)
62 configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
63
64
65 if(MSVC)
66         if(MSVC_IDE)
67                 add_definitions(-DBOOST_USER_CONFIG=&lt\;config.h&gt\;)
68         else(MSVC_IDE)
69                 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
70                 SET(CMAKE_EXE_LINKER_FLAGS /MANIFEST)
71         endif(MSVC_IDE)
72
73         SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Zi -wd4996 -wd4800" CACHE STRING "runtime-library flags" FORCE)
74         SET(CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAGS_RELEASE} -wd4996 -wd4800" CACHE STRING "runtime-library flags" FORCE)
75         SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
76         SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
77 else(MSVC)
78         add_definitions(-DBOOST_USER_CONFIG="<config.h>")
79 endif(MSVC)
80
81      
82 include_directories( 
83         ${CMAKE_BINARY_DIR} 
84         ${TOP_SRC_DIR}/src 
85         ${TOP_SRC_DIR}/boost 
86         ${QT_INCLUDES} 
87 )
88
89 add_subdirectory(boost)
90 add_subdirectory(intl)
91 add_subdirectory(src)