1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
4 # Copyright (c) 2006, Peter Kümmel, <syntheticpp@gmx.net>
7 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
8 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
10 set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
13 set(PACKAGE_VERSION 1.5.0svn)
14 set(LYX_DATE "not released yet")
16 set(VERSION_INFO "CMake Build")
18 #TODO: add command line option
19 # enable by default because the cmake
20 # build is mostly used for development
21 set(ENABLE_ASSERTIONS 1)
24 set(USE_WINDOWS_PACKAGING 1)
26 set(USE_POSIX_PACKAGING 1)
30 #set(GROUP_CODE "The Golden Code")
36 include(ProjectSourceGroup)
39 set(CMAKE_BUILD_TYPE Release)
46 project(lyx-${qt_postfix})
47 set(QT_MT_REQUIRED TRUE)
48 find_package(Qt3 REQUIRED)
50 set(build_qt3_frontend TRUE)
52 message("-- Found Qt3: ${QT_QT_LIBRARY}")
54 MESSAGE( FATAL_ERROR "Qt3 not found")
58 project(lyx-${qt_postfix})
59 find_package(Qt4 REQUIRED)
62 find_package(ZLIB REQUIRED)
63 find_package(ICONV REQUIRED)
64 add_definitions(-DHAVE_ICONV=1)
67 set(aspell TRUE CACHE TYPE STRING)
68 find_package(ASPELL REQUIRED)
76 set(nls TRUE CACHE TYPE STRING)
77 add_definitions(-DENABLE_NLS=1)
78 message("----- Building with ENABLE_NLS")
80 message("----- No nls, to enable use -Dnls=1")
84 add_definitions(-DUSE_ASPELL=1)
85 message("----- Building with USE_ASPELL")
87 message("----- No aspell, to get more information use -Daspell=1")
93 include(ConfigureChecks.cmake)
94 configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
99 add_definitions(-DBOOST_USER_CONFIG=<\;config.h>\;)
101 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
102 SET(CMAKE_EXE_LINKER_FLAGS /MANIFEST)
105 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Zi -wd4996 -wd4800" CACHE STRING "runtime-library flags" FORCE)
106 SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -wd4996 -wd4800" CACHE STRING "runtime-library flags" FORCE)
107 SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
108 SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
110 add_definitions(-DBOOST_USER_CONFIG="<config.h>")
114 #TODO: insource is not the best place
115 configure_file(${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py.in
116 ${TOP_SRC_DIR}/lib/lyx2lyx/lyx2lyx_version.py)
125 add_subdirectory(boost)
126 add_subdirectory(intl)
127 add_subdirectory(src)