Browse Source

[kdegraphics/kpdf] added cmake support

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1229555 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
tags/v3.5.13
samelian 9 years ago
parent
commit
b41a969e52
18 changed files with 470 additions and 17 deletions
  1. +8
    -14
      CMakeLists.txt
  2. +3
    -2
      ConfigureChecks.cmake
  3. +8
    -0
      config.h.cmake
  4. +51
    -0
      kpdf/CMakeLists.txt
  5. +31
    -0
      kpdf/conf/CMakeLists.txt
  6. +33
    -0
      kpdf/core/CMakeLists.txt
  7. +23
    -0
      kpdf/core/generator_kimgio/CMakeLists.txt
  8. +30
    -0
      kpdf/core/generator_pdf/CMakeLists.txt
  9. +36
    -0
      kpdf/shell/CMakeLists.txt
  10. +29
    -0
      kpdf/ui/CMakeLists.txt
  11. +17
    -0
      kpdf/xpdf/CMakeLists.txt
  12. +57
    -0
      kpdf/xpdf/ConfigureChecks.cmake
  13. +0
    -1
      kpdf/xpdf/aconf.h
  14. +26
    -0
      kpdf/xpdf/fofi/CMakeLists.txt
  15. +26
    -0
      kpdf/xpdf/goo/CMakeLists.txt
  16. +24
    -0
      kpdf/xpdf/goo/ConfigureChecks.cmake
  17. +32
    -0
      kpdf/xpdf/splash/CMakeLists.txt
  18. +36
    -0
      kpdf/xpdf/xpdf/CMakeLists.txt

+ 8
- 14
CMakeLists.txt View File

@@ -5,9 +5,11 @@
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################

cmake_minimum_required( VERSION 2.6 )
cmake_minimum_required( VERSION 2.8 )


##### general package setup #####################
@@ -21,12 +23,9 @@ set( VERSION 3.5.13 )
include( FindPkgConfig )
include( CheckIncludeFile )
include( CheckTypeSize )
# include( CheckCSourceRuns )
include( CheckCSourceCompiles )
include( CheckCXXSourceCompiles )
include( CheckLibraryExists )
# include( CheckFunctionExists )
# include( CheckStructHasMember )


##### include our cmake modules #################
@@ -43,7 +42,8 @@ tde_setup_paths( )

##### optional stuff ############################

# option( WITH_ALSA "Enable ALSA support" ON )
option( WITH_T1LIB "Enable t1lib support" OFF )
option( WITH_LIBPAPER "Enable libpaper support" OFF )


##### user requested modules ####################
@@ -51,6 +51,7 @@ tde_setup_paths( )
option( BUILD_ALL "Build all" OFF )
option( BUILD_KVIEW "Build kview" ${BUILD_ALL} )
option( BUILD_KRULER "Build kruler" ${BUILD_ALL} )
option( BUILD_KPDF "Build kpdf" ${BUILD_ALL} )


##### configure checks ##########################
@@ -62,25 +63,18 @@ include( ConfigureChecks.cmake )

add_definitions(
-DHAVE_CONFIG_H
${TQT_CFLAGS_OTHER}
)

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include tqt.h" )
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" )


##### activate dependencies #####################

# if( BUILD_LIBKCAL OR BUILD_LIBKDEPIM OR BUILD_LIBKPIMIDENTITIES OR BUILD_KIOSLAVES OR BUILD_KMAIL )
# add_subdirectory( libemailfunctions )
# endif()


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

tde_conditional_add_subdirectory( BUILD_KVIEW kview )
tde_conditional_add_subdirectory( BUILD_KRULER kruler )
tde_conditional_add_subdirectory( BUILD_KPDF kpdf )


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


+ 3
- 2
ConfigureChecks.cmake View File

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

# required stuff
find_package( Qt )
find_package( TQt )
find_package( TDE )

+ 8
- 0
config.h.cmake View File

@@ -1 +1,9 @@
#cmakedefine VERSION "@VERSION@"

// kpdf
#cmakedefine HAVE_FREETYPE 1
#cmakedefine HAVE_DIRENT_H 1
#cmakedefine HAVE_SYS_NDIR_H 1
#cmakedefine HAVE_SYS_DIR_H 1
#cmakedefine HAVE_NDIR_H 1
#cmakedefine HAVE_PAPER_H 1

+ 51
- 0
kpdf/CMakeLists.txt View File

@@ -0,0 +1,51 @@
#################################################
#
# (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( xpdf )
add_subdirectory( conf )
add_subdirectory( core )
add_subdirectory( ui )
add_subdirectory( shell )

include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/xpdf
${CMAKE_CURRENT_SOURCE_DIR}/xpdf/goo
${CMAKE_BINARY_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)

link_directories(
${TQT_LIBRARY_DIRS}
)


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

tde_install_icons( kpdf )
install( FILES kpdf_part.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES part.rc DESTINATION ${DATA_INSTALL_DIR}/kpdfpart )


##### libkpdfpart (module) ######################

tde_add_kpart( libkpdfpart AUTOMOC
SOURCES
dcop.skel error.cpp part.cpp
LINK
kpdfconf-static kpdfui-static kpdfcore-static generatorkimgio-static
generatorpdf-static xpdf-static goo-static splash-static fofi-static
kutils-shared kdeprint-shared kparts-shared ${PAPER_LIBRARY} ${XFT_LIBRARIES}
DEPENDENCIES kpdfconf-static
DESTINATION ${PLUGIN_INSTALL_DIR}
)

+ 31
- 0
kpdf/conf/CMakeLists.txt View File

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

include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/..
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)


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

install( FILES kpdf.kcfg DESTINATION ${KCFG_INSTALL_DIR} )


##### kpdfconf (static) #########################

tde_add_library( kpdfconf STATIC_PIC
SOURCES
dlggeneral.ui dlgperformance.ui dlgaccessibility.ui
dlgpresentation.ui preferencesdialog.cpp settings.kcfgc
)

+ 33
- 0
kpdf/core/CMakeLists.txt View File

@@ -0,0 +1,33 @@
#################################################
#
# (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( generator_pdf )
add_subdirectory( generator_kimgio )

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


##### kpdfcore (static) #########################

tde_add_library( kpdfcore STATIC_PIC AUTOMOC
SOURCES
document.cpp link.cpp page.cpp pagetransition.cpp
DEPENDENCIES kpdfconf-static
)

+ 23
- 0
kpdf/core/generator_kimgio/CMakeLists.txt View File

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

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../..
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)


##### generatorkimgio (static) ##################

tde_add_library( generatorkimgio STATIC_PIC
SOURCES generator_kimgio.cpp
)

+ 30
- 0
kpdf/core/generator_pdf/CMakeLists.txt View File

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

include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../..
${CMAKE_CURRENT_SOURCE_DIR}/../..
${CMAKE_CURRENT_SOURCE_DIR}/../../xpdf
${CMAKE_CURRENT_SOURCE_DIR}/../../xpdf/goo
${CMAKE_CURRENT_SOURCE_DIR}/../../xpdf/splash
${CMAKE_BINARY_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
)


##### generatorpdf (static) #####################

tde_add_library( generatorpdf STATIC_PIC
SOURCES
generator_pdf.cpp gp_outputdev.cpp
DEPENDENCIES kpdfconf-static
)

+ 36
- 0
kpdf/shell/CMakeLists.txt View File

@@ -0,0 +1,36 @@
#################################################
#
# (C) 2010-2011 Serghei Amelian
# serghei (DOT) amelian (AT) 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 ################################

install( FILES kpdf.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES shell.rc DESTINATION ${DATA_INSTALL_DIR}/kpdf )


##### kpdf (executable) #########################

tde_add_executable( kpdf AUTOMOC
SOURCES main.cpp shell.cpp
LINK kparts-shared
DESTINATION ${BIN_INSTALL_DIR}
)

+ 29
- 0
kpdf/ui/CMakeLists.txt View File

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

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


##### kpdfui (static) ###########################

tde_add_library( kpdfui STATIC_PIC AUTOMOC
SOURCES
pagepainter.cpp pageview.cpp pageviewutils.cpp minibar.cpp
thumbnaillist.cpp searchwidget.cpp toc.cpp propertiesdialog.cpp
presentationwidget.cpp
DEPENDENCIES kpdfconf-static
)

+ 17
- 0
kpdf/xpdf/CMakeLists.txt View File

@@ -0,0 +1,17 @@
#################################################
#
# (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_subdirectory( fofi )
add_subdirectory( goo )
add_subdirectory( splash )
add_subdirectory( xpdf )

+ 57
- 0
kpdf/xpdf/ConfigureChecks.cmake View File

@@ -0,0 +1,57 @@
#################################################
#
# (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( FREETYPE freetype2 )
if( FREETYPE_FOUND )
set( HAVE_FREETYPE 1 CACHE INTERNAL "" FORCE )
else( )
tde_message_fatal( "freetype2 is required, but was not found on your system" )
endif( )


pkg_search_module( XFT xft )
if( NOT XFT_FOUND )
tde_message_fatal( "Xft is required, but was not found on your system" )
endif( )


find_package( JPEG )
if( NOT JPEG_FOUND )
tde_message_fatal( "jpeg is required, but was not found on your system" )
endif( )


# check for t1lib
if( WITH_T1LIB )
check_include_file( t1lib.h HAVE_T1LIB_H )
if( HAVE_T1LIB_H )
check_library_exists( t1 T1_InitLib "" HAVE_T1LIB )
endif( )
if( HAVE_T1LIB_H AND HAVE_T1LIB )
set( T1_LIBRARY t1 CACHE INTERNAL "" FORCE )
else( )
tde_message_fatal( "t1lib is required, but was not found on your system" )
endif( )
endif( )


# check for libpaper
if( WITH_PAPER )
check_include_file( paper.h HAVE_PAPER_H )
if( HAVE_PAPER_H )
check_library_exists( paper paperinit "" HAVE_PAPER )
endif( )
if( HAVE_PAPER_H AND HAVE_PAPER )
set( PAPER_LIBRARY paper CACHE INTERNAL "" FORCE )
else( )
tde_message_fatal( "libpaper is required, but was not found on your system" )
endif( )
endif( )

+ 0
- 1
kpdf/xpdf/aconf.h View File

@@ -3,7 +3,6 @@

#include <config.h>

#define HAVE_T1LIB_H 0
#define HAVE_FREETYPE_H HAVE_FREETYPE
#define HAVE_FREETYPE_FREETYPE_H HAVE_FREETYPE
#define OPI_SUPPORT 0


+ 26
- 0
kpdf/xpdf/fofi/CMakeLists.txt View File

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

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_SOURCE_DIR}/../goo
${CMAKE_BINARY_DIR}
${TQT_INCLUDE_DIRS}
)


##### fofi (static) #############################

tde_add_library( fofi STATIC_PIC
SOURCES
FoFiBase.cc FoFiEncodings.cc FoFiTrueType.cc FoFiType1.cc
FoFiType1C.cc
)

+ 26
- 0
kpdf/xpdf/goo/CMakeLists.txt View File

@@ -0,0 +1,26 @@
#################################################
#
# (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 )

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_BINARY_DIR}
${TQT_INCLUDE_DIRS}
)


##### goo (static) ##############################

tde_add_library( goo STATIC_PIC
SOURCES
GHash.cc GList.cc GString.cc gfile.cc gmem.cc gmempp.cc
)

+ 24
- 0
kpdf/xpdf/goo/ConfigureChecks.cmake View File

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

check_include_file( "dirent.h" HAVE_DIRENT_H )
if( NOT HAVE_DIRENT_H )
check_include_file( "sys/ndir.h" HAVE_SYS_NDIR_H )
if( NOT HAVE_SYS_NDIR_H )
check_include_file( "sys/dir.h" HAVE_SYS_DIR_H )
if( NOT HAVE_SYS_DIR_H )
check_include_file( "ndir.h" HAVE_NDIR_H )
if( NOT HAVE_NDIR_H )
tde_message_fatal( "dirent.h is missing, this should not happen." )
endif( )
endif( )
endif( )
endif( )

+ 32
- 0
kpdf/xpdf/splash/CMakeLists.txt View File

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

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_SOURCE_DIR}/../goo
${CMAKE_CURRENT_SOURCE_DIR}/../fofi
${CMAKE_BINARY_DIR}
${TQT_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
)


##### splash (static) ###########################

tde_add_library( splash STATIC_PIC
SOURCES
Splash.cc SplashBitmap.cc SplashClip.cc SplashFTFont.cc
SplashFTFontEngine.cc SplashFTFontFile.cc SplashFont.cc
SplashFontEngine.cc SplashFontFile.cc SplashFontFileID.cc
SplashPath.cc SplashPattern.cc SplashScreen.cc SplashState.cc
SplashT1Font.cc SplashT1FontEngine.cc SplashT1FontFile.cc
SplashXPath.cc SplashXPathScanner.cc
)

+ 36
- 0
kpdf/xpdf/xpdf/CMakeLists.txt View File

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

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_SOURCE_DIR}/../goo
${CMAKE_CURRENT_SOURCE_DIR}/../fofi
${CMAKE_CURRENT_SOURCE_DIR}/../splash
${CMAKE_BINARY_DIR}
${TQT_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
)


##### xpdf (static) #############################

tde_add_library( xpdf STATIC_PIC
SOURCES
Annot.cc Array.cc BuiltinFont.cc BuiltinFontTables.cc
Catalog.cc CharCodeToUnicode.cc CMap.cc Decrypt.cc Dict.cc
FontEncodingTables.cc Function.cc Gfx.cc GfxFont.cc GfxState.cc
GlobalParams.cc JArithmeticDecoder.cc JBIG2Stream.cc Lexer.cc Link.cc
NameToCharCode.cc Object.cc Outline.cc OutputDev.cc PDFDoc.cc
PDFDocEncoding.cc PreScanOutputDev.cc PSTokenizer.cc Page.cc
Parser.cc PSOutputDev.cc SecurityHandler.cc SplashOutputDev.cc
Stream.cc JPXStream.cc TextOutputDev.cc UnicodeMap.cc
UnicodeTypeTable.cc XRef.cc
)

Loading…
Cancel
Save