Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

CMakeLists.txt 7.53 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)
14
macro_optional_find_package(Boost)
Laurent Montel's avatar
Laurent Montel committed
15 16
find_package(Perl REQUIRED)
find_package(ZLIB REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
17
find_package(KdepimLibs REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
18
find_package(LCMS REQUIRED)
19
find_package(PNG REQUIRED)
20
find_package(Eigen)
21 22
macro_optional_find_package(Blitz)

23
macro_optional_find_package(QCA2)
24
macro_optional_find_package(Exif)
25 26
macro_optional_find_package(Freetype)
macro_optional_find_package(Fontconfig)
27

28
macro_log_feature(EIGEN_FOUND "Eigen" "Eigen is needed by KSpread, KSpread won't be built" "http://eigen.tuxfamily.org" TRUE "1.0.5")
29

30
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
31

32
macro_log_feature(Boost_FOUND "libboost-dev" "Boost is needed by KPresenter. KPresenter will not be built" "http://www.boost.org" TRUE "")
33

Laurent Montel's avatar
Laurent Montel committed
34 35 36 37 38
if (APPLE)
   find_package(Carbon REQUIRED)
endif (APPLE)


39
add_definitions(-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS)
David Faure's avatar
David Faure committed
40
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS})
Laurent Montel's avatar
Laurent Montel committed
41 42 43 44


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

46
configure_file(config-prefix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-prefix.h )
David Faure's avatar
David Faure committed
47 48 49

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

52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
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
69
include (TestBigEndian)
70 71 72
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
configure_file(config-endian.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-endian.h )

73
# for config.h and <toplevel/foo.h> includes (if any?)
Laurent Montel's avatar
Laurent Montel committed
74
include_directories(${QDBUS_INCLUDE_DIRS}  ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
75 76

# kostore is at the bottom of stack, so it has the dependency on the kde4 includes.
77
set(KOSTORE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/store ${CMAKE_BINARY_DIR}/libs/store ${KDE4_INCLUDES})
Casper Boemann's avatar
Casper Boemann committed
78 79 80
# 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
81
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
82
# flake depends on komain
83
set(FLAKE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/flake ${CMAKE_SOURCE_DIR}/libs/flake/commands ${CMAKE_BINARY_DIR}/libs/flake)
84 85
# koresources depends on pigment
set(KORESOURCES_INCLUDES ${CMAKE_SOURCE_DIR}/libs/resources ${CMAKE_BINARY_DIR}/libs/resources ${PIGMENT_INCLUDES})
86
# koguiutils depends on komain, flake and pigment
87
set(KOGUIUTILS_INCLUDES ${CMAKE_SOURCE_DIR}/libs/guiutils ${CMAKE_BINARY_DIR}/libs/guiutils ${KOMAIN_INCLUDES} ${FLAKE_INCLUDES} ${PIGMENT_INCLUDES} ${KORESOURCES_INCLUDES})
88
# kopageapp
89
set(KOPAGEAPP_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kopageapp ${CMAKE_SOURCE_DIR}/libs/kopageapp/commands ${CMAKE_BINARY_DIR}/libs/kopageapp )
90 91

# The rest must be specified independently, in addition to one of the above three
92
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)
93
set(KOPAINTER_INCLUDES ${KOGUIUTILS_INCLUDES} ${CMAKE_SOURCE_DIR}/libs/kopainter ${CMAKE_BINARY_DIR}/libs/kopainter ${PIGMENT_INCLUDES})
94
set(KFORMULA_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kformula ${CMAKE_BINARY_DIR}/libs/kformula)
95
set(KOKROSS_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kokross ${CMAKE_BINARY_DIR}/libs/kokross)
96 97
# Those are included with e.g. <koproperty/set.h>
set(KOPROPERTY_INCLUDES ${CMAKE_SOURCE_DIR}/libs ${CMAKE_BINARY_DIR}/libs)
98

99 100 101 102 103 104 105 106 107 108 109 110
# 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})

111 112
if(NOT BLITZ_FOUND)
   set(SHOULD_BUILD_KRITA FALSE)
Thomas Zander's avatar
Thomas Zander committed
113
   message(STATUS  "Krita requires blitz. Krita will not be built, qimageblitz is available from kdesupport")
114 115
endif(NOT BLITZ_FOUND)

116
#Check if build kpresenter here to be able to test if we can build filters/kpresenter
117
if(Boost_FOUND)
118
    set(SHOULD_BUILD_KPRESENTER TRUE)
119
else(Boost_FOUND)
120
    set(SHOULD_BUILD_KPRESENTER FALSE)
121 122
    message(STATUS  "KPresenters requires the boost headers, KPresenter will not be built.\n"
                    "   If you want to compile KPresenter you should install libboost-dev")
123
endif(Boost_FOUND)
124

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 154
if(SHOULD_BUILD_KPRESENTER)
    macro_optional_add_subdirectory(kpresenter)
endif(SHOULD_BUILD_KPRESENTER)

155
macro_optional_add_subdirectory(kdgantt)
Stefan Nikolaus's avatar
Stefan Nikolaus committed
156
macro_optional_add_subdirectory(kchart)
Laurent Montel's avatar
Laurent Montel committed
157 158 159 160 161 162
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 )
163 164 165 166 167 168 169 170
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(krita)
macro_optional_add_subdirectory(kugar)
macro_optional_add_subdirectory(kword)
Laurent Montel's avatar
Laurent Montel committed
171
add_subdirectory(pics)
172
add_subdirectory(plugins)
Laurent Montel's avatar
Laurent Montel committed
173 174
add_subdirectory(servicetypes)
add_subdirectory(templates)
175 176
add_subdirectory(tools)
add_subdirectory(filters)
177
add_subdirectory(shapes)
178
macro_optional_add_subdirectory(doc)
179
message( STATUS "Re-add koshell when ported")
Laurent Montel's avatar
Laurent Montel committed
180

181
MACRO_DISPLAY_FEATURE_LOG()
182

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