2017-04-06 02:06:42 +03:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
|
|
|
|
2017-10-01 22:38:46 +03:00
|
|
|
option(APPVEYOR_BUILD "Build on appveyor" OFF)
|
2018-05-04 18:11:03 +03:00
|
|
|
option(ASAN "Compile with address sanitizers" OFF)
|
2017-05-02 04:22:33 +03:00
|
|
|
|
2017-11-06 18:17:21 +03:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
|
|
|
|
2018-09-01 13:35:10 +03:00
|
|
|
add_definitions(-DBOOST_MPL_LIMIT_LIST_SIZE=30)
|
|
|
|
add_definitions(-DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS)
|
|
|
|
|
2018-01-09 21:34:01 +03:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2017-11-06 18:17:21 +03:00
|
|
|
# Include Qt basic functions
|
|
|
|
include(QtCommon)
|
|
|
|
|
2018-03-22 17:20:22 +03:00
|
|
|
project(nheko LANGUAGES C CXX)
|
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR "0")
|
2018-09-21 16:44:45 +03:00
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR "6")
|
2018-09-26 09:27:58 +03:00
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH "1")
|
2018-03-22 20:13:38 +03:00
|
|
|
set(PROJECT_VERSION_MAJOR ${CPACK_PACKAGE_VERSION_MAJOR})
|
|
|
|
set(PROJECT_VERSION_MINOR ${CPACK_PACKAGE_VERSION_MINOR})
|
|
|
|
set(PROJECT_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH})
|
2017-11-06 18:17:21 +03:00
|
|
|
|
2018-03-22 20:13:38 +03:00
|
|
|
# Set PROJECT_VERSION_PATCH & PROJECT_VERSION_TWEAK to 0 if not present
|
|
|
|
# Needed by add_project_meta.
|
2017-11-06 18:17:21 +03:00
|
|
|
fix_project_version()
|
|
|
|
|
|
|
|
# Set additional project information
|
|
|
|
set(COMPANY "Nheko")
|
2018-07-15 10:25:06 +03:00
|
|
|
set(COPYRIGHT "Copyright (c) 2018 Nheko Contributors")
|
2018-05-05 22:40:24 +03:00
|
|
|
set(IDENTIFIER "com.github.mujx.nheko")
|
2017-11-06 18:17:21 +03:00
|
|
|
|
|
|
|
add_project_meta(META_FILES_TO_INCLUDE)
|
|
|
|
|
2018-06-04 13:54:51 +03:00
|
|
|
if(APPLE)
|
|
|
|
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
|
|
|
|
endif()
|
|
|
|
|
2018-06-04 16:07:47 +03:00
|
|
|
if(NOT MSVC AND NOT APPLE)
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
2018-07-02 18:39:49 +03:00
|
|
|
if (BUILD_DOCS)
|
|
|
|
find_package(Doxygen)
|
|
|
|
|
|
|
|
if (DOXYGEN_FOUND)
|
|
|
|
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Doxyfile.in)
|
|
|
|
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
|
|
|
|
|
|
|
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT})
|
|
|
|
|
|
|
|
add_custom_target(docs ALL
|
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMENT "Generating API documentation with Doxygen"
|
|
|
|
VERBATIM )
|
|
|
|
else (DOXYGEN_FOUND)
|
|
|
|
message("Doxygen need to be installed to generate the doxygen documentation")
|
|
|
|
endif (DOXYGEN_FOUND)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2017-07-29 11:49:00 +03:00
|
|
|
#
|
|
|
|
# LMDB
|
|
|
|
#
|
2018-03-29 09:59:04 +03:00
|
|
|
include(LMDB)
|
2017-07-29 11:49:00 +03:00
|
|
|
|
2017-07-09 12:49:17 +03:00
|
|
|
#
|
|
|
|
# Discover Qt dependencies.
|
|
|
|
#
|
2018-06-17 19:18:12 +03:00
|
|
|
find_package(Qt5 COMPONENTS Core Widgets LinguistTools Concurrent Svg Multimedia REQUIRED)
|
2018-07-11 17:33:02 +03:00
|
|
|
find_package(Qt5DBus)
|
2017-04-06 02:06:42 +03:00
|
|
|
|
2017-07-01 16:34:36 +03:00
|
|
|
if (APPLE)
|
|
|
|
find_package(Qt5MacExtras REQUIRED)
|
|
|
|
endif(APPLE)
|
|
|
|
|
2017-05-30 14:35:01 +03:00
|
|
|
if (Qt5Widgets_FOUND)
|
|
|
|
if (Qt5Widgets_VERSION VERSION_LESS 5.7.0)
|
|
|
|
message(STATUS "Qt version ${Qt5Widgets_VERSION}")
|
2017-05-30 14:44:51 +03:00
|
|
|
message(WARNING "Minimum supported Qt5 version is 5.7!")
|
2017-05-30 14:35:01 +03:00
|
|
|
endif()
|
|
|
|
endif(Qt5Widgets_FOUND)
|
|
|
|
|
2017-07-09 12:49:17 +03:00
|
|
|
#
|
|
|
|
# Set up compiler flags.
|
|
|
|
#
|
2018-06-14 02:17:38 +03:00
|
|
|
if (NOT MSVC)
|
|
|
|
set(CMAKE_C_COMPILER gcc)
|
|
|
|
endif(NOT MSVC)
|
|
|
|
|
2018-02-11 20:28:32 +03:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
2017-04-06 02:06:42 +03:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2018-06-04 16:07:47 +03:00
|
|
|
if(NOT MSVC)
|
|
|
|
set(
|
|
|
|
CMAKE_CXX_FLAGS
|
|
|
|
"${CMAKE_CXX_FLAGS} \
|
|
|
|
-Wall \
|
|
|
|
-Wextra \
|
|
|
|
-Werror \
|
|
|
|
-pipe \
|
|
|
|
-pedantic \
|
|
|
|
-fsized-deallocation \
|
|
|
|
-fdiagnostics-color=always \
|
|
|
|
-Wunreachable-code"
|
|
|
|
)
|
2018-07-10 11:39:28 +03:00
|
|
|
if (NOT CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
# -Wshadow is buggy and broken in GCC, so do not enable it.
|
|
|
|
# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79328
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
|
|
|
|
endif()
|
2018-06-04 16:07:47 +03:00
|
|
|
endif()
|
2017-04-06 02:06:42 +03:00
|
|
|
|
2018-06-14 02:17:38 +03:00
|
|
|
if(NOT (CMAKE_BUILD_TYPE OR CMAKE_CONFIGURATION_TYPES))
|
2017-04-11 18:25:39 +03:00
|
|
|
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
|
2017-04-06 14:58:48 +03:00
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
|
|
|
FORCE)
|
2017-04-11 18:25:39 +03:00
|
|
|
message("Setting build type to '${CMAKE_BUILD_TYPE}'")
|
2018-06-14 02:17:38 +03:00
|
|
|
else(NOT (CMAKE_BUILD_TYPE OR CMAKE_CONFIGURATION_TYPES))
|
2017-04-11 18:25:39 +03:00
|
|
|
message("Build type set to '${CMAKE_BUILD_TYPE}'")
|
2018-06-14 02:17:38 +03:00
|
|
|
endif(NOT (CMAKE_BUILD_TYPE OR CMAKE_CONFIGURATION_TYPES))
|
2017-04-11 18:25:39 +03:00
|
|
|
|
2018-03-22 17:20:22 +03:00
|
|
|
find_program(GIT git)
|
|
|
|
if(GIT)
|
|
|
|
execute_process(
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
COMMAND ${GIT} rev-parse --short HEAD
|
|
|
|
OUTPUT_VARIABLE GIT_OUT OUTPUT_STRIP_TRAILING_WHITESPACE
|
2017-04-06 14:58:48 +03:00
|
|
|
)
|
2018-08-08 14:18:29 +03:00
|
|
|
if(GIT_OUT)
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${GIT_OUT}")
|
|
|
|
else()
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}")
|
|
|
|
endif()
|
2018-03-22 17:20:22 +03:00
|
|
|
endif(GIT)
|
2017-04-11 18:25:39 +03:00
|
|
|
|
|
|
|
set(CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
|
|
|
set(PROJECT_VERSION ${CPACK_PACKAGE_VERSION})
|
|
|
|
|
|
|
|
message(STATUS "Version: ${PROJECT_VERSION}")
|
|
|
|
|
2018-03-22 17:20:22 +03:00
|
|
|
cmake_host_system_information(RESULT BUILD_HOST QUERY HOSTNAME)
|
|
|
|
set(BUILD_USER $ENV{USER})
|
2018-07-17 16:37:25 +03:00
|
|
|
configure_file(cmake/version.h config/version.h)
|
2018-03-22 17:20:22 +03:00
|
|
|
|
2018-03-25 00:36:27 +03:00
|
|
|
|
2017-07-09 12:49:17 +03:00
|
|
|
#
|
|
|
|
# Declare source and header files.
|
|
|
|
#
|
2017-04-06 02:06:42 +03:00
|
|
|
set(SRC_FILES
|
2017-11-30 14:53:28 +03:00
|
|
|
# Dialogs
|
2018-07-17 16:37:25 +03:00
|
|
|
src/dialogs/CreateRoom.cpp
|
|
|
|
src/dialogs/ImageOverlay.cpp
|
|
|
|
src/dialogs/PreviewUploadOverlay.cpp
|
|
|
|
src/dialogs/InviteUsers.cpp
|
|
|
|
src/dialogs/JoinRoom.cpp
|
2018-05-01 19:35:28 +03:00
|
|
|
src/dialogs/MemberList.cpp
|
2018-07-17 16:37:25 +03:00
|
|
|
src/dialogs/LeaveRoom.cpp
|
|
|
|
src/dialogs/Logout.cpp
|
2018-07-20 12:02:35 +03:00
|
|
|
src/dialogs/UserProfile.cpp
|
2018-07-17 16:37:25 +03:00
|
|
|
src/dialogs/ReadReceipts.cpp
|
2018-03-12 23:23:26 +03:00
|
|
|
src/dialogs/ReCaptcha.cpp
|
2018-04-30 21:41:47 +03:00
|
|
|
src/dialogs/RoomSettings.cpp
|
2017-11-30 14:53:28 +03:00
|
|
|
|
|
|
|
# Emoji
|
2018-07-17 16:37:25 +03:00
|
|
|
src/emoji/Category.cpp
|
|
|
|
src/emoji/ItemDelegate.cpp
|
|
|
|
src/emoji/Panel.cpp
|
|
|
|
src/emoji/PickButton.cpp
|
|
|
|
src/emoji/Provider.cpp
|
2017-11-30 14:53:28 +03:00
|
|
|
|
|
|
|
# Timeline
|
2018-07-17 16:37:25 +03:00
|
|
|
src/timeline/TimelineViewManager.cpp
|
|
|
|
src/timeline/TimelineItem.cpp
|
|
|
|
src/timeline/TimelineView.cpp
|
|
|
|
src/timeline/widgets/AudioItem.cpp
|
|
|
|
src/timeline/widgets/FileItem.cpp
|
|
|
|
src/timeline/widgets/ImageItem.cpp
|
|
|
|
src/timeline/widgets/VideoItem.cpp
|
2017-11-30 14:53:28 +03:00
|
|
|
|
|
|
|
# UI components
|
2018-07-17 16:37:25 +03:00
|
|
|
src/ui/Avatar.cpp
|
|
|
|
src/ui/Badge.cpp
|
|
|
|
src/ui/LoadingIndicator.cpp
|
2018-07-07 13:39:53 +03:00
|
|
|
src/ui/InfoMessage.cpp
|
2018-07-17 16:37:25 +03:00
|
|
|
src/ui/FlatButton.cpp
|
|
|
|
src/ui/FloatingButton.cpp
|
|
|
|
src/ui/Label.cpp
|
|
|
|
src/ui/OverlayModal.cpp
|
|
|
|
src/ui/ScrollBar.cpp
|
|
|
|
src/ui/SnackBar.cpp
|
|
|
|
src/ui/RaisedButton.cpp
|
|
|
|
src/ui/Ripple.cpp
|
|
|
|
src/ui/RippleOverlay.cpp
|
|
|
|
src/ui/OverlayWidget.cpp
|
|
|
|
src/ui/TextField.cpp
|
|
|
|
src/ui/ToggleButton.cpp
|
|
|
|
src/ui/Theme.cpp
|
|
|
|
src/ui/ThemeManager.cpp
|
|
|
|
|
|
|
|
src/AvatarProvider.cpp
|
|
|
|
src/Cache.cpp
|
|
|
|
src/ChatPage.cpp
|
|
|
|
src/CommunitiesListItem.cpp
|
|
|
|
src/CommunitiesList.cpp
|
|
|
|
src/InviteeItem.cpp
|
|
|
|
src/LoginPage.cpp
|
2018-06-09 16:03:14 +03:00
|
|
|
src/Logging.cpp
|
2018-07-17 16:37:25 +03:00
|
|
|
src/MainWindow.cpp
|
|
|
|
src/MatrixClient.cpp
|
|
|
|
src/QuickSwitcher.cpp
|
2018-06-10 20:03:45 +03:00
|
|
|
src/Olm.cpp
|
2018-07-17 16:37:25 +03:00
|
|
|
src/RegisterPage.cpp
|
|
|
|
src/RoomInfoListItem.cpp
|
|
|
|
src/RoomList.cpp
|
|
|
|
src/RunGuard.cpp
|
|
|
|
src/SideBarActions.cpp
|
|
|
|
src/Splitter.cpp
|
2018-03-25 00:16:15 +03:00
|
|
|
src/SuggestionsPopup.cpp
|
2018-07-17 16:37:25 +03:00
|
|
|
src/TextInputWidget.cpp
|
|
|
|
src/TopRoomBar.cpp
|
|
|
|
src/TrayIcon.cpp
|
|
|
|
src/TypingDisplay.cpp
|
|
|
|
src/Utils.cpp
|
|
|
|
src/UserInfoWidget.cpp
|
|
|
|
src/UserSettingsPage.cpp
|
|
|
|
src/WelcomePage.cpp
|
|
|
|
src/main.cpp
|
2017-04-06 02:06:42 +03:00
|
|
|
)
|
|
|
|
|
2018-03-29 09:59:04 +03:00
|
|
|
# ExternalProject dependencies
|
|
|
|
set(EXTERNAL_PROJECT_DEPS "")
|
|
|
|
|
2018-09-01 13:35:10 +03:00
|
|
|
set(Boost_USE_STATIC_LIBS OFF)
|
|
|
|
set(Boost_USE_STATIC_RUNTIME OFF)
|
|
|
|
set(Boost_USE_MULTITHREADED ON)
|
|
|
|
find_package(Boost 1.66 REQUIRED
|
|
|
|
COMPONENTS atomic
|
|
|
|
chrono
|
|
|
|
date_time
|
|
|
|
iostreams
|
|
|
|
random
|
|
|
|
regex
|
|
|
|
system
|
|
|
|
thread)
|
2018-06-04 16:07:47 +03:00
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
find_package(OpenSSL REQUIRED)
|
2018-06-17 00:23:49 +03:00
|
|
|
find_package(MatrixClient 0.1.0 REQUIRED)
|
|
|
|
find_package(Olm 2 REQUIRED)
|
2018-08-08 14:15:14 +03:00
|
|
|
find_package(spdlog 1.0.0 CONFIG REQUIRED)
|
2018-09-11 14:56:09 +03:00
|
|
|
find_package(cmark REQUIRED)
|
2018-03-03 14:02:33 +03:00
|
|
|
|
2018-07-04 01:38:54 +03:00
|
|
|
if(NOT LMDBXX_INCLUDE_DIR)
|
|
|
|
find_path(LMDBXX_INCLUDE_DIR
|
|
|
|
NAMES lmdb++.h
|
|
|
|
PATHS /usr/include
|
|
|
|
/usr/local/include
|
|
|
|
$ENV{LIB_DIR}/include
|
|
|
|
$ENV{LIB_DIR}/include/lmdbxx)
|
2018-03-29 09:59:04 +03:00
|
|
|
endif()
|
2018-07-04 21:36:02 +03:00
|
|
|
include_directories(SYSTEM ${LMDBXX_INCLUDE_DIR})
|
2018-03-16 18:56:45 +03:00
|
|
|
|
2018-07-04 01:38:54 +03:00
|
|
|
if(NOT TWEENY_INCLUDE_DIR)
|
|
|
|
find_path(TWEENY_INCLUDE_DIR
|
|
|
|
NAMES tweeny/tweeny.h
|
|
|
|
PATHS /usr/include/
|
|
|
|
/usr/local/include/
|
|
|
|
$ENV{LIB_DIR}/include/
|
|
|
|
$ENV{LIB_DIR}/include/tweeny)
|
2018-03-29 09:59:04 +03:00
|
|
|
endif()
|
2018-07-04 21:36:02 +03:00
|
|
|
include_directories(SYSTEM ${TWEENY_INCLUDE_DIR})
|
2018-03-03 14:02:33 +03:00
|
|
|
|
2018-07-17 16:37:25 +03:00
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/src)
|
2018-03-22 17:20:22 +03:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/config)
|
2018-09-01 13:35:10 +03:00
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
2017-08-06 11:01:46 +03:00
|
|
|
|
2017-04-06 02:06:42 +03:00
|
|
|
qt5_wrap_cpp(MOC_HEADERS
|
2017-11-30 14:53:28 +03:00
|
|
|
# Dialogs
|
2018-07-17 16:37:25 +03:00
|
|
|
src/dialogs/CreateRoom.h
|
|
|
|
src/dialogs/ImageOverlay.h
|
|
|
|
src/dialogs/PreviewUploadOverlay.h
|
|
|
|
src/dialogs/InviteUsers.h
|
|
|
|
src/dialogs/JoinRoom.h
|
|
|
|
src/dialogs/MemberList.h
|
|
|
|
src/dialogs/LeaveRoom.h
|
|
|
|
src/dialogs/Logout.h
|
2018-07-20 12:02:35 +03:00
|
|
|
src/dialogs/UserProfile.h
|
2018-09-12 16:27:25 +03:00
|
|
|
src/dialogs/RawMessage.h
|
2018-07-17 16:37:25 +03:00
|
|
|
src/dialogs/ReadReceipts.h
|
|
|
|
src/dialogs/ReCaptcha.h
|
|
|
|
src/dialogs/RoomSettings.h
|
2017-11-30 14:53:28 +03:00
|
|
|
|
|
|
|
# Emoji
|
2018-07-17 16:37:25 +03:00
|
|
|
src/emoji/Category.h
|
|
|
|
src/emoji/ItemDelegate.h
|
|
|
|
src/emoji/Panel.h
|
|
|
|
src/emoji/PickButton.h
|
2017-11-30 14:53:28 +03:00
|
|
|
|
|
|
|
# Timeline
|
2018-07-17 16:37:25 +03:00
|
|
|
src/timeline/TimelineItem.h
|
|
|
|
src/timeline/TimelineView.h
|
|
|
|
src/timeline/TimelineViewManager.h
|
|
|
|
src/timeline/widgets/AudioItem.h
|
|
|
|
src/timeline/widgets/FileItem.h
|
|
|
|
src/timeline/widgets/ImageItem.h
|
|
|
|
src/timeline/widgets/VideoItem.h
|
2017-11-30 14:53:28 +03:00
|
|
|
|
|
|
|
# UI components
|
2018-07-17 16:37:25 +03:00
|
|
|
src/ui/Avatar.h
|
|
|
|
src/ui/Badge.h
|
|
|
|
src/ui/LoadingIndicator.h
|
|
|
|
src/ui/InfoMessage.h
|
|
|
|
src/ui/FlatButton.h
|
|
|
|
src/ui/Label.h
|
|
|
|
src/ui/FloatingButton.h
|
2018-09-08 14:55:30 +03:00
|
|
|
src/ui/Menu.h
|
2018-07-17 16:37:25 +03:00
|
|
|
src/ui/OverlayWidget.h
|
|
|
|
src/ui/ScrollBar.h
|
|
|
|
src/ui/SnackBar.h
|
|
|
|
src/ui/RaisedButton.h
|
|
|
|
src/ui/Ripple.h
|
|
|
|
src/ui/RippleOverlay.h
|
|
|
|
src/ui/TextField.h
|
|
|
|
src/ui/ToggleButton.h
|
|
|
|
src/ui/Theme.h
|
|
|
|
src/ui/ThemeManager.h
|
|
|
|
|
|
|
|
src/notifications/Manager.h
|
|
|
|
|
|
|
|
src/AvatarProvider.h
|
|
|
|
src/Cache.h
|
|
|
|
src/ChatPage.h
|
|
|
|
src/CommunitiesListItem.h
|
|
|
|
src/CommunitiesList.h
|
|
|
|
src/LoginPage.h
|
|
|
|
src/MainWindow.h
|
2018-09-07 12:24:09 +03:00
|
|
|
src/MatrixClient.h
|
2018-07-17 16:37:25 +03:00
|
|
|
src/InviteeItem.h
|
|
|
|
src/QuickSwitcher.h
|
|
|
|
src/RegisterPage.h
|
|
|
|
src/RoomInfoListItem.h
|
|
|
|
src/RoomList.h
|
|
|
|
src/SideBarActions.h
|
|
|
|
src/Splitter.h
|
|
|
|
src/SuggestionsPopup.h
|
|
|
|
src/TextInputWidget.h
|
|
|
|
src/TopRoomBar.h
|
|
|
|
src/TrayIcon.h
|
|
|
|
src/TypingDisplay.h
|
|
|
|
src/UserInfoWidget.h
|
|
|
|
src/UserSettingsPage.h
|
|
|
|
src/WelcomePage.h
|
2017-04-06 02:06:42 +03:00
|
|
|
)
|
|
|
|
|
2017-07-09 12:49:17 +03:00
|
|
|
#
|
|
|
|
# Bundle translations.
|
|
|
|
#
|
2018-03-29 09:59:04 +03:00
|
|
|
include(Translations)
|
|
|
|
set(TRANSLATION_DEPS ${LANG_QRC} ${QRC} ${QM_SRC})
|
2017-05-29 19:09:12 +03:00
|
|
|
|
2018-03-29 09:59:04 +03:00
|
|
|
set(COMMON_LIBS
|
2018-06-04 13:54:51 +03:00
|
|
|
MatrixClient::MatrixClient
|
2018-09-01 13:35:10 +03:00
|
|
|
${Boost_LIBRARIES}
|
2018-09-11 14:56:09 +03:00
|
|
|
cmark::cmark
|
2018-03-29 09:59:04 +03:00
|
|
|
Qt5::Widgets
|
2018-04-28 21:19:16 +03:00
|
|
|
Qt5::Svg
|
2018-06-17 00:23:49 +03:00
|
|
|
Qt5::Concurrent
|
|
|
|
Qt5::Multimedia)
|
2017-12-03 03:47:37 +03:00
|
|
|
|
2017-10-01 22:38:46 +03:00
|
|
|
if(APPVEYOR_BUILD)
|
2017-12-03 03:47:37 +03:00
|
|
|
set(NHEKO_LIBS ${COMMON_LIBS} lmdb)
|
2017-10-01 22:38:46 +03:00
|
|
|
else()
|
2017-12-03 03:47:37 +03:00
|
|
|
set(NHEKO_LIBS ${COMMON_LIBS} ${LMDB_LIBRARY})
|
2017-10-01 22:38:46 +03:00
|
|
|
endif()
|
|
|
|
|
2018-05-05 22:40:24 +03:00
|
|
|
if (APPLE)
|
2018-09-19 23:38:36 +03:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Foundation -framework Cocoa")
|
|
|
|
set(SRC_FILES ${SRC_FILES} src/notifications/ManagerMac.mm src/emoji/MacHelper.mm)
|
2018-05-05 22:40:24 +03:00
|
|
|
elseif (WIN32)
|
2018-07-01 00:23:16 +03:00
|
|
|
file(DOWNLOAD
|
|
|
|
"https://raw.githubusercontent.com/mohabouje/WinToast/41ed1c58d5dce0ee9c01dbdeac05be45358d4f57/src/wintoastlib.cpp"
|
|
|
|
${PROJECT_SOURCE_DIR}/src/wintoastlib.cpp
|
|
|
|
EXPECTED_HASH SHA256=1A1A7CE41C1052B12946798F4A6C67CE1FAD209C967F5ED4D720B173527E2073)
|
|
|
|
|
|
|
|
file(DOWNLOAD
|
|
|
|
"https://raw.githubusercontent.com/mohabouje/WinToast/41ed1c58d5dce0ee9c01dbdeac05be45358d4f57/src/wintoastlib.h"
|
2018-07-17 17:11:59 +03:00
|
|
|
${PROJECT_SOURCE_DIR}/src/wintoastlib.h
|
2018-07-01 00:23:16 +03:00
|
|
|
EXPECTED_HASH SHA256=b4481023c5782733795838be22bf1a75f45d87458cd4d9a5a75f664a146eea11)
|
|
|
|
|
|
|
|
set(SRC_FILES ${SRC_FILES} src/notifications/ManagerWin.cpp src/wintoastlib.cpp)
|
2018-05-05 22:40:24 +03:00
|
|
|
else ()
|
|
|
|
set(SRC_FILES ${SRC_FILES} src/notifications/ManagerLinux.cpp)
|
|
|
|
endif ()
|
|
|
|
|
2018-03-29 09:59:04 +03:00
|
|
|
set(NHEKO_DEPS
|
|
|
|
${SRC_FILES}
|
|
|
|
${UI_HEADERS}
|
|
|
|
${MOC_HEADERS}
|
|
|
|
${TRANSLATION_DEPS}
|
|
|
|
${META_FILES_TO_INCLUDE})
|
2017-10-08 16:49:56 +03:00
|
|
|
|
2018-05-04 18:11:03 +03:00
|
|
|
if(ASAN)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined")
|
|
|
|
endif()
|
|
|
|
|
2017-10-08 16:49:56 +03:00
|
|
|
if(APPLE)
|
2017-11-06 18:17:21 +03:00
|
|
|
add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS})
|
2018-06-17 00:23:49 +03:00
|
|
|
target_link_libraries (nheko ${NHEKO_LIBS} Qt5::MacExtras)
|
2017-10-08 16:49:56 +03:00
|
|
|
elseif(WIN32)
|
2017-11-06 18:17:21 +03:00
|
|
|
add_executable (nheko ${OS_BUNDLE} ${ICON_FILE} ${NHEKO_DEPS})
|
2018-06-17 00:23:49 +03:00
|
|
|
target_link_libraries (nheko ${NTDLIB} ${NHEKO_LIBS} Qt5::WinMain)
|
2017-10-08 16:49:56 +03:00
|
|
|
else()
|
2017-11-06 18:17:21 +03:00
|
|
|
add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS})
|
2018-07-11 17:33:02 +03:00
|
|
|
target_link_libraries (nheko ${NHEKO_LIBS} Qt5::DBus)
|
2017-05-02 04:22:33 +03:00
|
|
|
endif()
|
2018-01-09 21:34:01 +03:00
|
|
|
|
2018-03-29 09:59:04 +03:00
|
|
|
if(EXTERNAL_PROJECT_DEPS)
|
|
|
|
add_dependencies(nheko ${EXTERNAL_PROJECT_DEPS})
|
|
|
|
endif()
|
2018-03-03 14:02:33 +03:00
|
|
|
|
2018-01-09 21:34:01 +03:00
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
install (TARGETS nheko RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
|
|
install (FILES "resources/nheko-16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "nheko.png")
|
|
|
|
install (FILES "resources/nheko-32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "nheko.png")
|
|
|
|
install (FILES "resources/nheko-48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "nheko.png")
|
|
|
|
install (FILES "resources/nheko-64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "nheko.png")
|
|
|
|
install (FILES "resources/nheko-128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "nheko.png")
|
|
|
|
install (FILES "resources/nheko-256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "nheko.png")
|
|
|
|
install (FILES "resources/nheko-512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "nheko.png")
|
|
|
|
install (FILES "resources/nheko.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
2018-02-02 02:02:30 +03:00
|
|
|
install (FILES "resources/nheko.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
|
2018-01-09 21:34:01 +03:00
|
|
|
|
|
|
|
if(NOT TARGET uninstall)
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
|
|
IMMEDIATE @ONLY)
|
|
|
|
add_custom_target(uninstall
|
|
|
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
|
|
|
endif()
|
|
|
|
endif()
|