Browse Source

[kdegraphics] cmake support for kamera, kcoloredit, and kviewshell

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1230743 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
tags/v3.5.13
samelian 9 years ago
parent
commit
0f962a277e
19 changed files with 464 additions and 8 deletions
  1. +7
    -1
      CMakeLists.txt
  2. +19
    -0
      config.h.cmake
  3. +16
    -0
      kamera/CMakeLists.txt
  4. +15
    -0
      kamera/ConfigureChecks.cmake
  5. +36
    -0
      kamera/kcontrol/CMakeLists.txt
  6. +32
    -0
      kamera/kioslave/CMakeLists.txt
  7. +13
    -0
      kamera/pics/CMakeLists.txt
  8. +57
    -0
      kcoloredit/CMakeLists.txt
  9. +110
    -0
      kviewshell/CMakeLists.txt
  10. +14
    -0
      kviewshell/pics/CMakeLists.txt
  11. +12
    -0
      kviewshell/pics/icons/CMakeLists.txt
  12. +12
    -0
      kviewshell/plugins/CMakeLists.txt
  13. +47
    -0
      kviewshell/plugins/djvu/CMakeLists.txt
  14. +41
    -0
      kviewshell/plugins/djvu/libdjvu/CMakeLists.txt
  15. +25
    -0
      kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake
  16. +4
    -4
      kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp
  17. +1
    -1
      kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
  18. +1
    -0
      kviewshell/plugins/djvu/libdjvu/GOS.cpp
  19. +2
    -2
      kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp

+ 7
- 1
CMakeLists.txt View File

@@ -49,10 +49,13 @@ option( WITH_LIBPAPER "Enable libpaper support" OFF )
##### user requested modules ####################

option( BUILD_ALL "Build all" OFF )
option( BUILD_KAMERA "Build kamera" ${BUILD_ALL} )
option( BUILD_KCOLOREDIT "Build kcoloredit" ${BUILD_ALL} )
option( BUILD_KVIEW "Build kview" ${BUILD_ALL} )
option( BUILD_KRULER "Build kruler" ${BUILD_ALL} )
option( BUILD_KPDF "Build kpdf" ${BUILD_ALL} )
option( BUILD_KSVG "Build ksvg" ${BUILD_ALL} )
option( BUILD_KVIEWSHELL "Build kviewshell" ${BUILD_ALL} )


##### configure checks ##########################
@@ -66,17 +69,20 @@ add_definitions(
-DHAVE_CONFIG_H
)

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS} -fexceptions" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )


##### kdegraphics directories ###################

tde_conditional_add_subdirectory( BUILD_KAMERA kamera )
tde_conditional_add_subdirectory( BUILD_KCOLOREDIT kcoloredit )
tde_conditional_add_subdirectory( BUILD_KVIEW kview )
tde_conditional_add_subdirectory( BUILD_KRULER kruler )
tde_conditional_add_subdirectory( BUILD_KPDF kpdf )
tde_conditional_add_subdirectory( BUILD_KSVG ksvg )
tde_conditional_add_subdirectory( BUILD_KVIEWSHELL kviewshell )


##### write configure files #####################


+ 19
- 0
config.h.cmake View File

@@ -12,3 +12,22 @@
#define STDC_HEADERS 1
#cmakedefine LCMS_HEADER <@LCMS_HEADER@>
#cmakedefine HAVE_FREETYPE_2_2_x 1

// kviewshell (djvu plugin)
#cmakedefine HAVE_WCHAR_T 1
#cmakedefine HAVE_ISWSPACE 1
#cmakedefine HAVE_WCRTOMB 1
#cmakedefine HAVE_MBSTATE_T 1
#if !defined(HAVE_WCHAR_T)
#define HAS_WCHAR 0
#define HAS_WCTYPE 0
#define HAS_MBSTATE 0
#else
#define HAS_WCHAR 1
#if defined(HAVE_WCTYPE_H) && defined(HAVE_ISWSPACE)
#define HAS_WCTYPE 1
#endif
#if defined(HAVE_MBSTATE_T) && defined(HAVE_WCRTOMB)
#define HAS_MBSTATE 1
#endif
#endif

+ 16
- 0
kamera/CMakeLists.txt View File

@@ -0,0 +1,16 @@
#################################################
#
# (C) 2010-2011 Calvin Morrison
# mutantturkey@gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

include( ConfigureChecks.cmake )

add_subdirectory( kioslave )
add_subdirectory( kcontrol )
add_subdirectory( pics )

+ 15
- 0
kamera/ConfigureChecks.cmake View File

@@ -0,0 +1,15 @@
#################################################
#
# (C) 2010-2011 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

pkg_search_module( GPHOTO2 libgphoto2 )
if( NOT GPHOTO2_FOUND )
tde_message_fatal( "libgphoto2 is required, but was not found on your system" )
endif( )

+ 36
- 0
kamera/kcontrol/CMakeLists.txt View File

@@ -0,0 +1,36 @@
#################################################
#
# (C) 2010-2011 Calvin Morrison
# mutantturkey@gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${GPHOTO2_INCLUDE_DIRS}
)

link_directories(
${TQT_LIBRARY_DIRS}
)


#### other data #################################

install( FILES kamera.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )


#### kamera (module) ############################

tde_add_kpart( kcm_kamera SHARED AUTOMOC
SOURCES kamera.cpp kameradevice.cpp kameraconfigdialog.cpp
LINK kio-shared ${GPHOTO2_LIBRARIES}
DESTINATION ${PLUGIN_INSTALL_DIR}
)

+ 32
- 0
kamera/kioslave/CMakeLists.txt View File

@@ -0,0 +1,32 @@
#################################################
#
# (C) 2010-2011 Calvin Morrison
# mutantturkey@gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${GPHOTO2_INCLUDE_DIRS}
)


link_directories(
${TQT_LIBRARY_DIRS}
)


#### kamera (module) ############################

tde_add_kpart( kio_kamera AUTOMOC
SOURCES kamera.cpp
LINK kio-shared ${GPHOTO2_LIBRARIES}
DESTINATION ${PLUGIN_INSTALL_DIR}
)

+ 13
- 0
kamera/pics/CMakeLists.txt View File

@@ -0,0 +1,13 @@
#################################################
#
# (C) 2010-2011 Calvin Morrison
# mutantturkey@gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

tde_install_icons( camera )
tde_install_icons( camera_test )

+ 57
- 0
kcoloredit/CMakeLists.txt View File

@@ -0,0 +1,57 @@
#################################################
#
# (C) 2010-2011 Calvin Morrison
# mutantturkey@gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)

link_directories(
${TQT_LIBRARY_DIRS}
)


#### other data #################################

tde_install_icons( kcoloredit kcolorchooser )

install( FILES
kcoloredit.desktop kcolorchooser.desktop
DESTINATION ${XDG_APPS_INSTALL_DIR} )

install( FILES
kcoloreditui.rc
DESTINATION ${DATA_INSTALL_DIR}/kcoloredit )


#### kcoloredit (executable) ####################

tde_add_executable( kcoloredit AUTOMOC
SOURCES
kzcolorselector.cpp imageselection.cpp
texteditselection.cpp gradientselection.cpp colorselector.cpp
kxycolorselector.cpp paletteview.cpp paletteviewscrolledarea.cpp
editablestreamhistory.cpp color.cpp palette.cpp loadpalettedlg.cpp
kcoloreditview.cpp kcoloreditdoc.cpp kcoloredit.cpp main.cpp
LINK kio-shared
DESTINATION ${BIN_INSTALL_DIR}
)


##### kcolorchooser (executable) ################

tde_add_executable( kcolorchooser AUTOMOC
SOURCES kcolorchooser.cpp
LINK kdeui-shared
DESTINATION ${BIN_INSTALL_DIR}
)

+ 110
- 0
kviewshell/CMakeLists.txt View File

@@ -0,0 +1,110 @@
#################################################
#
# (C) 2010-2011 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

project( kviewshell )

add_subdirectory( pics )
add_subdirectory( plugins )

include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)

link_directories(
${TQT_LIBRARY_DIRS}
)


##### headers ###################################

install( FILES
kmultipageInterface.h
DESTINATION ${INCLUDE_INSTALL_DIR} )

install( FILES
anchor.h bookmark.h pageView.h documentPageCache.h
documentRenderer.h documentWidget.h history.h hyperlink.h
kmultipage.h length.h pageNumber.h pageSize.h renderedDocumentPage.h
renderedDocumentPagePixmap.h renderedDocumentPagePrinter.h
selection.h simplePageSize.h textBox.h zoom.h zoomlimits.h
DESTINATION ${INCLUDE_INSTALL_DIR}/kviewshell )


##### other data ################################

install( FILES kviewshell.rc DESTINATION ${DATA_INSTALL_DIR}/kviewshell )
install( FILES kviewerpart.rc DESTINATION ${DATA_INSTALL_DIR}/kviewerpart )
install( FILES kmultipage.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
install( FILES emptymultipage.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES kviewshell.kcfg DESTINATION ${KCFG_INSTALL_DIR} )


##### ifaces (static) ###########################

tde_add_library( ifaces STATIC_PIC AUTOMOC
SOURCES
kviewpart_iface.cpp
)


##### kviewshell (static) #######################

tde_add_library( kviewshell STATIC_PIC AUTOMOC
SOURCES
kviewshell.cpp
)


##### kmultipage (shared) #######################

tde_add_library( kmultipage SHARED AUTOMOC
SOURCES
kmultipage.cpp pageView.cpp marklist.cpp kmultipageInterface.skel
units.cpp pageSize.cpp simplePageSize.cpp renderedDocumentPage.cpp
renderedDocumentPagePixmap.cpp renderedDocumentPagePrinter.cpp
documentPageCache.cpp documentWidget.cpp searchWidget.cpp
selection.cpp documentRenderer.cpp history.cpp kvsprefs.kcfgc
tableOfContents.cpp kprintDialogPage_pageoptions.cpp
LINK kparts-shared kdeprint-shared
DESTINATION ${LIB_INSTALL_DIR}
)


##### kviewerpart (module) ######################

tde_add_kpart( kviewerpart AUTOMOC
SOURCES
kviewpart.cpp pageSizeWidget_base.ui pageSizeWidget.cpp
pageSizeDialog.cpp pageSize.cpp sizePreview.cpp zoom.cpp
units.cpp kvsprefs.kcfgc optionDialogGUIWidget_base.ui
optionDialogAccessibilityWidget.ui simplePageSize.cpp
LINK ifaces-static kparts-shared
DESTINATION ${PLUGIN_INSTALL_DIR}
)


##### emptymultipagepart (module) ###############

tde_add_kpart( emptymultipagepart AUTOMOC
SOURCES
empty_multipage.cpp emptyRenderer.cpp
LINK kmultipage-shared
DESTINATION ${PLUGIN_INSTALL_DIR}
)


##### install import cmake modules ###############

tde_install_export( )

+ 14
- 0
kviewshell/pics/CMakeLists.txt View File

@@ -0,0 +1,14 @@
#################################################
#
# (C) 2010-2011 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

add_subdirectory( icons )

tde_install_icons( kviewshell )

+ 12
- 0
kviewshell/pics/icons/CMakeLists.txt View File

@@ -0,0 +1,12 @@
#################################################
#
# (C) 2010-2011 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

tde_install_icons( DESTINATION ${DATA_INSTALL_DIR}/kviewerpart/icons )

+ 12
- 0
kviewshell/plugins/CMakeLists.txt View File

@@ -0,0 +1,12 @@
#################################################
#
# (C) 2010-2011 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

add_subdirectory( djvu )

+ 47
- 0
kviewshell/plugins/djvu/CMakeLists.txt View File

@@ -0,0 +1,47 @@
#################################################
#
# (C) 2010-2011 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

add_subdirectory( libdjvu )

include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../..
${CMAKE_CURRENT_SOURCE_DIR}/libdjvu
${CMAKE_CURRENT_SOURCE_DIR}/../..
${CMAKE_BINARY_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)

link_directories(
${TQT_LIBRARY_DIRS}
)


##### other data ################################

install( FILES djvumultipage.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES djvumultipage.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES djvumultipage.rc DESTINATION ${DATA_INSTALL_DIR} )


##### djvuviewpart (module) #####################

tde_add_kpart( djvuviewpart
SOURCES
djvumultipage.cpp djvurenderer.cpp
kprintDialogPage_DJVUpageoptions.cpp
kprintDialogPage_DJVUconversionoptions.cpp
kprintDialogPage_DJVUconversionoptions_basewidget.ui
pageRangeWidget_base.ui pageRangeWidget.cpp prefs.kcfgc
LINK djvu-shared kmultipage-shared
DESTINATION ${PLUGIN_INSTALL_DIR}
)

+ 41
- 0
kviewshell/plugins/djvu/libdjvu/CMakeLists.txt View File

@@ -0,0 +1,41 @@
#################################################
#
# (C) 2010-2011 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

include( ConfigureChecks.cmake )

add_definitions(
-DUNIX
-DHAVE_STDINCLUDES
)

include_directories(
${CMAKE_BINARY_DIR}
${TQT_INCLUDE_DIRS}
)


##### djvu (shared) #############################

tde_add_library( djvu SHARED
SOURCES
Arrays.cpp DjVuDocEditor.cpp DjVuMessageLite.cpp GOS.cpp IW44Image.cpp
BSByteStream.cpp DjVuDocument.cpp DjVuNavDir.cpp GPixmap.cpp JB2EncodeCodec.cpp
BSEncodeByteStream.cpp DjVuDumpHelper.cpp DjVuPalette.cpp GRect.cpp
JB2Image.cpp ByteStream.cpp DjVuErrorList.cpp DjVuPort.cpp GScaler.cpp
JPEGDecoder.cpp DataPool.cpp DjVuFileCache.cpp DjVuText.cpp GSmartPointer.cpp
MMRDecoder.cpp DjVuFile.cpp DjVuToPS.cpp GString.cpp MMX.cpp DjVmNav.cpp
debug.cpp DjVuGlobal.cpp GBitmap.cpp GThreads.cpp UnicodeByteStream.cpp
DjVmDir0.cpp DjVuGlobalMemory.cpp GContainer.cpp GUnicode.cpp XMLParser.cpp
DjVmDir.cpp DjVuImage.cpp GException.cpp GURL.cpp XMLTags.cpp DjVmDoc.cpp
DjVuInfo.cpp GIFFManager.cpp IFFByteStream.cpp ZPCodec.cpp DjVuAnno.cpp
DjVuMessage.cpp GMapAreas.cpp IW44EncodeCodec.cpp
DESTINATION ${LIB_INSTALL_DIR}
)

+ 25
- 0
kviewshell/plugins/djvu/libdjvu/ConfigureChecks.cmake View File

@@ -0,0 +1,25 @@
#################################################
#
# (C) 2010-2011 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

include( CheckFunctionExists )

check_type_size( wchar_t WCHAR_T )

if( HAVE_WCHAR_T )
tde_save( CMAKE_EXTRA_INCLUDE_FILES )
set( CMAKE_EXTRA_INCLUDE_FILES wchar.h )
check_type_size( mbstate_t MBSTATE_T )
tde_restore( CMAKE_EXTRA_INCLUDE_FILES )
check_function_exists( iswspace HAVE_ISWSPACE )
if( HAVE_MBSTATE_T )
check_function_exists( wcrtomb HAVE_WCRTOMB )
endif( )
endif( )

+ 4
- 4
kviewshell/plugins/djvu/libdjvu/DjVuAnno.cpp View File

@@ -241,8 +241,8 @@ GLObject::print(ByteStream & str, int compact, int indent, int * cur_pos) const
else
{
char buf[8];
static char *tr1 = "\"\\tnrbf";
static char *tr2 = "\"\\\t\n\r\b\f";
static const char *tr1 = "\"\\tnrbf";
static const char *tr2 = "\"\\\t\n\r\b\f";
sprintf(buf,"\\%03o", (int)(((unsigned char*)data)[span]));
for (int i=0; tr2[i]; i++)
if (data[span] == tr2[i])
@@ -472,8 +472,8 @@ GLParser::get_token(const char * & start)
}
else
{
static char *tr1 = "tnrbfva";
static char *tr2 = "\t\n\r\b\f\013\007";
const static char *tr1 = "tnrbfva";
const static char *tr2 = "\t\n\r\b\f\013\007";
for (int i=0; tr1[i]; i++)
if (c == tr1[i])
c = tr2[i];


+ 1
- 1
kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp View File

@@ -267,7 +267,7 @@ DjVuToPS::DjVuToPS(void)
DEBUG_MAKE_INDENT(3);
DEBUG_MSG("Initializing dig2hex[]\n");
// Creating tables for bin=>text translation
static char * dig2hex="0123456789ABCDEF";
static const char * dig2hex="0123456789ABCDEF";
int i;
for(i=0;i<256;i++)
{


+ 1
- 0
kviewshell/plugins/djvu/libdjvu/GOS.cpp View File

@@ -66,6 +66,7 @@
#include "GOS.h"
#include "GURL.h"

#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>


+ 2
- 2
kviewshell/plugins/djvu/libdjvu/IFFByteStream.cpp View File

@@ -145,12 +145,12 @@ IFFByteStream::check_id(const char *id)
if (id[i]<0x20 || id[i]>0x7e)
return -1;
// check composite chunks
static char *szComposite[] = { "FORM", "LIST", "PROP", "CAT ", 0 };
static const char *szComposite[] = { "FORM", "LIST", "PROP", "CAT ", 0 };
for (i=0; szComposite[i]; i++)
if (!memcmp(id, szComposite[i], 4))
return 1;
// check reserved chunks
static char *szReserved[] = { "FOR", "LIS", "CAT", 0 };
static const char *szReserved[] = { "FOR", "LIS", "CAT", 0 };
for (i=0; szReserved[i]; i++)
if (!memcmp(id, szReserved[i], 3) && id[3]>='1' && id[3]<='9')
return -1;


Loading…
Cancel
Save