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

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

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


33
add_definitions(-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS)
34
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} -DHAVE_CONFIG_H=1)
Laurent Montel's avatar
Laurent Montel committed
35 36 37 38 39


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

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

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

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

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

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

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

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



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

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

112 113 114 115
if(SHOULD_BUILD_KARBON)
	add_subdirectory(karbon)
endif(SHOULD_BUILD_KARBON)	

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

141

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