CMakeLists.txt 5.79 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
macro_optional_find_package(QCA2)
Laurent Montel's avatar
Laurent Montel committed
20
macro_optional_find_package(OpenEXR)
21
macro_optional_find_package(Exif)
22
macro_optional_find_package(PythonLibs)
23
macro_optional_find_package(LibArt)
24 25 26
macro_optional_find_package(Freetype)
macro_optional_find_package(Fontconfig)

27
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
28 29 30 31 32 33

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


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


include (MacroAdditionalCleanFiles)
include (MacroAddFileDependencies)
include (ConfigureChecks.cmake)
41
include (TestBigEndian)
Laurent Montel's avatar
Laurent Montel committed
42

43 44
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
45

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

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

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

# 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)
67
set(KOTEXT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kotext/styles ${CMAKE_SOURCE_DIR}/libs/kotext ${CMAKE_BINARY_DIR}/libs/kotext)
68
set(KOPAINTER_INCLUDES $(CMAKE_SOURCE_DIR)/libs/kofficeui ${CMAKE_SOURCE_DIR}/libs/kopainter ${CMAKE_BINARY_DIR}/libs/kopainter ${CMAKE_SOURCE_DIR}/libs/pigment)
69
set(KFORMULA_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kformula ${CMAKE_BINARY_DIR}/libs/kformula)
70
set(KOKROSS_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kokross ${CMAKE_BINARY_DIR}/libs/kokross)
71 72
# Those are included with e.g. <koproperty/set.h>
set(KOPROPERTY_INCLUDES ${CMAKE_SOURCE_DIR}/libs ${CMAKE_BINARY_DIR}/libs)
73

Laurent Montel's avatar
Laurent Montel committed
74
set(libkdgantt_SRCS
75
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttView.cpp
Laurent Montel's avatar
Laurent Montel committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89
	${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
	)

90 91 92 93 94 95 96 97 98 99 100 101 102 103
# 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})



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

if(FREETYPE_FOUND AND FONTCONFIG_FOUND )
110
   set(SHOULD_BUILD_KARBON true)
111 112
endif(FREETYPE_FOUND AND FONTCONFIG_FOUND)

113 114
if(SHOULD_BUILD_KARBON)
	add_subdirectory(karbon)
David Faure's avatar
David Faure committed
115
endif(SHOULD_BUILD_KARBON)
116

117
add_subdirectory(kdgantt)
Laurent Montel's avatar
Laurent Montel committed
118
add_subdirectory(kchart)
119
#add_subdirectory(kexi)
Martin Pfeiffer's avatar
Martin Pfeiffer committed
120
add_subdirectory(kformula)
121
add_subdirectory(kivio)
122
#add_subdirectory(koshell)
123
add_subdirectory(kounavail)
124
add_subdirectory(kplato)
Laurent Montel's avatar
Laurent Montel committed
125
add_subdirectory(kpresenter)
126
add_subdirectory(krita)
Laurent Montel's avatar
Laurent Montel committed
127
add_subdirectory(kspread)
Laurent Montel's avatar
Laurent Montel committed
128
add_subdirectory(kugar)
129
add_subdirectory(kword)
Laurent Montel's avatar
Laurent Montel committed
130
add_subdirectory(pics)
131
add_subdirectory(plugins)
Laurent Montel's avatar
Laurent Montel committed
132 133
add_subdirectory(servicetypes)
add_subdirectory(templates)
134 135
add_subdirectory(tools)
add_subdirectory(filters)
136
add_subdirectory(shapes)
137 138
add_subdirectory(autocorrect)
add_subdirectory(doc)
Laurent Montel's avatar
Laurent Montel committed
139
add_subdirectory( cmake )
Laurent Montel's avatar
Laurent Montel committed
140
message( STATUS "Re-add kexi/koshell when ported")
Laurent Montel's avatar
Laurent Montel committed
141

142

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