summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-05-27 18:38:14 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-09-21 19:58:56 +0900
commitaf121719c99a99fc3444d181777a6177f0d59dba (patch)
tree786cf8548c92daf560733278701d95d3079b1d2f
parent5b8d2d73599f1a06c2106ef71b9774dada86e076 (diff)
downloadlibksquirrel-af121719c99a99fc3444d181777a6177f0d59dba.tar.gz
libksquirrel-af121719c99a99fc3444d181777a6177f0d59dba.zip
Conversion to cmake building system
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--CMakeLists.txt159
-rw-r--r--ConfigureChecks.cmake363
-rw-r--r--INSTALL32
-rw-r--r--config.h.cmake38
-rw-r--r--configure.ac3
-rw-r--r--doc/CMakeLists.txt17
-rw-r--r--kernel/CMakeLists.txt106
-rw-r--r--kernel/Makefile.am1
-rw-r--r--kernel/include/dds.h (renamed from kernel/kls_dds/dds.h)0
-rw-r--r--kernel/include/fmt_codec_cd_func.h6
-rw-r--r--kernel/include/ksquirrel-libs/fileio.h4
-rw-r--r--kernel/include/ksquirrel-libs/fmt_codec_base.h2
-rw-r--r--kernel/include/ksquirrel-libs/fmt_types.h2
-rw-r--r--kernel/include/ksquirrel-libs/fmt_utils.h18
-rw-r--r--kernel/include/ksquirrel-libs/ksquirrel_libs_export.h33
-rw-r--r--kernel/kls_avs/Makefile.am2
-rw-r--r--kernel/kls_bmp/Makefile.am2
-rw-r--r--kernel/kls_camera/CMakeLists.txt52
-rw-r--r--kernel/kls_camera/Makefile.am2
-rw-r--r--kernel/kls_camera/ksquirrel-libs-camera2ppm20
-rw-r--r--kernel/kls_cut/Makefile.am2
-rw-r--r--kernel/kls_dds/Makefile.am2
-rw-r--r--kernel/kls_dicom/CMakeLists.txt31
-rw-r--r--kernel/kls_dicom/Makefile.am2
-rw-r--r--kernel/kls_dicom/ksquirrel-libs-dicom2png.cmake3
-rw-r--r--kernel/kls_djvu/CMakeLists.txt35
-rw-r--r--kernel/kls_djvu/Makefile.am2
-rw-r--r--kernel/kls_dxf/CMakeLists.txt35
-rw-r--r--kernel/kls_dxf/Makefile.am2
-rw-r--r--kernel/kls_eps/CMakeLists.txt20
-rw-r--r--kernel/kls_eps/Makefile.am2
-rw-r--r--kernel/kls_fig/CMakeLists.txt34
-rw-r--r--kernel/kls_fig/Makefile.am2
-rw-r--r--kernel/kls_fig/ksquirrel-libs-fig2ppm.cmake3
-rw-r--r--kernel/kls_fli/Makefile.am2
-rw-r--r--kernel/kls_gif/CMakeLists.txt15
-rw-r--r--kernel/kls_gif/Makefile.am2
-rw-r--r--kernel/kls_hdr/Makefile.am2
-rw-r--r--kernel/kls_ico/Makefile.am2
-rw-r--r--kernel/kls_iff/CMakeLists.txt34
-rw-r--r--kernel/kls_iff/Makefile.am2
-rw-r--r--kernel/kls_iff/ksquirrel-libs-iff2ppm.cmake3
-rw-r--r--kernel/kls_jbig/CMakeLists.txt19
-rw-r--r--kernel/kls_jbig/Makefile.am2
-rw-r--r--kernel/kls_jbig/libjbig/CMakeLists.txt12
-rw-r--r--kernel/kls_jpeg/CMakeLists.txt15
-rw-r--r--kernel/kls_jpeg/Makefile.am2
-rw-r--r--kernel/kls_jpeg2000/CMakeLists.txt15
-rw-r--r--kernel/kls_jpeg2000/Makefile.am2
-rw-r--r--kernel/kls_jpeg2000/fmt_codec_jpeg2000.cpp4
-rw-r--r--kernel/kls_koala/Makefile.am2
-rw-r--r--kernel/kls_leaf/CMakeLists.txt35
-rw-r--r--kernel/kls_leaf/Makefile.am2
-rw-r--r--kernel/kls_leaf/ksquirrel-libs-leaf2ppm.cmake3
-rw-r--r--kernel/kls_lif/Makefile.am2
-rw-r--r--kernel/kls_ljpeg/CMakeLists.txt36
-rw-r--r--kernel/kls_ljpeg/Makefile.am2
-rw-r--r--kernel/kls_ljpeg/ksquirrel-libs-ljpeg2ppm-s18
-rw-r--r--kernel/kls_ljpeg/ljpeg2ppm/CMakeLists.txt14
-rw-r--r--kernel/kls_ljpeg/ljpeg2ppm/Makefile.am2
-rw-r--r--kernel/kls_mac/CMakeLists.txt35
-rw-r--r--kernel/kls_mac/Makefile.am2
-rw-r--r--kernel/kls_mac/ksquirrel-libs-mac2ppm.cmake3
-rw-r--r--kernel/kls_mdl/Makefile.am2
-rw-r--r--kernel/kls_mng/CMakeLists.txt15
-rw-r--r--kernel/kls_mng/Makefile.am2
-rw-r--r--kernel/kls_msp/CMakeLists.txt15
-rw-r--r--kernel/kls_msp/Makefile.am2
-rw-r--r--kernel/kls_mtv/Makefile.am2
-rw-r--r--kernel/kls_neo/CMakeLists.txt35
-rw-r--r--kernel/kls_neo/Makefile.am2
-rw-r--r--kernel/kls_neo/ksquirrel-libs-neo2ppm.cmake3
-rw-r--r--kernel/kls_openexr/CMakeLists.txt16
-rw-r--r--kernel/kls_openexr/Makefile.am2
-rw-r--r--kernel/kls_pcx/Makefile.am2
-rw-r--r--kernel/kls_pi1/CMakeLists.txt35
-rw-r--r--kernel/kls_pi1/Makefile.am2
-rw-r--r--kernel/kls_pi1/ksquirrel-libs-pi12ppm.cmake3
-rw-r--r--kernel/kls_pi3/CMakeLists.txt35
-rw-r--r--kernel/kls_pi3/Makefile.am2
-rw-r--r--kernel/kls_pi3/ksquirrel-libs-pi32ppm.cmake3
-rw-r--r--kernel/kls_pict/CMakeLists.txt35
-rw-r--r--kernel/kls_pict/Makefile.am2
-rw-r--r--kernel/kls_pict/ksquirrel-libs-pict2ppm.cmake3
-rw-r--r--kernel/kls_pix/Makefile.am2
-rw-r--r--kernel/kls_png/CMakeLists.txt21
-rw-r--r--kernel/kls_png/Makefile.am2
-rw-r--r--kernel/kls_pnm/Makefile.am2
-rw-r--r--kernel/kls_psd/Makefile.am2
-rw-r--r--kernel/kls_psp/Makefile.am2
-rw-r--r--kernel/kls_pxr/Makefile.am2
-rw-r--r--kernel/kls_ras/Makefile.am2
-rw-r--r--kernel/kls_rawrgb/Makefile.am2
-rw-r--r--kernel/kls_sct/Makefile.am2
-rw-r--r--kernel/kls_sgi/Makefile.am2
-rw-r--r--kernel/kls_sun/Makefile.am2
-rw-r--r--kernel/kls_svg/CMakeLists.txt38
-rw-r--r--kernel/kls_svg/Makefile.am2
-rw-r--r--kernel/kls_svg/ksquirrel-libs-svg2png20
-rw-r--r--kernel/kls_tga/Makefile.am2
-rw-r--r--kernel/kls_tiff/CMakeLists.txt28
-rw-r--r--kernel/kls_tiff/Makefile.am2
-rw-r--r--kernel/kls_ttf/CMakeLists.txt26
-rw-r--r--kernel/kls_ttf/Makefile.am2
-rw-r--r--kernel/kls_ttf/ftview/CMakeLists.txt13
-rw-r--r--kernel/kls_ttf/ftview/Makefile.am2
-rw-r--r--kernel/kls_utah/CMakeLists.txt35
-rw-r--r--kernel/kls_utah/Makefile.am2
-rw-r--r--kernel/kls_utah/ksquirrel-libs-utah2ppm.cmake3
-rw-r--r--kernel/kls_wal/Makefile.am2
-rw-r--r--kernel/kls_wbmp/Makefile.am2
-rw-r--r--kernel/kls_wmf/CMakeLists.txt16
-rw-r--r--kernel/kls_wmf/Makefile.am2
-rw-r--r--kernel/kls_xbm/Makefile.am2
-rw-r--r--kernel/kls_xcf/CMakeLists.txt40
-rw-r--r--kernel/kls_xcf/Makefile.am2
-rw-r--r--kernel/kls_xcf/xcf2pnm/CMakeLists.txt14
-rw-r--r--kernel/kls_xcf/xcf2pnm/io-unix.c4
-rw-r--r--kernel/kls_xcf/xcf2pnm/options.i4
-rw-r--r--kernel/kls_xcf/xcf2pnm/pixels.c4
-rw-r--r--kernel/kls_xcf/xcf2pnm/utils.c4
-rw-r--r--kernel/kls_xcf/xcf2pnm/xcf-general.c12
-rw-r--r--kernel/kls_xcf/xcf2pnm/xcf2pnm.c4
-rw-r--r--kernel/kls_xcf/xcf2pnm/xcf2pnm.oi4
-rw-r--r--kernel/kls_xcf/xcf2pnm/xcftools.h4
-rw-r--r--kernel/kls_xcur/Makefile.am2
-rw-r--r--kernel/kls_xim/CMakeLists.txt35
-rw-r--r--kernel/kls_xim/Makefile.am2
-rw-r--r--kernel/kls_xim/ksquirrel-libs-xim2ppm.cmake3
-rw-r--r--kernel/kls_xpm/CMakeLists.txt28
-rw-r--r--kernel/kls_xpm/Makefile.am2
-rw-r--r--kernel/kls_xwd/CMakeLists.txt15
-rw-r--r--kernel/kls_xwd/Makefile.am2
-rw-r--r--kernel/ksquirrel-libs-png/CMakeLists.txt19
-rw-r--r--kernel/ksquirrel-libs-png/Makefile.am2
-rw-r--r--kernel/ksquirrel-libs-png/pngconf.h4
-rw-r--r--kernel/ksquirrel-libs/Makefile.am4
-rw-r--r--ksquirrellibs.pc.cmake11
138 files changed, 1909 insertions, 102 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..22c5817
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,159 @@
+############################################
+#
+# (C) 2023 Michele Calgaro
+# Michele (DOT) Calgaro (AT) yahoo.it
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+############################################
+
+
+cmake_minimum_required( VERSION 3.1 )
+
+
+#### general package setup
+
+project( libksquirrel )
+
+set(LIBKSQUIRREL_VERSION_MAJOR 0)
+set(LIBKSQUIRREL_VERSION_MINOR 8)
+set(LIBKSQUIRREL_VERSION_PATCH 0)
+set(LIBKSQUIRREL_VERSION_STRING
+ "${LIBKSQUIRREL_VERSION_MAJOR}.${LIBKSQUIRREL_VERSION_MINOR}.${LIBKSQUIRREL_VERSION_PATCH}")
+
+
+#### include essential cmake modules
+
+include( FindPkgConfig )
+include( CheckFunctionExists )
+include( CheckSymbolExists )
+include( CheckIncludeFile )
+include( CheckLibraryExists )
+include( CheckCSourceCompiles )
+include( CheckCXXSourceCompiles )
+
+
+#### include our cmake modules
+
+include( TDEMacros )
+
+
+##### set version number
+
+tde_set_project_version( )
+
+
+##### setup install paths
+
+include( TDESetupPaths )
+tde_setup_paths( )
+
+
+##### optional stuff
+
+option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
+option( WITH_JPEG "Build camera code with jpeg support" ${WITH_ALL_OPTIONS} )
+option( WITH_LCMS "Build codecs with lcms support" ${WITH_ALL_OPTIONS} )
+
+option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
+
+
+##### user requested modules
+
+option( BUILD_ALL "Build all" ON )
+option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
+
+option( BUILD_AVS "Build avs codec" ${BUILD_ALL} )
+option( BUILD_BMP "Build bmp codec" ${BUILD_ALL} )
+option( BUILD_CAMERA "Build camera codec" ${BUILD_ALL} )
+option( BUILD_CUT "Build cut codec" ${BUILD_ALL} )
+option( BUILD_DDS "Build dds codec" ${BUILD_ALL} )
+option( BUILD_DICOM "Build dicom codec" ${BUILD_ALL} )
+option( BUILD_DJVU "Build djvu codec" ${BUILD_ALL} )
+option( BUILD_DXF "Build dxf codec" OFF )
+option( BUILD_EPS "Build eps codec" ${BUILD_ALL} )
+option( BUILD_FIG "Build fig codec" ${BUILD_ALL} )
+option( BUILD_FLI "Build fli codec" ${BUILD_ALL} )
+option( BUILD_GIF "Build gif codec" ${BUILD_ALL} )
+option( BUILD_HDR "Build hdr codec" ${BUILD_ALL} )
+option( BUILD_ICO "Build ico codec" ${BUILD_ALL} )
+option( BUILD_IFF "Build iff codec" ${BUILD_ALL} )
+option( BUILD_JBIG "Build jbig codec" ${BUILD_ALL} )
+option( BUILD_JPEG2000 "Build jpeg2000 codec" ${BUILD_ALL} )
+option( BUILD_JPEG "Build jpeg codec" ${BUILD_ALL} )
+option( BUILD_KOALA "Build koala codec" ${BUILD_ALL} )
+option( BUILD_LEAF "Build leaf codec" ${BUILD_ALL} )
+option( BUILD_LIF "Build lif codec" ${BUILD_ALL} )
+option( BUILD_LJPEG "Build ljpeg codec" ${BUILD_ALL} )
+option( BUILD_MAC "Build mac codec" ${BUILD_ALL} )
+option( BUILD_MDL "Build mdl codec" ${BUILD_ALL} )
+option( BUILD_MNG "Build mng codec" ${BUILD_ALL} )
+option( BUILD_MSP "Build msp codecs" ${BUILD_ALL} )
+option( BUILD_MTV "Build mtv codec" ${BUILD_ALL} )
+option( BUILD_NEO "Build neo codec" ${BUILD_ALL} )
+option( BUILD_OPENEXR "Build openexr codec" ${BUILD_ALL} )
+option( BUILD_PCX "Build pcx codec" ${BUILD_ALL} )
+option( BUILD_PI1 "Build pi1 codec" ${BUILD_ALL} )
+option( BUILD_PI3 "Build pi3 codec" ${BUILD_ALL} )
+option( BUILD_PICT "Build pict codec" ${BUILD_ALL} )
+option( BUILD_PIX "Build pix codec" ${BUILD_ALL} )
+option( BUILD_PNG "Build png codec" ${BUILD_ALL} )
+option( BUILD_PNM "Build pnm codec" ${BUILD_ALL} )
+option( BUILD_PSD "Build psd codec" ${BUILD_ALL} )
+option( BUILD_PSP "Build psp codec" ${BUILD_ALL} )
+option( BUILD_PXR "Build pxr codec" ${BUILD_ALL} )
+option( BUILD_RAS "Build ras codec" ${BUILD_ALL} )
+option( BUILD_RAWRGB "Build rawrgb codec" ${BUILD_ALL} )
+option( BUILD_SCT "Build sct codec" ${BUILD_ALL} )
+option( BUILD_SGI "Build sgi codec" ${BUILD_ALL} )
+option( BUILD_SUN "Build sun codec" ${BUILD_ALL} )
+option( BUILD_SVG "Build svg codec" ${BUILD_ALL} )
+option( BUILD_TGA "Build tga codec" ${BUILD_ALL} )
+option( BUILD_TIFF "Build tiff codec" ${BUILD_ALL} )
+option( BUILD_TTF "Build ttf codec" ${BUILD_ALL} )
+option( BUILD_UTAH "Build utah codec" ${BUILD_ALL} )
+option( BUILD_WAL "Build wal codec" ${BUILD_ALL} )
+option( BUILD_WBMP "Build wbmp codec" ${BUILD_ALL} )
+option( BUILD_WMF "Build wmf codec" ${BUILD_ALL} )
+option( BUILD_XBM "Build xbm codec" ${BUILD_ALL} )
+option( BUILD_XCF "Build xcf codec" ${BUILD_ALL} )
+option( BUILD_XCUR "Build xcur codec" ${BUILD_ALL} )
+option( BUILD_XIM "Build xim codec" ${BUILD_ALL} )
+option( BUILD_XPM "Build xpm codec" ${BUILD_ALL} )
+option( BUILD_XWD "Build xwd codec" ${BUILD_ALL} )
+
+
+##### configure checks
+
+include( ConfigureChecks.cmake )
+
+
+##### global compiler settings
+
+add_definitions( -DHAVE_CONFIG_H )
+
+set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
+set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
+
+
+##### write pkgconfig file
+
+string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} )
+string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR} )
+string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} )
+
+configure_file( ksquirrellibs.pc.cmake ksquirrellibs.pc @ONLY )
+install( FILES ${CMAKE_CURRENT_BINARY_DIR}/ksquirrellibs.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} )
+
+
+##### source directories
+
+add_subdirectory( kernel )
+tde_conditional_add_subdirectory( BUILD_DOC doc )
+
+
+##### write configure files
+
+configure_file( config.h.cmake config.h @ONLY )
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
new file mode 100644
index 0000000..2206bc9
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,363 @@
+###########################################
+# #
+# Improvements and feedback are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+###########################################
+
+
+# required stuff
+find_package( TQt )
+find_package( TDE )
+
+tde_setup_architecture_flags( )
+
+include(TestBigEndian)
+test_big_endian(WORDS_BIGENDIAN)
+
+tde_setup_largefiles( )
+
+
+##### check for gcc visibility support
+
+if( WITH_GCC_VISIBILITY )
+ tde_setup_gcc_visibility( )
+endif( WITH_GCC_VISIBILITY )
+
+
+##### check for lcms #####
+
+if( WITH_LCMS )
+ pkg_search_module( LCMS lcms )
+ if( NOT LCMS_FOUND )
+ tde_message_fatal( "lcms was requested but was not found on your system" )
+ endif()
+endif( )
+
+
+##### check for math libc #####
+
+find_library( MATH_LIBC m )
+if( NOT MATH_LIBC )
+ tde_message_fatal( "libm is required but not found on your system" )
+endif( )
+
+
+##### check for zlib #####
+
+pkg_search_module( ZLIB zlib )
+if( NOT ZLIB_FOUND )
+ tde_message_fatal( "zlib is required but not found on your system" )
+endif( )
+
+
+##### checks for dicom codec #####
+
+if( BUILD_DICOM )
+ ## check for medcon
+ find_program( DICOM_COMMAND NAMES medcon )
+ if( NOT DICOM_COMMAND )
+ tde_message_fatal( "dicom codec was requested but medcon not found on your system" )
+ endif( )
+endif( )
+
+
+##### checks for djvu codec #####
+
+if( BUILD_DJVU )
+ ## check for ddjvu
+ find_program( DJVU_COMMAND NAMES ddjvu )
+ if( NOT DJVU_COMMAND )
+ tde_message_fatal( "djvu codec was requested but ddjvu not found on your system" )
+ endif( )
+endif( )
+
+
+##### checks for dxf codec #####
+
+if( BUILD_DXF )
+ ## check for vec2web
+ find_program( DXF_COMMAND NAMES vec2web )
+ if( NOT DXF_COMMAND )
+ tde_message_fatal( "dxf codec was requested but vec2web not found on your system" )
+ endif( )
+endif( )
+
+
+##### checks for eps codec #####
+
+if( BUILD_EPS )
+ find_program( EPS_COMMAND NAMES gs )
+ if( NOT EPS_COMMAND )
+ tde_message_fatal( "eps codec was requested but gs not found on your system" )
+ endif( )
+endif( )
+
+
+##### checks for fig codec #####
+
+if( BUILD_FIG )
+ ## check for fig2dev
+ find_program( FIG2DEV_COMMAND NAMES fig2dev )
+ if( NOT FIG2DEV_COMMAND )
+ tde_message_fatal( "fig codec was requested but fig2dev not found on your system" )
+ endif( )
+endif( )
+
+
+##### checks for gif codec #####
+
+if( BUILD_GIF )
+ find_package( GIF )
+ if( NOT GIF_FOUND )
+ tde_message_fatal( "libgif was requested but not found on your system." )
+ endif( )
+endif( )
+
+
+##### checks for iff codec #####
+
+if( BUILD_IFF )
+ find_program( IFFTOPPM_COMMAND NAMES ilbmtoppm)
+ if( NOT IFFTOPPM_COMMAND )
+ tde_message_fatal( "iff codec was requested but ilbmtoppm not found on your system." )
+ endif( )
+endif( )
+
+
+##### check for jpeg codec #####
+
+if( BUILD_JPEG OR WITH_JPEG )
+ find_package( JPEG )
+ if( NOT JPEG_FOUND )
+ tde_message_fatal( "libjpeg was requested but not found on your system" )
+ endif()
+endif()
+
+
+##### checks for jpeg2000 codec #####
+
+if( BUILD_JPEG2000 )
+ find_package( Jasper )
+ if( NOT JASPER_FOUND )
+ tde_message_fatal( "libjasper was requested but not found on your system." )
+ endif( )
+ check_include_file( stdint.h HAVE_STDINT_H )
+endif( )
+
+
+##### check for leaf codec #####
+
+if( BUILD_LEAF )
+ find_program( LEAFTOPPM_COMMAND NAMES leaftoppm )
+ if( NOT LEAFTOPPM_COMMAND )
+ tde_message_fatal( "leaf codec was requested but leaftoppm not found on your system." )
+ endif( )
+endif( )
+
+
+##### check for mac codec #####
+
+if ( BUILD_MAC )
+ find_program( MACPTOPPM_COMMAND NAMES macptopbm )
+ if( NOT MACPTOPPM_COMMAND )
+ tde_message_fatal( "mac codec was requested but macptopbm not found on your system." )
+ endif( )
+endif( )
+
+
+##### checks for mng codec #####
+
+if( BUILD_MNG )
+ find_file( HAVE_LIBMNG_H "libmng.h" )
+ if( NOT HAVE_LIBMNG_H )
+ tde_message_fatal( "libmng was requested but not found on your system." )
+ endif( )
+ set( MNG_LIBRARY mng )
+endif( )
+
+
+##### check for neotoppm codec #####
+
+if( BUILD_NEO )
+ find_program( NEOTOPPM_COMMAND NAMES neotoppm )
+ if( NOT NEOTOPPM_COMMAND )
+ tde_message_fatal( "neo codec was requested but neotoppm not found on your system." )
+ endif( )
+endif( )
+
+
+##### checks for openexr codec #####
+
+if( BUILD_OPENEXR )
+ pkg_search_module( OPENEXR OpenEXR )
+ if( NOT OPENEXR_FOUND )
+ tde_message_fatal( "libopenexr was requested but not found on your system." )
+ endif( )
+endif( )
+
+
+##### check for pi1toppm codec #####
+
+if( BUILD_PI1 )
+ find_program( PI1TOPPM_COMMAND NAMES pi1toppm )
+ if( NOT PI1TOPPM_COMMAND )
+ tde_message_fatal( "pi1 codec was requested but pi1toppm not found on your system." )
+ endif( )
+endif( )
+
+
+##### check for pi3toppm codec #####
+
+if( BUILD_PI3 )
+ find_program( PI3TOPPM_COMMAND NAMES pi3topbm )
+ if( NOT PI3TOPPM_COMMAND )
+ tde_message_fatal( "pi3 codec was requested but pi3topbm not found on your system." )
+ endif( )
+endif( )
+
+
+##### check for picttoppm codec #####
+
+if( BUILD_PICT )
+ find_program( PICTTOPPM_COMMAND NAMES picttoppm )
+ if( NOT PICTTOPPM_COMMAND )
+ tde_message_fatal( "pict codec was requested but picttoppm not found on your system." )
+ endif( )
+endif( )
+
+
+##### checks for svg codec #####
+
+if( BUILD_SVG )
+ find_program( RSVG_COMMAND NAMES "rsvg-convert" )
+ if( NOT RSVG_COMMAND )
+ tde_message_fatal( "svg codec was requested but rsvg-convert not found on your system" )
+ endif( )
+endif( )
+
+
+##### checks for tiff codec #####
+
+if( BUILD_TIFF )
+ find_package( TIFF )
+ if( NOT TIFF_FOUND )
+ tde_message_fatal( "libtiff was requested but not found on your system" )
+ endif( )
+endif( )
+
+
+##### checks for ttf codec #####
+
+if( BUILD_TTF )
+ pkg_search_module( FREETYPE freetype2 )
+ if( NOT FREETYPE_FOUND )
+ tde_message_fatal( "ttf codec was requested but freetype2 not found on your system." )
+ endif( )
+endif( )
+
+
+##### check for utah codec #####
+
+if( BUILD_UTAH )
+ find_program( UTAHTOPPM_COMMAND NAMES rletopnm)
+ if( NOT UTAHTOPPM_COMMAND )
+ tde_message_fatal( "utah codec was requested but rletopnm not found on your system." )
+ endif( )
+endif( )
+
+
+##### checks for wmf codec #####
+
+if( BUILD_WMF )
+ pkg_search_module( WMF libwmf )
+ if( NOT WMF_FOUND )
+ find_program( WMF_CONFIG_EXECUTABLE NAMES "libwmf-config" )
+
+ if( WMF_CONFIG_EXECUTABLE )
+ execute_process(
+ COMMAND ${WMF_CONFIG_EXECUTABLE} --libs
+ OUTPUT_VARIABLE WMF_LDFLAGS
+ ERROR_VARIABLE WMF_LDFLAGS
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE
+ )
+ set( WMF_LIBRARIES "" )
+ set( WMF_LIBRARY_DIRS "" )
+ string( REPLACE " " ";" WMF_LDFLAGS ${WMF_LDFLAGS} )
+ foreach( _ldflag IN LISTS WMF_LDFLAGS )
+ if( _ldflag MATCHES "^-L" )
+ string( REGEX REPLACE "^-L" "" _libdir "${_ldflag}" )
+ list( APPEND WMF_LIBRARY_DIRS ${_libdir} )
+ endif()
+ if( _ldflag MATCHES "^-l" )
+ string( REGEX REPLACE "^-l" "" _lib "${_ldflag}" )
+ list( APPEND WMF_LIBRARIES ${_lib} )
+ endif()
+ endforeach()
+
+ execute_process(
+ COMMAND ${WMF_CONFIG_EXECUTABLE} --cflags
+ OUTPUT_VARIABLE WMF_CFLAGS
+ ERROR_VARIABLE WMF_CFLAGS
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE
+ )
+ set( WMF_INCLUDE_DIRS "" )
+ string( REPLACE " " ";" WMF_CFLAGS ${WMF_CFLAGS} )
+ foreach( _cflag IN LISTS WMF_CFLAGS )
+ if( _cflag MATCHES "^-I" )
+ string( REGEX REPLACE "^-I" "" _incdir "${_cflag}" )
+ list( APPEND WMF_INCLUDE_DIRS ${_incdir} )
+ endif()
+ endforeach()
+
+ set( WMF_FOUND 1 CACHE BOOL "WMF library found" FORCE )
+ set( WMF_LIBRARIES "${WMF_LIBRARIES}" CACHE INTERNAL "WMF link libraries" )
+ set( WMF_INCLUDE_DIRS "${WMF_INCLUDE_DIRS}" CACHE INTERNAL "WMF include directories" )
+ endif( )
+ endif( )
+ if( NOT WMF_FOUND )
+ tde_message_fatal( "libwmf was requested but not found on your system." )
+ endif( )
+endif( )
+
+
+##### checks for xcf codec #####
+
+if( BUILD_XCF )
+ check_include_file( "inttypes.h" HAVE_INTTYPES_H )
+ check_include_file( "netinet/in.h" HAVE_NETINET_IN_H )
+ check_include_file( "arpa/inet.h" HAVE_ARPA_INET_H )
+ check_include_file( "getopt.h" HAVE_GETOPT_H )
+ check_function_exists( "getopt_long" HAVE_GETOPT_LONG )
+ check_function_exists( "mmap" HAVE_MMAP )
+ check_function_exists( "strcasecmp" HAVE_STRCASECMP )
+
+ check_include_file( "iconv.h" HAVE_ICONV_H )
+ if( NOT HAVE_ICONV_H )
+ tde_message_fatal( "xcf codec was requested but libiconv not found on your system" )
+ endif( )
+ set( HAVE_ICONV 1 )
+endif( )
+
+
+##### check for xim codec #####
+
+if( BUILD_XIM )
+ find_program( XIMTOPPM_COMMAND NAMES ximtoppm )
+ if( NOT XIMTOPPM_COMMAND )
+ tde_message_fatal( "xim codec was requested but ximtoppm not found on your system." )
+ endif( )
+endif( )
+
+
+##### checks for xwd codec #####
+
+if( BUILD_XWD )
+ find_file( HAVE_XWDFILE_H "XWDFile.h" )
+ if( NOT HAVE_XWDFILE_H )
+ tde_message_fatal( "xwd codec was requested but xwdfile.h not found on your system" )
+ endif( )
+endif( )
diff --git a/INSTALL b/INSTALL
index 28ba2ff..191a678 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,22 +1,16 @@
-How to install 'ksquirrel-libs' package:
+Basic Installation
+==================
- a) from sources
- # tar jxfv ksquirrel-libs-0.8.0.tar.bz2
- # cd ksquirrel-libs-0.8.0/
- * # su -c './required-etch'
- # ./configure.gnu (not ./configure !)
- # make
- # su -c 'make install'
+libksquirrel relies on cmake to build.
-* For Debian Etch and Ubuntu Feisty only.
- This will install all required packages with aptitude.
+Here are suggested default options:
- b) from binary packages
-RPM # rpm -ihv ksquirrel-libs-0.8.0.rpm
-TGZ # installpkg ksquirrel-libs-0.8.0.tgz
-DEB # dpkg -i ksquirrel-libs-0.8.0.deb
-
---------------------------------------------------------------
-
-Note: You can pass all regular 'configure' parameters to configure.gnu.
-Note: Your automake version should be 1.8 or higher.
+ -DCMAKE_INSTALL_PREFIX="/opt/trinity" \
+ -DCONFIG_INSTALL_DIR="/etc/trinity" \
+ -DSYSCONF_INSTALL_DIR="/etc/trinity" \
+ -DXDG_MENU_INSTALL_DIR="/etc/xdg/menus" \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_VERBOSE_MAKEFILE="ON" \
+ -DCMAKE_SKIP_RPATH="OFF" \
+ -DBUILD_ALL="ON" \
+ -DWITH_ALL_OPTIONS="ON"
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000..2b1a33d
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,38 @@
+#define VERSION "@VERSION@"
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
+
+// package name and string
+#define PACKAGE_NAME "ksquirrel-libs"
+#define PACKAGE_STRING "ksquirrel-libs @LIBKSQUIRREL_VERSION_STRING@"
+#define PACKAGE_VERSION "@LIBKSQUIRREL_VERSION_STRING@"
+
+// Defined if you have "inttypes.h" header file
+#cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@
+
+// Defined if you have "stdint.h" header file
+#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
+
+// Defined if you have "netinet/in.h" header file
+#cmakedefine HAVE_NETINET_IN_H @HAVE_NETINET_IN_H@
+
+// Defined if you have "arpa/inet.h" header file
+#cmakedefine HAVE_ARPA_INET_H @HAVE_ARPA_INET_H@
+
+// Defined if you have "getopt.h" header file
+#cmakedefine HAVE_GETOPT_H @HAVE_GETOPT_H@
+
+// Defined if you have "getopt_long" support
+#cmakedefine HAVE_GETOPT_LONG @HAVE_GETOPT_LONG@
+
+// Defined if you have "mmap" support
+#cmakedefine HAVE_MMAP @HAVE_MMAP@
+
+// Defined if you have "strcasecmp" support
+#cmakedefine HAVE_STRCASECMP @HAVE_STRCASECMP@
+
+// Defined if you have "libiconv" support
+#cmakedefine HAVE_ICONV @HAVE_ICONV@
+
diff --git a/configure.ac b/configure.ac
index c54d6e4..c4ad72c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,6 +33,9 @@ KDE_PROG_LIBTOOL
# AM_PROG_CC_C_O
+KDE_USE_TQT(3.1)
+AC_PATH_KDE
+
# Checks for header files.
AC_HEADER_STDC
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000..c5ecf8c
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,17 @@
+install(
+ DIRECTORY html/
+ DESTINATION ${SHARE_INSTALL_PREFIX}/doc/ksquirrel-libs/${LIBKSQUIRREL_VERSION_STRING}
+ PATTERN "Makefile.am" EXCLUDE
+)
+
+install(
+ DIRECTORY man/
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ PATTERN "Makefile.am" EXCLUDE
+)
+
+install(
+ DIRECTORY sources/
+ DESTINATION ${SHARE_INSTALL_PREFIX}/doc/ksquirrel-libs/${LIBKSQUIRREL_VERSION_STRING}/sources
+ PATTERN "sources/Makefile.am" EXCLUDE
+)
diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt
new file mode 100644
index 0000000..bd7d3b6
--- /dev/null
+++ b/kernel/CMakeLists.txt
@@ -0,0 +1,106 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+)
+
+
+##### install files
+
+install(
+ DIRECTORY include/ksquirrel-libs/
+ DESTINATION ${INCLUDE_INSTALL_DIR}/ksquirrel-libs/
+)
+
+
+##### main ksquirrel-lib
+file( GLOB _lib_cpp_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/ksquirrel-libs/*.cpp )
+tde_add_library( ksquirrel-libs SHARED AUTOMOC
+ SOURCES ${_lib_cpp_files}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}
+)
+
+
+##### common codecs
+
+function( conditional_build_codec _cond _codec )
+ if( ${_cond} )
+ file( GLOB _codec_cpp_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${_codec}/*.cpp )
+ tde_add_library( ${_codec} SHARED AUTOMOC
+ SOURCES ${_codec_cpp_files}
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+ )
+ endif( )
+endfunction( )
+
+conditional_build_codec( BUILD_AVS kls_avs )
+conditional_build_codec( BUILD_BMP kls_bmp )
+conditional_build_codec( BUILD_CUT kls_cut )
+conditional_build_codec( BUILD_DDS kls_dds )
+conditional_build_codec( BUILD_FLI kls_fli )
+conditional_build_codec( BUILD_HDR kls_hdr )
+conditional_build_codec( BUILD_ICO kls_ico )
+conditional_build_codec( BUILD_KOALA kls_koala )
+conditional_build_codec( BUILD_LIF kls_lif )
+conditional_build_codec( BUILD_MDL kls_mdl )
+conditional_build_codec( BUILD_MTV kls_mtv )
+conditional_build_codec( BUILD_PCX kls_pcx )
+conditional_build_codec( BUILD_PIX kls_pix )
+conditional_build_codec( BUILD_PNM kls_pnm )
+conditional_build_codec( BUILD_PSD kls_psd )
+conditional_build_codec( BUILD_PSP kls_psp )
+conditional_build_codec( BUILD_PXR kls_pxr )
+conditional_build_codec( BUILD_RAS kls_ras )
+conditional_build_codec( BUILD_RAWRGB kls_rawrgb )
+conditional_build_codec( BUILD_SCT kls_sct )
+conditional_build_codec( BUILD_SGI kls_sgi )
+conditional_build_codec( BUILD_SUN kls_sun )
+conditional_build_codec( BUILD_TGA kls_tga )
+conditional_build_codec( BUILD_WAL kls_xbm )
+conditional_build_codec( BUILD_WBMP kls_wbmp )
+conditional_build_codec( BUILD_XBM kls_wal )
+conditional_build_codec( BUILD_XCUR kls_xcur )
+
+
+# other codecs
+
+if( BUILD_DICOM OR BUILD_PNG OR BUILD_SVG )
+ add_subdirectory( ksquirrel-libs-png )
+endif( )
+
+tde_conditional_add_subdirectory( BUILD_CAMERA kls_camera )
+tde_conditional_add_subdirectory( BUILD_DICOM kls_dicom )
+tde_conditional_add_subdirectory( BUILD_DJVU kls_djvu )
+tde_conditional_add_subdirectory( BUILD_DXF kls_dxf )
+tde_conditional_add_subdirectory( BUILD_EPS kls_eps )
+tde_conditional_add_subdirectory( BUILD_FIG kls_fig )
+tde_conditional_add_subdirectory( BUILD_GIF kls_gif )
+tde_conditional_add_subdirectory( BUILD_IFF kls_iff )
+tde_conditional_add_subdirectory( BUILD_JBIG kls_jbig )
+tde_conditional_add_subdirectory( BUILD_JPEG2000 kls_jpeg2000 )
+tde_conditional_add_subdirectory( BUILD_JPEG kls_jpeg )
+tde_conditional_add_subdirectory( BUILD_LEAF kls_leaf )
+tde_conditional_add_subdirectory( BUILD_LJPEG kls_ljpeg )
+tde_conditional_add_subdirectory( BUILD_MAC kls_mac )
+tde_conditional_add_subdirectory( BUILD_MNG kls_mng )
+tde_conditional_add_subdirectory( BUILD_MSP kls_msp )
+tde_conditional_add_subdirectory( BUILD_NEO kls_neo )
+tde_conditional_add_subdirectory( BUILD_OPENEXR kls_openexr )
+tde_conditional_add_subdirectory( BUILD_PI1 kls_pi1 )
+tde_conditional_add_subdirectory( BUILD_PI3 kls_pi3 )
+tde_conditional_add_subdirectory( BUILD_PICT kls_pict )
+tde_conditional_add_subdirectory( BUILD_PNG kls_png )
+tde_conditional_add_subdirectory( BUILD_SVG kls_svg )
+tde_conditional_add_subdirectory( BUILD_TIFF kls_tiff )
+tde_conditional_add_subdirectory( BUILD_TTF kls_ttf )
+tde_conditional_add_subdirectory( BUILD_UTAH kls_utah )
+tde_conditional_add_subdirectory( BUILD_WMF kls_wmf )
+tde_conditional_add_subdirectory( BUILD_XCF kls_xcf )
+tde_conditional_add_subdirectory( BUILD_XIM kls_xim )
+tde_conditional_add_subdirectory( BUILD_XPM kls_xpm )
+tde_conditional_add_subdirectory( BUILD_XWD kls_xwd )
+
diff --git a/kernel/Makefile.am b/kernel/Makefile.am
index 696470b..3f8217f 100644
--- a/kernel/Makefile.am
+++ b/kernel/Makefile.am
@@ -120,4 +120,5 @@ install-data-am:
$(INSTALL_HEADER) include/ksquirrel-libs/fmt_types.h $(DESTDIR)$(pkgincludedir)/fmt_types.h
$(INSTALL_HEADER) include/ksquirrel-libs/fmt_defs.h $(DESTDIR)$(pkgincludedir)/fmt_defs.h
$(INSTALL_HEADER) include/ksquirrel-libs/fmt_codec_base.h $(DESTDIR)$(pkgincludedir)/fmt_codec_base.h
+ $(INSTALL_HEADER) include/ksquirrel-libs/ksquirrel_libs_export.h $(DESTDIR)$(pkgincludedir)/ksquirrel_libs_export.h
$(INSTALL_HEADER) include/ksquirrel-libs/settings.h $(DESTDIR)$(pkgincludedir)/settings.h
diff --git a/kernel/kls_dds/dds.h b/kernel/include/dds.h
index 5e7af28..5e7af28 100644
--- a/kernel/kls_dds/dds.h
+++ b/kernel/include/dds.h
diff --git a/kernel/include/fmt_codec_cd_func.h b/kernel/include/fmt_codec_cd_func.h
index da38f56..271e678 100644
--- a/kernel/include/fmt_codec_cd_func.h
+++ b/kernel/include/fmt_codec_cd_func.h
@@ -22,12 +22,14 @@
#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_create_destroy_H
#define KSQUIRREL_LIBS_CLASS_DEFINITION_create_destroy_H
-extern "C" fmt_codec_base* codec_create()
+#include "ksquirrel-libs/ksquirrel_libs_export.h"
+
+extern "C" LIBKSQUIRREL_EXPORT fmt_codec_base* codec_create()
{
return (new fmt_codec);
}
-extern "C" void codec_destroy(fmt_codec_base *p)
+extern "C" LIBKSQUIRREL_EXPORT void codec_destroy(fmt_codec_base *p)
{
delete p;
}
diff --git a/kernel/include/ksquirrel-libs/fileio.h b/kernel/include/ksquirrel-libs/fileio.h
index 3bf3921..354d630 100644
--- a/kernel/include/ksquirrel-libs/fileio.h
+++ b/kernel/include/ksquirrel-libs/fileio.h
@@ -36,7 +36,7 @@ using namespace std;
// read binary data
-class ifstreamK : public ifstream
+class LIBKSQUIRREL_EXPORT ifstreamK : public ifstream
{
public:
ifstreamK();
@@ -60,7 +60,7 @@ class ifstreamK : public ifstream
};
// write binary data
-class ofstreamK : public ofstream
+class LIBKSQUIRREL_EXPORT ofstreamK : public ofstream
{
public:
ofstreamK();
diff --git a/kernel/include/ksquirrel-libs/fmt_codec_base.h b/kernel/include/ksquirrel-libs/fmt_codec_base.h
index cae04ea..003c44c 100644
--- a/kernel/include/ksquirrel-libs/fmt_codec_base.h
+++ b/kernel/include/ksquirrel-libs/fmt_codec_base.h
@@ -34,7 +34,7 @@
//////////////////////////////////
-class fmt_codec_base
+class LIBKSQUIRREL_EXPORT fmt_codec_base
{
public:
fmt_codec_base()
diff --git a/kernel/include/ksquirrel-libs/fmt_types.h b/kernel/include/ksquirrel-libs/fmt_types.h
index 75b6f02..28a049f 100644
--- a/kernel/include/ksquirrel-libs/fmt_types.h
+++ b/kernel/include/ksquirrel-libs/fmt_types.h
@@ -22,6 +22,8 @@
#ifndef KSQUIRREL_LIBS_TYPES_H
#define KSQUIRREL_LIBS_TYPES_H
+#include "ksquirrel_libs_export.h"
+
typedef char s8;
typedef unsigned char u8;
diff --git a/kernel/include/ksquirrel-libs/fmt_utils.h b/kernel/include/ksquirrel-libs/fmt_utils.h
index 1ab42e3..b320b08 100644
--- a/kernel/include/ksquirrel-libs/fmt_utils.h
+++ b/kernel/include/ksquirrel-libs/fmt_utils.h
@@ -39,26 +39,26 @@ struct RGBA;
namespace fmt_utils
{
- void fillAlpha(RGBA *scan, int w, u8 value = 255);
+ void LIBKSQUIRREL_EXPORT fillAlpha(RGBA *scan, int w, u8 value = 255);
// flip the image vertically
// usually BMP, SGI (or some other formats) need to be flipped
- void flipv(s8 *image, s32 bytes_w, s32 h);
+ void LIBKSQUIRREL_EXPORT flipv(s8 *image, s32 bytes_w, s32 h);
// flip the image horizontally
- void fliph(s8 *image, s32 w, s32 h, s32 bpp);
+ void LIBKSQUIRREL_EXPORT fliph(s8 *image, s32 w, s32 h, s32 bpp);
// Big endian to Little endian conversion
- u16 konvertWord(u16 a);
- u32 konvertLong(u32 a);
+ u16 LIBKSQUIRREL_EXPORT konvertWord(u16 a);
+ u32 LIBKSQUIRREL_EXPORT konvertLong(u32 a);
// return color system name by bpp.
// for example 32 bpp means RGBA image, 1 bpp - monochrome
- std::string colorSpaceByBpp(const s32 bpp);
+ std::string LIBKSQUIRREL_EXPORT colorSpaceByBpp(const s32 bpp);
- void expandMono1Byte(const u32 byte, u8 *array);
- void expandMono2Byte(const u32 byte, u8 *array);
- void expandMono4Byte(const u32 byte, u8 *array);
+ void LIBKSQUIRREL_EXPORT expandMono1Byte(const u32 byte, u8 *array);
+ void LIBKSQUIRREL_EXPORT expandMono2Byte(const u32 byte, u8 *array);
+ void LIBKSQUIRREL_EXPORT expandMono4Byte(const u32 byte, u8 *array);
}
#endif
diff --git a/kernel/include/ksquirrel-libs/ksquirrel_libs_export.h b/kernel/include/ksquirrel-libs/ksquirrel_libs_export.h
new file mode 100644
index 0000000..2f49ba4
--- /dev/null
+++ b/kernel/include/ksquirrel-libs/ksquirrel_libs_export.h
@@ -0,0 +1,33 @@
+/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net)
+
+ Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation;
+ either version 2 of the License, or (at your option) any later
+ version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KSQUIRREL_LIBS_EXPORT_H
+#define KSQUIRREL_LIBS_EXPORT_H
+
+#include <kdemacros.h>
+
+#ifdef __KDE_HAVE_GCC_VISIBILITY
+#define LIBKSQUIRREL_EXPORT __attribute__ ((visibility("default")))
+#else
+#define LIBKSQUIRREL_EXPORT
+#endif
+
+#endif
diff --git a/kernel/kls_avs/Makefile.am b/kernel/kls_avs/Makefile.am
index 0de3431..9a847e9 100644
--- a/kernel/kls_avs/Makefile.am
+++ b/kernel/kls_avs/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_avs.la
diff --git a/kernel/kls_bmp/Makefile.am b/kernel/kls_bmp/Makefile.am
index a53cbdf..6308acd 100644
--- a/kernel/kls_bmp/Makefile.am
+++ b/kernel/kls_bmp/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_bmp.la
diff --git a/kernel/kls_camera/CMakeLists.txt b/kernel/kls_camera/CMakeLists.txt
new file mode 100644
index 0000000..83ad471
--- /dev/null
+++ b/kernel/kls_camera/CMakeLists.txt
@@ -0,0 +1,52 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCAMERA_UI="${SHARE_INSTALL_PREFIX}/ksquirrel-libs/libkls_camera.so.ui"
+ -DCODEC_CAMERA
+ -DCODEC_ANOTHER
+ -DKLDCRAW_S="${BIN_INSTALL_DIR}/ksquirrel-libs-camera2ppm"
+ -DKLDCRAW="${BIN_INSTALL_DIR}/ksquirrel-libs-dcraw"
+)
+
+
+if( NOT WITH_JPEG )
+ add_definitions( -DNO_JPEG )
+endif( )
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_camera SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared ${LCMS_LIBRARIES}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+tde_add_executable( ksquirrel-libs-dcraw
+ SOURCES dcraw.c
+ LINK ${JPEG_LIBRARY} ${LCMS_LIBRARIES} ${MATH_LIBC}
+ DESTINATION ${BIN_INSTALL_DIR}
+)
+
+
+##### other data
+
+install(
+ FILES libkls_camera.so.ui
+ DESTINATION ${SHARE_INSTALL_PREFIX}/ksquirrel-libs
+)
+
+install(
+ PROGRAMS ksquirrel-libs-camera2ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_camera/Makefile.am b/kernel/kls_camera/Makefile.am
index d5e1a79..5081038 100644
--- a/kernel/kls_camera/Makefile.am
+++ b/kernel/kls_camera/Makefile.am
@@ -30,7 +30,7 @@ libkls_camera_la_SOURCES = fmt_codec_pnm.cpp fmt_codec_pnm_defs.h
libkls_camera_la_LDFLAGS = ${SQ_RELEASE}
libkls_camera_la_LIBADD = ${SQ_LOCAL_RPATH}
-AM_CXXFLAGS = ${camera_cms} -DCAMERA_UI=\"${pkgdatadir}/libkls_camera.so.ui\" -DCODEC_CAMERA -DCODEC_ANOTHER -DKLDCRAW_S=\"${bindir}/ksquirrel-libs-camera2ppm\" -DKLDCRAW=\"${bindir}/ksquirrel-libs-dcraw\"
+AM_CXXFLAGS = ${camera_cms} -DCAMERA_UI=\"${pkgdatadir}/libkls_camera.so.ui\" -DCODEC_CAMERA -DCODEC_ANOTHER -DKLDCRAW_S=\"${bindir}/ksquirrel-libs-camera2ppm\" -DKLDCRAW=\"${bindir}/ksquirrel-libs-dcraw\" $(all_includes)
EXTRA_DIST = libkls_camera.so.ui ksquirrel-libs-camera2ppm.in
diff --git a/kernel/kls_camera/ksquirrel-libs-camera2ppm b/kernel/kls_camera/ksquirrel-libs-camera2ppm
new file mode 100644
index 0000000..5ee4063
--- /dev/null
+++ b/kernel/kls_camera/ksquirrel-libs-camera2ppm
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+kls_camera_i=""
+kls_camera_o=""
+kls_camera_bin=""
+kls_camera_params=""
+
+while [ "$1" ] ; do
+
+ case "$1" in
+ "--input") kls_camera_i="$2" shift ;;
+ "--output") kls_camera_o="$2" shift ;;
+ "--binary") kls_camera_bin="$2" shift ;;
+ *) kls_camera_params="$kls_camera_params $1" ;;
+ esac
+
+shift
+done
+
+$kls_camera_bin $kls_camera_params "$kls_camera_i" > "$kls_camera_o" \ No newline at end of file
diff --git a/kernel/kls_cut/Makefile.am b/kernel/kls_cut/Makefile.am
index 1137f5a..dfec250 100644
--- a/kernel/kls_cut/Makefile.am
+++ b/kernel/kls_cut/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_cut.la
diff --git a/kernel/kls_dds/Makefile.am b/kernel/kls_dds/Makefile.am
index 753dfb6..95e4683 100644
--- a/kernel/kls_dds/Makefile.am
+++ b/kernel/kls_dds/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_dds.la
diff --git a/kernel/kls_dicom/CMakeLists.txt b/kernel/kls_dicom/CMakeLists.txt
new file mode 100644
index 0000000..59b740d
--- /dev/null
+++ b/kernel/kls_dicom/CMakeLists.txt
@@ -0,0 +1,31 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_DICOM
+ -DDICOM="${BIN_INSTALL_DIR}/ksquirrel-libs-dicom2png"
+)
+
+
+##### codecs
+
+tde_add_library( kls_dicom SHARED AUTOMOC
+ SOURCES fmt_codec_png.cpp
+ LINK ksquirrel-libs-shared ksquirrel-libs-png-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-dicom2png.cmake ksquirrel-libs-dicom2png @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-dicom2png
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_dicom/Makefile.am b/kernel/kls_dicom/Makefile.am
index 28f6a8c..f2eee99 100644
--- a/kernel/kls_dicom/Makefile.am
+++ b/kernel/kls_dicom/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include -I..
+INCLUDES = -I../include -I.. $(all_includes)
bin_SCRIPTS = ksquirrel-libs-dicom2png
diff --git a/kernel/kls_dicom/ksquirrel-libs-dicom2png.cmake b/kernel/kls_dicom/ksquirrel-libs-dicom2png.cmake
new file mode 100644
index 0000000..fafc30c
--- /dev/null
+++ b/kernel/kls_dicom/ksquirrel-libs-dicom2png.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@DICOM_COMMAND@ --without-prefix -f "$1" -e 0:0 -c - png > "$2"
diff --git a/kernel/kls_djvu/CMakeLists.txt b/kernel/kls_djvu/CMakeLists.txt
new file mode 100644
index 0000000..64558fd
--- /dev/null
+++ b/kernel/kls_djvu/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DDJVU_UI="${SHARE_INSTALL_PREFIX}/ksquirrel-libs/libkls_djvu.so.ui"
+ -DCODEC_DJVU
+ -DCODEC_ANOTHER
+ -DDJVU="${DJVU_COMMAND}"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_djvu SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+install(
+ FILES libkls_djvu.so.ui
+ DESTINATION ${SHARE_INSTALL_PREFIX}/ksquirrel-libs
+)
diff --git a/kernel/kls_djvu/Makefile.am b/kernel/kls_djvu/Makefile.am
index ea51058..ff5e4c8 100644
--- a/kernel/kls_djvu/Makefile.am
+++ b/kernel/kls_djvu/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_djvu.la
diff --git a/kernel/kls_dxf/CMakeLists.txt b/kernel/kls_dxf/CMakeLists.txt
new file mode 100644
index 0000000..b967b9a
--- /dev/null
+++ b/kernel/kls_dxf/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DDXF_UI="${SHARE_INSTALL_PREFIX}/ksquirrel-libs/libkls_dxf.so.ui"
+ -DCODEC_DXF
+ -DCODEC_ANOTHER
+ -DVEC2WEB="${DXF_COMMAND}"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_dxf SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+install(
+ FILES libkls_dxf.so.ui
+ DESTINATION ${SHARE_INSTALL_PREFIX}/ksquirrel-libs
+)
diff --git a/kernel/kls_dxf/Makefile.am b/kernel/kls_dxf/Makefile.am
index a9a7251..37d13a4 100644
--- a/kernel/kls_dxf/Makefile.am
+++ b/kernel/kls_dxf/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_dxf.la
diff --git a/kernel/kls_eps/CMakeLists.txt b/kernel/kls_eps/CMakeLists.txt
new file mode 100644
index 0000000..9146e46
--- /dev/null
+++ b/kernel/kls_eps/CMakeLists.txt
@@ -0,0 +1,20 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+add_definitions(
+ -DCODEC_EPS
+ -DEPS2PPM="${EPS_COMMAND}"
+)
+
+
+##### codecs
+
+tde_add_library( kls_eps SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared ${MATH_LIBC}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_eps/Makefile.am b/kernel/kls_eps/Makefile.am
index 5aa673f..dbfb7f7 100644
--- a/kernel/kls_eps/Makefile.am
+++ b/kernel/kls_eps/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_eps.la
diff --git a/kernel/kls_fig/CMakeLists.txt b/kernel/kls_fig/CMakeLists.txt
new file mode 100644
index 0000000..9294dc6
--- /dev/null
+++ b/kernel/kls_fig/CMakeLists.txt
@@ -0,0 +1,34 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_FIG
+ -DXFIG_S="${BIN_INSTALL_DIR}/ksquirrel-libs-fig2ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_fig SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-fig2ppm.cmake ksquirrel-libs-fig2ppm @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-fig2ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_fig/Makefile.am b/kernel/kls_fig/Makefile.am
index 7240c61..f84f928 100644
--- a/kernel/kls_fig/Makefile.am
+++ b/kernel/kls_fig/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-fig2ppm
diff --git a/kernel/kls_fig/ksquirrel-libs-fig2ppm.cmake b/kernel/kls_fig/ksquirrel-libs-fig2ppm.cmake
new file mode 100644
index 0000000..090361a
--- /dev/null
+++ b/kernel/kls_fig/ksquirrel-libs-fig2ppm.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@FIG2DEV_COMMAND@ -L ppm "$1" > "$2"
diff --git a/kernel/kls_fli/Makefile.am b/kernel/kls_fli/Makefile.am
index 7570336..a9f0e9f 100644
--- a/kernel/kls_fli/Makefile.am
+++ b/kernel/kls_fli/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_fli.la
diff --git a/kernel/kls_gif/CMakeLists.txt b/kernel/kls_gif/CMakeLists.txt
new file mode 100644
index 0000000..52677f3
--- /dev/null
+++ b/kernel/kls_gif/CMakeLists.txt
@@ -0,0 +1,15 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### codecs
+
+tde_add_library( kls_gif SHARED AUTOMOC
+ SOURCES fmt_codec_gif.cpp
+ LINK ksquirrel-libs-shared ${GIF_LIBRARIES}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_gif/Makefile.am b/kernel/kls_gif/Makefile.am
index 62f5ed5..727ad2a 100644
--- a/kernel/kls_gif/Makefile.am
+++ b/kernel/kls_gif/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_gif.la
diff --git a/kernel/kls_hdr/Makefile.am b/kernel/kls_hdr/Makefile.am
index 3c76848..c562e5f 100644
--- a/kernel/kls_hdr/Makefile.am
+++ b/kernel/kls_hdr/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_hdr.la
diff --git a/kernel/kls_ico/Makefile.am b/kernel/kls_ico/Makefile.am
index d81b368..27167ee 100644
--- a/kernel/kls_ico/Makefile.am
+++ b/kernel/kls_ico/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_ico.la
diff --git a/kernel/kls_iff/CMakeLists.txt b/kernel/kls_iff/CMakeLists.txt
new file mode 100644
index 0000000..cf93021
--- /dev/null
+++ b/kernel/kls_iff/CMakeLists.txt
@@ -0,0 +1,34 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_NETPBM
+ -DCODEC_IFF
+ -DNETPBM_S="${BIN_INSTALL_DIR}/ksquirrel-libs-iff2ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+##### codecs
+
+tde_add_library( kls_iff SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-iff2ppm.cmake ksquirrel-libs-iff2ppm @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-iff2ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_iff/Makefile.am b/kernel/kls_iff/Makefile.am
index 8b52a35..b4a3b48 100644
--- a/kernel/kls_iff/Makefile.am
+++ b/kernel/kls_iff/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-iff2ppm
diff --git a/kernel/kls_iff/ksquirrel-libs-iff2ppm.cmake b/kernel/kls_iff/ksquirrel-libs-iff2ppm.cmake
new file mode 100644
index 0000000..19ca501
--- /dev/null
+++ b/kernel/kls_iff/ksquirrel-libs-iff2ppm.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@IFFTOPPM_COMMAND@ "$1" > "$2"
diff --git a/kernel/kls_jbig/CMakeLists.txt b/kernel/kls_jbig/CMakeLists.txt
new file mode 100644
index 0000000..f56bfbc
--- /dev/null
+++ b/kernel/kls_jbig/CMakeLists.txt
@@ -0,0 +1,19 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/libjbig
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_subdirectory( libjbig )
+
+
+##### codecs
+
+tde_add_library( kls_jbig SHARED AUTOMOC
+ SOURCES fmt_codec_jbig.cpp jbig2mem.cpp
+ LINK ksquirrel-libs-shared jbig-static
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_jbig/Makefile.am b/kernel/kls_jbig/Makefile.am
index a74686f..9302e00 100644
--- a/kernel/kls_jbig/Makefile.am
+++ b/kernel/kls_jbig/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = libjbig
-INCLUDES = -I../include -Ilibjbig
+INCLUDES = -I../include -Ilibjbig $(all_includes)
pkglib_LTLIBRARIES = libkls_jbig.la
diff --git a/kernel/kls_jbig/libjbig/CMakeLists.txt b/kernel/kls_jbig/libjbig/CMakeLists.txt
new file mode 100644
index 0000000..d6042c1
--- /dev/null
+++ b/kernel/kls_jbig/libjbig/CMakeLists.txt
@@ -0,0 +1,12 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+)
+
+
+##### executable
+
+file( GLOB _bin_c_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c )
+tde_add_library( jbig STATIC_PIC AUTOMOC
+ SOURCES ${_bin_c_files}
+)
diff --git a/kernel/kls_jpeg/CMakeLists.txt b/kernel/kls_jpeg/CMakeLists.txt
new file mode 100644
index 0000000..3e17d82
--- /dev/null
+++ b/kernel/kls_jpeg/CMakeLists.txt
@@ -0,0 +1,15 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### codecs
+
+tde_add_library( kls_jpeg SHARED AUTOMOC
+ SOURCES fmt_codec_jpeg.cpp
+ LINK ksquirrel-libs-shared ${JPEG_LIBRARY}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_jpeg/Makefile.am b/kernel/kls_jpeg/Makefile.am
index 7717e5e..e981238 100644
--- a/kernel/kls_jpeg/Makefile.am
+++ b/kernel/kls_jpeg/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_jpeg.la
diff --git a/kernel/kls_jpeg2000/CMakeLists.txt b/kernel/kls_jpeg2000/CMakeLists.txt
new file mode 100644
index 0000000..0c74985
--- /dev/null
+++ b/kernel/kls_jpeg2000/CMakeLists.txt
@@ -0,0 +1,15 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### codecs
+
+tde_add_library( kls_jpeg2000 SHARED AUTOMOC
+ SOURCES fmt_codec_jpeg2000.cpp
+ LINK ksquirrel-libs-shared ${JASPER_LIBRARY}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_jpeg2000/Makefile.am b/kernel/kls_jpeg2000/Makefile.am
index 7fc2b3d..981041b 100644
--- a/kernel/kls_jpeg2000/Makefile.am
+++ b/kernel/kls_jpeg2000/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_jpeg2000.la
diff --git a/kernel/kls_jpeg2000/fmt_codec_jpeg2000.cpp b/kernel/kls_jpeg2000/fmt_codec_jpeg2000.cpp
index 010c7c6..4b54009 100644
--- a/kernel/kls_jpeg2000/fmt_codec_jpeg2000.cpp
+++ b/kernel/kls_jpeg2000/fmt_codec_jpeg2000.cpp
@@ -19,6 +19,10 @@
Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <iostream>
#include <stdio.h>
#include <string.h>
diff --git a/kernel/kls_koala/Makefile.am b/kernel/kls_koala/Makefile.am
index 468bb0a..84dac94 100644
--- a/kernel/kls_koala/Makefile.am
+++ b/kernel/kls_koala/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_koala.la
diff --git a/kernel/kls_leaf/CMakeLists.txt b/kernel/kls_leaf/CMakeLists.txt
new file mode 100644
index 0000000..531eb4f
--- /dev/null
+++ b/kernel/kls_leaf/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_NETPBM
+ -DCODEC_LEAF
+ -DNETPBM_S="${BIN_INSTALL_DIR}/ksquirrel-libs-leaf2ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_leaf SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-leaf2ppm.cmake ksquirrel-libs-leaf2ppm @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-leaf2ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_leaf/Makefile.am b/kernel/kls_leaf/Makefile.am
index f71925f..0bd2a38 100644
--- a/kernel/kls_leaf/Makefile.am
+++ b/kernel/kls_leaf/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-leaf2ppm
diff --git a/kernel/kls_leaf/ksquirrel-libs-leaf2ppm.cmake b/kernel/kls_leaf/ksquirrel-libs-leaf2ppm.cmake
new file mode 100644
index 0000000..5418a23
--- /dev/null
+++ b/kernel/kls_leaf/ksquirrel-libs-leaf2ppm.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@LEAFTOPPM_COMMAND@ "$1" > "$2"
diff --git a/kernel/kls_lif/Makefile.am b/kernel/kls_lif/Makefile.am
index 8375d24..3e630df 100644
--- a/kernel/kls_lif/Makefile.am
+++ b/kernel/kls_lif/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_lif.la
diff --git a/kernel/kls_ljpeg/CMakeLists.txt b/kernel/kls_ljpeg/CMakeLists.txt
new file mode 100644
index 0000000..e3785dc
--- /dev/null
+++ b/kernel/kls_ljpeg/CMakeLists.txt
@@ -0,0 +1,36 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_subdirectory( ljpeg2ppm )
+
+add_definitions(
+ -DCODEC_LJPEG
+ -DLJPEG2PPM_S="${BIN_INSTALL_DIR}/ksquirrel-libs-ljpeg2ppm-s"
+ -DLJPEG2PPM="${BIN_INSTALL_DIR}/ksquirrel-libs-ljpeg2ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_ljpeg SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+install(
+ PROGRAMS ksquirrel-libs-ljpeg2ppm-s
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_ljpeg/Makefile.am b/kernel/kls_ljpeg/Makefile.am
index e2f720d..542f360 100644
--- a/kernel/kls_ljpeg/Makefile.am
+++ b/kernel/kls_ljpeg/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = ljpeg2ppm
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-ljpeg2ppm-s
diff --git a/kernel/kls_ljpeg/ksquirrel-libs-ljpeg2ppm-s b/kernel/kls_ljpeg/ksquirrel-libs-ljpeg2ppm-s
new file mode 100644
index 0000000..74c3038
--- /dev/null
+++ b/kernel/kls_ljpeg/ksquirrel-libs-ljpeg2ppm-s
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+kls_ljpeg_i=""
+kls_ljpeg_o=""
+kls_ljpeg_bin=""
+
+while [ "$1" ] ; do
+
+ case "$1" in
+ "--input") kls_ljpeg_i="$2" shift ;;
+ "--output") kls_ljpeg_o="$2" shift ;;
+ "--binary") kls_ljpeg_bin="$2" shift ;;
+ esac
+
+shift
+done
+
+$kls_ljpeg_bin "$kls_ljpeg_i" > "$kls_ljpeg_o" \ No newline at end of file
diff --git a/kernel/kls_ljpeg/ljpeg2ppm/CMakeLists.txt b/kernel/kls_ljpeg/ljpeg2ppm/CMakeLists.txt
new file mode 100644
index 0000000..b73f5af
--- /dev/null
+++ b/kernel/kls_ljpeg/ljpeg2ppm/CMakeLists.txt
@@ -0,0 +1,14 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### executable
+
+file( GLOB _bin_c_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c )
+tde_add_executable( ksquirrel-libs-ljpeg2ppm
+ SOURCES ${_bin_c_files}
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_ljpeg/ljpeg2ppm/Makefile.am b/kernel/kls_ljpeg/ljpeg2ppm/Makefile.am
index 8d9632e..a341d06 100644
--- a/kernel/kls_ljpeg/ljpeg2ppm/Makefile.am
+++ b/kernel/kls_ljpeg/ljpeg2ppm/Makefile.am
@@ -1,4 +1,4 @@
-#INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_PROGRAMS = ksquirrel-libs-ljpeg2ppm
diff --git a/kernel/kls_mac/CMakeLists.txt b/kernel/kls_mac/CMakeLists.txt
new file mode 100644
index 0000000..6e12830
--- /dev/null
+++ b/kernel/kls_mac/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_NETPBM
+ -DCODEC_MAC
+ -DNETPBM_S="${BIN_INSTALL_DIR}/ksquirrel-libs-mac2ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_mac SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-mac2ppm.cmake ksquirrel-libs-mac2ppm @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-mac2ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_mac/Makefile.am b/kernel/kls_mac/Makefile.am
index 7dedca4..af930a4 100644
--- a/kernel/kls_mac/Makefile.am
+++ b/kernel/kls_mac/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-mac2ppm
diff --git a/kernel/kls_mac/ksquirrel-libs-mac2ppm.cmake b/kernel/kls_mac/ksquirrel-libs-mac2ppm.cmake
new file mode 100644
index 0000000..1764f75
--- /dev/null
+++ b/kernel/kls_mac/ksquirrel-libs-mac2ppm.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@MACPTOPPM_COMMAND@ "$1" > "$2"
diff --git a/kernel/kls_mdl/Makefile.am b/kernel/kls_mdl/Makefile.am
index 8ac900c..a30252a 100644
--- a/kernel/kls_mdl/Makefile.am
+++ b/kernel/kls_mdl/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_mdl.la
diff --git a/kernel/kls_mng/CMakeLists.txt b/kernel/kls_mng/CMakeLists.txt
new file mode 100644
index 0000000..ab01a81
--- /dev/null
+++ b/kernel/kls_mng/CMakeLists.txt
@@ -0,0 +1,15 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### codecs
+
+tde_add_library( kls_mng SHARED AUTOMOC
+ SOURCES fmt_codec_mng.cpp
+ LINK ksquirrel-libs-shared ${MNG_LIBRARY}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_mng/Makefile.am b/kernel/kls_mng/Makefile.am
index b94cbcd..dab042b 100644
--- a/kernel/kls_mng/Makefile.am
+++ b/kernel/kls_mng/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_mng.la
diff --git a/kernel/kls_msp/CMakeLists.txt b/kernel/kls_msp/CMakeLists.txt
new file mode 100644
index 0000000..c37d754
--- /dev/null
+++ b/kernel/kls_msp/CMakeLists.txt
@@ -0,0 +1,15 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### codecs
+
+tde_add_library( kls_msp SHARED AUTOMOC
+ SOURCES fmt_codec_msp.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_msp/Makefile.am b/kernel/kls_msp/Makefile.am
index 27ce122..a89a5dd 100644
--- a/kernel/kls_msp/Makefile.am
+++ b/kernel/kls_msp/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_msp.la
diff --git a/kernel/kls_mtv/Makefile.am b/kernel/kls_mtv/Makefile.am
index fe70b54..02b87ed 100644
--- a/kernel/kls_mtv/Makefile.am
+++ b/kernel/kls_mtv/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_mtv.la
diff --git a/kernel/kls_neo/CMakeLists.txt b/kernel/kls_neo/CMakeLists.txt
new file mode 100644
index 0000000..61eb8a0
--- /dev/null
+++ b/kernel/kls_neo/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_NETPBM
+ -DCODEC_NEO
+ -DNETPBM_S="${BIN_INSTALL_DIR}/ksquirrel-libs-neo2ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_neo SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-neo2ppm.cmake ksquirrel-libs-neo2ppm @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-neo2ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_neo/Makefile.am b/kernel/kls_neo/Makefile.am
index ceae15b..24ca98a 100644
--- a/kernel/kls_neo/Makefile.am
+++ b/kernel/kls_neo/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-neo2ppm
diff --git a/kernel/kls_neo/ksquirrel-libs-neo2ppm.cmake b/kernel/kls_neo/ksquirrel-libs-neo2ppm.cmake
new file mode 100644
index 0000000..122c753
--- /dev/null
+++ b/kernel/kls_neo/ksquirrel-libs-neo2ppm.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@NEOTOPPM_COMMAND@ "$1" > "$2"
diff --git a/kernel/kls_openexr/CMakeLists.txt b/kernel/kls_openexr/CMakeLists.txt
new file mode 100644
index 0000000..d1f0cc5
--- /dev/null
+++ b/kernel/kls_openexr/CMakeLists.txt
@@ -0,0 +1,16 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+ ${OPENEXR_INCLUDE_DIRS}
+)
+
+
+##### codecs
+
+tde_add_library( kls_openexr SHARED AUTOMOC
+ SOURCES fmt_codec_openexr.cpp
+ LINK ksquirrel-libs-shared ${OPENEXR_LIBRARIES}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_openexr/Makefile.am b/kernel/kls_openexr/Makefile.am
index 15c16e0..7c31f1b 100644
--- a/kernel/kls_openexr/Makefile.am
+++ b/kernel/kls_openexr/Makefile.am
@@ -1,6 +1,6 @@
CXXFLAGS = @CXXFLAGS@ -fexceptions @SQ_EXR_CFLAGS@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_openexr.la
diff --git a/kernel/kls_pcx/Makefile.am b/kernel/kls_pcx/Makefile.am
index 5aaa5f3..a3a82b4 100644
--- a/kernel/kls_pcx/Makefile.am
+++ b/kernel/kls_pcx/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_pcx.la
diff --git a/kernel/kls_pi1/CMakeLists.txt b/kernel/kls_pi1/CMakeLists.txt
new file mode 100644
index 0000000..0ee6ea1
--- /dev/null
+++ b/kernel/kls_pi1/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_NETPBM
+ -DCODEC_PI1
+ -DNETPBM_S="${BIN_INSTALL_DIR}/ksquirrel-libs-pi12ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_pi1 SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-pi12ppm.cmake ksquirrel-libs-pi12ppm @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-pi12ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_pi1/Makefile.am b/kernel/kls_pi1/Makefile.am
index f4c6513..716fb32 100644
--- a/kernel/kls_pi1/Makefile.am
+++ b/kernel/kls_pi1/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-pi12ppm
diff --git a/kernel/kls_pi1/ksquirrel-libs-pi12ppm.cmake b/kernel/kls_pi1/ksquirrel-libs-pi12ppm.cmake
new file mode 100644
index 0000000..d05469b
--- /dev/null
+++ b/kernel/kls_pi1/ksquirrel-libs-pi12ppm.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@PI1TOPPM_COMMAND@ "$1" > "$2"
diff --git a/kernel/kls_pi3/CMakeLists.txt b/kernel/kls_pi3/CMakeLists.txt
new file mode 100644
index 0000000..648b4d3
--- /dev/null
+++ b/kernel/kls_pi3/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_NETPBM
+ -DCODEC_PI3
+ -DNETPBM_S="${BIN_INSTALL_DIR}/ksquirrel-libs-pi32ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_pi3 SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-pi32ppm.cmake ksquirrel-libs-pi32ppm @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-pi32ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_pi3/Makefile.am b/kernel/kls_pi3/Makefile.am
index abd5bb4..0ccb4b5 100644
--- a/kernel/kls_pi3/Makefile.am
+++ b/kernel/kls_pi3/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-pi32ppm
diff --git a/kernel/kls_pi3/ksquirrel-libs-pi32ppm.cmake b/kernel/kls_pi3/ksquirrel-libs-pi32ppm.cmake
new file mode 100644
index 0000000..c3782a4
--- /dev/null
+++ b/kernel/kls_pi3/ksquirrel-libs-pi32ppm.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@PI3TOPPM_COMMAND@ "$1" > "$2"
diff --git a/kernel/kls_pict/CMakeLists.txt b/kernel/kls_pict/CMakeLists.txt
new file mode 100644
index 0000000..c54aca4
--- /dev/null
+++ b/kernel/kls_pict/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_NETPBM
+ -DCODEC_PICT
+ -DNETPBM_S="${BIN_INSTALL_DIR}/ksquirrel-libs-pict2ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_pict SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-pict2ppm.cmake ksquirrel-libs-pict2ppm @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-pict2ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_pict/Makefile.am b/kernel/kls_pict/Makefile.am
index a5732e7..b229087 100644
--- a/kernel/kls_pict/Makefile.am
+++ b/kernel/kls_pict/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-pict2ppm
diff --git a/kernel/kls_pict/ksquirrel-libs-pict2ppm.cmake b/kernel/kls_pict/ksquirrel-libs-pict2ppm.cmake
new file mode 100644
index 0000000..d4ef43c
--- /dev/null
+++ b/kernel/kls_pict/ksquirrel-libs-pict2ppm.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@PICTTOPPM_COMMAND@ "$1" > "$2"
diff --git a/kernel/kls_pix/Makefile.am b/kernel/kls_pix/Makefile.am
index c26bf49..8ff7c8c 100644
--- a/kernel/kls_pix/Makefile.am
+++ b/kernel/kls_pix/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_pix.la
diff --git a/kernel/kls_png/CMakeLists.txt b/kernel/kls_png/CMakeLists.txt
new file mode 100644
index 0000000..27bf534
--- /dev/null
+++ b/kernel/kls_png/CMakeLists.txt
@@ -0,0 +1,21 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_PNG
+)
+
+
+##### codecs
+
+tde_add_library( kls_png SHARED AUTOMOC
+ SOURCES fmt_codec_png.cpp
+ LINK ksquirrel-libs-shared ksquirrel-libs-png-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_png/Makefile.am b/kernel/kls_png/Makefile.am
index 82f8f09..13dc272 100644
--- a/kernel/kls_png/Makefile.am
+++ b/kernel/kls_png/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include -I..
+INCLUDES = -I../include -I.. $(all_includes)
pkglib_LTLIBRARIES = libkls_png.la
diff --git a/kernel/kls_pnm/Makefile.am b/kernel/kls_pnm/Makefile.am
index ddc0486..d34d1b1 100644
--- a/kernel/kls_pnm/Makefile.am
+++ b/kernel/kls_pnm/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_pnm.la
diff --git a/kernel/kls_psd/Makefile.am b/kernel/kls_psd/Makefile.am
index 82132ab..41cd023 100644
--- a/kernel/kls_psd/Makefile.am
+++ b/kernel/kls_psd/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_psd.la
diff --git a/kernel/kls_psp/Makefile.am b/kernel/kls_psp/Makefile.am
index d9ae202..f6d72eb 100644
--- a/kernel/kls_psp/Makefile.am
+++ b/kernel/kls_psp/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_psp.la
diff --git a/kernel/kls_pxr/Makefile.am b/kernel/kls_pxr/Makefile.am
index 9f3d4d0..f81c5cb 100644
--- a/kernel/kls_pxr/Makefile.am
+++ b/kernel/kls_pxr/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_pxr.la
diff --git a/kernel/kls_ras/Makefile.am b/kernel/kls_ras/Makefile.am
index 3bae1c6..290678f 100644
--- a/kernel/kls_ras/Makefile.am
+++ b/kernel/kls_ras/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_ras.la
diff --git a/kernel/kls_rawrgb/Makefile.am b/kernel/kls_rawrgb/Makefile.am
index a12c81e..9f9382d 100644
--- a/kernel/kls_rawrgb/Makefile.am
+++ b/kernel/kls_rawrgb/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_rawrgb.la
diff --git a/kernel/kls_sct/Makefile.am b/kernel/kls_sct/Makefile.am
index 826c167..a6ff833 100644
--- a/kernel/kls_sct/Makefile.am
+++ b/kernel/kls_sct/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_sct.la
diff --git a/kernel/kls_sgi/Makefile.am b/kernel/kls_sgi/Makefile.am
index 6284c4c..08ecb06 100644
--- a/kernel/kls_sgi/Makefile.am
+++ b/kernel/kls_sgi/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_sgi.la
diff --git a/kernel/kls_sun/Makefile.am b/kernel/kls_sun/Makefile.am
index b7b3b16..ede5e78 100644
--- a/kernel/kls_sun/Makefile.am
+++ b/kernel/kls_sun/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_sun.la
diff --git a/kernel/kls_svg/CMakeLists.txt b/kernel/kls_svg/CMakeLists.txt
new file mode 100644
index 0000000..0e8f785
--- /dev/null
+++ b/kernel/kls_svg/CMakeLists.txt
@@ -0,0 +1,38 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DSVG_UI="${SHARE_INSTALL_PREFIX}/ksquirrel-libs/libkls_svg.so.ui"
+ -DCODEC_SVG
+ -DCODEC_ANOTHER
+ -DRSVG="${RSVG_COMMAND}"
+ -DSVG2PNG="${BIN_INSTALL_DIR}/ksquirrel-libs-svg2png"
+)
+
+
+##### codecs
+
+tde_add_library( kls_svg SHARED AUTOMOC
+ SOURCES fmt_codec_png.cpp
+ LINK ksquirrel-libs-shared ksquirrel-libs-png-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+install(
+ FILES libkls_svg.so.ui
+ DESTINATION ${SHARE_INSTALL_PREFIX}/ksquirrel-libs
+)
+
+install(
+ PROGRAMS ksquirrel-libs-svg2png
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_svg/Makefile.am b/kernel/kls_svg/Makefile.am
index 0623b49..28d1845 100644
--- a/kernel/kls_svg/Makefile.am
+++ b/kernel/kls_svg/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include -I..
+INCLUDES = -I../include -I.. $(all_includes)
bin_SCRIPTS = ksquirrel-libs-svg2png
diff --git a/kernel/kls_svg/ksquirrel-libs-svg2png b/kernel/kls_svg/ksquirrel-libs-svg2png
new file mode 100644
index 0000000..b921e6d
--- /dev/null
+++ b/kernel/kls_svg/ksquirrel-libs-svg2png
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+kls_svg_i=""
+kls_svg_o=""
+kls_svg_bin=""
+kls_svg_params=""
+
+while [ "$1" ] ; do
+
+ case "$1" in
+ "--input") kls_svg_i="$2" shift ;;
+ "--output") kls_svg_o="$2" shift ;;
+ "--binary") kls_svg_bin="$2" shift ;;
+ *) kls_svg_params="$kls_svg_params $1" ;;
+ esac
+
+shift
+done
+
+$kls_svg_bin $kls_svg_params "$kls_svg_i" > "$kls_svg_o" \ No newline at end of file
diff --git a/kernel/kls_tga/Makefile.am b/kernel/kls_tga/Makefile.am
index c7b8423..7da7495 100644
--- a/kernel/kls_tga/Makefile.am
+++ b/kernel/kls_tga/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_tga.la
diff --git a/kernel/kls_tiff/CMakeLists.txt b/kernel/kls_tiff/CMakeLists.txt
new file mode 100644
index 0000000..855092e
--- /dev/null
+++ b/kernel/kls_tiff/CMakeLists.txt
@@ -0,0 +1,28 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DTIFF_UI="${SHARE_INSTALL_PREFIX}/ksquirrel-libs/libkls_tiff.so.ui"
+)
+
+
+##### codecs
+
+tde_add_library( kls_tiff SHARED AUTOMOC
+ SOURCES fmt_codec_tiff.cpp
+ LINK ksquirrel-libs-shared ${TIFF_LIBRARY}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+install(
+ FILES libkls_tiff.so.ui
+ DESTINATION ${SHARE_INSTALL_PREFIX}/ksquirrel-libs
+)
diff --git a/kernel/kls_tiff/Makefile.am b/kernel/kls_tiff/Makefile.am
index 0414d92..3076e99 100644
--- a/kernel/kls_tiff/Makefile.am
+++ b/kernel/kls_tiff/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_tiff.la
diff --git a/kernel/kls_ttf/CMakeLists.txt b/kernel/kls_ttf/CMakeLists.txt
new file mode 100644
index 0000000..bd4c2a4
--- /dev/null
+++ b/kernel/kls_ttf/CMakeLists.txt
@@ -0,0 +1,26 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/ftview
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+ ${FREETYPE_INCLUDE_DIRS}
+)
+
+
+add_subdirectory( ftview )
+
+
+##### codecs
+
+tde_add_library( kls_ttf SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+tde_add_executable( ksquirrel-libs-ttf2pnm
+ SOURCES ttf2pnm.cpp ftcommon.cpp
+ LINK ${LCMS_LIBRARIES} ${FREETYPE_LIBRARIES} ftview-static
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_ttf/Makefile.am b/kernel/kls_ttf/Makefile.am
index 10d2efe..979b2f6 100644
--- a/kernel/kls_ttf/Makefile.am
+++ b/kernel/kls_ttf/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = ftview
-INCLUDES = -I../include -Iftview @SQ_FT_CFLAGS@
+INCLUDES = -I../include -Iftview @SQ_FT_CFLAGS@ $(all_includes)
bin_PROGRAMS = ksquirrel-libs-ttf2pnm
diff --git a/kernel/kls_ttf/ftview/CMakeLists.txt b/kernel/kls_ttf/ftview/CMakeLists.txt
new file mode 100644
index 0000000..a0fa7cd
--- /dev/null
+++ b/kernel/kls_ttf/ftview/CMakeLists.txt
@@ -0,0 +1,13 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### executable
+
+file( GLOB _bin_cpp_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp )
+tde_add_library( ftview STATIC_PIC AUTOMOC
+ SOURCES ${_bin_cpp_files}
+)
diff --git a/kernel/kls_ttf/ftview/Makefile.am b/kernel/kls_ttf/ftview/Makefile.am
index d744d11..3961023 100644
--- a/kernel/kls_ttf/ftview/Makefile.am
+++ b/kernel/kls_ttf/ftview/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I. @SQ_FT_CFLAGS@
+INCLUDES = -I. @SQ_FT_CFLAGS@ $(all_includes)
noinst_LTLIBRARIES = libftview.la
diff --git a/kernel/kls_utah/CMakeLists.txt b/kernel/kls_utah/CMakeLists.txt
new file mode 100644
index 0000000..ab0aac7
--- /dev/null
+++ b/kernel/kls_utah/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_NETPBM
+ -DCODEC_UTAH
+ -DNETPBM_S="${BIN_INSTALL_DIR}/ksquirrel-libs-utah2ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_utah SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-utah2ppm.cmake ksquirrel-libs-utah2ppm @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-utah2ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_utah/Makefile.am b/kernel/kls_utah/Makefile.am
index 965b4cb..72290e9 100644
--- a/kernel/kls_utah/Makefile.am
+++ b/kernel/kls_utah/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-utah2ppm
diff --git a/kernel/kls_utah/ksquirrel-libs-utah2ppm.cmake b/kernel/kls_utah/ksquirrel-libs-utah2ppm.cmake
new file mode 100644
index 0000000..89c0dea
--- /dev/null
+++ b/kernel/kls_utah/ksquirrel-libs-utah2ppm.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@UTAHTOPPM_COMMAND@ "$1" > "$2"
diff --git a/kernel/kls_wal/Makefile.am b/kernel/kls_wal/Makefile.am
index 388c52b..870fa7d 100644
--- a/kernel/kls_wal/Makefile.am
+++ b/kernel/kls_wal/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_wal.la
diff --git a/kernel/kls_wbmp/Makefile.am b/kernel/kls_wbmp/Makefile.am
index 9c2d093..4b44c2d 100644
--- a/kernel/kls_wbmp/Makefile.am
+++ b/kernel/kls_wbmp/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_wbmp.la
diff --git a/kernel/kls_wmf/CMakeLists.txt b/kernel/kls_wmf/CMakeLists.txt
new file mode 100644
index 0000000..c977048
--- /dev/null
+++ b/kernel/kls_wmf/CMakeLists.txt
@@ -0,0 +1,16 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+ ${WMF_INCLUDE_DIRS}
+)
+
+
+##### codecs
+
+tde_add_library( kls_wmf SHARED AUTOMOC
+ SOURCES fmt_codec_wmf.cpp wmf2mem.cpp
+ LINK ksquirrel-libs-shared ${WMF_LIBRARIES}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_wmf/Makefile.am b/kernel/kls_wmf/Makefile.am
index be71d57..3675b11 100644
--- a/kernel/kls_wmf/Makefile.am
+++ b/kernel/kls_wmf/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include @SQ_WMF_CFLAGS@
+INCLUDES = -I../include @SQ_WMF_CFLAGS@ $(all_includes)
pkglib_LTLIBRARIES = libkls_wmf.la
diff --git a/kernel/kls_xbm/Makefile.am b/kernel/kls_xbm/Makefile.am
index 07bd070..b381d46 100644
--- a/kernel/kls_xbm/Makefile.am
+++ b/kernel/kls_xbm/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_xbm.la
diff --git a/kernel/kls_xcf/CMakeLists.txt b/kernel/kls_xcf/CMakeLists.txt
new file mode 100644
index 0000000..305fd79
--- /dev/null
+++ b/kernel/kls_xcf/CMakeLists.txt
@@ -0,0 +1,40 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_subdirectory( xcf2pnm )
+
+add_definitions(
+ -DXCF_UI="${SHARE_INSTALL_PREFIX}/ksquirrel-libs/libkls_xcf.so.ui"
+ -DCODEC_XCF
+ -DCODEC_ANOTHER
+ -DKLXCF2PNM="${BIN_INSTALL_DIR}/ksquirrel-libs-xcf2pnm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+if( ${CMAKE_SYSTEM_PROCESSOR} MATCHES "(i.86|x86_64|powerpc)" )
+ add_definitions( -DCAN_DO_UNALIGNED_WORDS)
+endif( )
+
+##### codecs
+
+tde_add_library( kls_xcf SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+install(
+ FILES libkls_xcf.so.ui
+ DESTINATION ${SHARE_INSTALL_PREFIX}/ksquirrel-libs
+)
diff --git a/kernel/kls_xcf/Makefile.am b/kernel/kls_xcf/Makefile.am
index 0af18aa..9607c91 100644
--- a/kernel/kls_xcf/Makefile.am
+++ b/kernel/kls_xcf/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = xcf2pnm
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_xcf.la
diff --git a/kernel/kls_xcf/xcf2pnm/CMakeLists.txt b/kernel/kls_xcf/xcf2pnm/CMakeLists.txt
new file mode 100644
index 0000000..5edc991
--- /dev/null
+++ b/kernel/kls_xcf/xcf2pnm/CMakeLists.txt
@@ -0,0 +1,14 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### executable
+
+file( GLOB _bin_c_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c )
+tde_add_executable( ksquirrel-libs-xcf2pnm
+ SOURCES ${_bin_c_files}
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_xcf/xcf2pnm/io-unix.c b/kernel/kls_xcf/xcf2pnm/io-unix.c
index 38dc4e4..2367779 100644
--- a/kernel/kls_xcf/xcf2pnm/io-unix.c
+++ b/kernel/kls_xcf/xcf2pnm/io-unix.c
@@ -16,6 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xcftools.h"
#include <string.h>
#include <sys/types.h>
diff --git a/kernel/kls_xcf/xcf2pnm/options.i b/kernel/kls_xcf/xcf2pnm/options.i
index f891767..418d01e 100644
--- a/kernel/kls_xcf/xcf2pnm/options.i
+++ b/kernel/kls_xcf/xcf2pnm/options.i
@@ -16,6 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
OPTIONGROUP(1i,General options);
OPTION('h',--help,show this message,
diff --git a/kernel/kls_xcf/xcf2pnm/pixels.c b/kernel/kls_xcf/xcf2pnm/pixels.c
index 65891f9..562f1be 100644
--- a/kernel/kls_xcf/xcf2pnm/pixels.c
+++ b/kernel/kls_xcf/xcf2pnm/pixels.c
@@ -16,6 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#define DEBUG
#include "xcftools.h"
#include "pixels.h"
diff --git a/kernel/kls_xcf/xcf2pnm/utils.c b/kernel/kls_xcf/xcf2pnm/utils.c
index bde0782..5875a4e 100644
--- a/kernel/kls_xcf/xcf2pnm/utils.c
+++ b/kernel/kls_xcf/xcf2pnm/utils.c
@@ -16,6 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xcftools.h"
#include <string.h>
#include <stdarg.h>
diff --git a/kernel/kls_xcf/xcf2pnm/xcf-general.c b/kernel/kls_xcf/xcf2pnm/xcf-general.c
index 9231134..fadba37 100644
--- a/kernel/kls_xcf/xcf2pnm/xcf-general.c
+++ b/kernel/kls_xcf/xcf2pnm/xcf-general.c
@@ -16,13 +16,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xcftools.h"
#include <string.h>
#include <errno.h>
#ifdef HAVE_ICONV
# include <iconv.h>
-#elif !defined(ICONV_CONST)
-# define ICONV_CONST const
#endif
uint8_t *xcf_file = 0 ;
@@ -91,13 +93,13 @@ xcfString(uint32_t ptr,uint32_t *after)
{
uint32_t length ;
unsigned i ;
- ICONV_CONST char *utf8master ;
+ const char *utf8master ;
xcfCheckspace(ptr,4,"(string length)");
length = xcfL(ptr) ;
ptr += 4 ;
xcfCheckspace(ptr,length,"(string)");
- utf8master = (ICONV_CONST char*)(xcf_file+ptr) ;
+ utf8master = (const char*)(xcf_file+ptr) ;
if( after ) *after = ptr + length ;
if( length == 0 || utf8master[length-1] != 0 )
FatalBadXCF("String at %" PRIX32 " not zero-terminated",ptr-4);
@@ -130,7 +132,7 @@ xcfString(uint32_t ptr,uint32_t *after)
else
while(1) {
char *buffer = xcfmalloc(targetsize) ;
- ICONV_CONST char *inbuf = utf8master ;
+ const char *inbuf = utf8master ;
char *outbuf = buffer ;
size_t incount = length ;
size_t outcount = targetsize ;
diff --git a/kernel/kls_xcf/xcf2pnm/xcf2pnm.c b/kernel/kls_xcf/xcf2pnm/xcf2pnm.c
index 06baf8d..70437e2 100644
--- a/kernel/kls_xcf/xcf2pnm/xcf2pnm.c
+++ b/kernel/kls_xcf/xcf2pnm/xcf2pnm.c
@@ -16,6 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xcftools.h"
#include "flatten.h"
#include <stdlib.h>
diff --git a/kernel/kls_xcf/xcf2pnm/xcf2pnm.oi b/kernel/kls_xcf/xcf2pnm/xcf2pnm.oi
index 382bd96..f02c4b8 100644
--- a/kernel/kls_xcf/xcf2pnm/xcf2pnm.oi
+++ b/kernel/kls_xcf/xcf2pnm/xcf2pnm.oi
@@ -4,6 +4,10 @@
#define XCF2FOO
#define OPTIONGROUP(a,b)
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef HAVE_GETOPT_LONG
static const struct option longopts[] = {
{ "help", 0, 0, 'h'},
diff --git a/kernel/kls_xcf/xcf2pnm/xcftools.h b/kernel/kls_xcf/xcf2pnm/xcftools.h
index d3efbab..4091648 100644
--- a/kernel/kls_xcf/xcf2pnm/xcftools.h
+++ b/kernel/kls_xcf/xcf2pnm/xcftools.h
@@ -19,6 +19,10 @@
#ifndef XCFTOOLS_H
#define XCFTOOLS_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "enums.h"
#include <stddef.h>
#include <stdio.h>
diff --git a/kernel/kls_xcur/Makefile.am b/kernel/kls_xcur/Makefile.am
index 9554260..c7ad865 100644
--- a/kernel/kls_xcur/Makefile.am
+++ b/kernel/kls_xcur/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_xcur.la
diff --git a/kernel/kls_xim/CMakeLists.txt b/kernel/kls_xim/CMakeLists.txt
new file mode 100644
index 0000000..6f3dce5
--- /dev/null
+++ b/kernel/kls_xim/CMakeLists.txt
@@ -0,0 +1,35 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DCODEC_NETPBM
+ -DCODEC_XIM
+ -DNETPBM_S="${BIN_INSTALL_DIR}/ksquirrel-libs-xim2ppm"
+)
+
+if( NOT WITH_LCMS )
+ add_definitions( -DNO_LCMS )
+endif( )
+
+
+##### codecs
+
+tde_add_library( kls_xim SHARED AUTOMOC
+ SOURCES fmt_codec_pnm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+configure_file( ksquirrel-libs-xim2ppm.cmake ksquirrel-libs-xim2ppm @ONLY )
+INSTALL(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ksquirrel-libs-xim2ppm
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/kernel/kls_xim/Makefile.am b/kernel/kls_xim/Makefile.am
index c14de1e..af790fd 100644
--- a/kernel/kls_xim/Makefile.am
+++ b/kernel/kls_xim/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
bin_SCRIPTS = ksquirrel-libs-xim2ppm
diff --git a/kernel/kls_xim/ksquirrel-libs-xim2ppm.cmake b/kernel/kls_xim/ksquirrel-libs-xim2ppm.cmake
new file mode 100644
index 0000000..5965ee5
--- /dev/null
+++ b/kernel/kls_xim/ksquirrel-libs-xim2ppm.cmake
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+@XIMTOPPM_COMMAND@ "$1" > "$2"
diff --git a/kernel/kls_xpm/CMakeLists.txt b/kernel/kls_xpm/CMakeLists.txt
new file mode 100644
index 0000000..5f9cb92
--- /dev/null
+++ b/kernel/kls_xpm/CMakeLists.txt
@@ -0,0 +1,28 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+add_definitions(
+ -DSQ_RGBMAP="${SHARE_INSTALL_PREFIX}/ksquirrel-libs/rgbmap"
+)
+
+
+##### codecs
+
+tde_add_library( kls_xpm SHARED AUTOMOC
+ SOURCES fmt_codec_xpm.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
+
+
+##### other data
+
+install(
+ FILES rgbmap
+ DESTINATION ${SHARE_INSTALL_PREFIX}/ksquirrel-libs
+)
diff --git a/kernel/kls_xpm/Makefile.am b/kernel/kls_xpm/Makefile.am
index 882d749..4189dbd 100644
--- a/kernel/kls_xpm/Makefile.am
+++ b/kernel/kls_xpm/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_xpm.la
diff --git a/kernel/kls_xwd/CMakeLists.txt b/kernel/kls_xwd/CMakeLists.txt
new file mode 100644
index 0000000..ea78642
--- /dev/null
+++ b/kernel/kls_xwd/CMakeLists.txt
@@ -0,0 +1,15 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### codecs
+
+tde_add_library( kls_xwd SHARED AUTOMOC
+ SOURCES fmt_codec_xwd.cpp
+ LINK ksquirrel-libs-shared
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}/ksquirrel-libs
+)
diff --git a/kernel/kls_xwd/Makefile.am b/kernel/kls_xwd/Makefile.am
index 9815d7d..ecdc394 100644
--- a/kernel/kls_xwd/Makefile.am
+++ b/kernel/kls_xwd/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
pkglib_LTLIBRARIES = libkls_xwd.la
diff --git a/kernel/ksquirrel-libs-png/CMakeLists.txt b/kernel/ksquirrel-libs-png/CMakeLists.txt
new file mode 100644
index 0000000..d7ddcb4
--- /dev/null
+++ b/kernel/ksquirrel-libs-png/CMakeLists.txt
@@ -0,0 +1,19 @@
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/kernel/include
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### executable
+
+file( GLOB _bin_source_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
+)
+tde_add_library( ksquirrel-libs-png SHARED AUTOMOC
+ SOURCES ${_bin_source_files}
+ LINK ${ZLIB_LIBRARIES} ${MATH_LIBC}
+ VERSION 0.8.0
+ DESTINATION ${LIB_INSTALL_DIR}
+)
diff --git a/kernel/ksquirrel-libs-png/Makefile.am b/kernel/ksquirrel-libs-png/Makefile.am
index 084a02e..f00c7d9 100644
--- a/kernel/ksquirrel-libs-png/Makefile.am
+++ b/kernel/ksquirrel-libs-png/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I.
+INCLUDES = -I. -I../include $(all_includes)
lib_LTLIBRARIES = libksquirrel-libs-png.la
diff --git a/kernel/ksquirrel-libs-png/pngconf.h b/kernel/ksquirrel-libs-png/pngconf.h
index cfd61bf..b766375 100644
--- a/kernel/ksquirrel-libs-png/pngconf.h
+++ b/kernel/ksquirrel-libs-png/pngconf.h
@@ -17,6 +17,8 @@
#ifndef PNGCONF_H
#define PNGCONF_H
+#include "ksquirrel-libs/ksquirrel_libs_export.h"
+
#define PNG_1_2_X
/*
@@ -1378,7 +1380,7 @@ typedef z_stream FAR * png_zstreamp;
#endif
#ifndef PNG_EXPORT
-# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
+# define PNG_EXPORT(type,symbol) LIBKSQUIRREL_EXPORT PNG_IMPEXP type PNGAPI symbol
#endif
#ifdef PNG_USE_GLOBAL_ARRAYS
diff --git a/kernel/ksquirrel-libs/Makefile.am b/kernel/ksquirrel-libs/Makefile.am
index 54258cb..a268c8a 100644
--- a/kernel/ksquirrel-libs/Makefile.am
+++ b/kernel/ksquirrel-libs/Makefile.am
@@ -1,8 +1,8 @@
-INCLUDES = -I../include
+INCLUDES = -I../include $(all_includes)
# create small development library. KSquirrel will use it.
lib_LTLIBRARIES = libksquirrel-libs.la
libksquirrel_libs_la_SOURCES = fileio.cpp fmt_utils.cpp
-libksquirrel_libs_la_LDFLAGS = ${SQ_RELEASE} \ No newline at end of file
+libksquirrel_libs_la_LDFLAGS = ${SQ_RELEASE}
diff --git a/ksquirrellibs.pc.cmake b/ksquirrellibs.pc.cmake
new file mode 100644
index 0000000..8853405
--- /dev/null
+++ b/ksquirrellibs.pc.cmake
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@PC_EXEC_PREFIX@
+libdir=@PC_LIB_DIR@
+includedir=@PC_INCLUDE_DIR@
+version=@LIBKSQUIRREL_VERSION_STRING@
+
+Name: ksquirrellibs
+Description: Image codecs for KSquirrel
+Version: @LIBKSQUIRREL_VERSION_STRING@
+Libs: -L${libdir} -lksquirrel-libs
+Cflags: -I${includedir} -DSQ_KLIBS=${libdir}/ksquirrel-libs -DSQ_KL_VER=${version}