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