project( desq-panel ) cmake_minimum_required( VERSION 3.16 ) set( PROJECT_VERSION 1.0.0 ) set( PROJECT_VERSION_MAJOR 1 ) set( PROJECT_VERSION_MINOR 0 ) set( PROJECT_VERSION_PATCH 0 ) set( PROJECT_VERSION_MAJOR_MINOR ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} ) add_compile_definitions(VERSION_TEXT="${PROJECT_VERSION}") add_compile_definitions(LOGGING=3) set( CMAKE_CXX_STANDARD 17 ) set( CMAKE_INCLUDE_CURRENT_DIR ON ) set( CMAKE_BUILD_TYPE Release ) cmake_policy( SET CMP0071 NEW ) 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 ( Qt5Core REQUIRED ) find_package ( Qt5Gui REQUIRED ) find_package ( Qt5Widgets REQUIRED ) find_package ( Qt5DBus REQUIRED ) find_package ( dbusmenu-qt5 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} UI UI/Classic UI/Modern Widgets Widgets/Clock Widgets/Misc Widgets/Pager Widgets/TaskBar ) include_directories( SNI ) include_directories( ${dbusmenu-qt5_INCLUDE_DIRS} ) set( LIBRARIES dbusmenu-qt5 ) set( HDRS Global.hpp UI/AbstractPanel.hpp UI/Classic/ClassicPanel.hpp Widgets/Clock/Clock.hpp Widgets/Misc/ShowDesktop.hpp Widgets/Pager/dbustypes.hpp Widgets/Pager/PagerWidget.hpp Widgets/TaskBar/TaskBar.hpp Widgets/TaskBar/TaskButton.hpp ) set( SRCS Main.cpp UI/Classic/ClassicPanel.cpp Widgets/Clock/Clock.cpp Widgets/Misc/ShowDesktop.cpp Widgets/Pager/dbustypes.cpp Widgets/Pager/PagerWidget.cpp Widgets/TaskBar/TaskBar.cpp Widgets/TaskBar/TaskButton.cpp ) set( RSCS icons/icons.qrc ) add_executable( desq-panel ${SRCS} ${HDRS} ${RSCS} ) target_link_libraries( desq-panel Qt5::Core Qt5::Gui Qt5::GuiPrivate Qt5::Widgets Qt5::DBus dbusmenu-qt5 ${DESQ_UI_LIBRARIES} ${DESQ_WL_LIBRARIES} ) configure_file( panel.conf.in panel.conf @ONLY ) # Main Executable install( TARGETS desq-panel DESTINATION ${CMAKE_INSTALL_LIBDIR}/libexec/desq ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/panel.conf DESTINATION ${PKGCONFPATH} ) install( FILES DesQPanel.conf DESTINATION ${APPCONFPATH} )