2015-12-05 22:50:38 +01:00
|
|
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
|
|
|
|
2017-01-07 16:46:53 +01:00
|
|
|
# meta data
|
|
|
|
set(META_PROJECT_NAME qtutilities)
|
|
|
|
set(META_PROJECT_VARNAME QT_UTILITIES)
|
|
|
|
set(META_APP_NAME "Qt Utilities")
|
|
|
|
set(META_APP_AUTHOR "Martchus")
|
|
|
|
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
|
|
|
|
set(META_APP_DESCRIPTION "Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models")
|
|
|
|
set(META_VERSION_MAJOR 5)
|
|
|
|
set(META_VERSION_MINOR 4)
|
2017-02-05 21:01:34 +01:00
|
|
|
set(META_VERSION_PATCH 1)
|
2017-01-07 16:46:53 +01:00
|
|
|
set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH})
|
|
|
|
|
2015-12-08 08:36:36 +01:00
|
|
|
# add project files
|
|
|
|
set(HEADER_FILES
|
2016-03-03 01:43:48 +01:00
|
|
|
misc/xmlparsermacros.h
|
2016-03-06 17:12:50 +01:00
|
|
|
misc/undefxmlparsermacros.h
|
2016-03-10 22:15:16 +01:00
|
|
|
misc/trylocker.h
|
|
|
|
misc/adoptlocker.h
|
2016-04-16 18:32:56 +02:00
|
|
|
misc/dialogutils.h
|
|
|
|
misc/desktoputils.h
|
2016-12-19 23:38:32 +01:00
|
|
|
misc/conversion.h
|
2015-12-08 08:36:36 +01:00
|
|
|
models/checklistmodel.h
|
|
|
|
resources/qtconfigarguments.h
|
|
|
|
resources/resources.h
|
2016-08-19 22:37:43 +02:00
|
|
|
resources/importplugin.h
|
2016-04-09 02:33:09 +02:00
|
|
|
)
|
|
|
|
set(SRC_FILES
|
2016-04-16 18:32:56 +02:00
|
|
|
misc/dialogutils.cpp
|
|
|
|
misc/desktoputils.cpp
|
2016-04-09 02:33:09 +02:00
|
|
|
models/checklistmodel.cpp
|
|
|
|
resources/qtconfigarguments.cpp
|
|
|
|
resources/resources.cpp
|
2017-02-11 02:04:12 +01:00
|
|
|
)
|
|
|
|
set(RES_FILES
|
2016-04-09 02:33:09 +02:00
|
|
|
resources/qtutilsicons.qrc
|
|
|
|
)
|
2016-04-16 00:50:31 +02:00
|
|
|
|
2016-04-09 02:33:09 +02:00
|
|
|
set(WIDGETS_HEADER_FILES
|
|
|
|
aboutdialog/aboutdialog.h
|
|
|
|
enterpassworddialog/enterpassworddialog.h
|
2015-12-08 08:36:36 +01:00
|
|
|
settingsdialog/optioncategory.h
|
|
|
|
settingsdialog/optioncategoryfiltermodel.h
|
|
|
|
settingsdialog/optioncategorymodel.h
|
|
|
|
settingsdialog/optionpage.h
|
|
|
|
settingsdialog/settingsdialog.h
|
2016-04-04 14:49:40 +02:00
|
|
|
settingsdialog/qtsettings.h
|
2015-12-08 08:36:36 +01:00
|
|
|
widgets/buttonoverlay.h
|
|
|
|
widgets/clearcombobox.h
|
|
|
|
widgets/clearlineedit.h
|
|
|
|
widgets/clearplaintextedit.h
|
|
|
|
widgets/clearspinbox.h
|
|
|
|
widgets/iconbutton.h
|
2016-04-09 02:33:09 +02:00
|
|
|
widgets/pathselection.h
|
2016-04-04 14:49:40 +02:00
|
|
|
paletteeditor/paletteeditor.h
|
|
|
|
paletteeditor/colorbutton.h
|
2016-04-19 01:38:21 +02:00
|
|
|
misc/recentmenumanager.h
|
2015-12-08 08:36:36 +01:00
|
|
|
)
|
2016-04-09 02:33:09 +02:00
|
|
|
set(WIDGETS_SRC_FILES
|
2015-12-08 08:36:36 +01:00
|
|
|
aboutdialog/aboutdialog.cpp
|
|
|
|
enterpassworddialog/enterpassworddialog.cpp
|
|
|
|
settingsdialog/optioncategory.cpp
|
|
|
|
settingsdialog/optioncategoryfiltermodel.cpp
|
|
|
|
settingsdialog/optioncategorymodel.cpp
|
|
|
|
settingsdialog/optionpage.cpp
|
|
|
|
settingsdialog/settingsdialog.cpp
|
2016-04-04 14:49:40 +02:00
|
|
|
settingsdialog/qtsettings.cpp
|
2015-12-08 08:36:36 +01:00
|
|
|
widgets/buttonoverlay.cpp
|
|
|
|
widgets/clearcombobox.cpp
|
|
|
|
widgets/clearlineedit.cpp
|
|
|
|
widgets/clearplaintextedit.cpp
|
|
|
|
widgets/clearspinbox.cpp
|
|
|
|
widgets/iconbutton.cpp
|
2016-04-09 02:33:09 +02:00
|
|
|
widgets/pathselection.cpp
|
2016-04-04 14:49:40 +02:00
|
|
|
paletteeditor/paletteeditor.cpp
|
|
|
|
paletteeditor/colorbutton.cpp
|
2016-04-19 01:38:21 +02:00
|
|
|
misc/recentmenumanager.cpp
|
2015-12-08 08:36:36 +01:00
|
|
|
)
|
2016-01-25 18:59:44 +01:00
|
|
|
set(WIDGETS_UI_FILES
|
|
|
|
aboutdialog/aboutdialog.ui
|
|
|
|
enterpassworddialog/enterpassworddialog.ui
|
|
|
|
settingsdialog/settingsdialog.ui
|
2016-04-04 14:49:40 +02:00
|
|
|
settingsdialog/qtappearanceoptionpage.ui
|
|
|
|
settingsdialog/qtlanguageoptionpage.ui
|
2016-04-09 02:33:09 +02:00
|
|
|
settingsdialog/qtenvoptionpage.ui
|
2016-04-04 14:49:40 +02:00
|
|
|
paletteeditor/paletteeditor.ui
|
2016-01-25 18:59:44 +01:00
|
|
|
)
|
2015-12-08 08:36:36 +01:00
|
|
|
|
2016-04-16 00:50:31 +02:00
|
|
|
set(CMAKE_MODULE_FILES
|
|
|
|
cmake/modules/QtConfig.cmake
|
|
|
|
cmake/modules/QtGuiConfig.cmake
|
2016-08-29 15:41:11 +02:00
|
|
|
cmake/modules/QtLinkage.cmake
|
2016-04-16 00:50:31 +02:00
|
|
|
cmake/modules/JsProviderConfig.cmake
|
|
|
|
cmake/modules/WebViewProviderConfig.cmake
|
|
|
|
)
|
|
|
|
|
2017-01-07 16:46:53 +01:00
|
|
|
set(TS_FILES
|
|
|
|
translations/${META_PROJECT_NAME}_de_DE.ts
|
|
|
|
translations/${META_PROJECT_NAME}_en_US.ts
|
|
|
|
)
|
|
|
|
|
2016-06-10 23:05:43 +02:00
|
|
|
set(DOC_FILES
|
|
|
|
README.md
|
|
|
|
)
|
|
|
|
|
2016-07-16 23:12:02 +02:00
|
|
|
set(REQUIRED_ICONS
|
2016-09-03 20:19:17 +02:00
|
|
|
dialog-cancel
|
|
|
|
dialog-ok
|
|
|
|
dialog-ok-apply
|
2016-07-16 23:12:02 +02:00
|
|
|
document-open
|
|
|
|
document-open-recent
|
|
|
|
edit-clear
|
|
|
|
go-next
|
2016-08-31 23:38:35 +02:00
|
|
|
preferences-desktop-icons
|
|
|
|
preferences-desktop-locale
|
2016-09-03 20:19:17 +02:00
|
|
|
qtcreator
|
|
|
|
system-file-manager
|
|
|
|
system-run
|
|
|
|
system-search
|
|
|
|
window-close
|
2016-07-16 23:12:02 +02:00
|
|
|
)
|
|
|
|
|
2016-09-11 20:31:11 +02:00
|
|
|
set(SCRIPT_FILES
|
|
|
|
scripts/required_icons.sh
|
|
|
|
)
|
|
|
|
|
2016-04-16 00:50:31 +02:00
|
|
|
# required to include CMake modules from own project directory
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" "${CMAKE_MODULE_PATH}")
|
2015-12-05 22:50:38 +01:00
|
|
|
|
2016-04-16 00:50:31 +02:00
|
|
|
# configure platform specific capslock detection
|
2016-03-28 21:57:01 +02:00
|
|
|
if(WIN32)
|
|
|
|
# WinAPI provides functions required for capslock detection
|
2016-12-11 17:13:19 +01:00
|
|
|
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION)
|
2016-03-28 21:57:01 +02:00
|
|
|
else()
|
|
|
|
# X11 can provide functions required for capslock detection under non-Windows environments
|
|
|
|
find_package(X11)
|
|
|
|
if(X11_FOUND)
|
2016-04-16 00:50:31 +02:00
|
|
|
list(APPEND LIBRARIES ${X11_LIBRARIES})
|
2016-12-11 17:13:19 +01:00
|
|
|
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION)
|
2016-03-28 21:57:01 +02:00
|
|
|
endif()
|
2015-12-05 22:50:38 +01:00
|
|
|
endif()
|
|
|
|
|
2016-12-11 17:31:49 +01:00
|
|
|
# configure support for D-Bus notifications
|
|
|
|
option(DBUS_NOTIFICATIONS "enables support for D-Bus notifications" ${UNIX})
|
|
|
|
set(DBUS_NOTIFICATIONS_FILE_NAME misc/dbusnotification)
|
|
|
|
if(DBUS_NOTIFICATIONS)
|
|
|
|
list(APPEND HEADER_FILES
|
|
|
|
${DBUS_NOTIFICATIONS_FILE_NAME}.h
|
|
|
|
)
|
|
|
|
list(APPEND SRC_FILES
|
|
|
|
${DBUS_NOTIFICATIONS_FILE_NAME}.cpp
|
|
|
|
)
|
|
|
|
list(APPEND DBUS_FILES
|
|
|
|
dbus/org.freedesktop.Notifications.xml
|
|
|
|
)
|
2016-12-19 23:38:32 +01:00
|
|
|
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME}_SUPPORT_DBUS_NOTIFICATIONS)
|
2016-12-11 17:31:49 +01:00
|
|
|
message(STATUS "D-Bus notifications enabled")
|
|
|
|
else()
|
|
|
|
list(APPEND DOC_ONLY_FILES
|
|
|
|
${DBUS_NOTIFICATIONS_FILE_NAME}.h
|
|
|
|
${DBUS_NOTIFICATIONS_FILE_NAME}.cpp
|
|
|
|
)
|
|
|
|
message(STATUS "D-Bus notifications disabled")
|
|
|
|
endif()
|
|
|
|
|
2016-04-16 00:50:31 +02:00
|
|
|
# find c++utilities
|
2017-02-09 16:48:42 +01:00
|
|
|
find_package(c++utilities 4.6.0 REQUIRED)
|
2016-04-16 00:50:31 +02:00
|
|
|
use_cpp_utilities()
|
|
|
|
|
|
|
|
# include modules to apply configuration
|
|
|
|
include(BasicConfig)
|
|
|
|
include(QtGuiConfig)
|
2016-11-10 23:40:03 +01:00
|
|
|
set(META_PUBLIC_QT_MODULES Core ${ADDITIONAL_QT_MODULES})
|
2016-04-16 00:50:31 +02:00
|
|
|
include(QtConfig)
|
|
|
|
include(WindowsResources)
|
|
|
|
include(LibraryTarget)
|
2016-06-10 23:05:43 +02:00
|
|
|
include(Doxygen)
|
2016-07-27 21:38:57 +02:00
|
|
|
include(ConfigHeader)
|