CMakeLists.txt 1.99 KB
Newer Older
1
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
2 3
project(lxqt-about)

4 5 6 7 8 9 10 11 12
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)

include(GNUInstallDirs)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

13
set(CPP_FILES
14 15 16
    aboutdialog/lxqtaboutdialog.cpp
    aboutdialog/technicalinfo.cpp
    translatorsinfo/translatorsinfo.cpp
17 18 19
    main.cpp
)

20 21 22 23
set(UI_FILES
    aboutdialog/lxqtaboutdialog.ui
)

24 25
find_package(lxqt REQUIRED QUIET)

26
include(LXQtCompilerSettings NO_POLICY_SCOPE)
27 28 29 30 31

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release)
endif()

32 33
# Translations **********************************
include(LXQtTranslate)
34

35 36 37 38 39 40 41 42 43 44 45
lxqt_translate_ts(QM_FILES
    UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS}
    SOURCES
        ${H_FILES}
        ${CPP_FILES}
        ${UI_FILES}
    INSTALL_DIR
        "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}"
)

lxqt_app_translation_loader(QM_LOADER ${PROJECT_NAME})
46 47 48 49 50 51 52

lxqt_translate_desktop(DESKTOP_FILES
    SOURCES
    resources/lxqt-about.desktop.in
)
#************************************************

53 54
include(translatorsinfo/CMakeLists.txt)
get_translatorsinfo_qrc(translatorsinfo_qrc)
55 56 57 58 59

add_executable(${PROJECT_NAME}
    ${CPP_FILES}
    ${QM_FILES}
    ${DESKTOP_FILES}
60 61 62
    ${translatorsinfo_qrc}
    ${QM_LOADER}

63 64 65
)

target_link_libraries(${PROJECT_NAME}
66
    lxqt
67 68
)

69 70 71 72 73 74 75 76 77 78
install(TARGETS
    ${PROJECT_NAME}
    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
    COMPONENT Runtime
)
install(FILES
    ${DESKTOP_FILES}
    DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
    COMPONENT Runtime
)
79 80 81 82 83 84 85 86 87 88

# building tarball with CPack -------------------------------------------------
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${LXQT_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${LXQT_PATCH_VERSION})
set(CPACK_GENERATOR TBZ2)
set(CPACK_SOURCE_GENERATOR TBZ2)
set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp)
include(CPack)