2016-12-19 17:41:01 +00:00
|
|
|
cmake_minimum_required (VERSION 3.4)
|
|
|
|
|
2020-03-17 22:45:20 +00:00
|
|
|
find_package (Qt5 REQUIRED COMPONENTS Core Widgets Network)
|
2016-12-19 17:41:01 +00:00
|
|
|
set (CMAKE_AUTOMOC ON)
|
|
|
|
set (CMAKE_AUTORCC ON)
|
|
|
|
set (CMAKE_AUTOUIC ON)
|
|
|
|
set (CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
2021-01-07 21:43:54 +00:00
|
|
|
# files that are used both in tests and the app
|
|
|
|
set(GUI_COMMON_SOURCE_FILES
|
2021-01-10 11:39:39 +00:00
|
|
|
src/Action.cpp
|
|
|
|
src/Hotkey.cpp
|
2021-01-07 21:43:54 +00:00
|
|
|
src/KeySequence.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(GUI_COMMON_HEADER_FILES
|
2021-01-10 11:39:39 +00:00
|
|
|
src/Action.h
|
|
|
|
src/Hotkey.h
|
2021-01-07 21:43:54 +00:00
|
|
|
src/KeySequence.h
|
|
|
|
)
|
|
|
|
|
2021-01-07 21:43:50 +00:00
|
|
|
set(GUI_SOURCE_FILES
|
|
|
|
src/AboutDialog.cpp
|
|
|
|
src/ActionDialog.cpp
|
|
|
|
src/AddClientDialog.cpp
|
|
|
|
src/AppConfig.cpp
|
|
|
|
src/BarrierLocale.cpp
|
|
|
|
src/BaseConfig.cpp
|
|
|
|
src/CommandProcess.cpp
|
|
|
|
src/DataDownloader.cpp
|
|
|
|
src/DisplayIsValid.cpp
|
2021-11-01 02:50:17 +00:00
|
|
|
src/FingerprintAcceptDialog.cpp
|
2021-01-07 21:43:50 +00:00
|
|
|
src/HotkeyDialog.cpp
|
|
|
|
src/IpcClient.cpp
|
|
|
|
src/Ipc.cpp
|
|
|
|
src/IpcReader.cpp
|
|
|
|
src/KeySequenceWidget.cpp
|
|
|
|
src/LogWindow.cpp
|
|
|
|
src/main.cpp
|
|
|
|
src/MainWindow.cpp
|
|
|
|
src/NewScreenWidget.cpp
|
|
|
|
src/QBarrierApplication.cpp
|
|
|
|
src/QUtility.cpp
|
|
|
|
src/Screen.cpp
|
|
|
|
src/ScreenSettingsDialog.cpp
|
|
|
|
src/ScreenSetupModel.cpp
|
|
|
|
src/ScreenSetupView.cpp
|
|
|
|
src/ServerConfig.cpp
|
|
|
|
src/ServerConfigDialog.cpp
|
|
|
|
src/SettingsDialog.cpp
|
|
|
|
src/SetupWizard.cpp
|
|
|
|
src/SslCertificate.cpp
|
|
|
|
src/TrashScreenWidget.cpp
|
|
|
|
src/VersionChecker.cpp
|
|
|
|
src/ZeroconfBrowser.cpp
|
|
|
|
src/ZeroconfRegister.cpp
|
|
|
|
src/ZeroconfServer.cpp
|
|
|
|
src/ZeroconfService.cpp
|
|
|
|
src/ZeroconfThread.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(GUI_HEADER_FILES
|
|
|
|
src/AboutDialog.h
|
|
|
|
src/ActionDialog.h
|
|
|
|
src/AddClientDialog.h
|
|
|
|
src/AppConfig.h
|
|
|
|
src/BarrierLocale.h
|
|
|
|
src/BaseConfig.h
|
|
|
|
src/CommandProcess.h
|
|
|
|
src/DataDownloader.h
|
|
|
|
src/DisplayIsValid.h
|
|
|
|
src/ElevateMode.h
|
|
|
|
src/HotkeyDialog.h
|
|
|
|
src/IpcClient.h
|
|
|
|
src/Ipc.h
|
|
|
|
src/IpcReader.h
|
|
|
|
src/KeySequenceWidget.h
|
|
|
|
src/LogWindow.h
|
|
|
|
src/MainWindow.h
|
|
|
|
src/NewScreenWidget.h
|
|
|
|
src/ProcessorArch.h
|
|
|
|
src/QBarrierApplication.h
|
|
|
|
src/QUtility.h
|
|
|
|
src/Screen.h
|
|
|
|
src/ScreenSettingsDialog.h
|
|
|
|
src/ScreenSetupModel.h
|
|
|
|
src/ScreenSetupView.h
|
|
|
|
src/ServerConfigDialog.h
|
|
|
|
src/ServerConfig.h
|
|
|
|
src/SettingsDialog.h
|
|
|
|
src/SetupWizard.h
|
|
|
|
src/ShutdownCh.h
|
|
|
|
src/SslCertificate.h
|
|
|
|
src/TrashScreenWidget.h
|
|
|
|
src/VersionChecker.h
|
|
|
|
src/ZeroconfBrowser.h
|
|
|
|
src/ZeroconfRecord.h
|
|
|
|
src/ZeroconfRegister.h
|
|
|
|
src/ZeroconfServer.h
|
|
|
|
src/ZeroconfService.h
|
|
|
|
src/ZeroconfThread.h
|
|
|
|
)
|
|
|
|
|
|
|
|
set(GUI_UI_FILES
|
|
|
|
src/AboutDialogBase.ui
|
|
|
|
src/ActionDialogBase.ui
|
|
|
|
src/AddClientDialogBase.ui
|
2021-11-01 02:50:17 +00:00
|
|
|
src/FingerprintAcceptDialog.ui
|
2021-01-07 21:43:50 +00:00
|
|
|
src/HotkeyDialogBase.ui
|
|
|
|
src/LogWindowBase.ui
|
|
|
|
src/MainWindowBase.ui
|
|
|
|
src/ScreenSettingsDialogBase.ui
|
|
|
|
src/ServerConfigDialogBase.ui
|
|
|
|
src/SettingsDialogBase.ui
|
|
|
|
src/SetupWizardBase.ui
|
|
|
|
)
|
2016-12-19 17:41:01 +00:00
|
|
|
|
2017-02-09 20:05:36 +00:00
|
|
|
if (WIN32)
|
2018-03-11 16:48:59 +00:00
|
|
|
set (GUI_RC_FILES res/win/Barrier.rc)
|
2017-02-09 20:05:36 +00:00
|
|
|
endif()
|
|
|
|
|
2018-01-27 21:48:17 +00:00
|
|
|
add_executable (barrier WIN32
|
2021-01-07 21:43:54 +00:00
|
|
|
${GUI_COMMON_SOURCE_FILES}
|
|
|
|
${GUI_COMMON_HEADER_FILES}
|
2018-03-11 16:48:59 +00:00
|
|
|
${GUI_SOURCE_FILES}
|
2021-01-07 21:43:50 +00:00
|
|
|
${GUI_HEADER_FILES}
|
2018-03-11 16:48:59 +00:00
|
|
|
${GUI_UI_FILES}
|
|
|
|
${GUI_RC_FILES}
|
2018-01-27 21:48:17 +00:00
|
|
|
res/Barrier.qrc
|
2016-12-19 17:41:01 +00:00
|
|
|
)
|
|
|
|
|
2017-03-09 14:32:41 +00:00
|
|
|
include_directories (./src)
|
2018-01-31 15:04:07 +00:00
|
|
|
|
2021-11-01 00:52:40 +00:00
|
|
|
target_link_libraries(barrier net base io Qt5::Core Qt5::Widgets Qt5::Network ${OPENSSL_LIBS})
|
2018-01-31 15:04:07 +00:00
|
|
|
target_compile_definitions (barrier PRIVATE -DBARRIER_VERSION_STAGE="${BARRIER_VERSION_STAGE}")
|
|
|
|
target_compile_definitions (barrier PRIVATE -DBARRIER_REVISION="${BARRIER_REVISION}")
|
2016-12-19 17:41:01 +00:00
|
|
|
|
|
|
|
if (WIN32)
|
2016-12-28 11:50:32 +00:00
|
|
|
include_directories ($ENV{BONJOUR_SDK_HOME}/Include)
|
2020-10-30 02:00:07 +00:00
|
|
|
find_library (DNSSD_LIB dnssd.lib
|
2016-12-28 11:50:32 +00:00
|
|
|
HINTS ENV BONJOUR_SDK_HOME
|
|
|
|
PATH_SUFFIXES "Lib/x64")
|
2018-01-31 15:04:07 +00:00
|
|
|
set_target_properties (barrier PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
|
|
|
|
target_link_libraries (barrier ${DNSSD_LIB})
|
2018-02-13 19:49:39 +00:00
|
|
|
elseif (APPLE)
|
|
|
|
find_library(APPSERVICES_LIB ApplicationServices)
|
|
|
|
target_link_libraries(barrier ${APPSERVICES_LIB})
|
2018-08-02 12:41:02 +00:00
|
|
|
else()
|
2018-01-27 21:48:17 +00:00
|
|
|
target_link_libraries (barrier dns_sd)
|
2018-03-04 19:48:15 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (HAVE_X11)
|
|
|
|
target_link_libraries (barrier X11)
|
2017-02-07 01:35:07 +00:00
|
|
|
endif()
|
2017-03-07 14:10:24 +00:00
|
|
|
|
2018-03-29 18:01:07 +00:00
|
|
|
target_link_libraries (barrier common)
|
|
|
|
|
2017-03-07 14:10:24 +00:00
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
2018-01-27 21:48:17 +00:00
|
|
|
install (TARGETS barrier DESTINATION ${BARRIER_BUNDLE_BINARY_DIR})
|
2019-10-16 23:35:30 +00:00
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "BSD")
|
2018-01-27 21:48:17 +00:00
|
|
|
install (TARGETS barrier DESTINATION bin)
|
2017-03-07 14:10:24 +00:00
|
|
|
endif()
|
2021-01-07 21:43:54 +00:00
|
|
|
|
|
|
|
if (BARRIER_BUILD_TESTS)
|
|
|
|
set(GUI_TEST_SOURCE_FILES
|
|
|
|
test/KeySequenceTests.cpp
|
2021-01-10 11:39:39 +00:00
|
|
|
test/HotkeyTests.cpp
|
2021-01-07 21:43:54 +00:00
|
|
|
test/main.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(guiunittests
|
|
|
|
${GUI_TEST_SOURCE_FILES}
|
|
|
|
${GUI_COMMON_SOURCE_FILES}
|
|
|
|
${GUI_COMMON_HEADER_FILES}
|
|
|
|
)
|
|
|
|
|
|
|
|
add_test(guiunittests guiunittests)
|
|
|
|
|
|
|
|
target_include_directories(guiunittests PUBLIC ../../ext)
|
2021-01-10 11:49:54 +00:00
|
|
|
target_link_libraries(guiunittests gtest gmock Qt5::Core Qt5::Widgets Qt5::Network ${libs})
|
2021-01-07 21:43:54 +00:00
|
|
|
endif()
|