CMakeLists.txt 6.37 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1 2 3 4
project(koffice)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )

5 6 7 8 9
# define the generic version of the KOffice libraries here
# this makes it easy to advance it when the next KOffice release comes
set(GENERIC_KOFFICE_LIB_VERSION "5.0.0")
set(GENERIC_KOFFICE_LIB_SOVERSION "5")

Laurent Montel's avatar
Laurent Montel committed
10 11
# search packages used by KDE
find_package(KDE4 REQUIRED)
12
include(KDE4Defaults)
13
include(MacroLibrary)
Laurent Montel's avatar
Laurent Montel committed
14 15
find_package(Perl REQUIRED)
find_package(ZLIB REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
16
find_package(KdepimLibs REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
17
find_package(LCMS REQUIRED)
18
find_package(PNG REQUIRED)
19
find_package(Eigen)
20
macro_optional_find_package(QCA2)
Laurent Montel's avatar
Laurent Montel committed
21
macro_optional_find_package(OpenEXR)
22
macro_optional_find_package(Exif)
23
macro_optional_find_package(PythonLibs)
24
macro_optional_find_package(LibArt)
25 26
macro_optional_find_package(Freetype)
macro_optional_find_package(Fontconfig)
27
macro_log_feature(EIGEN_FOUND "Eigen" "Eigen is needed by KSpread, KSpread won't be built" "http://eigen.tuxfamily.org" TRUE "1.0.5")
28

29
macro_log_feature(QCA2_FOUND "libqca2" "QCA2 is needed to compile support for encrypted OpenDocument files" "Module into kdesupport" FALSE "2.0" "" )
Laurent Montel's avatar
Laurent Montel committed
30 31 32 33 34 35

if (APPLE)
   find_package(Carbon REQUIRED)
endif (APPLE)


36
add_definitions(-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS)
David Faure's avatar
David Faure committed
37
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS})
Laurent Montel's avatar
Laurent Montel committed
38 39 40 41 42


include (MacroAdditionalCleanFiles)
include (MacroAddFileDependencies)
include (ConfigureChecks.cmake)
43
include (TestBigEndian)
Laurent Montel's avatar
Laurent Montel committed
44

45 46
configure_file(config-prefix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-prefix.h )
configure_file(config-openexr.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-openexr.h )
Laurent Montel's avatar
Laurent Montel committed
47

48 49 50
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
configure_file(config-endian.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-endian.h )

51
# for config.h and <toplevel/foo.h> includes (if any?)
Laurent Montel's avatar
Laurent Montel committed
52
include_directories(${QDBUS_INCLUDE_DIRS}  ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
53 54

# kostore is at the bottom of stack, so it has the dependency on the kde4 includes.
55
set(KOSTORE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/store ${CMAKE_BINARY_DIR}/libs/store ${KDE4_INCLUDES})
56
# kofficecore depends on kostore
57
set(KOFFICECORE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kofficecore ${CMAKE_SOURCE_DIR}/libs/kofficecore/threadAction ${CMAKE_BINARY_DIR}/libs/kofficecore ${KOSTORE_INCLUDES})
58
# flake depends on kofficecore
59
set(FLAKE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/flake ${CMAKE_SOURCE_DIR}/libs/flake/commands ${CMAKE_BINARY_DIR}/libs/flake )
60
# kofficeui depends on kofficecore
61
set(KOFFICEUI_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kofficeui ${CMAKE_BINARY_DIR}/libs/kofficeui ${KOFFICECORE_INCLUDES} ${FLAKE_INCLUDES} )
62 63
# pigment depends on kofficecore and lcms
set(PIGMENT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/pigment ${CMAKE_SOURCE_DIR}/libs/pigment/colorspaces ${LCMS_INCLUDE_DIR} )
64
# kopageapp
65
set(KOPAGEAPP_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kopageapp ${CMAKE_SOURCE_DIR}/libs/kopageapp/commands ${CMAKE_BINARY_DIR}/libs/kopageapp )
66 67 68

# The rest must be specified independently, in addition to one of the above three
set(KWMF_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kwmf ${CMAKE_BINARY_DIR}/libs/kwmf)
69
set(KOTEXT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kotext/styles ${CMAKE_SOURCE_DIR}/libs/kotext ${CMAKE_BINARY_DIR}/libs/kotext)
70
set(KOPAINTER_INCLUDES $(CMAKE_SOURCE_DIR)/libs/kofficeui ${CMAKE_SOURCE_DIR}/libs/kopainter ${CMAKE_BINARY_DIR}/libs/kopainter ${CMAKE_SOURCE_DIR}/libs/pigment)
71
set(KFORMULA_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kformula ${CMAKE_BINARY_DIR}/libs/kformula)
72
set(KOKROSS_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kokross ${CMAKE_BINARY_DIR}/libs/kokross)
73 74
# Those are included with e.g. <koproperty/set.h>
set(KOPROPERTY_INCLUDES ${CMAKE_SOURCE_DIR}/libs ${CMAKE_BINARY_DIR}/libs)
75

Laurent Montel's avatar
Laurent Montel committed
76
set(libkdgantt_SRCS
77
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttView.cpp
Laurent Montel's avatar
Laurent Montel committed
78 79 80 81 82 83 84 85 86 87 88 89 90 91
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttViewEventItem.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttViewItem.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttViewItemDrag.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttViewSubwidgets.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttViewSummaryItem.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttViewTaskItem.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttViewTaskLink.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttViewTaskLinkGroup.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttMinimizeSplitter.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttSemiSizingControl.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttSizingControl.cpp
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttXMLTools.cpp
	)

92 93 94 95 96 97 98 99 100 101 102 103 104 105
# check if build krita there to be able to test if we can build filters/krita
set(REQUIRED_LCMS_VERSION 115)

if(LCMS_FOUND AND NOT LCMS_VERSION LESS ${REQUIRED_LCMS_VERSION})
    set(SHOULD_BUILD_KRITA TRUE)
else(LCMS_FOUND AND NOT LCMS_VERSION LESS ${REQUIRED_LCMS_VERSION})
        set(SHOULD_BUILD_KRITA FALSE)
        message(STATUS  "krita requires LittleCMS 1.15 or greater. Krita will not be built.\n"
                        "   If you want to compile Krita you should install:\n"
                        "   lcms 1.15 or newer (http://www.littlecms.com/)")
endif(LCMS_FOUND AND NOT LCMS_VERSION LESS ${REQUIRED_LCMS_VERSION})



106
add_subdirectory(libs)
107
MESSAGE(STATUS "Before koffice-2.0 disable compile of example subdir, not necessary for official release")
108
#add_subdirectory(example)
Laurent Montel's avatar
Laurent Montel committed
109
add_subdirectory(interfaces)
110 111

if(FREETYPE_FOUND AND FONTCONFIG_FOUND )
112
   set(SHOULD_BUILD_KARBON true)
113 114
endif(FREETYPE_FOUND AND FONTCONFIG_FOUND)

115 116
if(SHOULD_BUILD_KARBON)
	add_subdirectory(karbon)
David Faure's avatar
David Faure committed
117
endif(SHOULD_BUILD_KARBON)
118

119 120
if(EIGEN_FOUND)
    set(SHOULD_BUILD_KSPREAD true)
121 122 123 124 125
else(EIGEN_FOUND)
        set(SHOULD_BUILD_KSPREAD FALSE)
        message(STATUS  "KSpread requires the eigen library, KSpread will not be built.\n"
                        "   If you want to compile KSpread you should install:\n"
                        "   lib eigen http://eigen.tuxfamily.org")
126
endif(EIGEN_FOUND)
127

128 129 130 131
if(SHOULD_BUILD_KSPREAD)
    add_subdirectory(kspread)
endif(SHOULD_BUILD_KSPREAD)

132
add_subdirectory(kdgantt)
Laurent Montel's avatar
Laurent Montel committed
133
add_subdirectory(kchart)
134
#add_subdirectory(kexi)
Martin Pfeiffer's avatar
Martin Pfeiffer committed
135
add_subdirectory(kformula)
136
add_subdirectory(kivio)
137
#add_subdirectory(koshell)
138
add_subdirectory(kounavail)
139
add_subdirectory(kplato)
Laurent Montel's avatar
Laurent Montel committed
140
add_subdirectory(kpresenter)
141
add_subdirectory(krita)
Laurent Montel's avatar
Laurent Montel committed
142
add_subdirectory(kugar)
143
add_subdirectory(kword)
Laurent Montel's avatar
Laurent Montel committed
144
add_subdirectory(pics)
145
add_subdirectory(plugins)
Laurent Montel's avatar
Laurent Montel committed
146 147
add_subdirectory(servicetypes)
add_subdirectory(templates)
148 149
add_subdirectory(tools)
add_subdirectory(filters)
150
add_subdirectory(shapes)
151
add_subdirectory(doc)
Laurent Montel's avatar
Laurent Montel committed
152
add_subdirectory( cmake )
Laurent Montel's avatar
Laurent Montel committed
153
message( STATUS "Re-add kexi/koshell when ported")
Laurent Montel's avatar
Laurent Montel committed
154

155

Stefan Nikolaus's avatar
Stefan Nikolaus committed
156
ADD_CUSTOM_TARGET(apidox doc/api/gendocs.pl WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})