File: CMakeLists.txt

package info (click to toggle)
lxqt-runner 0.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 528 kB
  • ctags: 251
  • sloc: cpp: 1,888; makefile: 10
file content (150 lines) | stat: -rw-r--r-- 3,642 bytes parent folder | download
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)

project(lxqt-runner)

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

set(REQUIRED_MENUCACHE_VERSION "0.3.3")

include(CMakeDependentOption)
include(GNUInstallDirs)

option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
option(USE_MENU_CACHE "Use libmenu-cache from LXDE to generate the app menu" ON)
option(RUNNER_MATH "Math operations support" ON)
option(RUNNER_VBOX "Virtual Box support" ON)
cmake_dependent_option(RUNNER_VBOX_HEADLESS
    "Use headless mode instead of default window" OFF
    "RUNNER_VBOX" OFF
)

find_package(KF5WindowSystem REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5LinguistTools REQUIRED QUIET)
find_package(lxqt REQUIRED)
find_package(lxqt-globalkeys REQUIRED)
find_package(lxqt-globalkeys-ui REQUIRED)
message(STATUS "Building with Qt${Qt5Core_VERSION_STRING}")

include(LXQtCompilerSettings NO_POLICY_SCOPE)

set(QTX_LIBRARIES Qt5::Widgets Qt5::Xml)

if (USE_MENU_CACHE OR RUNNER_MATH)
    find_package(PkgConfig REQUIRED QUIET)
endif ()

if (USE_MENU_CACHE)
    # optionally use libmenu-cache from lxde to generate the application menu
    find_package(MenuCache "${REQUIRED_MENUCACHE_VERSION}" REQUIRED)
endif()

if (RUNNER_MATH)
    pkg_check_modules(MUPARSER REQUIRED QUIET muparser)
endif ()

set(lxqt-runner_H_FILES
    dialog.h
    commanditemmodel.h
    widgets.h
    providers.h
    yamlparser.h
    configuredialog/configuredialog.h
)

set(lxqt-runner_CPP_FILES
    main.cpp
    dialog.cpp
    commanditemmodel.cpp
    widgets.cpp
    providers.cpp
    yamlparser.cpp
    configuredialog/configuredialog.cpp
)

set(lxqt-runner_UI_FILES
    dialog.ui
    configuredialog/configuredialog.ui
)

set(QRC_FILES

)

set(lxqt-runner_LIBRARIES
    lxqt
    lxqt-globalkeys
    lxqt-globalkeys-ui
    ${MENUCACHE_LIBRARIES}
    ${QTX_LIBRARIES}
    ${MUPARSER_LDFLAGS}
)

include(LXQtTranslate)

lxqt_translate_ts(lxqt-runner_QM_FILES
    UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS}
    SOURCES
        ${lxqt-runner_H_FILES}
        ${lxqt-runner_CPP_FILES}
        ${lxqt-runner_UI_FILES}
    INSTALL_DIR
        "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}"
    PULL_TRANSLATIONS
        ${PULL_TRANSLATIONS}
    CLEAN_TRANSLATIONS
        ${CLEAN_TRANSLATIONS}
    TRANSLATIONS_REPO
        ${TRANSLATIONS_REPO}
    TRANSLATIONS_REFSPEC
        ${TRANSLATIONS_REFSPEC}
)

lxqt_app_translation_loader(lxqt-runner_QM_LOADER ${PROJECT_NAME})

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

if (RUNNER_VBOX)
    list(APPEND QRC_FILES virtualbox-icons.qrc)
endif()

add_executable(${PROJECT_NAME}
    ${lxqt-runner_CPP_FILES}
    ${lxqt-runner_QRC_SOURCES}
    ${lxqt-runner_QM_FILES}
    ${lxqt-runner_QM_LOADER}
)

if (RUNNER_MATH)
    lxqt_enable_target_exceptions("${PROJECT_NAME}" PRIVATE)
endif ()

target_include_directories(${PROJECT_NAME}
    PRIVATE "$<$<BOOL:${MENUCACHE_FOUND}>:${MENUCACHE_INCLUDE_DIRS}>"
    PRIVATE "$<$<BOOL:${MUPARSER_FOUND}>:${MUPARSER_INCLUDE_DIRS}>"
)

target_compile_definitions(${PROJECT_NAME}
    PRIVATE "$<$<BOOL:${RUNNER_MATH}>:MATH_ENABLED>"
    PRIVATE "$<$<BOOL:${RUNNER_VBOX}>:VBOX_ENABLED>"
    PRIVATE "$<$<BOOL:${RUNNER_VBOX_HEADLESS}>:VBOX_HEADLESS_ENABLED>"
    PRIVATE "$<$<BOOL:${MENUCACHE_FOUND}>:HAVE_MENU_CACHE=1>"
)

target_link_libraries(${PROJECT_NAME}
    ${lxqt-runner_LIBRARIES}
    KF5::WindowSystem
)

install(TARGETS
    ${PROJECT_NAME}
    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
    COMPONENT Runtime
)