From 8b12682035e2ae92a29a9ce12abc5fbcf38b1192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 26 Mar 2017 15:58:46 +0200 Subject: Initial cmake conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- mpeglib/example/yaf/yafcore/CMakeLists.txt | 55 ++++++++++++++++++++++++++ mpeglib/example/yaf/yafcore/inputInterface.cpp | 8 ++++ 2 files changed, 63 insertions(+) create mode 100644 mpeglib/example/yaf/yafcore/CMakeLists.txt (limited to 'mpeglib/example/yaf/yafcore') diff --git a/mpeglib/example/yaf/yafcore/CMakeLists.txt b/mpeglib/example/yaf/yafcore/CMakeLists.txt new file mode 100644 index 00000000..1e0abe1b --- /dev/null +++ b/mpeglib/example/yaf/yafcore/CMakeLists.txt @@ -0,0 +1,55 @@ +################################################# +# +# (C) 2017 Slávek Banko +# slavek (DOT) banko (AT) axis.cz +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_BINARY_DIR} + ${TQT_INCLUDE_DIRS} + ${TDE_INCLUDE_DIR} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${ARTS_LIBRARY_DIRS} +) + + +##### yafcore (library) ######################### + +tde_add_library( yafcore SHARED + SOURCES + buffer.cpp + lineStack.cpp + commandLine.cpp + parser.cpp + outputInterface.cpp + inputInterface.cpp + commandTable.cpp + commandTableYAF.cpp + runtimeTableYAF.cpp + inputDecoder.cpp + outputDecoder.cpp + yaf_control.cpp + multiReader.cpp + LINK + tdefakes-shared + mpeg-shared + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### other data ################################ + +install( + FILES + inputInterface.h outputInterface.h + buffer.h inputDecoder.h yaf_control.h + DESTINATION ${INCLUDE_INSTALL_DIR}/mpeglib/util/yaf/yafcore +) diff --git a/mpeglib/example/yaf/yafcore/inputInterface.cpp b/mpeglib/example/yaf/yafcore/inputInterface.cpp index 455ddd40..c5beaeda 100644 --- a/mpeglib/example/yaf/yafcore/inputInterface.cpp +++ b/mpeglib/example/yaf/yafcore/inputInterface.cpp @@ -75,7 +75,11 @@ int InputInterface::write(int fd,const char* txt) { snprintf(loopback->getData(),300, "Command:41 Msg:%s",txt); } else { +#if defined(HAVE_STRLCPY) || defined(HAVE_STRLCPY_PROTO) strlcpy(loopback->getData(),txt, loopback->getSize()); +#else + strncpy(loopback->getData(),txt, loopback->getSize()); +#endif } len =loopback->len(); back=::write(fd,loopback->getData(),len); @@ -136,7 +140,11 @@ void InputInterface::makeValidLine(char* line) { "Command:%d Msg:%s",currentCommandNumber,line); } else { increaseCurrentCommandNumber(); +#if defined(HAVE_STRLCPY) || defined(HAVE_STRLCPY_PROTO) strlcpy(currentLine->getData(),line, currentLine->getSize()); +#else + strncpy(currentLine->getData(),line, currentLine->getSize()); +#endif } return; -- cgit v1.2.1