Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/cmake/FindPopplerQt6.cmake
T
berrux-dev 8976b5aedb Remove dead CMake configuration from the release validation scope
- Top-level CMakeLists.txt: drop RTI/Connext DDS config and placeholder targets,
  MIGRATE_MODULE guarded-subdir machinery (now unconditional add_subdirectory),
  BUILD_QAV, BUILD_PLUGINS_*, KDReports stub, ArcGIS option and FindRTI placeholder loop
- Lts/CMakeLists.txt: release scope now unconditional (Common + Proxies/TrainingAreaBase),
  codegen/DDS/test/docs blocks removed
- Lts/Common: drop DDS/RTI-gated plugin and utils test blocks
- Lts/Proxies/TrainingAreaBase: remove RTI codegen, svcTabClient/svcTabServer, RTI plugins,
  sTAB; keep stub-only svcTabCommon + tabTelegrams + tabPluginInterface
- TetraIF/PrtCnv: remove out-of-scope TetraTestServer/LastTest subdirs
- Z/src/nglcompression: remove nglcomp_test (pre-existing Qt6 failure, no longer registered)
- Delete 16 unused cmake/ helper modules and the tests/ scaffolding dir
- new_docker_build.sh: drop BUILD_ARCGIS and nglcomp_test from the release build
- README: update ctest baseline to 7/7 and remove license/exception mentions
2026-10-14 18:39:18 +02:00

104 lines
3.4 KiB
CMake
Executable File

# FindPopplerQt6.cmake - Find Poppler Qt6 bindings
# Sets: POPPLER_QT6_INCLUDE_DIR, POPPLER_QT6_LIBRARY, PopplerQt6::Poppler target
if(POPPLER_QT6_INCLUDE_DIR AND POPPLER_QT6_LIBRARY)
set(POPPLER_QT6_FOUND TRUE)
else()
set(_poppler_version_bad FALSE)
if(NOT WIN32)
include(FindPkgConfig)
# Prefer poppler-qt6
pkg_check_modules(_pc_poppler poppler-qt6)
if(_pc_poppler_FOUND)
set(_pc_poppler_pkgname poppler-qt6)
if(NOT "${_pc_poppler_VERSION}" VERSION_GREATER 0.24.0)
set(_poppler_version_bad TRUE)
endif()
endif()
endif()
if(NOT _poppler_version_bad)
set(POPPLER_QT6_FOUND FALSE)
# Try library name discovered by pkg-config
if(_pc_poppler_FOUND)
set(_pkg_var "pkgcfg_lib__pc_poppler_${_pc_poppler_pkgname}")
message(STATUS "FindPoppler: pkg-config found ${_pc_poppler_pkgname}, var ${_pkg_var} defined? ${${_pkg_var}}")
if(DEFINED ${_pkg_var})
set(POPPLER_QT6_LIBRARY ${${_pkg_var}})
message(STATUS "FindPoppler: using pkgcfg path ${POPPLER_QT6_LIBRARY}")
endif()
endif()
if(NOT POPPLER_QT6_LIBRARY)
find_library(POPPLER_QT6_LIBRARY ${_pc_poppler_pkgname}
HINTS ${_pc_poppler_LIBRARY_DIRS}
)
endif()
# Fallback: try common library names
if(NOT POPPLER_QT6_LIBRARY)
find_library(POPPLER_QT6_LIBRARY NAMES poppler-qt6 poppler-qt6)
endif()
# Extra fallback paths
if(NOT POPPLER_QT6_LIBRARY)
find_library(POPPLER_QT6_LIBRARY NAMES poppler-qt6 poppler-qt6
PATHS /usr/lib/x86_64-linux-gnu /usr/lib /usr/local/lib)
endif()
# Check for headers (Qt6 layout: poppler/qt6/poppler-qt6.h)
find_path(POPPLER_QT6_INCLUDE_DIR poppler/qt6/poppler-qt6.h
HINTS ${_pc_poppler_INCLUDE_DIRS}
PATH_SUFFIXES poppler
)
if(POPPLER_QT6_LIBRARY AND POPPLER_QT6_INCLUDE_DIR)
set(POPPLER_QT6_FOUND TRUE)
# Expose a modern imported target for consumers
if(NOT TARGET PopplerQt6::Poppler)
add_library(PopplerQt6::Poppler UNKNOWN IMPORTED)
set_target_properties(PopplerQt6::Poppler PROPERTIES
IMPORTED_LOCATION "${POPPLER_QT6_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${POPPLER_QT6_INCLUDE_DIR}"
)
endif()
# Cache the variables
set(POPPLER_QT6_LIBRARY "${POPPLER_QT6_LIBRARY}" CACHE FILEPATH "Path to poppler-qt6 library")
set(POPPLER_QT6_INCLUDE_DIR "${POPPLER_QT6_INCLUDE_DIR}" CACHE PATH "Poppler-Qt6 include dirs")
endif()
endif()
if(POPPLER_QT6_LIBRARY AND POPPLER_QT6_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PopplerQt6 DEFAULT_MSG
POPPLER_QT6_LIBRARY
POPPLER_QT6_INCLUDE_DIR)
else()
message(WARNING "Poppler Qt6 bindings not found. Creating placeholder PopplerQt6::Poppler target.")
set(POPPLER_QT6_LIBRARY "" CACHE STRING "Placeholder poppler library" FORCE)
set(POPPLER_QT6_INCLUDE_DIR "" CACHE STRING "Placeholder poppler include dir" FORCE)
if(NOT TARGET PopplerQt6::Poppler)
add_library(PopplerQt6::Poppler UNKNOWN IMPORTED)
set_property(TARGET PopplerQt6::Poppler PROPERTY INTERFACE_INCLUDE_DIRECTORIES "")
endif()
set(POPPLER_QT6_FOUND TRUE CACHE INTERNAL "Poppler placeholder present")
endif()
endif()