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

Commit e5cfcfe5 authored by Laurent Montel's avatar Laurent Montel 😁

Big first commit:

-> add cmake support
-> qt3to4
-> launch my script to adapt to new kdelibs api
-> fix some compile error

For the moment koffice doesn't compile.
I will not port kspread/kpresenter/krita/karbon
All changes into theses directories are just my script
which changed it (necessary for the future, but I will 
not work on to make it compile (until we decided to port them))


svn path=/trunk/koffice/; revision=523004
parent e9e9b2d6
project(koffice)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
# Perhaps define share/apps as ${DATA_INSTALL_DIR}
#set(CMAKE_MODULE_PATH "${KDEDIR}/share/apps/cmake/modules/ ${CMAKE_SOURCE_DIR}/cmake/modules")
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
# support for Dart: http://public.kitware.com/dashboard.php?name=kde
enable_testing()
include(CTest)
# generate non-quiet makefiles
set(CMAKE_VERBOSE_MAKEFILE ON)
# search packages used by KDE
find_package(KDE4 REQUIRED)
find_package(Perl REQUIRED)
find_package(ZLIB REQUIRED)
if (APPLE)
find_package(Carbon REQUIRED)
endif (APPLE)
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1)
link_directories(${KDE4_LIB_DIR})
include (MacroAdditionalCleanFiles)
include (MacroAddFileDependencies)
include (ConfigureChecks.cmake)
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 )
include_directories(
${KDE4_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
)
add_subdirectory(lib)
#add_subdirectory(ascend)
add_subdirectory(autocorrect)
add_subdirectory(doc)
#add_subdirectory(example)
#add_subdirectory(filters)
add_subdirectory(interfaces)
#add_subdirectory(karbon)
#add_subdirectory(kchart)
#add_subdirectory(kdgantt)
#add_subdirectory(kexi)
#add_subdirectory(kformula)
#add_subdirectory(kivio)
#add_subdirectory(koshell)
#add_subdirectory(kounavail)
#add_subdirectory(kplato)
#add_subdirectory(kpresenter)
#add_subdirectory(krita)
#add_subdirectory(kspread)
#add_subdirectory(kugar)
#add_subdirectory(kword)
add_subdirectory(mimetypes)
add_subdirectory(pics)
#add_subdirectory(plugins)
add_subdirectory(servicetypes)
add_subdirectory(templates)
#add_subdirectory(tools)
MESSAGE(STATUS "Perhaps not install FindKDE4. It will conflict when we install with rpm/deb package")
add_subdirectory( cmake )
kde4_create_doxygen_docs( )
add_subdirectory(modules)
# install the cmake files
file(GLOB cmakeFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.cmake")
install_files(/share/apps/cmake/modules FILES ${cmakeFiles} )
# first try to find kde-config
# then ask kde-config for the kde data dirs
# then check the data dirs for FindKDE4.cmake
MACRO(_MACRO_GETENV_WIN_PATH var name)
set(${var} $ENV{${name}})
STRING( REGEX REPLACE "\\\\" "/" ${var} "${${var}}" )
ENDMACRO(_MACRO_GETENV_WIN_PATH)
_MACRO_GETENV_WIN_PATH(ENV_KDEDIR KDEDIR)
FIND_PROGRAM(KDE4_KDECONFIG_EXECUTABLE NAMES kde-config
PATHS
${ENV_KDEDIR}/bin
/opt/kde4/bin
/opt/kde
)
IF (KDE4_KDECONFIG_EXECUTABLE)
EXEC_PROGRAM(${KDE4_KDECONFIG_EXECUTABLE} ARGS --path data OUTPUT_VARIABLE _data_DIR )
# replace the ":" with ";" so that it becomes a valid cmake list
STRING(REGEX REPLACE ":" ";" _data_DIR "${_data_DIR}")
MESSAGE(STATUS "datadir: ${_data_DIR}")
FIND_PATH(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake
${_data_DIR}
)
IF (KDE4_DATA_DIR)
SET(CMAKE_MODULE_PATH ${KDE4_DATA_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
IF (KDE4_FIND_QUIETLY)
SET(_quiet QUIET)
ENDIF (KDE4_FIND_QUIETLY)
IF (KDE4_FIND_REQUIRED)
SET(_req REQUIRED)
ENDIF (KDE4_FIND_REQUIRED)
FIND_PACKAGE(KDE4Internal ${_req} ${_quiet})
ENDIF (KDE4_DATA_DIR)
ENDIF (KDE4_KDECONFIG_EXECUTABLE)
IF (KDE4_FIND_REQUIRED AND NOT KDE4_FOUND)
MESSAGE(FATAL_ERROR "Could not find KDE4")
ENDIF (KDE4_FIND_REQUIRED AND NOT KDE4_FOUND)
kde4_header()
include_directories( ${CMAKE_SOURCE_DIR}/kchart/kdchart ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### next target ###############
set(kochart_LIB_SRCS koChart.cc )
kde4_automoc(${kochart_LIB_SRCS})
kde4_add_library(kochart SHARED ${kochart_LIB_SRCS})
target_link_libraries(kochart ${KDE4_KDECORE_LIBS} )
set_target_properties(kochart PROPERTIES VERSION 1.0.0 SOVERSION 1 )
install_targets(${LIB_INSTALL_DIR} kochart )
########### install files ###############
install_files( /include FILES koChart.h )
kde4_create_doxygen_docs( )
kde4_footer()
#original Makefile.am contents follow:
#INCLUDES = $(KOFFICE_INCLUDES) -I$(top_srcdir)/kchart/kdchart -I$(interfacedir) $(all_includes)
#
#lib_LTLIBRARIES = libkochart.la
#
#libkochart_la_SOURCES = koChart.cc
#libkochart_la_LDFLAGS = $(all_libraries) -version-info 1:0:0 -no-undefined
#libkochart_la_LIBADD = $(LIB_KOFFICECORE)
#METASOURCES = AUTO
#
#include_HEADERS = koChart.h
#
#include $(top_srcdir)/admin/Doxyfile.am
......@@ -18,7 +18,7 @@
#include "koChart.h"
#include <qobjectlist.h>
#include <qobject.h>
using namespace KoChart;
......
kde4_header()
add_subdirectory( sdk )
add_subdirectory( kritacolor )
add_subdirectory( core )
add_subdirectory( ui )
add_subdirectory( dtd )
add_subdirectory( colorspaces )
add_subdirectory( plugins )
add_subdirectory( data )
add_subdirectory( pics )
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### next target ###############
set(kritacommon_LIB_SRCS dummy.cc )
kde4_automoc(${kritacommon_LIB_SRCS})
kde4_add_library(kritacommon SHARED ${kritacommon_LIB_SRCS})
target_link_libraries(kritacommon ${KDE4_KDECORE_LIBS} kritasdk kritaimage kritaui kritacolor )
set_target_properties(kritacommon PROPERTIES VERSION 1.0.0 SOVERSION 1 )
install_targets(${LIB_INSTALL_DIR} kritacommon )
########### next target ###############
set(kritapart_PART_SRCS krita_part_init.cc )
kde4_automoc(${kritapart_PART_SRCS})
kde4_add_plugin(kritapart WITH_PREFIX ${kritapart_PART_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kritapart )
target_link_libraries(kritapart ${KDE4_KDECORE_LIBS} kritacommon )
install_targets(${LIB_INSTALL_DIR}/kde4 kritapart )
########### next target ###############
set(krita_KDEINIT_SRCS main.cc )
kde4_automoc(${krita_KDEINIT_SRCS})
kde4_add_kdeinit_executable( krita ${krita_KDEINIT_SRCS})
target_link_libraries(kdeinit_krita ${KDE4_KDECORE_LIBS} )
install_targets(${LIB_INSTALL_DIR} kdeinit_krita )
target_link_libraries( krita kdeinit_krita )
install_targets(/bin krita )
########### install files ###############
install_files( ${XDG_APPS_DIR} FILES krita.desktop )
install_files( ${MIME_INSTALL_DIR}/application FILES )
install_files( ${SERVICES_INSTALL_DIR} FILES kritapart.desktop )
install_files( ${DATA_INSTALL_DIR}/krita FILES krita.rc krita_readonly.rc )
kde4_create_doxygen_docs( EXCLUDE CImg.h colorspaces plugins kritacolor/colorspaces core/tiles )
kde4_footer()
#original Makefile.am contents follow:
#INCLUDES = $(KOFFICE_INCLUDES) $(KOPAINTER_INCLUDES) $(all_includes)
#
### The common lib, shared between the part, the plugins, and the filters
#lib_LTLIBRARIES = libkritacommon.la
#libkritacommon_la_SOURCES = dummy.cc
#libkritacommon_la_LDFLAGS = $(all_libraries) -version-info 1:0 -no-undefined
#libkritacommon_la_LIBADD = sdk/libkritasdk.la core/libkritaimage.la ui/libkritaui.la kritacolor/libkritacolor.la $(LCMS_LIBS) $(LIB_KOFFICEUI) $(LIB_KOPAINTER) $(LIB_KOPALETTE) $(LIB_XINPUTEXT)
#
### The part
#kde_module_LTLIBRARIES = libkritapart.la
#libkritapart_la_SOURCES = krita_part_init.cc
#libkritapart_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
#libkritapart_la_LIBADD = libkritacommon.la
#
#METASOURCES = AUTO
#
### The kdeinit loadable module and executable
#kdeinit_LTLIBRARIES = krita.la
#bin_PROGRAMS =
#krita_la_SOURCES = main.cc
#krita_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
#krita_la_LIBADD = $(LIB_KOFFICECORE)
#
#xdg_apps_DATA = krita.desktop
#kdemimedir = $(kde_mimedir)/application
#
#rcdir = $(kde_datadir)/krita
#rc_DATA = krita.rc krita_readonly.rc
#
#SUBDIRS = sdk kritacolor core ui . dtd colorspaces plugins data pics
## Needed to compile libkritacommon.la, which has no source files to itself
## but everything in static libs.
#dummy.cc:
# echo > dummy.cc
#
#messages: rc.cpp
# $(EXTRACTRC) `find . -name \*.ui` >> rc.cpp
# $(EXTRACTRC) `find . -name \*.rc` >> rc.cpp
# perl extracti18n.pl > i18ndata
# $(XGETTEXT) i18ndata rc.cpp `find . -name \*.cc -o -name \*.h` ui/kis_aboutdata.h -o $(podir)/krita.pot
# rm -f i18ndata
#
#DOXYGEN_EXCLUDE = CImg.h colorspaces plugins kritacolor/colorspaces core/tiles
#include $(top_srcdir)/admin/Doxyfile.am
#
#kde_services_DATA = kritapart.desktop
#
kde4_header()
add_subdirectory( rgb_u8 )
add_subdirectory( rgb_u16 )
add_subdirectory( rgb_f32 )
add_subdirectory( gray_u8 )
add_subdirectory( gray_u16 )
add_subdirectory( cmyk_u8 )
add_subdirectory( cmyk_u16 )
add_subdirectory( lms_f32 )
add_subdirectory( wet )
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(HALF_SUBDIRS)")
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### install files ###############
kde4_footer()
#original Makefile.am contents follow:
## Definition of the service type
#
#if have_openexr
#HALF_SUBDIRS=rgb_f16half
#endif
#
#SUBDIRS = rgb_u8 rgb_u16 rgb_f32 \
# gray_u8 gray_u16 \
# cmyk_u8 cmyk_u16 \
# lms_f32 \
# $(HALF_SUBDIRS) \
# wet
##wet wetsticky
#
kde4_header()
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### next target ###############
set(krita_cmyk_u16_LIB_SRCS kis_cmyk_u16_colorspace.cc )
kde4_automoc(${krita_cmyk_u16_LIB_SRCS})
kde4_add_library(krita_cmyk_u16 SHARED ${krita_cmyk_u16_LIB_SRCS})
target_link_libraries(krita_cmyk_u16 ${KDE4_KDECORE_LIBS} kritacolor )
set_target_properties(krita_cmyk_u16 PROPERTIES VERSION 1.0.0 SOVERSION 1 )
install_targets(${LIB_INSTALL_DIR} krita_cmyk_u16 )
########### next target ###############
set(krita_cmyk_u16_plugin_PART_SRCS cmyk_u16_plugin.cc )
kde4_automoc(${krita_cmyk_u16_plugin_PART_SRCS})
kde4_add_plugin(krita_cmyk_u16_plugin ${krita_cmyk_u16_plugin_PART_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} krita_cmyk_u16_plugin )
target_link_libraries(krita_cmyk_u16_plugin ${KDE4_KDECORE_LIBS} krita_cmyk_u16 kritacolor )
install_targets(${LIB_INSTALL_DIR}/kde4 krita_cmyk_u16_plugin )
########### install files ###############
install_files( ${SERVICES_INSTALL_DIR} FILES krita_cmyk_u16_plugin.desktop )
kde4_footer()
#original Makefile.am contents follow:
#kde_services_DATA = krita_cmyk_u16_plugin.desktop
#
#INCLUDES = -I$(srcdir)/../../sdk \
# -I$(srcdir)/../../kritacolor/color_strategy/ \
# -I$(srcdir)/../../kritacolor/ \
# $(KOFFICE_INCLUDES) \
# $(all_includes)
#
#lib_LTLIBRARIES = libkrita_cmyk_u16.la
#libkrita_cmyk_u16_la_SOURCES = kis_cmyk_u16_colorspace.cc
#libkrita_cmyk_u16_la_LDFLAGS = $(all_libraries)
#libkrita_cmyk_u16_la_LIBADD = ../../kritacolor/libkritacolor.la
#
## Install this plugin in the KDE modules directory
#kde_module_LTLIBRARIES = krita_cmyk_u16_plugin.la
#
## Srcs for the plugin
#krita_cmyk_u16_plugin_la_SOURCES = cmyk_u16_plugin.cc
#noinst_HEADERS = cmyk_u16_plugin.h kis_cmyk_u16_colorspace.h
#
#krita_cmyk_u16_plugin_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
#krita_cmyk_u16_plugin_la_LIBADD = libkrita_cmyk_u16.la ../../kritacolor/libkritacolor.la
#
#krita_cmyk_u16_plugin_la_METASOURCES = AUTO
##METASOURCES = AUTO # XXX: which of the two?
#
#
#SUBDIRS = .
##$(TESTSDIR)
#
kde4_header()
add_subdirectory( templates )
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### next target ###############
set(kritacmykplugin_PART_SRCS cmyk_plugin.cc kis_cmyk_colorspace.cc )
kde4_automoc(${kritacmykplugin_PART_SRCS})
kde4_add_plugin(kritacmykplugin ${kritacmykplugin_PART_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kritacmykplugin )
target_link_libraries(kritacmykplugin ${KDE4_KDECORE_LIBS} kritacolor )
install_targets(${LIB_INSTALL_DIR}/kde4 kritacmykplugin )
########### install files ###############
install_files( ${SERVICES_INSTALL_DIR} FILES kritacmykplugin.desktop )
kde4_footer()
#original Makefile.am contents follow:
#kde_services_DATA = kritacmykplugin.desktop
#
#INCLUDES = -I$(srcdir)/../../sdk \
# -I$(srcdir)/../../kritacolor/color_strategy \
# -I$(srcdir)/../../kritacolor \
# $(KOFFICE_INCLUDES) \
# $(all_includes)
#
#kde_module_LTLIBRARIES = kritacmykplugin.la
#
#kritacmykplugin_la_SOURCES = cmyk_plugin.cc kis_cmyk_colorspace.cc
#noinst_HEADERS = cmyk_plugin.h kis_cmyk_colorspace.h
#
#kritacmykplugin_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
#kritacmykplugin_la_LIBADD = ../../kritacolor/libkritacolor.la
#
#kritacmykplugin_la_METASOURCES = AUTO
#
#
#SUBDIRS=templates
kde4_header()
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### install files ###############
install_files( ${DATA_INSTALL_DIR}/krita/icons FILES )
install_files( ${DATA_INSTALL_DIR}/krita/templates/cmyk/.source FILES white_2000x800.kra )
install_files( ${DATA_INSTALL_DIR}/krita/templates/cmyk FILES .directory white_2000x800.desktop )
kde4_footer()
#original Makefile.am contents follow:
#templates_DATA = .directory white_2000x800.desktop
#templatesdir = $(kde_datadir)/krita/templates/cmyk
#
#templatesrc_DATA = white_2000x800.kra
#templatesrcdir = $(kde_datadir)/krita/templates/cmyk/.source
#
#templatesicon_ICON = AUTO
#templatesicondir = $(kde_datadir)/krita/icons
kde4_header()
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### next target ###############
set(krita_gray_u16_LIB_SRCS kis_gray_u16_colorspace.cc )
kde4_automoc(${krita_gray_u16_LIB_SRCS})
kde4_add_library(krita_gray_u16 SHARED ${krita_gray_u16_LIB_SRCS})
target_link_libraries(krita_gray_u16 ${KDE4_KDECORE_LIBS} kritacolor )
set_target_properties(krita_gray_u16 PROPERTIES VERSION 1.0.0 SOVERSION 1 )
install_targets(${LIB_INSTALL_DIR} krita_gray_u16 )
########### next target ###############
set(krita_gray_u16_plugin_PART_SRCS gray_u16_plugin.cc )
kde4_automoc(${krita_gray_u16_plugin_PART_SRCS})
kde4_add_plugin(krita_gray_u16_plugin ${krita_gray_u16_plugin_PART_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} krita_gray_u16_plugin )
target_link_libraries(krita_gray_u16_plugin ${KDE4_KDECORE_LIBS} krita_gray_u16 kritacolor )
install_targets(${LIB_INSTALL_DIR}/kde4 krita_gray_u16_plugin )
########### install files ###############
install_files( ${SERVICES_INSTALL_DIR} FILES krita_gray_u16_plugin.desktop )
kde4_footer()
#original Makefile.am contents follow:
## location for the rc file
#kde_services_DATA = krita_gray_u16_plugin.desktop
#
#INCLUDES = -I$(srcdir)/../../sdk \
# -I$(srcdir)/../../kritacolor/color_strategy \
# -I$(srcdir)/../../kritacolor/ \
# $(KOFFICE_INCLUDES) \
# $(all_includes)
#
#lib_LTLIBRARIES = libkrita_gray_u16.la
#libkrita_gray_u16_la_SOURCES = kis_gray_u16_colorspace.cc
#libkrita_gray_u16_la_LDFLAGS = $(all_libraries)
#libkrita_gray_u16_la_LIBADD = ../../kritacolor/libkritacolor.la
#
## Install this plugin in the KDE modules directory
#kde_module_LTLIBRARIES = krita_gray_u16_plugin.la
#
## Srcs for the plugin
#krita_gray_u16_plugin_la_SOURCES = gray_u16_plugin.cc
#noinst_HEADERS = gray_u16_plugin.h kis_gray_u16_colorspace.h
#
#krita_gray_u16_plugin_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
#krita_gray_u16_plugin_la_LIBADD = libkrita_gray_u16.la ../../kritacolor/libkritacolor.la
#
#krita_gray_u16_plugin_la_METASOURCES = AUTO
#
#
#SUBDIRS = .
#
kde4_header()
add_subdirectory( templates )
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(TESTSDIR)")
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### next target ###############
set(kritagrayscale_LIB_SRCS kis_gray_colorspace.cc )
kde4_automoc(${kritagrayscale_LIB_SRCS})
kde4_add_library(kritagrayscale SHARED ${kritagrayscale_LIB_SRCS})
target_link_libraries(kritagrayscale ${KDE4_KDECORE_LIBS} kritacolor )
set_target_properties(kritagrayscale PROPERTIES VERSION 1.0.0 SOVERSION 1 )
install_targets(${LIB_INSTALL_DIR} kritagrayscale )
########### next target ###############
set(kritagrayplugin_PART_SRCS gray_plugin.cc )
kde4_automoc(${kritagrayplugin_PART_SRCS})
kde4_add_plugin(kritagrayplugin ${kritagrayplugin_PART_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kritagrayplugin )
target_link_libraries(kritagrayplugin ${KDE4_KDECORE_LIBS} kritagrayscale kritacolor )
install_targets(${LIB_INSTALL_DIR}/kde4 kritagrayplugin )
########### install files ###############
install_files( ${SERVICES_INSTALL_DIR} FILES kritagrayplugin.desktop )
kde4_footer()
#original Makefile.am contents follow:
#kde_services_DATA = kritagrayplugin.desktop
#
#INCLUDES = -I$(srcdir)/../../sdk \
# -I$(srcdir)/../../kritacolor/color_strategy/ \
# -I$(srcdir)/../../kritacolor/ \
# -I$(interfacedir) \
# $(KOFFICE_INCLUDES) \
# $(all_includes)
#
#
#lib_LTLIBRARIES = libkritagrayscale.la
#libkritagrayscale_la_SOURCES = kis_gray_colorspace.cc
#libkritagrayscale_la_LDFLAGS = $(all_libraries)
#libkritagrayscale_la_LIBADD = ../../kritacolor/libkritacolor.la
#
#kde_module_LTLIBRARIES = kritagrayplugin.la
#
#kritagrayplugin_la_SOURCES = gray_plugin.cc
#noinst_HEADERS = gray_plugin.h kis_gray_colorspace.h