2023-06-21 21:02:19 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
#
|
2024-05-24 18:17:26 +00:00
|
|
|
# ES-DE Frontend
|
2023-06-21 21:02:19 +00:00
|
|
|
# CMakeLists.txt (es-pdf-converter)
|
|
|
|
#
|
|
|
|
# CMake configuration for es-pdf-convert
|
|
|
|
#
|
|
|
|
|
|
|
|
project(es-pdf-convert)
|
|
|
|
|
2023-06-22 19:15:35 +00:00
|
|
|
if(WIN32)
|
2023-06-23 13:23:14 +00:00
|
|
|
set(POPPLER_CPP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../external/poppler/Library/include/poppler/cpp)
|
2023-12-19 16:38:21 +00:00
|
|
|
set(POPPLER_CPP_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/poppler-cpp.lib)
|
|
|
|
# Disable DLL interface warnings.
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251")
|
2023-06-24 21:58:33 +00:00
|
|
|
elseif(APPLE)
|
|
|
|
set(POPPLER_CPP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../external/poppler/cpp ${CMAKE_CURRENT_SOURCE_DIR}/../external/poppler/build/cpp)
|
|
|
|
set(POPPLER_CPP_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../libpoppler-cpp.0.dylib)
|
2023-12-11 17:31:38 +00:00
|
|
|
elseif(ANDROID)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -llog")
|
|
|
|
set(POPPLER_CPP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../external/poppler/cpp ${CMAKE_CURRENT_SOURCE_DIR}/../external/poppler/build/cpp)
|
|
|
|
set(POPPLER_CPP_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../android/libs/${ANDROID_CPU_ARCH}/libpoppler-cpp.so)
|
2023-06-23 13:23:14 +00:00
|
|
|
else()
|
2023-06-22 19:15:35 +00:00
|
|
|
find_package(Poppler REQUIRED COMPONENTS cpp)
|
|
|
|
endif()
|
2023-06-21 21:02:19 +00:00
|
|
|
|
|
|
|
include_directories(${POPPLER_CPP_INCLUDE_DIR})
|
2023-12-11 17:31:38 +00:00
|
|
|
if (ANDROID)
|
|
|
|
set(CONVERTER_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/ConvertPDF.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ConvertPDF.h)
|
|
|
|
add_library(es-pdf-convert SHARED ${CONVERTER_SOURCE_FILES})
|
|
|
|
else()
|
|
|
|
set(CONVERTER_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ConvertPDF.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ConvertPDF.h)
|
|
|
|
add_executable(es-pdf-convert WIN32 ${CONVERTER_SOURCE_FILES})
|
|
|
|
endif()
|
|
|
|
target_link_libraries(es-pdf-convert PRIVATE ${POPPLER_CPP_LIBRARY})
|
2023-06-22 19:15:35 +00:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set_target_properties(es-pdf-convert PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/es-pdf-converter" INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
|
|
else()
|
|
|
|
set_target_properties(es-pdf-convert PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
|
|
endif()
|