70 lines
1.6 KiB
CMake
Executable File
70 lines
1.6 KiB
CMake
Executable File
PROJECT(nglwidgets)
|
|
|
|
FIND_PACKAGE(PopplerQt5 REQUIRED)
|
|
|
|
#
|
|
# NGL Widgets library
|
|
#
|
|
SET(nglwidgets_SRCS
|
|
ngldialogbuttonbox.cpp
|
|
ngldialogbuttonbox.h
|
|
ngldialog.cpp
|
|
ngldialog.h
|
|
nglmainwindow.cpp
|
|
nglmainwindow.h
|
|
nglpdfdocument.cpp
|
|
nglpdfdocument.h
|
|
nglpdfpage.cpp
|
|
nglpdfpage.h
|
|
nglstandardbutton.cpp
|
|
nglstandardbutton.h
|
|
ngltreeitem.cpp
|
|
ngltreeitem.h
|
|
ngltreemodel.cpp
|
|
ngltreemodel.h
|
|
nglpdfwidget.cpp
|
|
nglpdfwidget.h
|
|
nglwidgets_export.h
|
|
)
|
|
|
|
NGL_WRAP_UI(nglwidgets_SRCS
|
|
nglpdfwidget.ui
|
|
)
|
|
|
|
# Collect big resource QRCs
|
|
set(oxygen_SRCS nglresources.qrc)
|
|
if(TARGET Qt6::Core)
|
|
# Use Qt6's CMake helper to generate resource sources so resources are available at runtime
|
|
qt_add_resources(RME_LIGHT_RCC rme_light_style.qrc)
|
|
list(APPEND oxygen_SRCS ${RME_LIGHT_RCC})
|
|
else()
|
|
NGL_ADD_BIG_RESOURCES(oxygen_SRCS nglresources.qrc rme_light_style.qrc)
|
|
endif()
|
|
|
|
# SV: logView
|
|
NGL_ADD_LIBRARY(WS AAR SV nglwidgets SHARED ${nglwidgets_SRCS} ${oxygen_SRCS})
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(nglwidgets
|
|
PRIVATE
|
|
${POPPLER_QT5_INCLUDE_DIR}
|
|
)
|
|
NGL_TARGET_LINK_LIBRARIES(nglwidgets
|
|
PRIVATE
|
|
NGLLogger
|
|
ngltranslator
|
|
ngltools
|
|
${POPPLER_QT5_LIBRARY}
|
|
PUBLIC
|
|
Qt5::Core
|
|
Qt5::Widgets
|
|
)
|
|
|
|
NGL_INSTALL_TARGET(nglwidgets)
|
|
|
|
# Unit test for PDFWidget
|
|
IF(BUILD_TESTING AND TARGET nglwidgets)
|
|
FIND_PACKAGE(Qt6 REQUIRED COMPONENTS Test Widgets)
|
|
ADD_EXECUTABLE(test_nglpdfwidget test_nglpdfwidget.cpp)
|
|
TARGET_LINK_LIBRARIES(test_nglpdfwidget PRIVATE nglwidgets Qt6::Test Qt6::Widgets)
|
|
ADD_TEST(NAME test_nglpdfwidget COMMAND $<TARGET_FILE:test_nglpdfwidget>)
|
|
ENDIF()
|