From 1c9d378bb302daee620ba253dc716558e3e8f780 Mon Sep 17 00:00:00 2001 From: Abdou-Raouf ATARMLA Date: Tue, 12 Nov 2024 14:41:04 +0100 Subject: [PATCH] Fix CMake configuration for hide-formfields build - Updated `CMakeLists.txt` to properly find and link Qt5 and Poppler libraries. - Set correct include directories to resolve build issues. - Ensures compatibility and successful build on systems with Qt5 and Poppler dependencies. --- cpp/hide-formfields/CMakeLists.txt | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/cpp/hide-formfields/CMakeLists.txt b/cpp/hide-formfields/CMakeLists.txt index f38e0c9..67ca64d 100644 --- a/cpp/hide-formfields/CMakeLists.txt +++ b/cpp/hide-formfields/CMakeLists.txt @@ -1,26 +1,22 @@ cmake_minimum_required(VERSION 3.10) -set (CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 17) project(hide-formfields) -find_library(poppler poppler) -find_library(poppler-qt poppler-qt5) -find_library(qt Qt5Core) +find_package(Qt5Core REQUIRED) +find_library(poppler_LIB poppler) +find_library(poppler_qt_LIB poppler-qt5) -message("${qt}") -message("${poppler}") -message("${poppler-qt}") - -set(LIB_DIR /lib/x86_64-linux-gnu) +message("Qt5Core found at: ${Qt5Core_LIBRARIES}") +message("Poppler found at: ${poppler_LIB}") +message("Poppler-Qt5 found at: ${poppler_qt_LIB}") set(INCLUDE_POPPLER /usr/include/poppler/cpp) set(INCLUDE_POPPLER_QT /usr/include/poppler/qt5) -set(INCLUDE_QT /usr/include/qt5) -set(INCLUDE_QT_CORE /usr/include/QtCore) -add_executable(hide-formfields main.cpp) +include_directories(${INCLUDE_POPPLER} ${INCLUDE_POPPLER_QT}) -include_directories(${INCLUDE_POPPLER} ${INCLUDE_POPPLER_QT} ${INCLUDE_QT} ${INCLUDE_QT_CORE} include) +add_executable(hide-formfields main.cpp) -target_link_libraries(hide-formfields ${qt} ${poppler} ${poppler-qt}) +target_link_libraries(hide-formfields Qt5::Core ${poppler_LIB} ${poppler_qt_LIB})