2019-06-24 22:01:18 +08:00
|
|
|
# Copyright © 2019 by The qTox Project Contributors
|
|
|
|
#
|
|
|
|
# This file is part of qTox, a Qt-based graphical interface for Tox.
|
|
|
|
# qTox is libre 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.
|
|
|
|
#
|
|
|
|
# qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
|
2016-08-10 03:29:49 +08:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# :: CMake configuration
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2021-10-26 04:45:59 +08:00
|
|
|
cmake_minimum_required(VERSION 3.7.2)
|
2016-08-10 03:29:49 +08:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
|
|
|
|
2017-07-09 02:11:31 +08:00
|
|
|
option(PLATFORM_EXTENSIONS "Enable platform specific extensions, requires extra dependencies" ON)
|
2019-01-08 13:46:30 +08:00
|
|
|
option(UPDATE_CHECK "Enable automatic update check" ON)
|
2018-03-03 13:25:53 +08:00
|
|
|
option(USE_CCACHE "Use ccache when available" ON)
|
2017-11-16 04:41:08 +08:00
|
|
|
option(SPELL_CHECK "Enable spell cheching support" ON)
|
2019-02-09 19:02:56 +08:00
|
|
|
option(SVGZ_ICON "Compress the SVG icon of qTox" ON)
|
2018-08-25 06:48:53 +08:00
|
|
|
option(ASAN "Compile with AddressSanitizer" OFF)
|
2021-03-19 07:02:32 +08:00
|
|
|
option(TSAN "Compile with ThreadSanitizer" OFF)
|
2018-07-12 02:55:16 +08:00
|
|
|
option(DESKTOP_NOTIFICATIONS "Use snorenotify for desktop notifications" OFF)
|
2022-03-11 10:08:50 +08:00
|
|
|
option(STRICT_OPTIONS "Error on compile warning, used by CI" OFF)
|
2017-07-09 02:11:31 +08:00
|
|
|
|
2018-10-04 16:50:41 +08:00
|
|
|
# process generated files if cmake >= 3.10
|
|
|
|
if(POLICY CMP0071)
|
|
|
|
cmake_policy(SET CMP0071 NEW)
|
|
|
|
endif()
|
|
|
|
|
2016-08-10 03:29:49 +08:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
2018-08-23 10:56:13 +08:00
|
|
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE)
|
2016-08-10 03:29:49 +08:00
|
|
|
endif()
|
|
|
|
|
2018-08-25 06:48:53 +08:00
|
|
|
if(ASAN)
|
|
|
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
|
|
|
|
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
|
|
|
|
endif()
|
|
|
|
|
2021-03-19 07:02:32 +08:00
|
|
|
if(TSAN)
|
|
|
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=thread")
|
|
|
|
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=thread")
|
|
|
|
endif()
|
|
|
|
|
2016-08-10 03:29:49 +08:00
|
|
|
set(ENV{PKG_CONFIG_PATH}
|
|
|
|
${CMAKE_SOURCE_DIR}/libs/lib/pkgconfig:/opt/ffmpeg/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
|
|
|
|
|
2017-05-16 04:42:15 +08:00
|
|
|
# necessary to find openal-soft on mac os
|
|
|
|
if(APPLE)
|
|
|
|
set(ENV{PKG_CONFIG_PATH}
|
|
|
|
/usr/local/opt/openal-soft/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
|
|
|
|
endif()
|
|
|
|
|
2016-08-10 03:29:49 +08:00
|
|
|
execute_process(
|
2022-02-09 08:37:47 +08:00
|
|
|
COMMAND brew --prefix qt@5
|
2016-08-10 03:29:49 +08:00
|
|
|
OUTPUT_VARIABLE QT_PREFIX_PATH
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
2016-11-23 05:33:00 +08:00
|
|
|
|
2016-08-10 03:29:49 +08:00
|
|
|
project(qtox)
|
|
|
|
|
|
|
|
# Instruct CMake to run moc automatically when needed.
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
2020-05-20 16:33:55 +08:00
|
|
|
# Run resource compilation automatically
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
# Enable maximum compression
|
|
|
|
set(AUTORCC_OPTIONS -compress 9 -threshold 0)
|
2016-08-10 03:29:49 +08:00
|
|
|
|
2020-05-20 16:33:55 +08:00
|
|
|
|
|
|
|
if(NOT Qt5Widgets_VERSION VERSION_LESS "5.9")
|
|
|
|
# Drop the file modification time of source files from generated files
|
|
|
|
# to help with reproducible builds. We do not use QFileInfo.lastModified
|
|
|
|
# so this has no unwanted side effects. This mtime started appearing in
|
|
|
|
# Qt 5.8. The option to force the old file format without mtime was
|
|
|
|
# added in Qt 5.9. See https://bugreports.qt.io/browse/QTBUG-58769
|
|
|
|
set(AUTORCC_OPTIONS ${AUTORCC_OPTIONS} -format-version 1)
|
|
|
|
endif()
|
2017-06-19 17:22:26 +08:00
|
|
|
|
2016-08-10 03:29:49 +08:00
|
|
|
# Use C++11.
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
|
|
|
|
|
2017-01-31 14:40:11 +08:00
|
|
|
# Hardening flags (ASLR, warnings, etc)
|
2017-10-04 02:49:28 +08:00
|
|
|
set(POSITION_INDEPENDENT_CODE True)
|
2021-10-15 13:26:40 +08:00
|
|
|
|
2020-12-14 00:44:38 +08:00
|
|
|
if (NOT WIN32 AND NOT HAIKU)
|
2017-01-31 14:40:11 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,now")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro")
|
|
|
|
endif()
|
|
|
|
|
2018-11-18 14:01:07 +08:00
|
|
|
include(CheckAtomic)
|
|
|
|
|
2017-01-08 21:36:31 +08:00
|
|
|
# Use ccache when available to speed up builds.
|
2018-03-03 13:25:53 +08:00
|
|
|
if (USE_CCACHE)
|
|
|
|
find_program(CCACHE_FOUND ccache)
|
|
|
|
if(CCACHE_FOUND)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
|
|
|
message(STATUS "using ccache")
|
|
|
|
else()
|
|
|
|
message(STATUS "ccache not found")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(STATUS "ccache disabled; set option USE_CCACHE=ON to use ccache if available")
|
2017-01-08 21:36:31 +08:00
|
|
|
endif()
|
|
|
|
|
2016-08-10 03:29:49 +08:00
|
|
|
# Search for headers in current directory.
|
|
|
|
include_directories(${CMAKE_BINARY_DIR})
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR})
|
|
|
|
|
|
|
|
include(Dependencies)
|
|
|
|
|
2019-01-25 05:10:39 +08:00
|
|
|
|
2016-08-10 03:29:49 +08:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# :: qTox main library sources
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
qt5_wrap_ui(${PROJECT_NAME}_FORMS
|
|
|
|
src/chatlog/content/filetransferwidget.ui
|
|
|
|
src/loginscreen.ui
|
|
|
|
src/mainwindow.ui
|
2017-08-30 05:46:19 +08:00
|
|
|
src/widget/about/aboutfriendform.ui
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/form/loadhistorydialog.ui
|
|
|
|
src/widget/form/profileform.ui
|
|
|
|
src/widget/form/removefrienddialog.ui
|
2018-06-16 18:41:31 +08:00
|
|
|
src/widget/form/searchsettingsform.ui
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/form/setpassworddialog.ui
|
|
|
|
src/widget/form/settings/aboutsettings.ui
|
|
|
|
src/widget/form/settings/advancedsettings.ui
|
|
|
|
src/widget/form/settings/avform.ui
|
|
|
|
src/widget/form/settings/generalsettings.ui
|
|
|
|
src/widget/form/settings/privacysettings.ui
|
|
|
|
src/widget/form/settings/userinterfacesettings.ui)
|
|
|
|
|
2020-05-20 16:33:55 +08:00
|
|
|
set(${PROJECT_NAME}_RESOURCES
|
|
|
|
res.qrc
|
2016-11-23 05:33:00 +08:00
|
|
|
)
|
|
|
|
|
2017-01-07 05:45:40 +08:00
|
|
|
if(NOT SMILEYS)
|
|
|
|
set(SMILEYS "")
|
2016-11-23 05:33:00 +08:00
|
|
|
endif()
|
|
|
|
|
2022-02-24 05:04:02 +08:00
|
|
|
set(SMILEY_RESOURCES "")
|
2017-01-07 05:45:40 +08:00
|
|
|
if(NOT "${SMILEYS}" STREQUAL "DISABLED")
|
2022-02-24 05:04:02 +08:00
|
|
|
set(SMILEY_RESOURCES smileys/emojione.qrc)
|
2017-01-07 05:45:40 +08:00
|
|
|
|
|
|
|
if(NOT "${SMILEYS}" STREQUAL "MIN")
|
2022-02-24 05:04:02 +08:00
|
|
|
set(SMILEY_RESOURCES
|
|
|
|
${SMILEY_RESOURCES}
|
2020-05-20 16:33:55 +08:00
|
|
|
smileys/smileys.qrc)
|
2016-11-23 05:33:00 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
2016-08-10 03:29:49 +08:00
|
|
|
|
|
|
|
set(${PROJECT_NAME}_SOURCES
|
|
|
|
src/chatlog/chatlinecontent.cpp
|
|
|
|
src/chatlog/chatlinecontent.h
|
|
|
|
src/chatlog/chatlinecontentproxy.cpp
|
|
|
|
src/chatlog/chatlinecontentproxy.h
|
|
|
|
src/chatlog/chatline.cpp
|
|
|
|
src/chatlog/chatline.h
|
2021-02-26 12:41:35 +08:00
|
|
|
src/chatlog/chatlinestorage.cpp
|
|
|
|
src/chatlog/chatlinestorage.h
|
2021-02-28 14:28:29 +08:00
|
|
|
src/chatlog/chatwidget.cpp
|
|
|
|
src/chatlog/chatwidget.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/chatlog/chatmessage.cpp
|
|
|
|
src/chatlog/chatmessage.h
|
|
|
|
src/chatlog/content/filetransferwidget.cpp
|
|
|
|
src/chatlog/content/filetransferwidget.h
|
|
|
|
src/chatlog/content/image.cpp
|
|
|
|
src/chatlog/content/image.h
|
|
|
|
src/chatlog/content/notificationicon.cpp
|
|
|
|
src/chatlog/content/notificationicon.h
|
|
|
|
src/chatlog/content/spinner.cpp
|
|
|
|
src/chatlog/content/spinner.h
|
|
|
|
src/chatlog/content/text.cpp
|
|
|
|
src/chatlog/content/text.h
|
|
|
|
src/chatlog/content/timestamp.cpp
|
|
|
|
src/chatlog/content/timestamp.h
|
2019-10-08 11:43:10 +08:00
|
|
|
src/chatlog/content/broken.cpp
|
|
|
|
src/chatlog/content/broken.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/chatlog/customtextdocument.cpp
|
|
|
|
src/chatlog/customtextdocument.h
|
|
|
|
src/chatlog/documentcache.cpp
|
|
|
|
src/chatlog/documentcache.h
|
|
|
|
src/chatlog/pixmapcache.cpp
|
|
|
|
src/chatlog/pixmapcache.h
|
2021-09-27 05:59:32 +08:00
|
|
|
src/core/toxfileprogress.cpp
|
|
|
|
src/core/toxfileprogress.h
|
2017-02-06 23:20:45 +08:00
|
|
|
src/chatlog/textformatter.cpp
|
|
|
|
src/chatlog/textformatter.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/core/coreav.cpp
|
|
|
|
src/core/coreav.h
|
2019-11-13 12:12:05 +08:00
|
|
|
src/core/coreext.cpp
|
|
|
|
src/core/coreext.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/core/core.cpp
|
|
|
|
src/core/corefile.cpp
|
|
|
|
src/core/corefile.h
|
|
|
|
src/core/core.h
|
2017-09-28 04:19:59 +08:00
|
|
|
src/core/dhtserver.cpp
|
|
|
|
src/core/dhtserver.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/core/icoreextpacket.cpp
|
|
|
|
src/core/icoreextpacket.h
|
|
|
|
src/core/icoresettings.cpp
|
2017-09-28 04:28:54 +08:00
|
|
|
src/core/icoresettings.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/core/icorefriendmessagesender.cpp
|
|
|
|
src/core/icorefriendmessagesender.h
|
|
|
|
src/core/icoregroupmessagesender.cpp
|
|
|
|
src/core/icoregroupmessagesender.h
|
|
|
|
src/core/icoregroupquery.cpp
|
|
|
|
src/core/icoregroupquery.h
|
|
|
|
src/core/icoreidhandler.cpp
|
|
|
|
src/core/icoreidhandler.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/core/toxcall.cpp
|
|
|
|
src/core/toxcall.h
|
2017-01-09 02:48:36 +08:00
|
|
|
src/core/toxencrypt.cpp
|
|
|
|
src/core/toxencrypt.h
|
2017-10-27 20:02:43 +08:00
|
|
|
src/core/toxfile.cpp
|
|
|
|
src/core/toxfile.h
|
2018-10-04 14:45:01 +08:00
|
|
|
src/core/toxfilepause.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/core/toxid.cpp
|
|
|
|
src/core/toxid.h
|
2019-04-12 04:38:37 +08:00
|
|
|
src/core/groupid.cpp
|
|
|
|
src/core/groupid.h
|
2018-06-25 14:32:53 +08:00
|
|
|
src/core/toxlogger.cpp
|
|
|
|
src/core/toxlogger.h
|
2018-06-26 14:48:52 +08:00
|
|
|
src/core/toxoptions.cpp
|
|
|
|
src/core/toxoptions.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/core/toxpk.cpp
|
|
|
|
src/core/toxpk.h
|
2022-03-07 20:18:16 +08:00
|
|
|
src/core/chatid.cpp
|
|
|
|
src/core/chatid.h
|
2017-03-06 04:25:25 +08:00
|
|
|
src/core/toxstring.cpp
|
|
|
|
src/core/toxstring.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/friendlist.cpp
|
|
|
|
src/friendlist.h
|
|
|
|
src/grouplist.cpp
|
|
|
|
src/grouplist.h
|
|
|
|
src/ipc.cpp
|
|
|
|
src/ipc.h
|
2017-08-30 14:39:54 +08:00
|
|
|
src/model/about/aboutfriend.cpp
|
|
|
|
src/model/about/aboutfriend.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/model/about/iaboutfriend.cpp
|
2017-08-30 14:39:54 +08:00
|
|
|
src/model/about/iaboutfriend.h
|
2021-04-29 00:09:28 +08:00
|
|
|
src/model/chathistory.cpp
|
|
|
|
src/model/chathistory.h
|
|
|
|
src/model/chatlogitem.cpp
|
|
|
|
src/model/chatlogitem.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/model/chatroom/chatroom.cpp
|
2018-07-17 20:29:36 +08:00
|
|
|
src/model/chatroom/chatroom.h
|
2018-02-10 00:45:31 +08:00
|
|
|
src/model/chatroom/friendchatroom.cpp
|
|
|
|
src/model/chatroom/friendchatroom.h
|
2018-07-17 20:29:36 +08:00
|
|
|
src/model/chatroom/groupchatroom.cpp
|
|
|
|
src/model/chatroom/groupchatroom.h
|
2022-03-07 20:18:16 +08:00
|
|
|
src/model/chat.cpp
|
|
|
|
src/model/chat.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/model/dialogs/idialogs.cpp
|
2021-04-29 00:09:28 +08:00
|
|
|
src/model/dialogs/idialogs.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/model/dialogs/idialogsmanager.h
|
|
|
|
src/model/dialogs/idialogsmanager.cpp
|
2020-05-17 04:20:02 +08:00
|
|
|
src/model/exiftransform.cpp
|
2021-04-29 00:09:28 +08:00
|
|
|
src/model/exiftransform.h
|
2021-06-14 01:11:19 +08:00
|
|
|
src/model/friendlist/friendlistmanager.cpp
|
|
|
|
src/model/friendlist/friendlistmanager.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/model/friendlist/ifriendlistitem.cpp
|
2021-06-14 01:11:19 +08:00
|
|
|
src/model/friendlist/ifriendlistitem.h
|
2021-04-29 00:09:28 +08:00
|
|
|
src/model/friendmessagedispatcher.cpp
|
|
|
|
src/model/friendmessagedispatcher.h
|
2017-07-30 01:39:14 +08:00
|
|
|
src/model/friend.cpp
|
|
|
|
src/model/friend.h
|
2017-09-29 03:37:20 +08:00
|
|
|
src/model/groupinvite.cpp
|
|
|
|
src/model/groupinvite.h
|
2021-04-29 00:09:28 +08:00
|
|
|
src/model/groupmessagedispatcher.cpp
|
|
|
|
src/model/groupmessagedispatcher.h
|
2017-07-30 01:39:14 +08:00
|
|
|
src/model/group.cpp
|
|
|
|
src/model/group.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/model/ibootstraplistgenerator.cpp
|
2021-04-29 00:09:28 +08:00
|
|
|
src/model/ibootstraplistgenerator.h
|
|
|
|
src/model/ichatlog.h
|
|
|
|
src/model/imessagedispatcher.h
|
|
|
|
src/model/message.cpp
|
|
|
|
src/model/message.h
|
|
|
|
src/model/notificationgenerator.cpp
|
|
|
|
src/model/notificationgenerator.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/model/profile/iprofileinfo.cpp
|
2017-10-07 19:42:32 +08:00
|
|
|
src/model/profile/iprofileinfo.h
|
|
|
|
src/model/profile/profileinfo.cpp
|
|
|
|
src/model/profile/profileinfo.h
|
2019-06-18 09:05:14 +08:00
|
|
|
src/model/sessionchatlog.cpp
|
2021-04-29 00:09:28 +08:00
|
|
|
src/model/sessionchatlog.h
|
|
|
|
src/model/status.cpp
|
|
|
|
src/model/status.h
|
2020-04-08 07:55:13 +08:00
|
|
|
src/model/toxclientstandards.h
|
2018-11-05 02:30:49 +08:00
|
|
|
src/net/bootstrapnodeupdater.cpp
|
|
|
|
src/net/bootstrapnodeupdater.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/net/avatarbroadcaster.cpp
|
|
|
|
src/net/avatarbroadcaster.h
|
|
|
|
src/net/toxuri.cpp
|
|
|
|
src/net/toxuri.h
|
|
|
|
src/nexus.cpp
|
|
|
|
src/nexus.h
|
|
|
|
src/persistence/db/rawdatabase.cpp
|
|
|
|
src/persistence/db/rawdatabase.h
|
|
|
|
src/persistence/history.cpp
|
|
|
|
src/persistence/history.h
|
2022-03-09 20:15:26 +08:00
|
|
|
src/persistence/dbupgrader.cpp
|
|
|
|
src/persistence/dbupgrader.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/persistence/ifriendsettings.cpp
|
2017-08-30 17:04:43 +08:00
|
|
|
src/persistence/ifriendsettings.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/persistence/igroupsettings.cpp
|
|
|
|
src/persistence/igroupsettings.h
|
|
|
|
src/persistence/inotificationsettings.cpp
|
|
|
|
src/persistence/inotificationsettings.h
|
2022-03-15 16:31:50 +08:00
|
|
|
src/persistence/ismileysettings.cpp
|
|
|
|
src/persistence/ismileysettings.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/persistence/offlinemsgengine.cpp
|
|
|
|
src/persistence/offlinemsgengine.h
|
2018-11-09 04:47:44 +08:00
|
|
|
src/persistence/paths.cpp
|
|
|
|
src/persistence/paths.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/persistence/profile.cpp
|
|
|
|
src/persistence/profile.h
|
|
|
|
src/persistence/profilelocker.cpp
|
|
|
|
src/persistence/profilelocker.h
|
|
|
|
src/persistence/serialize.cpp
|
|
|
|
src/persistence/serialize.h
|
|
|
|
src/persistence/settings.cpp
|
|
|
|
src/persistence/settings.h
|
|
|
|
src/persistence/settingsserializer.cpp
|
|
|
|
src/persistence/settingsserializer.h
|
2022-03-04 04:36:09 +08:00
|
|
|
src/persistence/globalsettingsupgrader.cpp
|
|
|
|
src/persistence/globalsettingsupgrader.h
|
|
|
|
src/persistence/personalsettingsupgrader.cpp
|
|
|
|
src/persistence/personalsettingsupgrader.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/persistence/smileypack.cpp
|
|
|
|
src/persistence/smileypack.h
|
|
|
|
src/persistence/toxsave.cpp
|
|
|
|
src/persistence/toxsave.h
|
|
|
|
src/video/cameradevice.cpp
|
|
|
|
src/video/cameradevice.h
|
|
|
|
src/video/camerasource.cpp
|
|
|
|
src/video/camerasource.h
|
|
|
|
src/video/corevideosource.cpp
|
|
|
|
src/video/corevideosource.h
|
2021-10-15 13:26:40 +08:00
|
|
|
src/video/ivideosettings.cpp
|
2017-10-23 00:39:11 +08:00
|
|
|
src/video/ivideosettings.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/video/netcamview.cpp
|
|
|
|
src/video/netcamview.h
|
|
|
|
src/video/videoframe.cpp
|
|
|
|
src/video/videoframe.h
|
|
|
|
src/video/videomode.cpp
|
|
|
|
src/video/videomode.h
|
|
|
|
src/video/videosource.cpp
|
|
|
|
src/video/videosource.h
|
|
|
|
src/video/videosurface.cpp
|
|
|
|
src/video/videosurface.h
|
2017-08-30 05:46:19 +08:00
|
|
|
src/widget/about/aboutfriendform.cpp
|
|
|
|
src/widget/about/aboutfriendform.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/categorywidget.cpp
|
|
|
|
src/widget/categorywidget.h
|
2017-10-26 13:59:06 +08:00
|
|
|
src/widget/chatformheader.cpp
|
|
|
|
src/widget/chatformheader.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/circlewidget.cpp
|
|
|
|
src/widget/circlewidget.h
|
|
|
|
src/widget/contentdialog.cpp
|
|
|
|
src/widget/contentdialog.h
|
2018-12-25 02:36:36 +08:00
|
|
|
src/widget/contentdialogmanager.cpp
|
|
|
|
src/widget/contentdialogmanager.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/contentlayout.cpp
|
|
|
|
src/widget/contentlayout.h
|
|
|
|
src/widget/emoticonswidget.cpp
|
|
|
|
src/widget/emoticonswidget.h
|
2019-11-15 11:08:40 +08:00
|
|
|
src/widget/extensionstatus.cpp
|
|
|
|
src/widget/extensionstatus.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/flowlayout.cpp
|
|
|
|
src/widget/flowlayout.h
|
2020-05-17 04:22:36 +08:00
|
|
|
src/widget/imagepreviewwidget.h
|
|
|
|
src/widget/imagepreviewwidget.cpp
|
2018-02-04 22:17:55 +08:00
|
|
|
src/widget/searchform.cpp
|
|
|
|
src/widget/searchform.h
|
2018-06-25 02:11:20 +08:00
|
|
|
src/widget/searchtypes.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/form/addfriendform.cpp
|
|
|
|
src/widget/form/addfriendform.h
|
|
|
|
src/widget/form/chatform.cpp
|
|
|
|
src/widget/form/chatform.h
|
|
|
|
src/widget/form/filesform.cpp
|
|
|
|
src/widget/form/filesform.h
|
|
|
|
src/widget/form/genericchatform.cpp
|
|
|
|
src/widget/form/genericchatform.h
|
|
|
|
src/widget/form/groupchatform.cpp
|
|
|
|
src/widget/form/groupchatform.h
|
|
|
|
src/widget/form/groupinviteform.cpp
|
|
|
|
src/widget/form/groupinviteform.h
|
2017-02-22 20:54:02 +08:00
|
|
|
src/widget/form/groupinvitewidget.cpp
|
|
|
|
src/widget/form/groupinvitewidget.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/form/loadhistorydialog.cpp
|
|
|
|
src/widget/form/loadhistorydialog.h
|
|
|
|
src/widget/form/profileform.cpp
|
|
|
|
src/widget/form/profileform.h
|
2018-06-16 18:41:31 +08:00
|
|
|
src/widget/form/searchsettingsform.cpp
|
|
|
|
src/widget/form/searchsettingsform.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/form/setpassworddialog.cpp
|
|
|
|
src/widget/form/setpassworddialog.h
|
|
|
|
src/widget/form/settings/aboutform.cpp
|
|
|
|
src/widget/form/settings/aboutform.h
|
|
|
|
src/widget/form/settings/advancedform.cpp
|
|
|
|
src/widget/form/settings/advancedform.h
|
|
|
|
src/widget/form/settings/avform.cpp
|
|
|
|
src/widget/form/settings/avform.h
|
|
|
|
src/widget/form/settings/generalform.cpp
|
|
|
|
src/widget/form/settings/generalform.h
|
|
|
|
src/widget/form/settings/genericsettings.cpp
|
|
|
|
src/widget/form/settings/genericsettings.h
|
|
|
|
src/widget/form/settings/privacyform.cpp
|
|
|
|
src/widget/form/settings/privacyform.h
|
|
|
|
src/widget/form/settings/userinterfaceform.h
|
|
|
|
src/widget/form/settings/userinterfaceform.cpp
|
|
|
|
src/widget/form/settings/verticalonlyscroller.cpp
|
|
|
|
src/widget/form/settings/verticalonlyscroller.h
|
|
|
|
src/widget/form/settingswidget.cpp
|
|
|
|
src/widget/form/settingswidget.h
|
|
|
|
src/widget/form/tabcompleter.cpp
|
|
|
|
src/widget/form/tabcompleter.h
|
|
|
|
src/widget/friendlistlayout.cpp
|
|
|
|
src/widget/friendlistlayout.h
|
|
|
|
src/widget/friendlistwidget.cpp
|
|
|
|
src/widget/friendlistwidget.h
|
|
|
|
src/widget/friendwidget.cpp
|
|
|
|
src/widget/friendwidget.h
|
|
|
|
src/widget/genericchatitemlayout.cpp
|
|
|
|
src/widget/genericchatitemlayout.h
|
|
|
|
src/widget/genericchatitemwidget.cpp
|
|
|
|
src/widget/genericchatitemwidget.h
|
|
|
|
src/widget/genericchatroomwidget.cpp
|
|
|
|
src/widget/genericchatroomwidget.h
|
|
|
|
src/widget/groupwidget.cpp
|
|
|
|
src/widget/groupwidget.h
|
|
|
|
src/widget/loginscreen.cpp
|
|
|
|
src/widget/loginscreen.h
|
|
|
|
src/widget/maskablepixmapwidget.cpp
|
|
|
|
src/widget/maskablepixmapwidget.h
|
|
|
|
src/widget/notificationedgewidget.cpp
|
|
|
|
src/widget/notificationedgewidget.h
|
|
|
|
src/widget/notificationscrollarea.cpp
|
|
|
|
src/widget/notificationscrollarea.h
|
|
|
|
src/widget/passwordedit.cpp
|
|
|
|
src/widget/passwordedit.h
|
|
|
|
src/widget/qrwidget.cpp
|
|
|
|
src/widget/qrwidget.h
|
2017-02-26 06:06:07 +08:00
|
|
|
src/widget/splitterrestorer.cpp
|
|
|
|
src/widget/splitterrestorer.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/style.cpp
|
|
|
|
src/widget/style.h
|
|
|
|
src/widget/tool/activatedialog.cpp
|
|
|
|
src/widget/tool/activatedialog.h
|
|
|
|
src/widget/tool/adjustingscrollarea.cpp
|
|
|
|
src/widget/tool/adjustingscrollarea.h
|
2022-03-13 21:04:24 +08:00
|
|
|
src/widget/tool/imessageboxmanager.h
|
|
|
|
src/widget/tool/imessageboxmanager.cpp
|
|
|
|
src/widget/tool/messageboxmanager.cpp
|
|
|
|
src/widget/tool/messageboxmanager.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/tool/callconfirmwidget.cpp
|
|
|
|
src/widget/tool/callconfirmwidget.h
|
|
|
|
src/widget/tool/chattextedit.cpp
|
|
|
|
src/widget/tool/chattextedit.h
|
|
|
|
src/widget/tool/croppinglabel.cpp
|
|
|
|
src/widget/tool/croppinglabel.h
|
|
|
|
src/widget/tool/flyoutoverlaywidget.cpp
|
|
|
|
src/widget/tool/flyoutoverlaywidget.h
|
2017-09-29 06:02:13 +08:00
|
|
|
src/widget/tool/identicon.cpp
|
|
|
|
src/widget/tool/identicon.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/tool/movablewidget.cpp
|
|
|
|
src/widget/tool/movablewidget.h
|
|
|
|
src/widget/tool/profileimporter.cpp
|
|
|
|
src/widget/tool/profileimporter.h
|
2018-11-10 09:43:37 +08:00
|
|
|
src/widget/tool/recursivesignalblocker.cpp
|
|
|
|
src/widget/tool/recursivesignalblocker.h
|
2016-08-10 03:29:49 +08:00
|
|
|
src/widget/tool/removefrienddialog.cpp
|
|
|
|
src/widget/tool/removefrienddialog.h
|
|
|
|
src/widget/tool/screengrabberchooserrectitem.cpp
|
|
|
|
src/widget/tool/screengrabberchooserrectitem.h
|
|
|
|
src/widget/tool/screengrabberoverlayitem.cpp
|
|
|
|
src/widget/tool/screengrabberoverlayitem.h
|
|
|
|
src/widget/tool/screenshotgrabber.cpp
|
|
|
|
src/widget/tool/screenshotgrabber.h
|
|
|
|
src/widget/tool/toolboxgraphicsitem.cpp
|
|
|
|
src/widget/tool/toolboxgraphicsitem.h
|
|
|
|
src/widget/translator.cpp
|
|
|
|
src/widget/translator.h
|
|
|
|
src/widget/widget.cpp
|
2016-12-04 06:44:03 +08:00
|
|
|
src/widget/widget.h
|
|
|
|
)
|
|
|
|
|
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
|
|
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
|
|
|
src/platform/camera/directshow.cpp
|
|
|
|
src/platform/camera/directshow.h
|
|
|
|
)
|
2020-05-20 16:33:55 +08:00
|
|
|
|
2017-07-03 03:32:48 +08:00
|
|
|
set(${PROJECT_NAME}_RESOURCES ${${PROJECT_NAME}_RESOURCES}
|
|
|
|
windows/qtox.rc
|
|
|
|
)
|
2017-06-21 11:21:34 +08:00
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
2016-12-04 06:44:03 +08:00
|
|
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
|
|
|
src/platform/camera/v4l2.cpp
|
|
|
|
src/platform/camera/v4l2.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2017-08-19 20:35:54 +08:00
|
|
|
if (UNIX)
|
|
|
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
|
|
|
src/platform/posixsignalnotifier.cpp
|
|
|
|
src/platform/posixsignalnotifier.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2017-07-09 02:11:31 +08:00
|
|
|
if (PLATFORM_EXTENSIONS)
|
|
|
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
|
|
|
src/platform/autorun.h
|
|
|
|
src/platform/capslock.h
|
|
|
|
src/platform/timer.h
|
|
|
|
)
|
2018-12-03 15:59:31 +08:00
|
|
|
if (WIN32)
|
|
|
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
|
|
|
src/platform/autorun_win.cpp
|
|
|
|
src/platform/capslock_win.cpp
|
|
|
|
src/platform/timer_win.cpp
|
|
|
|
)
|
|
|
|
elseif (${X11_EXT})
|
|
|
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
|
|
|
src/platform/autorun_xdg.cpp
|
|
|
|
src/platform/capslock_x11.cpp
|
|
|
|
src/platform/timer_x11.cpp
|
|
|
|
src/platform/x11_display.cpp
|
|
|
|
)
|
|
|
|
elseif (${APPLE_EXT})
|
|
|
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
|
|
|
src/platform/autorun_osx.cpp
|
|
|
|
src/platform/capslock_osx.cpp
|
|
|
|
src/platform/timer_osx.cpp
|
|
|
|
)
|
|
|
|
endif()
|
2017-07-09 02:11:31 +08:00
|
|
|
endif()
|
|
|
|
|
2016-12-04 06:44:03 +08:00
|
|
|
add_definitions(-DQT_MESSAGELOGCONTEXT=1)
|
2016-08-10 03:29:49 +08:00
|
|
|
|
|
|
|
if(AVFOUNDATION_FOUND)
|
|
|
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
|
|
|
src/platform/camera/avfoundation.mm
|
|
|
|
src/platform/camera/avfoundation.h)
|
|
|
|
endif()
|
|
|
|
|
2019-01-08 13:46:30 +08:00
|
|
|
if(${UPDATE_CHECK})
|
|
|
|
add_definitions(-DUPDATE_CHECK_ENABLED=1)
|
|
|
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
|
|
|
src/net/updatecheck.cpp
|
|
|
|
src/net/updatecheck.h)
|
|
|
|
message(STATUS "using update check")
|
|
|
|
else()
|
|
|
|
message(STATUS "NOT using update check")
|
|
|
|
endif()
|
|
|
|
|
2018-07-12 02:55:16 +08:00
|
|
|
if (${DESKTOP_NOTIFICATIONS})
|
|
|
|
add_definitions(-DDESKTOP_NOTIFICATIONS=1)
|
|
|
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
|
|
|
src/platform/desktop_notifications/desktopnotify.cpp
|
|
|
|
src/platform/desktop_notifications/desktopnotify.h)
|
|
|
|
message(STATUS "using desktop notifications")
|
|
|
|
else()
|
|
|
|
add_definitions(-DDESKTOP_NOTIFICATIONS=0)
|
|
|
|
message(STATUS "not using desktop notifications")
|
|
|
|
endif()
|
|
|
|
|
2017-10-24 15:10:03 +08:00
|
|
|
if (MINGW)
|
|
|
|
STRING(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
|
|
|
|
if (CMAKE_BUILD_TYPE_LOWER MATCHES debug)
|
|
|
|
# Allows wine to display source code file names and line numbers on crash in its backtrace
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-2")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2017-07-03 05:08:22 +08:00
|
|
|
# the compiler flags for compiling C sources
|
2017-06-10 19:12:57 +08:00
|
|
|
MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
|
|
|
|
|
2017-07-03 05:08:22 +08:00
|
|
|
# the compiler flags for compiling C++ sources
|
2017-06-10 19:12:57 +08:00
|
|
|
MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
|
|
|
|
|
2021-03-01 06:19:24 +08:00
|
|
|
# Interface library to propagate code coverage flags if enabled
|
|
|
|
add_library(coverage_config INTERFACE)
|
|
|
|
option(CODE_COVERAGE "Enable coverage reporting" OFF)
|
|
|
|
if (CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
|
|
target_compile_options(coverage_config INTERFACE -O0 -g --coverage)
|
|
|
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
|
|
|
|
target_link_options(coverage_config INTERFACE --coverage)
|
|
|
|
else()
|
|
|
|
target_link_libraries(coverage_config INTERFACE --coverage)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
link_libraries(coverage_config)
|
|
|
|
|
2020-04-30 02:06:41 +08:00
|
|
|
add_subdirectory(util)
|
|
|
|
add_subdirectory(audio)
|
2020-05-21 06:28:16 +08:00
|
|
|
add_subdirectory(translations)
|
2022-03-11 09:54:23 +08:00
|
|
|
add_subdirectory(cmake/warnings)
|
2020-04-30 02:06:41 +08:00
|
|
|
|
2016-08-10 03:29:49 +08:00
|
|
|
add_library(${PROJECT_NAME}_static
|
|
|
|
STATIC
|
|
|
|
${${PROJECT_NAME}_FORMS}
|
2020-05-21 06:28:16 +08:00
|
|
|
${${PROJECT_NAME}_SOURCES})
|
2019-07-27 18:37:49 +08:00
|
|
|
target_link_libraries(${PROJECT_NAME}_static
|
|
|
|
${CMAKE_REQUIRED_LIBRARIES}
|
2021-03-01 06:19:24 +08:00
|
|
|
${ALL_LIBRARIES}
|
|
|
|
coverage_config)
|
2016-08-10 03:29:49 +08:00
|
|
|
|
2020-04-30 02:06:41 +08:00
|
|
|
target_link_libraries(${PROJECT_NAME}_static util_library)
|
|
|
|
target_link_libraries(${PROJECT_NAME}_static audio_library)
|
2020-05-21 06:28:16 +08:00
|
|
|
target_link_libraries(${PROJECT_NAME}_static translations_library)
|
2022-03-11 09:54:23 +08:00
|
|
|
target_link_libraries(${PROJECT_NAME}_static qtox::warnings)
|
2020-04-30 02:06:41 +08:00
|
|
|
|
2016-08-10 03:29:49 +08:00
|
|
|
add_executable(${PROJECT_NAME}
|
|
|
|
WIN32
|
|
|
|
MACOSX_BUNDLE
|
|
|
|
${${PROJECT_NAME}_RESOURCES}
|
2022-02-24 05:04:02 +08:00
|
|
|
${SMILEY_RESOURCES}
|
2016-08-10 03:29:49 +08:00
|
|
|
src/main.cpp)
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
|
|
|
${PROJECT_NAME}_static
|
2019-03-27 11:12:52 +08:00
|
|
|
${CMAKE_REQUIRED_LIBRARIES}
|
2016-08-10 03:29:49 +08:00
|
|
|
${ALL_LIBRARIES})
|
|
|
|
|
2017-05-08 19:25:57 +08:00
|
|
|
include(Testing)
|
2017-01-29 16:56:05 +08:00
|
|
|
include(Installation)
|
2019-12-16 14:50:07 +08:00
|
|
|
|
|
|
|
if (DEFINED ENV{IN_NIX_SHELL})
|
|
|
|
# the qtox binary must be "wrapped" to find the Qt platform plugin
|
|
|
|
# and other dependencies at runtime
|
|
|
|
add_custom_command(
|
|
|
|
TARGET ${PROJECT_NAME}
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND nix-shell --run "wrapQtApp ${PROJECT_NAME}")
|
|
|
|
endif()
|