[poppler] qt5/demos qt5/src qt5/tests

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Dec 2 17:39:27 UTC 2020


 qt5/demos/CMakeLists.txt |   13 +------------
 qt5/src/CMakeLists.txt   |    5 +----
 qt5/tests/CMakeLists.txt |   16 +++-------------
 3 files changed, 5 insertions(+), 29 deletions(-)

New commits:
commit 0f72f73357414ea79af774d4ce8f4fed80db3d98
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Dec 2 18:29:45 2020 +0100

    cmake: Use the new syntax to link in the Qt5 libs

diff --git a/qt5/demos/CMakeLists.txt b/qt5/demos/CMakeLists.txt
index 060ff167..fc5ae601 100644
--- a/qt5/demos/CMakeLists.txt
+++ b/qt5/demos/CMakeLists.txt
@@ -1,17 +1,7 @@
-add_definitions(${QT5_DEFINITIONS})
-add_definitions(${Qt5Core_DEFINITIONS})
-add_definitions(${Qt5Gui_DEFINITIONS})
-add_definitions(${Qt5Widgets_DEFINITIONS})
-add_definitions(${Qt5Xml_DEFINITIONS})
-
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/../src
   ${CMAKE_CURRENT_BINARY_DIR}
-  ${Qt5Core_INCLUDE_DIRS}
-  ${Qt5Widgets_INCLUDE_DIRS}
-  ${Qt5Gui_INCLUDE_DIRS}
-  ${Qt5Xml_INCLUDE_DIRS}
 )
 
 set(poppler_qt5viewer_SRCS
@@ -31,6 +21,5 @@ set(poppler_qt5viewer_SRCS
   viewer.cpp
 )
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
 poppler_add_test(poppler_qt5viewer BUILD_QT5_TESTS ${poppler_qt5viewer_SRCS})
-target_link_libraries(poppler_qt5viewer poppler-qt5 ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Xml_LIBRARIES})
+target_link_libraries(poppler_qt5viewer poppler-qt5 Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml)
diff --git a/qt5/src/CMakeLists.txt b/qt5/src/CMakeLists.txt
index 80f40fca..ae055a12 100644
--- a/qt5/src/CMakeLists.txt
+++ b/qt5/src/CMakeLists.txt
@@ -1,10 +1,7 @@
-add_definitions(${QT5_DEFINITIONS})
-add_definitions(${Qt5Core_DEFINITIONS})
 add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
 
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}
-  ${Qt5Core_INCLUDE_DIRS}
   ${CMAKE_CURRENT_BINARY_DIR}
 )
 
@@ -45,7 +42,7 @@ if(MINGW AND BUILD_SHARED_LIBS)
     get_target_property(POPPLER_QT5_SOVERSION poppler-qt5 SOVERSION)
     set_target_properties(poppler-qt5 PROPERTIES SUFFIX "-${POPPLER_QT5_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
 endif()
-target_link_libraries(poppler-qt5 poppler ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Xml_LIBRARIES} ${FREETYPE_LIBRARIES})
+target_link_libraries(poppler-qt5 poppler Qt5::Core Qt5::Gui Qt5::Xml ${FREETYPE_LIBRARIES})
 if(MSVC)
 target_link_libraries(poppler-qt5 poppler ${poppler_LIBS})
 endif()
diff --git a/qt5/tests/CMakeLists.txt b/qt5/tests/CMakeLists.txt
index b8b5a399..82ef2139 100644
--- a/qt5/tests/CMakeLists.txt
+++ b/qt5/tests/CMakeLists.txt
@@ -1,28 +1,18 @@
-add_definitions(${Qt5Core_DEFINITIONS})
 add_definitions(-DTESTDATADIR=\"${TESTDATADIR}\")
 
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/../src
   ${CMAKE_CURRENT_BINARY_DIR}
-  ${Qt5Core_INCLUDE_DIRS}
-  ${Qt5Gui_INCLUDE_DIRS}
-  ${Qt5Xml_INCLUDE_DIRS}
-  ${Qt5Widgets_INCLUDE_DIRS}
 )
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Gui_EXECUTABLE_COMPILE_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Xml_EXECUTABLE_COMPILE_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
-
 macro(QT5_ADD_SIMPLETEST exe source)
   string(REPLACE "-" "" test_name ${exe})
   set(${test_name}_SOURCES
     ${source}
   )
   poppler_add_test(${exe} BUILD_QT5_TESTS ${${test_name}_SOURCES})
-  target_link_libraries(${exe} poppler-qt5 ${Qt5Widgets_LIBRARIES})
+  target_link_libraries(${exe} poppler-qt5 Qt5::Widgets)
   if(MSVC)
     target_link_libraries(${exe} poppler ${poppler_LIBS})
   endif()
@@ -36,7 +26,7 @@ macro(QT5_ADD_QTEST exe source)
     )
     poppler_add_test(${exe} BUILD_QT5_TESTS ${${test_name}_SOURCES})
     add_test(${exe} ${EXECUTABLE_OUTPUT_PATH}/${exe})
-    target_link_libraries(${exe} poppler-qt5 ${Qt5Widgets_LIBRARIES} ${Qt5Test_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES})
+    target_link_libraries(${exe} poppler-qt5 Qt5::Widgets Qt5::Test Qt5::Core Qt5::Gui)
     if(MSVC)
       target_link_libraries(${exe} poppler ${poppler_LIBS})
     endif()
@@ -49,7 +39,7 @@ macro(QT_ADD_FUZZER exe)
     ${ARGN}
   )
   poppler_add_test(${exe} BUILD_QT5_TESTS ${${test_name}_SOURCES})
-  target_link_libraries(${exe} poppler-qt5 ${Qt5Widgets_LIBRARIES} ${Qt5Test_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES})
+  target_link_libraries(${exe} poppler-qt5 Qt5::Widgets Qt5::Test Qt5::Core Qt5::Gui)
 endmacro(QT_ADD_FUZZER)
 
 qt5_add_simpletest(test-poppler-qt5 test-poppler-qt5.cpp)


More information about the poppler mailing list