CMakeLists.txt 5.27 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
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
24 25 26 27 28 29

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


30
add_definitions(-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS)
31
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} -DHAVE_CONFIG_H=1)
Laurent Montel's avatar
Laurent Montel committed
32 33 34 35 36 37
link_directories(${KDE4_LIB_DIR})


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

Laurent Montel's avatar
Laurent Montel committed
39 40 41
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
#macro_additional_clean_files( ${CMAKE_CURRENT_BINARY_DIR}/config.h )

42
# for config.h and <toplevel/foo.h> includes (if any?)
Laurent Montel's avatar
Laurent Montel committed
43
include_directories(${QDBUS_INCLUDE_DIRS}  ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
44 45

# kostore is at the bottom of stack, so it has the dependency on the kde4 includes.
46
set(KOSTORE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/store ${CMAKE_BINARY_DIR}/libs/store ${KDE4_INCLUDES})
47
# kofficecore depends on kostore
48
set(KOFFICECORE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kofficecore ${CMAKE_BINARY_DIR}/libs/kofficecore ${KOSTORE_INCLUDES})
49 50
# flake depends on kofficecore
set(FLAKE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/flake ${CMAKE_BINARY_DIR}/libs/flake )
51
# kofficeui depends on kofficecore
52
set(KOFFICEUI_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kofficeui ${CMAKE_BINARY_DIR}/libs/kofficeui ${KOFFICECORE_INCLUDES} ${FLAKE_INCLUDES} )
53 54
# pigment depends on kofficecore and lcms
set(PIGMENT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/pigment ${CMAKE_SOURCE_DIR}/libs/pigment/colorspaces ${LCMS_INCLUDE_DIR} )
55 56 57

# 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)
58
set(KOTEXT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kotext/styles ${CMAKE_SOURCE_DIR}/libs/kotext ${CMAKE_BINARY_DIR}/libs/kotext)
59
set(KOPAINTER_INCLUDES $(CMAKE_SOURCE_DIR)/libs/kofficeui ${CMAKE_SOURCE_DIR}/libs/kopainter ${CMAKE_BINARY_DIR}/libs/kopainter ${CMAKE_SOURCE_DIR}/libs/pigment)
60 61 62 63
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)
64

Laurent Montel's avatar
Laurent Montel committed
65
set(libkdgantt_SRCS
66
	${CMAKE_SOURCE_DIR}/kdgantt/KDGanttView.cpp
Laurent Montel's avatar
Laurent Montel committed
67 68 69 70 71 72 73 74 75 76 77 78 79 80
	${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
	)

81 82 83 84 85 86 87 88 89 90 91 92 93 94
# 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})



95
add_subdirectory(libs)
96
MESSAGE(STATUS "Before koffice-2.0 disable compile of example subdir, not necessary for official release")
97
add_subdirectory(example)
Laurent Montel's avatar
Laurent Montel committed
98
add_subdirectory(interfaces)
99
add_subdirectory(karbon)
100
add_subdirectory(kdgantt)
Laurent Montel's avatar
Laurent Montel committed
101
add_subdirectory(kchart)
102
#add_subdirectory(kexi)
103 104
# Disabled while libs/kformula is disabled
#add_subdirectory(kformula)
105
add_subdirectory(kivio)
106
#add_subdirectory(koshell)
107
add_subdirectory(kounavail)
108
add_subdirectory(kplato)
Laurent Montel's avatar
Laurent Montel committed
109
add_subdirectory(kpresenter)
110
add_subdirectory(krita)
Laurent Montel's avatar
Laurent Montel committed
111
add_subdirectory(kspread)
Laurent Montel's avatar
Laurent Montel committed
112
add_subdirectory(kugar)
113
add_subdirectory(kword)
Laurent Montel's avatar
Laurent Montel committed
114
add_subdirectory(pics)
115
add_subdirectory(plugins)
Laurent Montel's avatar
Laurent Montel committed
116 117
add_subdirectory(servicetypes)
add_subdirectory(templates)
118 119
add_subdirectory(tools)
add_subdirectory(filters)
120
add_subdirectory(shapes)
121 122
add_subdirectory(autocorrect)
add_subdirectory(doc)
Laurent Montel's avatar
Laurent Montel committed
123
add_subdirectory( cmake )
Laurent Montel's avatar
Laurent Montel committed
124
message( STATUS "Re-add kexi when we will port them")
Laurent Montel's avatar
Laurent Montel committed
125

126

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