blob: ae196dbc42fee7fcd07e7d37820c6372eb434bc2 (
plain) (
tree)
|
|
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
# Since some distro (debian) doesn't have a qt5 version of liblightdm-qt5, let's just ship it
OPTION(USE_INCLUDED_LDMQT "Use included liblightdm-qt" OFF)
PROJECT(qt-lightdm-greeter)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CONFIGURATION_TYPES Debug Release)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
message(STATUS "Build type is not set. Defaulting to ${CMAKE_BUILD_TYPE} build!")
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
file(GLOB SRCS src/*.cpp src/*.c)
file(GLOB UIS src/*.ui)
FIND_PACKAGE(Qt5 COMPONENTS Widgets X11Extras Svg Network WebKitWidgets REQUIRED)
FIND_PACKAGE(X11 REQUIRED)
IF(X11_Xscreensaver_FOUND)
ADD_DEFINITIONS(-DX11_Xscreensaver_FOUND)
ENDIF()
QT5_ADD_RESOURCES(RSCS qt-lightdm-greeter.qrc)
QT5_WRAP_UI(UI_HEADERS ${UIS})
# Some cmake versions can't understand the CMAKE_CXX_STANDARD option above?
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-multichar -Wno-error=deprecated-declarations" )
IF (USE_INCLUDED_LDMQT)
message( FATAL_ERROR "Using included liblightdm-qt is not implemented" )
SET( LIGHTDM_QT_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src/liblightdm-qt" )
SET( LIGHTDM_QT_LIBRARIES "" )
FILE(GLOB LQT_SRCS src/liblightdm-qt/*.cpp)
SET( SRCS ${SRCS} ${LQT_SRCS} )
# TODO
# pkg check modules liblightdm-gobject(-1)-dev
ELSE()
include(FindPkgConfig)
pkg_check_modules(LIGHTDM_QT liblightdm-qt5-3)
if (NOT LIGHTDM_QT_INCLUDE_DIRS)
MESSAGE( FATAL_ERROR "Cannot find liblightdm-qt" )
endif()
ENDIF()
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${LIGHTDM_QT_INCLUDE_DIRS}
)
add_executable ( qt-lightdm-greeter ${SRCS} ${RSCS} ${UI_HEADERS} )
target_link_libraries ( qt-lightdm-greeter
Qt5::Widgets
Qt5::X11Extras
Qt5::Svg
Qt5::Network
Qt5::WebKitWidgets
${LIGHTDM_QT_LIBRARIES}
${X11_LIBRARIES}
${X11_Xscreensaver_LIB}
)
install(TARGETS ${PROJECT} RUNTIME DESTINATION bin)
install(FILES qt-lightdm-greeter.desktop DESTINATION /usr/share/xgreeters)
if (NOT KEEP_CONFIGS)
install(FILES qt-lightdm-greeter.conf DESTINATION /etc/lightdm)
endif()
|