CMakeLists.txt 1.76 KB
Newer Older
aliorhun's avatar
aliorhun committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
set(PROJECT hvl-lightdm-greeter)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(LIGHTDM_QT_LIBRARIES /usr/lib/x86_64-linux-gnu/liblightdm-qt5-3.so)
set(LIGHTDM_QT_INCLUDE_DIRS /usr/include/lightdm-qt5-3)
set(LIGHTDM_X11_LIBRARIES /usr/lib/x86_64-linux-gnu/libX11.so)
set(LIGHTDM_X11_EXTRA_LIBRARIES /usr/lib/x86_64-linux-gnu/libQt5X11Extras.so)
set(LIGHTDM_XCURSOR_LIBRARIES /usr/lib/x86_64-linux-gnu/libXcursor.so /usr/lib/x86_64-linux-gnu/libXrandr.so)




file(GLOB SRCS *.cpp *ui *moc)
message(STATUS "SRCS ${SRCS}")

find_package (Threads REQUIRED)

find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5WebEngine REQUIRED)
find_package(Qt5WebEngineCore REQUIRED)
find_package(Qt5WebEngineWidgets REQUIRED)
find_package(Qt5LinguistTools)
find_package(Qt5X11Extras REQUIRED)

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)


add_definitions(-DUNIX)
add_definitions(-D_LIB)
add_definitions(-DNDEBUG)

QT5_ADD_RESOURCES(RSCS hvl-lightdm-greeter.qrc)

include(FindPkgConfig)
pkg_check_modules(LIGHTDM_QT liblightdm-qt5-3)

include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}
                      ${CMAKE_CURRENT_BINARY_DIR}
                      ${LIGHTDM_QT_INCLUDE_DIRS}

)



file(GLOB TS_FILES ../languages/*.ts)

qt5_add_translation(QM_FILES ${TS_FILES})

add_custom_target(translations DEPENDS ${QM_FILES})


add_executable (hvl-lightdm-greeter ${SRCS} ${RSCS} ${QM_FILES})

target_link_libraries ( hvl-lightdm-greeter Qt5::Widgets Qt5::Network Qt5::WebEngine Qt5::WebEngineCore Qt5::Quick Qt5::WebEngineWidgets ${LIGHTDM_QT_LIBRARIES} ${LIGHTDM_X11_LIBRARIES} ${LIGHTDM_X11_EXTRA_LIBRARIES} ${LIGHTDM_XCURSOR_LIBRARIES})


install(TARGETS ${PROJECT} RUNTIME DESTINATION bin)
install(FILES ${QM_FILES} DESTINATION /usr/share/lightdm/lightdm-hvl-greeter.conf.d/lang)