CMakeLists.txt 4.55 KB
Newer Older
Sandro Knauß's avatar
Sandro Knauß committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161

add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )


add_definitions(-DTRANSLATION_DOMAIN=\"libmimetreeparser\")

# target_include_directories does not handle empty include paths
include_directories(${GPGME_INCLUDES})

set(libmimetreeparser_main_SRCS
    interfaces/bodypartformatter.cpp
    job/kleojobexecutor.cpp
    viewer/attachmentstrategy.cpp
    viewer/bodypartformatter.cpp
    viewer/bodypartformatterbasefactory.cpp
    viewer/cryptohelper.cpp
    viewer/csshelperbase.cpp
    viewer/nodehelper.cpp
    viewer/objecttreeparser.cpp
    viewer/messagepart.cpp
    viewer/partnodebodypart.cpp
    viewer/memento/cryptobodypartmemento.cpp
    viewer/memento/decryptverifybodypartmemento.cpp
    viewer/memento/verifydetachedbodypartmemento.cpp
    viewer/memento/verifyopaquebodypartmemento.cpp
    )

set(libmimetreeparser_extra_SRCS
    #for quotes
    utils/iconnamecache.cpp
    utils/mimetype.cpp
    viewer/converthtmltoplaintext.cpp
    #HTML Writer
    htmlwriter/filehtmlwriter.cpp
    htmlwriter/queuehtmlwriter.cpp
    )


ecm_generate_headers(MimeTreeParser_Camelcaseviewer_HEADERS
    HEADER_NAMES
    AttachmentStrategy
    BodyPartFormatterBaseFactory
    CSSHelperBase
    Enums
    MessagePart
    NodeHelper
    ObjectTreeParser
    PartMetaData
    PartNodeBodyPart
    REQUIRED_HEADERS MimeTreeParser_viewer_HEADERS
    PREFIX MimeTreeParser
    RELATIVE viewer
    )

ecm_generate_headers(MimeTreeParser_Camelcasemain_HEADERS
    HEADER_NAMES
    ObjectTreeSourceIf
    REQUIRED_HEADERS MimeTreeParser_main_HEADERS
    PREFIX MimeTreeParser
    )

ecm_generate_headers(MimeTreeParser_Camelcaseutils_HEADERS
    HEADER_NAMES
    IconNameCache
    MimeType
    REQUIRED_HEADERS MimeTreeParser_utils_HEADERS
    PREFIX MimeTreeParser
    RELATIVE utils
    )

ecm_generate_headers(MimeTreeParser_Camelcaseinterfaces_HEADERS
    HEADER_NAMES
    BodyPartFormatter
    BodyPart
    HtmlWriter
    REQUIRED_HEADERS MimeTreeParser_interfaces_HEADERS
    PREFIX MimeTreeParser
    RELATIVE interfaces
    )

ecm_generate_headers(MimeTreeParser_Camelcasehtmlwriter_HEADERS
    HEADER_NAMES
    FileHtmlWriter
    REQUIRED_HEADERS MimeTreeParser_htmlwriter_HEADERS
    PREFIX MimeTreeParser
    RELATIVE htmlwriter
    )

install(FILES
    ${MimeTreeParser_Camelcasehtmlwriter_HEADERS}
    ${MimeTreeParser_Camelcaseutils_HEADERS}
    ${MimeTreeParser_Camelcaseinterfaces_HEADERS}
    ${MimeTreeParser_Camelcaseviewer_HEADERS}
    ${MimeTreeParser_Camelcasemain_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/MimeTreeParser
    COMPONENT Devel
    )

install(FILES
    ${MimeTreeParser_htmlwriter_HEADERS}
    ${MimeTreeParser_utils_HEADERS}
    ${MimeTreeParser_interfaces_HEADERS}
    ${MimeTreeParser_viewer_HEADERS}
    ${MimeTreeParser_main_HEADERS}
    ${CMAKE_CURRENT_BINARY_DIR}/mimetreeparser_export.h
    ${CMAKE_CURRENT_BINARY_DIR}/mimetreeparser_debug.h

    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/mimetreeparser
    COMPONENT Devel
    )

ecm_generate_pri_file(BASE_NAME MimeTreeParser
    LIB_NAME KF5MimeTreeParser
    DEPS "PimCommon MessageCore Libkleo" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/MimeTreeParser
    )

install(FILES
    ${PRI_FILENAME}
    DESTINATION ${ECM_MKSPECS_INSTALL_DIR}
    )

set(libmimetreeparser_SRCS
    ${libmimetreeparser_main_SRCS}
    ${libmimetreeparser_extra_SRCS}
    )

ecm_qt_declare_logging_category(libmimetreeparser_SRCS HEADER mimetreeparser_debug.h IDENTIFIER MIMETREEPARSER_LOG CATEGORY_NAME log_mimetreeparser)

add_library(KF5MimeTreeParser
    ${libmimetreeparser_SRCS}
    )

generate_export_header(KF5MimeTreeParser BASE_NAME mimetreeparser)
add_library(KF5::MimeTreeParser ALIAS KF5MimeTreeParser)

target_link_libraries(KF5MimeTreeParser
    PUBLIC
    KF5::MessageCore #NodeHelper, StringUtils
    KF5::PimCommon #AttachmentTemporaryFile handling
    KF5::Libkleo
    PRIVATE
    KF5::Mime
    Qt5::WebKitWidgets
    KF5::IconThemes
    Grantlee5::TextDocument
    )

install(TARGETS
    KF5MimeTreeParser
    EXPORT KF5MimeTreeParserTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} ${LIBRARY_NAMELINK}
    )

set_target_properties(KF5MimeTreeParser PROPERTIES
    VERSION ${MIMETREEPARSER_VERSION_STRING}
    SOVERSION ${MIMETREEPARSER_SOVERSION}
    EXPORT_NAME MimeTreeParser
    )

target_include_directories(KF5MimeTreeParser INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/MimeTreeParser/;${KDE_INSTALL_INCLUDEDIR_KF5}/mimetreeparser>")
target_include_directories(KF5MimeTreeParser PUBLIC "$<BUILD_INTERFACE:${MimeTreeParser_SOURCE_DIR}/src;${MimeTreeParser_BINARY_DIR}/src;>")