Commit f8db0fba authored by Vishesh Handa's avatar Vishesh Handa
Browse files

Export the lib as qmobipocket

The Nepomuk mobi pocket analyzer needs this library for indexing mobi
file metadata.

REVIEW: 113401
parent e0bc8545
......@@ -14,6 +14,8 @@ macro_log_feature(STRIGI_FOUND "strigi libraries" "Provide a strigi analyzer for
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(${KDE4_INCLUDES})
add_subdirectory(lib)
macro_optional_add_subdirectory(thumbnailers)
if(OKULAR_FOUND)
macro_optional_add_subdirectory(okular)
......@@ -22,5 +24,8 @@ if(STRIGI_FOUND)
macro_optional_add_subdirectory(strigi)
endif()
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/QMobipocketConfig.cmake
DESTINATION ${LIB_INSTALL_DIR}/cmake/QMobipocket )
macro_display_feature_log()
get_filename_component( _currentDir ${CMAKE_CURRENT_LIST_FILE} PATH)
get_filename_component( _currentDir ${_currentDir} PATH)
get_filename_component( _currentDir ${_currentDir} PATH)
get_filename_component( _currentDir ${_currentDir} PATH)
# find the full paths to the library and the includes:
find_path(QMOBIPOCKET_INCLUDE_DIR qmobipocket/mobipocket.h
HINTS ${_currentDir}/include
NO_DEFAULT_PATH)
find_library(QMOBIPOCKET_LIBRARY qmobipocket
HINTS ${_currentDir}/lib
NO_DEFAULT_PATH)
set(QMOBIPOCKET_LIBRARIES ${QMOBIPOCKET_LIBRARY})
if(QMOBIPOCKET_INCLUDE_DIR AND QMOBIPOCKET_LIBRARY)
set(QMOBIPOCKET_FOUND TRUE)
endif()
set (QMOBIPOCKET_SRCS
decompressor.cpp
mobipocket.cpp
)
kde4_add_library(qmobipocket SHARED ${QMOBIPOCKET_SRCS})
target_link_libraries (qmobipocket
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
)
install(FILES
mobipocket.h
qmobipocket_export.h
DESTINATION ${INCLUDE_INSTALL_DIR}/qmobipocket/ COMPONENT Devel
)
install(TARGETS qmobipocket ${INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -15,6 +15,8 @@
#include <QtCore/QMap>
#include <QtGui/QImage>
#include "qmobipocket_export.h"
class QIODevice;
namespace Mobipocket {
......@@ -23,7 +25,7 @@ namespace Mobipocket {
Minimalistic stream abstraction. It is supposed to allow mobipocket document classes to be
used with both QIODevice (for Okular generator) and InputStream for Strigi analyzer.
*/
class Stream {
class QMOBIPOCKET_EXPORT Stream {
public:
virtual int read(char* buf, int size)=0;
virtual bool seek(int pos)=0;
......@@ -47,7 +49,7 @@ private:
};
struct DocumentPrivate;
class Document {
class QMOBIPOCKET_EXPORT Document {
public:
enum MetaKey { Title, Author, Copyright, Description, Subject };
~Document();
......
/* This file is part of the KDE project
Copyright (C) 2007 David Faure <faure@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _QMOBIPOCKET_EXPORT_H
#define _QMOBIPOCKET_EXPORT_H
/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>
#ifndef QMOBIPOCKET_EXPORT
# if defined(KDELIBS_STATIC_LIBS)
/* No export/import for static libraries */
# define QMOBIPOCKET_EXPORT
# elif defined(MAKE_QMOBIPOCKET_LIB)
/* We are building this library */
# define QMOBIPOCKET_EXPORT KDE_EXPORT
# else
/* We are using this library */
# define QMOBIPOCKET_EXPORT KDE_IMPORT
# endif
#endif
#endif
......@@ -6,8 +6,6 @@ include_directories(
########### next target ###############
set(okularGenerator_mobi_PART_SRCS
${PROJECT_SOURCE_DIR}/lib/mobipocket.cpp
${PROJECT_SOURCE_DIR}/lib/decompressor.cpp
mobidocument.cpp
generator_mobi.cpp
converter.cpp
......@@ -15,7 +13,7 @@ set(okularGenerator_mobi_PART_SRCS
kde4_add_plugin(okularGenerator_mobi ${okularGenerator_mobi_PART_SRCS})
target_link_libraries(okularGenerator_mobi ${OKULAR_CORE_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY})
target_link_libraries(okularGenerator_mobi ${OKULAR_CORE_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} qmobipocket)
install(TARGETS okularGenerator_mobi DESTINATION ${PLUGIN_INSTALL_DIR})
......
......@@ -6,14 +6,12 @@ include_directories(
########### next target ###############
set(mobianalyzer_SRCS
${PROJECT_SOURCE_DIR}/lib/mobipocket.cpp
${PROJECT_SOURCE_DIR}/lib/decompressor.cpp
mobiendanalyzer.cpp
)
kde4_add_library(mobi MODULE ${mobianalyzer_SRCS})
target_link_libraries(mobi ${STRIGI_STREAMS_LIBRARY} ${STRIGI_STREAMANALYZER_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
target_link_libraries(mobi ${STRIGI_STREAMS_LIBRARY} ${STRIGI_STREAMANALYZER_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} qmobipocket)
# install the module in the right directory so it is picked up
set_target_properties(mobi PROPERTIES PREFIX ${STRIGI_LINE_ANALYZER_PREFIX})
......
......@@ -6,13 +6,11 @@ include_directories(
########### next target ###############
set(mobithumbnail_SRCS
${PROJECT_SOURCE_DIR}/lib/mobipocket.cpp
${PROJECT_SOURCE_DIR}/lib/decompressor.cpp
mobithumbnail.cpp
)
kde4_add_plugin(mobithumbnail ${mobithumbnail_SRCS})
target_link_libraries(mobithumbnail ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${QT_QTGUI_LIBRARY} )
target_link_libraries(mobithumbnail ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${QT_QTGUI_LIBRARY} qmobipocket)
install(TARGETS mobithumbnail DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment