CMakeLists.txt 7.54 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)
21
macro_optional_find_package(Exif)
22
macro_optional_find_package(LibArt)
23 24
macro_optional_find_package(Freetype)
macro_optional_find_package(Fontconfig)
25
macro_log_feature(EIGEN_FOUND "Eigen" "Eigen is needed by KSpread, KSpread won't be built" "http://eigen.tuxfamily.org" TRUE "1.0.5")
26

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


include (MacroAdditionalCleanFiles)
include (MacroAddFileDependencies)
Laurent Montel's avatar
Laurent Montel committed
40

41
configure_file(config-prefix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-prefix.h )
David Faure's avatar
David Faure committed
42 43 44

macro_optional_find_package(OpenEXR)
macro_bool_to_01(OPENEXR_FOUND HAVE_OPENEXR)
45
configure_file(config-openexr.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-openexr.h )
Laurent Montel's avatar
Laurent Montel committed
46

47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
macro_optional_find_package(OpenGL)
set(HAVE_OPENGL 0)

if(OPENGL_FOUND)
    message(STATUS "Found OpenGL: ${OPENGL_LIBRARIES}")
    if(QT_QTOPENGL_FOUND)
        message(STATUS "Found Qt OpenGL support")
        set(HAVE_OPENGL 1)
    else(QT_QTOPENGL_FOUND)
        message(STATUS "Did NOT find Qt OpenGL support. Check your Qt configuration")
    endif(QT_QTOPENGL_FOUND)
else(OPENGL_FOUND)
    message(STATUS "Did NOT find OpenGL libraries")
endif(OPENGL_FOUND)

configure_file(config-opengl.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-opengl.h )

David Faure's avatar
David Faure committed
64
include (TestBigEndian)
65 66 67
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
configure_file(config-endian.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-endian.h )

68
# for config.h and <toplevel/foo.h> includes (if any?)
Laurent Montel's avatar
Laurent Montel committed
69
include_directories(${QDBUS_INCLUDE_DIRS}  ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
70 71

# kostore is at the bottom of stack, so it has the dependency on the kde4 includes.
72
set(KOSTORE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/store ${CMAKE_BINARY_DIR}/libs/store ${KDE4_INCLUDES})
Casper Boemann's avatar
Casper Boemann committed
73 74 75
# komain depends on kostore
set(KOMAIN_INCLUDES ${CMAKE_SOURCE_DIR}/libs/main ${CMAKE_SOURCE_DIR}/libs/main/threadAction ${CMAKE_BINARY_DIR}/libs/main ${KOSTORE_INCLUDES})
# pigment depends on komain and lcms
76
set(PIGMENT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/pigment ${CMAKE_SOURCE_DIR}/libs/pigment/colorspaces ${CMAKE_SOURCE_DIR}/libs/pigment/colorprofiles ${LCMS_INCLUDE_DIR} )
Casper Boemann's avatar
Casper Boemann committed
77
# flake depends on komain
78
set(FLAKE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/flake ${CMAKE_SOURCE_DIR}/libs/flake/commands ${CMAKE_BINARY_DIR}/libs/flake)
79 80
# koresources depends on pigment
set(KORESOURCES_INCLUDES ${CMAKE_SOURCE_DIR}/libs/resources ${CMAKE_BINARY_DIR}/libs/resources ${PIGMENT_INCLUDES})
81
# koguiutils depends on komain, flake and pigment
82
set(KOGUIUTILS_INCLUDES ${CMAKE_SOURCE_DIR}/libs/guiutils ${CMAKE_BINARY_DIR}/libs/guiutils ${KOMAIN_INCLUDES} ${FLAKE_INCLUDES} ${PIGMENT_INCLUDES} ${KORESOURCES_INCLUDES})
83
# kopageapp
84
set(KOPAGEAPP_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kopageapp ${CMAKE_SOURCE_DIR}/libs/kopageapp/commands ${CMAKE_BINARY_DIR}/libs/kopageapp )
85 86 87

# 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)
88
set(KOTEXT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kotext/styles ${CMAKE_SOURCE_DIR}/libs/kotext/opendocument ${CMAKE_SOURCE_DIR}/libs/kotext ${CMAKE_BINARY_DIR}/libs/kotext)
89
set(KOPAINTER_INCLUDES ${KOGUIUTILS_INCLUDES} ${CMAKE_SOURCE_DIR}/libs/kopainter ${CMAKE_BINARY_DIR}/libs/kopainter ${PIGMENT_INCLUDES})
90
set(KFORMULA_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kformula ${CMAKE_BINARY_DIR}/libs/kformula)
91
set(KOKROSS_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kokross ${CMAKE_BINARY_DIR}/libs/kokross)
92 93
# Those are included with e.g. <koproperty/set.h>
set(KOPROPERTY_INCLUDES ${CMAKE_SOURCE_DIR}/libs ${CMAKE_BINARY_DIR}/libs)
94

David Faure's avatar
David Faure committed
95 96 97 98 99 100 101 102 103 104 105 106 107 108
set(libkdgantt1_SRCS
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttView.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewEventItem.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewItem.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewItemDrag.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewSubwidgets.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewSummaryItem.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskItem.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskLink.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskLinkGroup.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttMinimizeSplitter.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttSemiSizingControl.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttSizingControl.cpp
	${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttXMLTools.cpp
Laurent Montel's avatar
Laurent Montel committed
109 110
	)

111 112 113 114 115 116 117 118 119 120 121 122 123 124
# 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})



125
add_subdirectory(libs)
126
MESSAGE(STATUS "Before koffice-2.0 disable compile of example subdir, not necessary for official release")
127
#add_subdirectory(example)
Laurent Montel's avatar
Laurent Montel committed
128
add_subdirectory(interfaces)
129 130

if(FREETYPE_FOUND AND FONTCONFIG_FOUND )
131
   set(SHOULD_BUILD_KARBON true)
132 133
endif(FREETYPE_FOUND AND FONTCONFIG_FOUND)

134
if(SHOULD_BUILD_KARBON)
135
	macro_optional_add_subdirectory(karbon)
David Faure's avatar
David Faure committed
136
endif(SHOULD_BUILD_KARBON)
137

138 139
if(EIGEN_FOUND)
    set(SHOULD_BUILD_KSPREAD true)
140 141 142 143 144
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")
145
endif(EIGEN_FOUND)
146

147
if(SHOULD_BUILD_KSPREAD)
148
    macro_optional_add_subdirectory(kspread)
149 150
endif(SHOULD_BUILD_KSPREAD)

151 152 153
macro_optional_add_subdirectory(kdgantt1)
macro_optional_add_subdirectory(kdgantt)
# macro_optional_add_subdirectory(kchart)
Laurent Montel's avatar
Laurent Montel committed
154 155 156 157 158 159
FIND_PROGRAM(BZIP2_EXECUTABLE NAMES bzip2 )
if( BZIP2_EXECUTABLE )
  macro_optional_add_subdirectory(kexi)
else( BZIP2_EXECUTABLE )
  MESSAGE(STATUS "bzip2 program is necessary to compile kexi")
endif( BZIP2_EXECUTABLE )
160 161 162 163 164 165 166 167 168
macro_optional_add_subdirectory(kformula)
macro_optional_add_subdirectory(kivio)
#macro_optional_add_subdirectory(koshell)
macro_optional_add_subdirectory(kounavail)
macro_optional_add_subdirectory(kplato)
macro_optional_add_subdirectory(kpresenter)
macro_optional_add_subdirectory(krita)
macro_optional_add_subdirectory(kugar)
macro_optional_add_subdirectory(kword)
Laurent Montel's avatar
Laurent Montel committed
169
add_subdirectory(pics)
170
add_subdirectory(plugins)
Laurent Montel's avatar
Laurent Montel committed
171 172
add_subdirectory(servicetypes)
add_subdirectory(templates)
173 174
add_subdirectory(tools)
add_subdirectory(filters)
175
add_subdirectory(shapes)
176
add_subdirectory(doc)
Laurent Montel's avatar
Laurent Montel committed
177
add_subdirectory( cmake )
178
message( STATUS "Re-add koshell when ported")
Laurent Montel's avatar
Laurent Montel committed
179

180

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