rssguard/CMakeLists.txt

808 lines
28 KiB
CMake
Raw Normal View History

2013-11-24 18:35:12 +01:00
#################################################################
2013-11-27 18:21:40 +01:00
#
# This file is part of RSS Guard.
#
# Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
#
# RSS Guard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# RSS Guard is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with RSS Guard. If not, see <http:# www.gnu.org/licenses/>.
#
#
# This is RSS Guard compilation script for CMake.
2013-11-24 18:35:12 +01:00
#
# Usage:
# a) DEBUG build for testing.
# cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT_5=ON
#
# b) RELEASE build for production use.
# cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT_5=ON
#
# Arguments:
# -DCMAKE_INSTALL_PREFIX=/usr
2013-11-24 18:35:12 +01:00
# Installation path, replace with something like "C:\rssguard" on Windows.
#
# -DUSE_QT_5=OFF
2013-11-24 18:35:12 +01:00
# Specifies which major Qt version to use. Qt 4 and Qt 5 are supported.
2013-12-07 20:33:41 +01:00
# If "OFF" is passed as an argument, then Qt 4 is used. Default is "OFF".
2013-11-27 18:21:40 +01:00
#
# -DBUNDLE_ICON_THEMES=ON
2013-12-11 14:07:18 +01:00
# If "ON", then custom icons theme(s) will be bundled with application
# installation. If "OFF", then no icon theme(s) will be available for
# the application and application will run in iconless mode.
# Default and recommended value is "ON".
#
# -DENABLE_OS2_RC=OFF
# If "ON" then icon is compiled into executable file on OS/2. Defaults to "OFF".
#
# Refreshing translation sources:
# make lupdate
#
# Generating source tarballs:
# make dist or make package_source
#
# Generating binary tarballs:
# make package
#
2013-11-27 18:21:40 +01:00
# Other information:
2013-12-07 20:33:41 +01:00
# - supports Windows, Linux, OS/2 (eComStation),
2013-11-27 18:21:40 +01:00
# - Qt 4.7.3 and higher is required,
2013-11-28 21:36:37 +01:00
# - resource compiler (windres.exe) is needed on MinGW,
# - resource compiler (rc.exe) is recommended on OS/2.
2013-11-27 18:21:40 +01:00
#
2013-11-29 21:19:45 +01:00
# Authors and contributors:
# - Martin Rotter (project leader),
2013-11-29 21:19:45 +01:00
# - Elbert Pol (huge OS/2-related contributions)
#
2013-11-24 18:35:12 +01:00
#################################################################
# Setup basic variables.
project(rssguard)
2014-02-12 07:13:11 +01:00
set(APP_NAME "RSS Guard")
set(APP_LOW_NAME "rssguard")
2014-09-29 07:42:14 +02:00
set(APP_VERSION "2.0.0.3")
set(FILE_VERSION "2,0,0,3")
set(APP_AUTHOR "Martin Rotter")
2014-02-15 20:24:37 +01:00
set(APP_URL "http://bitbucket.org/skunkos/rssguard")
set(APP_URL_ISSUES "http://bitbucket.org/skunkos/rssguard/issues")
2014-09-11 08:19:01 +02:00
set(APP_URL_ISSUES_NEW_GITHUB "https://github.com/martinrotter/rssguard/issues/new")
set(APP_URL_ISSUES_NEW_BITBUCKET "http://bitbucket.org/skunkos/rssguard/issues/new")
2014-09-17 16:10:24 +02:00
set(APP_URL_WIKI "https://bitbucket.org/skunkos/rssguard/wiki/Home")
2013-12-13 16:35:52 +01:00
set(APP_EMAIL "rotter.martinos@gmail.com")
2013-11-27 18:21:40 +01:00
set(MINIMUM_QT_VERSION 4.7.3)
2013-12-07 20:33:41 +01:00
set(EXE_NAME ${APP_LOW_NAME})
2014-02-12 07:13:11 +01:00
if(APPLE)
2014-02-15 20:24:37 +01:00
set(APP_URL_BACKWARDS "org.bitbucket.rssguard")
2014-02-12 07:13:11 +01:00
endif(APPLE)
2013-12-09 15:09:14 +01:00
# Options declaration.
2013-12-08 14:02:28 +01:00
option(USE_QT_5 "Use Qt 5 for building" OFF)
option(ENABLE_OS2_RC "Compile application icon on OS/2" OFF)
option(BUNDLE_ICON_THEMES "Equip installation with custom icon themes" ON)
2013-11-09 08:48:13 +01:00
if(WIN32)
option(USE_NSIS "Use NSIS generator to produce installer" OFF)
endif(WIN32)
# Set appropriate CMake policies.
2014-01-19 13:25:16 +01:00
if(POLICY CMP0012)
cmake_policy(SET CMP0012 NEW)
endif()
2014-01-17 19:40:54 +01:00
if(${USE_QT_5})
cmake_minimum_required(VERSION 2.8.10)
else(${USE_QT_5})
cmake_minimum_required(VERSION 2.8.0)
endif(${USE_QT_5})
if(APPLE AND NOT USE_QT_5)
message(FATAL_ERROR "[${APP_LOW_NAME}] Only Qt 5.x.x is supported on Mac OS X.")
endif(APPLE AND NOT USE_QT_5)
message(STATUS "")
message(STATUS "[${APP_LOW_NAME}] ==== Options summary ====")
message(STATUS "[${APP_LOW_NAME}] Use Qt 5 for building -> ${USE_QT_5}")
message(STATUS "[${APP_LOW_NAME}] Equip installation with custom icon themes -> ${BUNDLE_ICON_THEMES}")
message(STATUS "[${APP_LOW_NAME}] Compile application icon on OS/2 -> ${ENABLE_OS2_RC}")
if(WIN32)
message(STATUS "[${APP_LOW_NAME}] Use NSIS generator to produce installer -> ${USE_NSIS}")
endif(WIN32)
message(STATUS "[${APP_LOW_NAME}] ==== Options summary ====")
message(STATUS "")
2013-06-16 17:35:31 +02:00
message(STATUS "[${APP_LOW_NAME}] Welcome to ${APP_NAME} compilation process.")
2013-06-09 22:24:10 +02:00
message(STATUS "[${APP_LOW_NAME}] Compilation process begins right now.")
2013-11-28 21:36:37 +01:00
# Setup misc options.
2013-11-27 18:21:40 +01:00
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/resources/nsis
${CMAKE_MODULE_PATH})
2013-11-28 21:36:37 +01:00
set(CMAKE_INCLUDE_CURRENT_DIR ON)
2013-11-27 18:21:40 +01:00
2014-01-02 21:50:37 +01:00
# Eliminate a warning when building in Windows that relates
# to static linking of Qt executables to qtmain.lib.
# This policy was introduced in CMake version 2.8.11.
# CMake version 2.8.11.2 warns when the policy is not set
# and uses OLD behavior.
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif()
# Select which Qt version to use.
if(${USE_QT_5})
message(STATUS "[${APP_LOW_NAME}] Using Qt 5 library for building.")
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
else(${USE_QT_5})
message(STATUS "[${APP_LOW_NAME}] Using Qt 4 library for building.")
endif(${USE_QT_5})
2013-11-24 18:35:12 +01:00
# Obtain revision number if available.
message(STATUS "[${APP_LOW_NAME}] Obtaining revision number.")
if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
find_package(Git)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2013-06-06 18:26:05 +02:00
OUTPUT_VARIABLE GIT_REVISION
)
2013-06-06 18:26:05 +02:00
string(REGEX REPLACE "\n" "" GIT_REVISION "${GIT_REVISION}")
set(APP_REVISION ${GIT_REVISION})
else(GIT_FOUND)
# Git was not found, we cannot determine current revision.
set(APP_REVISION "-")
endif(GIT_FOUND)
else(EXISTS "${PROJECT_SOURCE_DIR}/.git")
# Not information for Git are available, this is stripped
# build environment
set(APP_REVISION "-")
endif(EXISTS "${PROJECT_SOURCE_DIR}/.git")
message(STATUS "[${APP_LOW_NAME}] Revision number obtained: ${APP_REVISION}.")
2013-06-03 22:20:23 +02:00
# Configure desktop entry for Linux.
if(UNIX)
2013-11-28 21:36:37 +01:00
message(STATUS "[${APP_LOW_NAME}] Generating desktop entry for Linux.")
configure_file (
${PROJECT_SOURCE_DIR}/resources/desktop/rssguard.desktop.in
${CMAKE_BINARY_DIR}/resources/desktop/rssguard.desktop
)
set(DESKTOP_ENTRY_PATH ${CMAKE_INSTALL_PREFIX}/share/applications)
endif(UNIX)
# Configure internal C++ defines.
configure_file (
2014-03-27 08:40:23 +01:00
${PROJECT_SOURCE_DIR}/src/definitions/definitions.h.in
${CMAKE_BINARY_DIR}/src/definitions/definitions.h
)
# Define some useful DEBUG for, ehrm, debug build.
2014-08-21 17:58:12 +02:00
if(CMAKE_BUILD_TYPE STREQUAL "release" OR CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RELEASE")
2013-06-09 22:24:10 +02:00
message(STATUS "[${APP_LOW_NAME}] A release build (non-debug) is chosen. Debugging outputs are silently ignored.")
set(CMAKE_BUILD_TYPE MinSizeRel)
2013-06-16 17:35:31 +02:00
message(STATUS "[${APP_LOW_NAME}] Output executable file is optimized for minimum size.")
2014-08-21 17:58:12 +02:00
else(CMAKE_BUILD_TYPE STREQUAL "release" OR CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RELEASE")
2013-11-28 21:36:37 +01:00
message(STATUS "[${APP_LOW_NAME}] A debug build is chosen.")
add_definitions(-DDEBUG)
set(CMAKE_BUILD_TYPE Debug)
# Enable compiler warnings.
# See http://stackoverflow.com/questions/2368811/how-to-set-warning-level-in-cmake
2013-06-09 22:24:10 +02:00
message(STATUS "[${APP_LOW_NAME}] Enabling verbose makefile and full warning reports.")
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-pedantic -Wall -Wextra)
endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
2013-12-18 20:00:58 +01:00
# Verbose compiling outputs.
set(CMAKE_VERBOSE_MAKEFILE ON)
2014-08-21 17:58:12 +02:00
endif(CMAKE_BUILD_TYPE STREQUAL "release" OR CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RELEASE")
# Force Qt to use string builders.
add_definitions(-DQT_USE_QSTRINGBUILDER)
# Force Unicode.
add_definitions(-DUNICODE -D_UNICODE)
if(${USE_QT_5})
# Check for C++ 11 features availability.
# See http://stackoverflow.com/questions/10984442/how-to-detect-c11-support-of-a-compiler-with-cmake
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION
)
if(NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7))
message(FATAL_ERROR "[${APP_LOW_NAME}] Your C++ compiler does not support C++ 11.")
else(NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7))
add_definitions(-std=c++11)
endif(NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7))
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_definitions(-std=c++11 -stdlib=libc++)
elseif(${MSVC_VERSION} VERSION_LESS 1600)
message(FATAL_ERROR "[${APP_LOW_NAME}] Your C++ compiler does not support C++ 11.")
endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
endif(${USE_QT_5})
# Setup librar ies.
if(${USE_QT_5})
2013-11-28 21:36:37 +01:00
find_package(Qt5 REQUIRED Sql WebKit WebKitWidgets Widgets Xml XmlPatterns Network LinguistTools)
else(${USE_QT_5})
2013-11-27 18:21:40 +01:00
set(QT_MIN_VERSION ${MINIMUM_QT_VERSION})
2013-09-06 20:26:12 +02:00
find_package(Qt4 REQUIRED QtCore QtGui QtSql QtNetwork QtWebkit QtXml QtXmlPatterns)
include(${QT_USE_FILE})
endif(${USE_QT_5})
2014-01-04 09:54:52 +01:00
# Configure QStringBuilder behavior.
if(${USE_QT_5})
message(STATUS "[${APP_LOW_NAME}] Enabling fast QString concatenation.")
add_definitions(-DQT_USE_FAST_CONCATENATION)
add_definitions(-DQT_USE_FAST_OPERATOR_PLUS)
elseif(NOT ${QTVERSION} VERSION_LESS 4.8.0)
message(STATUS "[${APP_LOW_NAME}] Enabling fast QString concatenation.")
add_definitions(-DQT_USE_FAST_CONCATENATION)
add_definitions(-DQT_USE_FAST_OPERATOR_PLUS)
else(NOT ${QTVERSION} VERSION_LESS 4.8.0)
message(STATUS "[${APP_LOW_NAME}] Disabling fast QString concatenation.")
endif(${USE_QT_5})
2013-11-27 19:47:44 +01:00
# Configure executable "properties" for Windows or OS2.
2013-11-27 19:38:49 +01:00
if(WIN32)
message(STATUS "[${APP_LOW_NAME}] Generating executable file properties for Windows.")
configure_file (
${PROJECT_SOURCE_DIR}/resources/executable_properties/rssguard_win.rc.in
${CMAKE_BINARY_DIR}/resources/executable_properties/rssguard_win.rc
2013-11-27 19:38:49 +01:00
)
elseif(OS2 AND ${ENABLE_OS2_RC})
2013-11-28 19:37:00 +01:00
message(STATUS "[${APP_LOW_NAME}] Generating executable file properties for OS2.")
configure_file (
${PROJECT_SOURCE_DIR}/resources/executable_properties/rssguard_os2.rc.in
${CMAKE_BINARY_DIR}/resources/executable_properties/rssguard_os2.rc
2013-11-28 19:37:00 +01:00
)
2013-11-27 19:38:49 +01:00
endif(WIN32)
2013-11-27 19:47:44 +01:00
# Compile application icon if compiling with MinGW on WIN32 or with OS2.
if(MINGW AND WIN32)
2013-11-28 20:46:17 +01:00
enable_language(RC)
set(CMAKE_RC_COMPILER_INIT windres)
message(STATUS "[${APP_LOW_NAME}] Icon file binary will be builded for Windows.")
message(STATUS "[${APP_LOW_NAME}] Used tool is: ${CMAKE_RC_COMPILER}")
set(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> -i <SOURCE> -o <OBJECT>")
2013-11-28 19:37:00 +01:00
2013-11-28 20:46:17 +01:00
set(APP_SOURCES
${APP_SOURCES}
${CMAKE_BINARY_DIR}/resources/executable_properties/rssguard_win.rc)
2013-11-28 20:46:17 +01:00
elseif(OS2)
2013-11-28 19:40:56 +01:00
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Zstack 0x2000 -Zlinker \"DISABLE 1121\" -s -Zlinker /PM:PM -Zno-fork -Zhigh-mem -Zmap")
2013-11-28 19:37:00 +01:00
if(${ENABLE_OS2_RC})
enable_language(RC)
set(CMAKE_RC_COMPILER_INIT rc)
message(STATUS "[${APP_LOW_NAME}] Icon file binary will be builded for OS2.")
message(STATUS "[${APP_LOW_NAME}] Used tool is: ${CMAKE_RC_COMPILER}")
set(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> -n -r <SOURCE> <OBJECT>")
set(APP_SOURCES
${APP_SOURCES}
${CMAKE_BINARY_DIR}/resources/executable_properties/rssguard_os2.rc)
endif(${ENABLE_OS2_RC})
2013-11-27 19:38:49 +01:00
elseif(WIN32 AND MSVC)
2013-11-28 20:46:17 +01:00
# MSVC takes care of this automatically - no need to use windres.exe
# for MSVC compilers.
set(APP_SOURCES ${APP_SOURCES} ${CMAKE_BINARY_DIR}/resources/executable_properties/rssguard_win.rc)
endif(MINGW AND WIN32)
2014-04-10 13:06:35 +02:00
# APP source files.
set(APP_SOURCES
${APP_SOURCES}
2013-06-07 23:12:33 +02:00
2014-03-26 20:20:13 +01:00
# QTSINGLEAPPLICATION sources.
2013-06-07 23:12:33 +02:00
src/qtsingleapplication/qtlocalpeer.cpp
2014-04-10 13:06:35 +02:00
src/qtsingleapplication/qtsinglecoreapplication.cpp
2013-06-07 23:12:33 +02:00
src/qtsingleapplication/qtsingleapplication.cpp
2013-06-09 22:24:10 +02:00
# GUI sources.
src/gui/formmain.cpp
src/gui/systemtrayicon.cpp
src/gui/formsettings.cpp
2013-06-26 21:51:37 +02:00
src/gui/formabout.cpp
src/gui/baselineedit.cpp
src/gui/locationlineedit.cpp
2013-07-30 18:54:36 +02:00
src/gui/tabwidget.cpp
src/gui/tabbar.cpp
src/gui/tabcontent.cpp
2013-10-05 07:43:10 +02:00
src/gui/feedmessageviewer.cpp
2013-10-13 16:12:15 +02:00
src/gui/feedsview.cpp
src/gui/messagesview.cpp
2013-10-20 18:09:15 +02:00
src/gui/statusbar.cpp
src/gui/formcategorydetails.cpp
src/gui/formfeeddetails.cpp
2014-01-19 21:35:13 +01:00
src/gui/plaintoolbutton.cpp
src/gui/lineeditwithstatus.cpp
2014-02-10 17:53:24 +01:00
src/gui/widgetwithstatus.cpp
2014-02-11 17:23:40 +01:00
src/gui/labelwithstatus.cpp
2014-01-20 13:59:08 +01:00
src/gui/messagebox.cpp
2014-02-19 17:41:14 +01:00
src/gui/formupdate.cpp
2014-02-19 20:46:54 +01:00
src/gui/comboboxwithstatus.cpp
2014-04-01 08:54:12 +02:00
src/gui/basetoolbar.cpp
2014-04-01 08:12:54 +02:00
src/gui/messagestoolbar.cpp
2014-04-07 08:21:55 +02:00
src/gui/feedstoolbar.cpp
2014-04-02 08:13:38 +02:00
src/gui/toolbareditor.cpp
2014-04-09 14:16:16 +02:00
src/gui/messagessearchlineedit.cpp
src/gui/formimportexport.cpp
src/gui/styleditemdelegatewithoutfocus.cpp
2014-10-09 16:49:19 +02:00
src/gui/formbackupdatabasesettings.cpp
2014-10-13 19:53:54 +02:00
src/gui/formrestoredatabasesettings.cpp
2014-03-26 20:20:13 +01:00
# DYNAMIC-SHORTCUTS sources.
src/dynamic-shortcuts/shortcutcatcher.cpp
src/dynamic-shortcuts/shortcutbutton.cpp
src/dynamic-shortcuts/dynamicshortcutswidget.cpp
src/dynamic-shortcuts/dynamicshortcuts.cpp
2014-03-27 08:40:23 +01:00
# MISCELLANEOUS sources.
2014-08-22 09:27:01 +02:00
src/miscellaneous/application.cpp
2014-03-27 08:40:23 +01:00
src/miscellaneous/debugging.cpp
src/miscellaneous/settings.cpp
src/miscellaneous/systemfactory.cpp
src/miscellaneous/localization.cpp
src/miscellaneous/textfactory.cpp
src/miscellaneous/databasefactory.cpp
src/miscellaneous/skinfactory.cpp
src/miscellaneous/iconfactory.cpp
src/miscellaneous/iofactory.cpp
2014-03-27 08:40:23 +01:00
# CORE sources.
2013-11-09 19:04:00 +01:00
src/core/messagesmodel.cpp
src/core/messagesproxymodel.cpp
2013-11-12 20:24:19 +01:00
src/core/feedsmodel.cpp
src/core/feedsproxymodel.cpp
2013-12-11 18:54:09 +01:00
src/core/feedsmodelcategory.cpp
2013-12-11 14:07:18 +01:00
src/core/feedsmodelrootitem.cpp
src/core/feedsmodelfeed.cpp
2013-12-14 18:54:35 +01:00
src/core/parsingfactory.cpp
src/core/feeddownloader.cpp
src/core/feedsimportexportmodel.cpp
2014-09-13 16:11:53 +02:00
src/core/feedsmodelrecyclebin.cpp
2013-06-09 22:24:10 +02:00
2014-03-26 12:23:27 +01:00
# NETWORK-WEB sources.
src/network-web/basenetworkaccessmanager.cpp
src/network-web/webpage.cpp
src/network-web/webbrowsernetworkaccessmanager.cpp
src/network-web/silentnetworkaccessmanager.cpp
src/network-web/networkfactory.cpp
src/network-web/webfactory.cpp
2014-03-26 13:30:18 +01:00
src/network-web/webbrowser.cpp
src/network-web/webview.cpp
2014-04-11 12:21:00 +02:00
src/network-web/downloader.cpp
2014-03-26 12:23:27 +01:00
# MAIN sources.
src/main.cpp
)
2014-04-10 13:06:35 +02:00
# APP headers.
set(APP_HEADERS
${APP_HEADERS}
2013-06-07 23:12:33 +02:00
2014-03-26 20:20:13 +01:00
# QTSINGLEAPPLICATION headers.
2013-06-07 23:12:33 +02:00
src/qtsingleapplication/qtlocalpeer.h
2014-04-10 13:06:35 +02:00
src/qtsingleapplication/qtsinglecoreapplication.h
2013-06-07 23:12:33 +02:00
src/qtsingleapplication/qtsingleapplication.h
2013-06-09 22:24:10 +02:00
# GUI headers.
src/gui/formmain.h
src/gui/systemtrayicon.h
src/gui/formsettings.h
2013-06-26 21:51:37 +02:00
src/gui/formabout.h
src/gui/baselineedit.h
src/gui/locationlineedit.h
2013-07-30 18:54:36 +02:00
src/gui/tabwidget.h
src/gui/tabbar.h
src/gui/tabcontent.h
2013-10-05 07:43:10 +02:00
src/gui/feedmessageviewer.h
2013-10-13 16:12:15 +02:00
src/gui/feedsview.h
src/gui/messagesview.h
2013-10-20 18:09:15 +02:00
src/gui/statusbar.h
src/gui/formcategorydetails.h
src/gui/formfeeddetails.h
2014-01-19 21:35:13 +01:00
src/gui/plaintoolbutton.h
src/gui/lineeditwithstatus.h
2014-02-10 17:53:24 +01:00
src/gui/widgetwithstatus.h
2014-02-11 17:23:40 +01:00
src/gui/labelwithstatus.h
2014-01-23 07:17:27 +01:00
src/gui/messagebox.h
2014-02-19 17:41:14 +01:00
src/gui/formupdate.h
2014-02-19 20:46:54 +01:00
src/gui/comboboxwithstatus.h
2014-04-01 08:54:12 +02:00
src/gui/basetoolbar.h
2014-04-01 08:12:54 +02:00
src/gui/messagestoolbar.h
2014-04-07 08:21:55 +02:00
src/gui/feedstoolbar.h
2014-04-02 08:13:38 +02:00
src/gui/toolbareditor.h
2014-04-09 14:16:16 +02:00
src/gui/messagessearchlineedit.h
src/gui/formimportexport.h
2014-10-09 16:49:19 +02:00
src/gui/formbackupdatabasesettings.h
2014-10-13 19:53:54 +02:00
src/gui/formrestoredatabasesettings.h
2014-03-26 20:20:13 +01:00
# DYNAMIC-SHORTCUTS headers.
src/dynamic-shortcuts/dynamicshortcutswidget.h
src/dynamic-shortcuts/shortcutcatcher.h
src/dynamic-shortcuts/shortcutbutton.h
2014-03-27 08:40:23 +01:00
# MISCELLANEOUS headers.
2014-08-22 09:27:01 +02:00
src/miscellaneous/application.h
2014-03-27 08:40:23 +01:00
src/miscellaneous/settings.h
src/miscellaneous/localization.h
src/miscellaneous/systemfactory.h
src/miscellaneous/databasefactory.h
2014-03-28 09:04:36 +01:00
src/miscellaneous/iconfactory.h
2014-03-27 08:40:23 +01:00
src/miscellaneous/skinfactory.h
# CORE headers.
2013-11-09 19:04:00 +01:00
src/core/messagesmodel.h
src/core/messagesproxymodel.h
2013-11-12 20:24:19 +01:00
src/core/feedsmodel.h
src/core/feedsproxymodel.h
src/core/feeddownloader.h
src/core/feedsimportexportmodel.h
#src/core/feedsmodelrecyclebin.h
2014-03-26 12:23:27 +01:00
# NETWORK-WEB headers.
2014-03-26 20:20:13 +01:00
src/network-web/webpage.h
2014-03-26 12:23:27 +01:00
src/network-web/basenetworkaccessmanager.h
src/network-web/webbrowsernetworkaccessmanager.h
src/network-web/silentnetworkaccessmanager.h
src/network-web/webfactory.h
2014-03-26 13:30:18 +01:00
src/network-web/webbrowser.h
src/network-web/webview.h
2014-04-11 12:21:00 +02:00
src/network-web/downloader.h
)
2014-04-10 13:06:35 +02:00
# APP form files.
set(APP_FORMS
2014-02-19 17:41:14 +01:00
src/gui/formupdate.ui
2013-06-09 22:24:10 +02:00
src/gui/formmain.ui
src/gui/formsettings.ui
2013-06-26 21:51:37 +02:00
src/gui/formabout.ui
src/gui/formcategorydetails.ui
src/gui/formfeeddetails.ui
2014-04-02 08:13:38 +02:00
src/gui/toolbareditor.ui
src/gui/formimportexport.ui
2014-10-09 16:49:19 +02:00
src/gui/formbackupdatabasesettings.ui
2014-10-13 19:53:54 +02:00
src/gui/formrestoredatabasesettings.ui
)
2014-04-10 13:06:35 +02:00
# APP translations.
set(APP_TRANSLATIONS
2014-02-17 17:43:37 +01:00
localization/rssguard-cs_CZ.ts
2014-02-26 21:41:13 +01:00
localization/rssguard-de_DE.ts
2014-02-27 21:22:13 +01:00
localization/rssguard-en_GB.ts
2014-10-20 18:38:24 +02:00
localization/rssguard-en_US.ts
2014-02-27 21:22:13 +01:00
localization/rssguard-fr_FR.ts
2014-08-19 17:21:32 +02:00
localization/rssguard-it_IT.ts
2014-02-17 17:43:37 +01:00
localization/rssguard-nl_NL.ts
localization/rssguard-sv_SE.ts
2014-02-17 17:43:37 +01:00
localization/qt-cs_CZ.ts
2014-02-28 07:24:32 +01:00
localization/qt-de_DE.ts
localization/qt-fr_FR.ts
2014-02-17 17:43:37 +01:00
localization/qt-nl_NL.ts
)
set(APP_TRANSLATIONS_WO_QT
2014-02-17 17:43:37 +01:00
localization/rssguard-cs_CZ.ts
2014-02-26 21:41:13 +01:00
localization/rssguard-de_DE.ts
2014-02-27 21:22:13 +01:00
localization/rssguard-en_GB.ts
2014-10-20 18:38:24 +02:00
localization/rssguard-en_US.ts
2014-02-27 21:22:13 +01:00
localization/rssguard-fr_FR.ts
2014-08-19 17:21:32 +02:00
localization/rssguard-it_IT.ts
2014-02-17 17:43:37 +01:00
localization/rssguard-nl_NL.ts
localization/rssguard-sv_SE.ts
)
2013-10-20 11:51:09 +02:00
set(APP_TEXT
2013-06-26 21:51:37 +02:00
resources/text/CHANGELOG
resources/text/COPYING_GNU_GPL
resources/text/COPYING_GNU_GPL_HTML
resources/text/COPYING_BSD
)
if(WIN32)
set(APP_DLLS_QT4_MSVC2010
resources/binaries/windows/deployment/qt4-msvc2010/libeay32.dll
resources/binaries/windows/deployment/qt4-msvc2010/msvcp100.dll
resources/binaries/windows/deployment/qt4-msvc2010/msvcr100.dll
resources/binaries/windows/deployment/qt4-msvc2010/QtCore4.dll
resources/binaries/windows/deployment/qt4-msvc2010/QtGui4.dll
resources/binaries/windows/deployment/qt4-msvc2010/QtNetwork4.dll
resources/binaries/windows/deployment/qt4-msvc2010/QtSql4.dll
resources/binaries/windows/deployment/qt4-msvc2010/QtWebKit4.dll
resources/binaries/windows/deployment/qt4-msvc2010/QtXml4.dll
resources/binaries/windows/deployment/qt4-msvc2010/ssleay32.dll
2014-08-21 17:58:12 +02:00
resources/binaries/windows/deployment/qt4-msvc2010/libmysql.dll
)
set(APP_DLLS_QT4_MSVC2010_IMAGEFORMATS
resources/binaries/windows/deployment/qt4-msvc2010/imageformats/qgif4.dll
resources/binaries/windows/deployment/qt4-msvc2010/imageformats/qico4.dll
resources/binaries/windows/deployment/qt4-msvc2010/imageformats/qjpeg4.dll
resources/binaries/windows/deployment/qt4-msvc2010/imageformats/qmng4.dll
resources/binaries/windows/deployment/qt4-msvc2010/imageformats/qsvg4.dll
resources/binaries/windows/deployment/qt4-msvc2010/imageformats/qtga4.dll
resources/binaries/windows/deployment/qt4-msvc2010/imageformats/qtiff4.dll
)
2014-08-21 17:58:12 +02:00
set(APP_DLLS_QT4_MSVC2010_SQLDRIVERS
resources/binaries/windows/deployment/qt4-msvc2010/sqldrivers/qsqlite4.dll
resources/binaries/windows/deployment/qt4-msvc2010/sqldrivers/qsqlmysql4.dll
)
endif(WIN32)
2014-02-12 07:13:11 +01:00
# Add custom icon on Mac OS X.
if(APPLE)
SET (APP_SOURCES ${APP_SOURCES} resources/macosx/rssguard.icns)
2014-02-12 07:13:11 +01:00
endif(APPLE)
# Wrap files, create moc files.
if(${USE_QT_5})
qt5_wrap_ui(APP_UI ${APP_FORMS})
# Load translations.
if(Qt5LinguistTools_FOUND)
2014-01-06 08:54:20 +01:00
message(STATUS "[${APP_LOW_NAME}] Qt Linguist Tools found. Translations will get compiled.")
qt5_add_translation(APP_QM ${APP_TRANSLATIONS})
else(Qt5LinguistTools_FOUND)
2014-01-06 08:54:20 +01:00
message(STATUS "[${APP_LOW_NAME}] Qt Linguist Tools NOT found. No compilation for translations.")
endif(Qt5LinguistTools_FOUND)
else(${USE_QT_5})
qt4_wrap_cpp(APP_MOC ${APP_HEADERS})
qt4_wrap_ui(APP_UI ${APP_FORMS})
# Load translations.
qt4_add_translation(APP_QM ${APP_TRANSLATIONS})
2014-04-11 08:36:46 +02:00
# Setup Qt for "rssguard_updater".
if(WIN32 OR OS2)
qt4_wrap_cpp(UPDATER_MOC ${UPDATER_HEADERS})
endif(WIN32 OR OS2)
endif(${USE_QT_5})
# Include additional directory paths.
include_directories (
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/network-web
${CMAKE_SOURCE_DIR}/src/dynamic-shortcuts
${CMAKE_BINARY_DIR}/src
)
2014-04-11 08:36:46 +02:00
# Compile "rssguard"
if(${USE_QT_5})
2014-02-11 21:43:55 +01:00
add_executable(${EXE_NAME} WIN32 MACOSX_BUNDLE
2014-03-01 19:02:03 +01:00
${APP_SOURCES}
${APP_FORMS}
${APP_RCC}
${APP_QM}
)
2014-02-12 07:13:11 +01:00
2014-02-11 21:43:55 +01:00
if(WIN32)
target_link_libraries(${EXE_NAME} Qt5::WinMain)
endif(WIN32)
# Use modules from Qt.
qt5_use_modules(${EXE_NAME}
Core
Widgets
Sql
Network
Xml
WebKit
WebKitWidgets
)
# Setup compilation for Qt 4.
else(${USE_QT_5})
2014-02-11 21:43:55 +01:00
add_executable(${EXE_NAME} WIN32 MACOSX_BUNDLE
${APP_SOURCES}
${APP_FORMS}
${APP_MOC}
${APP_RCC}
${APP_QM}
)
# Link modules from Qt.
2014-04-11 08:36:46 +02:00
target_link_libraries(${EXE_NAME}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTSQL_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_QTMAIN_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
)
endif(${USE_QT_5})
# Installation stage.
2013-11-24 14:53:03 +01:00
if(WIN32 OR OS2)
message(STATUS "[${APP_LOW_NAME}] You will probably install on Windows or OS/2.")
2013-06-16 17:35:31 +02:00
install(TARGETS ${EXE_NAME}
RUNTIME DESTINATION ./)
2014-04-11 22:42:49 +02:00
install(TARGETS ${UPDATER_EXE_NAME}
RUNTIME DESTINATION ./${UPDATER_SUBFOLDER})
# Copy DLLs and other binary files for main installation and updater.
if(WIN32 AND NOT ${USE_QT_5})
install(FILES ${APP_DLLS_QT4_MSVC2010}
DESTINATION ./)
install(FILES ${APP_DLLS_QT4_MSVC2010_IMAGEFORMATS}
DESTINATION ./imageformats)
install(FILES ${APP_DLLS_QT4_MSVC2010_SQLDRIVERS}
DESTINATION ./sqldrivers)
install(FILES ${APP_DLLS_QT4_MSVC2010}
DESTINATION ./${UPDATER_SUBFOLDER})
endif(WIN32 AND NOT ${USE_QT_5})
2014-04-11 22:42:49 +02:00
if(BUNDLE_ICON_THEMES)
install(DIRECTORY resources/graphics/icons/mini-kfaenza
DESTINATION ./icons)
endif(BUNDLE_ICON_THEMES)
2013-09-30 16:47:10 +02:00
install(DIRECTORY resources/skins/base
DESTINATION ./skins)
2013-10-20 11:51:09 +02:00
install(DIRECTORY resources/misc
DESTINATION ./)
install(FILES resources/graphics/${APP_LOW_NAME}_128.png
DESTINATION ./
RENAME ${APP_LOW_NAME}.png)
install(FILES resources/graphics/${APP_LOW_NAME}_plain_128.png
DESTINATION ./
RENAME ${APP_LOW_NAME}_plain.png)
2013-12-03 18:38:43 +01:00
install(FILES resources/graphics/${APP_LOW_NAME}.ico
DESTINATION ./)
2013-06-16 17:35:31 +02:00
install(FILES ${APP_QM}
DESTINATION ./l10n)
2013-10-20 11:51:09 +02:00
install(FILES ${APP_TEXT}
2013-06-16 17:35:31 +02:00
DESTINATION ./)
2014-02-11 21:43:55 +01:00
elseif(APPLE)
2014-02-12 07:13:11 +01:00
message(STATUS "[${APP_LOW_NAME}] You will probably install on Mac OS X.")
2014-02-11 21:43:55 +01:00
set_target_properties(${EXE_NAME}
PROPERTIES
MACOSX_BUNDLE_INFO_PLIST
"${CMAKE_SOURCE_DIR}/resources/macosx/Info.plist.in")
set_source_files_properties(${CMAKE_SOURCE_DIR}/resources/macosx/${APP_LOW_NAME}.icns
2014-02-11 21:43:55 +01:00
PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(MACOSX_BUNDLE_ICON_FILE ${APP_LOW_NAME}.icns)
set(MACOSX_BUNDLE_INFO_STRING "${EXE_NAME} ${APP_VERSION}")
set(MACOSX_BUNDLE_GUI_IDENTIFIER "${APP_URL_BACKWARDS}")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${APP_VERSION}")
set(MACOSX_BUNDLE_BUNDLE_NAME "${EXE_NAME}")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${APP_VERSION}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${APP_VERSION}")
set(MACOSX_BUNDLE_COPYRIGHT "(c) ${APP_AUTHOR}")
2014-02-11 21:43:55 +01:00
install(TARGETS ${EXE_NAME} BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX})
# Setup custom "bundle" prefix.
set(APPLE_PREFIX ${CMAKE_INSTALL_PREFIX}/${EXE_NAME}.app/Contents/Resources)
2014-02-12 07:13:11 +01:00
2014-02-11 21:43:55 +01:00
if(BUNDLE_ICON_THEMES)
install(DIRECTORY resources/graphics/icons/mini-kfaenza
DESTINATION ${APPLE_PREFIX}/icons)
2014-02-11 21:43:55 +01:00
endif(BUNDLE_ICON_THEMES)
install(DIRECTORY resources/skins
DESTINATION ${APPLE_PREFIX})
2014-02-11 21:43:55 +01:00
install(DIRECTORY resources/misc
DESTINATION ${APPLE_PREFIX})
2014-02-11 21:43:55 +01:00
install(FILES resources/graphics/${APP_LOW_NAME}_128.png
DESTINATION ${APPLE_PREFIX}
2014-02-11 21:43:55 +01:00
RENAME ${APP_LOW_NAME}.png)
install(FILES resources/graphics/${APP_LOW_NAME}_plain_128.png
DESTINATION ${APPLE_PREFIX}
2014-02-11 21:43:55 +01:00
RENAME ${APP_LOW_NAME}_plain.png)
install(FILES ${APP_QM}
DESTINATION ${APPLE_PREFIX}/l10n)
2014-02-11 21:43:55 +01:00
install(FILES ${APP_TEXT}
DESTINATION ${APPLE_PREFIX}/information)
elseif(UNIX)
2013-06-09 22:24:10 +02:00
message(STATUS "[${APP_LOW_NAME}] You will probably install on Linux.")
2013-06-16 17:35:31 +02:00
install(TARGETS ${EXE_NAME}
RUNTIME DESTINATION bin)
if(BUNDLE_ICON_THEMES)
install(DIRECTORY resources/graphics/icons/mini-kfaenza
DESTINATION share/${APP_LOW_NAME}/icons)
endif(BUNDLE_ICON_THEMES)
2013-09-30 16:47:10 +02:00
install(DIRECTORY resources/skins/base
DESTINATION share/${APP_LOW_NAME}/skins)
2013-10-20 11:51:09 +02:00
install(DIRECTORY resources/misc
DESTINATION share/${APP_LOW_NAME})
install(FILES ${CMAKE_BINARY_DIR}/resources/desktop/${APP_LOW_NAME}.desktop
2013-06-16 17:35:31 +02:00
DESTINATION share/applications)
install(FILES resources/graphics/${APP_LOW_NAME}_128.png
2013-12-29 11:55:18 +01:00
DESTINATION share/pixmaps
RENAME ${APP_LOW_NAME}.png)
install(FILES resources/graphics/${APP_LOW_NAME}_plain_128.png
2013-12-29 11:55:18 +01:00
DESTINATION share/rssguard/icons
RENAME ${APP_LOW_NAME}_plain.png)
2013-06-16 17:35:31 +02:00
install(FILES ${APP_QM}
DESTINATION share/${APP_LOW_NAME}/l10n)
2013-10-20 11:51:09 +02:00
install(FILES ${APP_TEXT}
2013-06-16 17:35:31 +02:00
DESTINATION share/${APP_LOW_NAME}/information)
2013-11-24 14:53:03 +01:00
endif(WIN32 OR OS2)
# Custom target for packaging.
if(WIN32)
if(USE_NSIS)
set(CPACK_GENERATOR "NSIS")
else(USE_NSIS)
set(CPACK_GENERATOR "ZIP")
endif(USE_NSIS)
else(WIN32)
set(CPACK_GENERATOR "ZIP")
endif(WIN32)
set(CPACK_PACKAGE_NAME ${APP_LOW_NAME})
set(CPACK_PACKAGE_VERSION ${APP_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_VENDOR ${APP_AUTHOR})
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${APP_NAME})
2013-11-26 21:41:39 +01:00
set(CPACK_IGNORE_FILES "/resources/aur/;\\\\.psd$;/resources/deployment;/CVS/;/\\\\.svn/;/\\\\.git/;\\\\.swp$;/CMakeLists.txt.user;\\\\.#;/#;\\\\.tar.gz$;/CMakeFiles/;CMakeCache.txt;\\\\.qm$;/build/;\\\\.diff$;.DS_Store'")
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES ${CPACK_IGNORE_FILES})
set(CPACK_NSIS_INSTALLED_ICON_NAME "${APP_LOW_NAME}.ico")
set(CPACK_NSIS_HELP_LINK ${APP_URL})
set(CPACK_NSIS_URL_INFO_ABOUT ${APP_URL})
set(CPACK_NSIS_CONTACT ${APP_EMAIL})
# Load packaging facilities.
include(CPack)
# Configure file with custom definitions for NSIS.
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/resources/nsis/NSIS.definitions.nsh.in
${CMAKE_CURRENT_BINARY_DIR}/resources/nsis/NSIS.definitions.nsh
)
# make dist implementation.
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
2013-11-27 19:08:58 +01:00
# make lupdate implementation.
if(${USE_QT_5})
add_custom_target(lupdate
${Qt5Core_QMAKE_EXECUTABLE} -project -o ${CMAKE_BINARY_DIR}/${APP_LOW_NAME}.pro
COMMAND ${Qt5_LUPDATE_EXECUTABLE} -no-obsolete -ts ${APP_TRANSLATIONS_WO_QT} -pro ${CMAKE_BINARY_DIR}/${APP_LOW_NAME}.pro
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
else(${USE_QT_5})
add_custom_target(lupdate
${QT_QMAKE_EXECUTABLE} -project -o ${CMAKE_BINARY_DIR}/${APP_LOW_NAME}.pro
COMMAND ${QT_LUPDATE_EXECUTABLE} -no-obsolete -ts ${APP_TRANSLATIONS_WO_QT} -pro ${CMAKE_BINARY_DIR}/${APP_LOW_NAME}.pro
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endif(${USE_QT_5})