project( desq-dock ) cmake_minimum_required( VERSION 3.1 ) set( CMAKE_CXX_STANDARD 17 ) set( CMAKE_INCLUDE_CURRENT_DIR ON ) set( CMAKE_AUTOMOC ON ) set( CMAKE_BUILD_TYPE Release ) add_definitions ( -Wall ) if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT ) set( CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Location for installing the project" FORCE ) endif() find_package( PkgConfig REQUIRED ) if ( CMAKE_INSTALL_LIBDIR STREQUAL "" OR NOT DEFINED CMAKE_INSTALL_LIBDIR ) message( "-- CMAKE_INSTALL_LIBDIR not set. Trying pkg-config" ) pkg_get_variable( LIBDIR desq-core libdir ) set( CMAKE_INSTALL_LIBDIR ${LIBDIR} ) if ( LIBDIR STREQUAL "" OR NOT DEFINED LIBDIR ) message( "-- Unable to retrieve information from pkg-config." ) set( CMAKE_INSTALL_LIBDIR "lib/x86_64-linux-gnu" ) message( "-- Using default value for CMAKE_INSTALL_LIBDIR: ${CMAKE_INSTALL_LIBDIR}" ) endif() endif() if ( NOT DEFINED PKGCONFPATH ) message( "-- PKGCONFPATH not set. Trying pkg-config" ) pkg_get_variable( PKGCONFPATH desq-core pkgconfpath ) if ( PKGCONFPATH STREQUAL "" OR NOT DEFINED PKGCONFPATH ) message( "-- Unable to retrieve the value of PKGCONFPATH." ) set( PKGCONFPATH "/etc/xdg/desq" ) message( "-- Using default value: /etc/xdg/desq" ) endif() endif() if ( NOT DEFINED APPCONFPATH ) message( "-- APPCONFPATH not set. Trying pkg-config" ) pkg_get_variable( APPCONFPATH desq-core appconfpath ) if ( APPCONFPATH STREQUAL "" OR NOT DEFINED APPCONFPATH ) message( "-- Unable to retrieve the value of APPCONFPATH." ) set( APPCONFPATH "${PKGSHAREDPATH}/configs/" ) message( "-- Using default value: ${APPCONFPATH}" ) endif() endif() set( CMAKE_AUTOMOC ON ) set( CMAKE_AUTORCC ON ) set( CMAKE_AUTOUIC ON ) find_package ( Qt5Widgets REQUIRED ) find_package ( Qt5Core REQUIRED ) find_package ( Qt5Gui REQUIRED ) find_package ( Qt5DBus REQUIRED ) pkg_check_modules( DESQ_CORE REQUIRED desq-core ) pkg_check_modules( DESQ_GUI REQUIRED desq-gui ) pkg_check_modules( DESQ_UI REQUIRED desqui ) pkg_check_modules( DESQ_WL REQUIRED desqwl ) include_directories( ${DESQ_GUI_INCLUDE_DIRS} ${DESQ_UI_INCLUDE_DIRS} ${DESQ_WL_INCLUDE_DIRS} Common UI Widgets Widgets/Clock Widgets/Common Widgets/Factory Widgets/Loads Widgets/Misc Widgets/Notifications Widgets/Pager Widgets/ShowDesktop Widgets/Start Widgets/Tasks ) set ( HDRS Global.hpp Common/Common.hpp UI/DesQDock.hpp UI/DesQDockIsland.hpp Widgets/Common/dbustypes.hpp Widgets/Clock/ClockWidget.hpp Widgets/Factory/WidgetFactory.hpp Widgets/Loads/LoadsWidget.hpp Widgets/Misc/MiscWidgets.hpp Widgets/Notifications/Notifications.hpp Widgets/Pager/DesQDockPager.hpp Widgets/ShowDesktop/ShowDesktop.hpp Widgets/Start/DesQDockStart.hpp Widgets/Tasks/DesQDockTasks.hpp Widgets/Widgets.hpp ) set ( SRCS Main.cpp Common/Common.cpp UI/DesQDock.cpp UI/DesQDockIsland.cpp Widgets/Common/dbustypes.cpp Widgets/Clock/ClockWidget.cpp Widgets/Factory/WidgetFactory.cpp Widgets/Loads/LoadsWidget.cpp Widgets/Misc/MiscWidgets.cpp Widgets/Notifications/Notifications.cpp Widgets/Pager/DesQDockPager.cpp Widgets/ShowDesktop/ShowDesktop.cpp Widgets/Start/DesQDockStart.cpp Widgets/Tasks/DesQDockTasks.cpp ) add_executable ( desq-dock ${SRCS} ${HDRS} ) target_include_directories( desq-dock PRIVATE protocols ) target_link_libraries ( desq-dock Qt5::Core Qt5::Gui Qt5::Widgets Qt5::DBus ${DESQ_UI_LIBRARIES} ${DESQ_WL_LIBRARIES} ) configure_file( dock.conf.in dock.conf @ONLY ) # Main Executable install( TARGETS desq-dock DESTINATION ${CMAKE_INSTALL_LIBDIR}/libexec/desq ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/dock.conf DESTINATION ${PKGCONFPATH} ) # Config file install( FILES DesQDock.conf DESTINATION ${APPCONFPATH} )