2019-03-29 14:54:34 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(squawk)
|
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2019-10-16 19:38:35 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
2019-10-05 11:27:39 +00:00
|
|
|
|
2019-03-29 14:54:34 +00:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
2019-06-21 19:33:38 +00:00
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
|
2019-10-07 15:35:55 +00:00
|
|
|
include(GNUInstallDirs)
|
2019-11-02 20:50:25 +00:00
|
|
|
include_directories(.)
|
2019-10-07 15:35:55 +00:00
|
|
|
|
2019-03-29 14:54:34 +00:00
|
|
|
find_package(Qt5Widgets CONFIG REQUIRED)
|
2019-10-05 11:27:39 +00:00
|
|
|
find_package(Qt5LinguistTools)
|
|
|
|
|
2019-03-29 14:54:34 +00:00
|
|
|
set(squawk_SRC
|
|
|
|
main.cpp
|
2019-04-11 14:58:59 +00:00
|
|
|
global.cpp
|
|
|
|
exception.cpp
|
2019-04-02 21:58:43 +00:00
|
|
|
signalcatcher.cpp
|
2019-03-29 14:54:34 +00:00
|
|
|
)
|
|
|
|
|
2019-10-08 09:01:14 +00:00
|
|
|
configure_file(resources/images/logo.svg squawk.svg COPYONLY)
|
|
|
|
execute_process(COMMAND convert -background none -size 48x48 squawk.svg squawk48.png WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
execute_process(COMMAND convert -background none -size 64x64 squawk.svg squawk64.png WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
execute_process(COMMAND convert -background none -size 128x128 squawk.svg squawk128.png WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
execute_process(COMMAND convert -background none -size 256x256 squawk.svg squawk256.png WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
|
|
|
configure_file(packaging/squawk.desktop squawk.desktop COPYONLY)
|
|
|
|
|
2019-10-05 11:27:39 +00:00
|
|
|
set(TS_FILES
|
|
|
|
translations/squawk.ru.ts
|
|
|
|
)
|
|
|
|
qt5_add_translation(QM_FILES ${TS_FILES})
|
|
|
|
add_custom_target(translations ALL DEPENDS ${QM_FILES})
|
|
|
|
|
|
|
|
qt5_add_resources(RCC resources/resources.qrc)
|
|
|
|
|
|
|
|
add_executable(squawk ${squawk_SRC} ${RCC})
|
2019-03-29 14:54:34 +00:00
|
|
|
target_link_libraries(squawk Qt5::Widgets)
|
|
|
|
|
2019-10-10 11:45:21 +00:00
|
|
|
option(SYSTEM_QXMPP "Use system qxmpp lib" ON)
|
2019-10-07 15:35:55 +00:00
|
|
|
|
|
|
|
if(NOT SYSTEM_QXMPP)
|
|
|
|
add_subdirectory(external/qxmpp)
|
|
|
|
endif()
|
2019-03-29 14:54:34 +00:00
|
|
|
|
2019-10-10 11:45:21 +00:00
|
|
|
add_subdirectory(ui)
|
|
|
|
add_subdirectory(core)
|
|
|
|
|
2019-03-29 14:54:34 +00:00
|
|
|
target_link_libraries(squawk squawkUI)
|
|
|
|
target_link_libraries(squawk squawkCORE)
|
2019-04-12 15:22:10 +00:00
|
|
|
target_link_libraries(squawk uuid)
|
2019-03-29 14:54:34 +00:00
|
|
|
|
2019-10-05 11:27:39 +00:00
|
|
|
add_dependencies(${CMAKE_PROJECT_NAME} translations)
|
|
|
|
|
2019-03-29 14:54:34 +00:00
|
|
|
# Install the executable
|
2019-10-07 15:35:55 +00:00
|
|
|
install(TARGETS squawk DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2019-10-10 11:45:21 +00:00
|
|
|
install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/squawk/l10n)
|
2019-10-08 09:01:14 +00:00
|
|
|
install(FILES squawk.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
|
|
|
|
install(FILES squawk48.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps RENAME squawk.png)
|
|
|
|
install(FILES squawk64.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps RENAME squawk.png)
|
|
|
|
install(FILES squawk128.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps RENAME squawk.png)
|
|
|
|
install(FILES squawk256.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/256x256/apps RENAME squawk.png)
|
|
|
|
install(FILES squawk.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|