diff --git a/cmake/modules/FindDiscount.cmake b/cmake/modules/FindDiscount.cmake index 43eac0b24..583fb0598 100644 --- a/cmake/modules/FindDiscount.cmake +++ b/cmake/modules/FindDiscount.cmake @@ -1,36 +1,41 @@ # - Find Discount # Find the discount markdown library. # # This module defines # discount_FOUND - whether the discount library was found # discount_LIBRARIES - the discount library # discount_INCLUDE_DIR - the include path of the discount library # Copyright (c) 2017, Julian Wolff, +# Copyright (c) 2018, Sune Vuorela, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (discount_INCLUDE_DIR AND discount_LIBRARIES) # Already in cache set (discount_FOUND TRUE) else (discount_INCLUDE_DIR AND discount_LIBRARIES) find_library (discount_LIBRARIES NAMES markdown libmarkdown ) find_path (discount_INCLUDE_DIR NAMES mkdio.h ) include (FindPackageHandleStandardArgs) find_package_handle_standard_args (discount DEFAULT_MSG discount_LIBRARIES discount_INCLUDE_DIR) endif (discount_INCLUDE_DIR AND discount_LIBRARIES) mark_as_advanced(discount_INCLUDE_DIR discount_LIBRARIES) +if (discount_FOUND) + add_library(discount::Lib UNKNOWN IMPORTED) + set_target_properties(discount::Lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${discount_INCLUDE_DIR} IMPORTED_LOCATION ${discount_LIBRARIES}) +endif() diff --git a/generators/markdown/CMakeLists.txt b/generators/markdown/CMakeLists.txt index f5fa2eced..6e8b0f1a4 100644 --- a/generators/markdown/CMakeLists.txt +++ b/generators/markdown/CMakeLists.txt @@ -1,25 +1,25 @@ remove_definitions(-DTRANSLATION_DOMAIN="okular") add_definitions(-DTRANSLATION_DOMAIN="okular_markdown") include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../.. ) ########### next target ############### set(okularGenerator_md_PART_SRCS converter.cpp generator_md.cpp ) okular_add_generator(okularGenerator_md ${okularGenerator_md_PART_SRCS}) -target_link_libraries(okularGenerator_md okularcore KF5::I18n KF5::KIOCore ${discount_LIBRARIES}) +target_link_libraries(okularGenerator_md PRIVATE okularcore KF5::I18n KF5::KIOCore discount::Lib) ########### install files ############### install( FILES okularMd.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} ) install( PROGRAMS okularApplication_md.desktop org.kde.mobile.okular_md.desktop DESTINATION ${KDE_INSTALL_APPDIR} ) install( FILES org.kde.okular-md.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )