Warning, /maui/mauikit-documents/src/code/poppler/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2021 Camilo Higuita <milo.h@aol.com>
0002 #
0003 # SPDX-License-Identifier: BSD-2-Clause
0004 
0005 project(PopplerLib)
0006 
0007 if(ANDROID)
0008     find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS AndroidExtras QuickControls2)
0009 elseif(UNIX)
0010     find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets)
0011     find_package(Poppler REQUIRED COMPONENTS Qt${QT_MAJOR_VERSION})
0012     set_package_properties("Poppler" PROPERTIES
0013         TYPE RECOMMENDED
0014         PURPOSE "Support for PDF files.")
0015 endif()
0016 
0017 include_directories(
0018     ${CMAKE_CURRENT_SOURCE_DIR}
0019     ${CMAKE_CURRENT_BINARY_DIR}
0020     ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
0021     ${Qt5Qml_PRIVATE_INCLUDE_DIRS})
0022 
0023 set(sources
0024     code/pdfdocument.cpp
0025     code/pdfimageprovider.cpp
0026     code/thumbnailer.cpp
0027     code/pdfitem.cpp
0028 #    code/verticalview.cpp
0029     code/pdftocmodel.cpp
0030     )
0031 
0032 set( pluginData
0033     data/fonts/fonts.qrc
0034     img_assets.qrc)
0035 
0036 
0037 add_library(PopplerLib
0038     STATIC
0039     ${sources}
0040     ${pluginData})
0041 
0042 if (ANDROID)
0043     add_library(poppler STATIC IMPORTED GLOBAL)
0044     set_target_properties(poppler PROPERTIES IMPORTED_LOCATION "/home/camilo/Qt5152/5.15.2/android/lib/libpoppler_armeabi-v7a.so" )
0045 
0046     add_library(poppler-qt5 STATIC IMPORTED GLOBAL)
0047     set_target_properties(poppler-qt5 PROPERTIES IMPORTED_LOCATION "/home/camilo/Qt5152/5.15.2/android/lib/libpoppler-qt5_armeabi-v7a.so" )
0048 
0049     target_include_directories(PopplerLib PUBLIC "/home/camilo/Qt5152/5.15.2/android/include/")
0050 
0051     target_link_libraries(PopplerLib PRIVATE poppler-qt5)
0052 elseif(UNIX)
0053     target_link_libraries(PopplerLib PRIVATE Poppler::Qt${QT_MAJOR_VERSION})
0054 endif()
0055 
0056 set_property(TARGET PopplerLib PROPERTY POSITION_INDEPENDENT_CODE ON)
0057 
0058 target_include_directories(PopplerLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
0059 target_link_libraries(PopplerLib
0060     PRIVATE
0061     Qt${QT_MAJOR_VERSION}::Core
0062     Qt${QT_MAJOR_VERSION}::Quick
0063     Qt${QT_MAJOR_VERSION}::Qml
0064     Qt${QT_MAJOR_VERSION}::Concurrent)
0065