diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-05-27 18:38:14 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-09-21 19:58:56 +0900 |
commit | af121719c99a99fc3444d181777a6177f0d59dba (patch) | |
tree | 786cf8548c92daf560733278701d95d3079b1d2f /kernel/kls_xcf | |
parent | 5b8d2d73599f1a06c2106ef71b9774dada86e076 (diff) | |
download | libksquirrel-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>
Diffstat (limited to 'kernel/kls_xcf')
-rw-r--r-- | kernel/kls_xcf/CMakeLists.txt | 40 | ||||
-rw-r--r-- | kernel/kls_xcf/Makefile.am | 2 | ||||
-rw-r--r-- | kernel/kls_xcf/xcf2pnm/CMakeLists.txt | 14 | ||||
-rw-r--r-- | kernel/kls_xcf/xcf2pnm/io-unix.c | 4 | ||||
-rw-r--r-- | kernel/kls_xcf/xcf2pnm/options.i | 4 | ||||
-rw-r--r-- | kernel/kls_xcf/xcf2pnm/pixels.c | 4 | ||||
-rw-r--r-- | kernel/kls_xcf/xcf2pnm/utils.c | 4 | ||||
-rw-r--r-- | kernel/kls_xcf/xcf2pnm/xcf-general.c | 12 | ||||
-rw-r--r-- | kernel/kls_xcf/xcf2pnm/xcf2pnm.c | 4 | ||||
-rw-r--r-- | kernel/kls_xcf/xcf2pnm/xcf2pnm.oi | 4 | ||||
-rw-r--r-- | kernel/kls_xcf/xcf2pnm/xcftools.h | 4 |
11 files changed, 90 insertions, 6 deletions
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> |