CMakeLists.txt 5.71 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 40
link_directories(${KDE4_LIB_DIR})


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

Laurent Montel's avatar
Laurent Montel committed
42
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
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
# for config.h and <toplevel/foo.h> includes (if any?)
Laurent Montel's avatar
Laurent Montel committed
47
include_directories(${QDBUS_INCLUDE_DIRS}  ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
48 49

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

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

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

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



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

if(FREETYPE_FOUND AND FONTCONFIG_FOUND )
107
   set(SHOULD_BUILD_KARBON true)
108 109
endif(FREETYPE_FOUND AND FONTCONFIG_FOUND)

110 111 112 113
if(SHOULD_BUILD_KARBON)
	add_subdirectory(karbon)
endif(SHOULD_BUILD_KARBON)	

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

139

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