2024-03-02 22:33:27 +01:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
2024-04-02 19:23:12 +02:00
|
|
|
project(swaymux VERSION 1.1 LANGUAGES CXX)
|
2024-03-02 22:33:27 +01:00
|
|
|
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
|
2024-03-08 10:53:30 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2024-03-02 22:33:27 +01:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2024-03-09 15:38:58 +01:00
|
|
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
|
|
|
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
|
2024-03-02 22:33:27 +01:00
|
|
|
|
2024-03-09 17:58:15 +01:00
|
|
|
# set(TS_FILES swaymux_en_US.ts)
|
2024-03-02 22:33:27 +01:00
|
|
|
|
|
|
|
set(PROJECT_SOURCES
|
|
|
|
main.cpp
|
|
|
|
mainwindow.cpp
|
|
|
|
mainwindow.h
|
|
|
|
mainwindow.ui
|
2024-03-09 17:58:15 +01:00
|
|
|
# ${TS_FILES}
|
2024-03-04 00:27:05 +01:00
|
|
|
sway_bindings/Formatter.h
|
|
|
|
sway_bindings/Sway.cpp
|
|
|
|
tree/swaytree.h
|
|
|
|
tree/swaytree.cpp
|
|
|
|
tree/AbstractTreeModel.h
|
|
|
|
tree/AbstractTreeModel.h
|
|
|
|
tree/SwayTreeModel.h
|
|
|
|
tree/SwayTreeModel.cpp
|
2024-03-07 17:37:18 +01:00
|
|
|
Keys/KeyHandler.h
|
|
|
|
Keys/KeyHandler.cpp
|
|
|
|
Keys/AbstractKeyListener.h
|
|
|
|
Keys/HelpKeyListener.h
|
|
|
|
Keys/CloseHelpKeyListener.h
|
2024-03-08 10:53:30 +01:00
|
|
|
Keys/CreateWorkspaceKeyListener.h
|
2024-03-08 13:13:28 +01:00
|
|
|
Keys/CloseSwaymuxKeyListener.h
|
|
|
|
Keys/CloseSwaymuxKeyListener.h
|
|
|
|
sway_bindings/swayoutputs.h
|
2024-03-09 12:55:29 +01:00
|
|
|
Keys/SwitchToKeybindListener.h
|
2024-03-09 23:44:43 +01:00
|
|
|
Keys/JumpOutputKeyListener.h
|
|
|
|
Keys/PrevOutputKeyListener.h
|
|
|
|
Keys/NextOutputKeyListener.h
|
2024-03-11 13:33:26 +01:00
|
|
|
Keys/CloseKeyListener.h
|
|
|
|
Keys/MoveToScratchpadKeyListener.h
|
|
|
|
Keys/MoveToScratchpadKeyListener.h
|
|
|
|
Keys/RestoreKeyListener.h
|
2024-03-11 17:11:26 +01:00
|
|
|
Keys/MainWindowAwareKeyListener.h
|
2024-03-12 11:48:43 +01:00
|
|
|
Keys/ToggleDetailsKeyListener.h
|
|
|
|
sway_bindings/SwayRecords.cpp
|
|
|
|
sway_bindings/SwayRecords.h
|
2024-03-13 21:43:57 +01:00
|
|
|
Keys/DummyKeyListener.h
|
2024-03-02 22:33:27 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
|
|
|
qt_add_executable(swaymux
|
|
|
|
MANUAL_FINALIZATION
|
|
|
|
${PROJECT_SOURCES}
|
|
|
|
)
|
|
|
|
# Define target properties for Android with Qt 6 as:
|
|
|
|
# set_property(TARGET swaymux APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
|
|
|
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
|
|
|
|
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
|
|
|
|
|
|
|
|
else()
|
|
|
|
if(ANDROID)
|
|
|
|
add_library(swaymux SHARED
|
|
|
|
${PROJECT_SOURCES}
|
|
|
|
)
|
|
|
|
# Define properties for Android with Qt 5 after find_package() calls as:
|
|
|
|
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
|
|
|
|
else()
|
|
|
|
add_executable(swaymux
|
|
|
|
${PROJECT_SOURCES}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_link_libraries(swaymux PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
|
|
|
|
|
|
|
|
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
|
|
|
# If you are developing for iOS or macOS you should consider setting an
|
|
|
|
# explicit, fixed bundle identifier manually though.
|
|
|
|
if(${QT_VERSION} VERSION_LESS 6.1.0)
|
|
|
|
set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.swaymux)
|
|
|
|
endif()
|
|
|
|
set_target_properties(swaymux PROPERTIES
|
|
|
|
${BUNDLE_ID_OPTION}
|
|
|
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
|
|
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
|
|
|
MACOSX_BUNDLE TRUE
|
2024-03-09 17:58:15 +01:00
|
|
|
WIN32_EXECUTABLE FALSE
|
2024-03-02 22:33:27 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
install(TARGETS swaymux
|
|
|
|
BUNDLE DESTINATION .
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(QT_VERSION_MAJOR EQUAL 6)
|
|
|
|
qt_finalize_executable(swaymux)
|
|
|
|
endif()
|