-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
89 lines (72 loc) · 2.36 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.5)
project(ru.bmstu.MobAdaptUi CXX)
find_package (Qt5 COMPONENTS Core Network Qml Gui Quick LinguistTools REQUIRED)
include(FindPkgConfig)
pkg_search_module(AURORA auroraapp REQUIRED)
pkg_search_module(AURORA auroraapp_i18n REQUIRED)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(short_name MobAdaptUi)
file(GLOB TsFiles "translations/*.ts")
qt5_add_translation(QmFiles ${TsFiles})
set(SOURCES
src/utilityservice.h
src/utilityservice.cpp
src/main.cpp
src/stringobject.h
src/stringobject.cpp
src/neuron.h
src/neuron.cpp
src/neural-net.h
src/neural-net.cpp
)
set(CMAKE_SKIP_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/lib")
add_executable(${PROJECT_NAME} ${SOURCES} ${QmFiles})
target_compile_definitions(${PROJECT_NAME} PRIVATE
$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>
)
target_include_directories(${PROJECT_NAME} PRIVATE
$<BUILD_INTERFACE:
${AURORA_INCLUDE_DIRS}
>)
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt5::Quick
${AURORA_LDFLAGS}
)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(DIRECTORY qml
DESTINATION share/${PROJECT_NAME}
)
foreach(_file IN LISTS QmFiles)
get_filename_component(_filename "${_file}" NAME)
string(REPLACE "${short_name}" "${PROJECT_NAME}" _full_filename "${_filename}")
install(FILES ${_file} DESTINATION share/${PROJECT_NAME}/translations RENAME ${_full_filename})
endforeach()
set(IconSize 86x86 108x108 128x128 172x172)
foreach(_size IN LISTS IconSize)
install(FILES icons/${_size}/${PROJECT_NAME}.png DESTINATION share/icons/hicolor/${_size}/apps)
endforeach()
install(FILES ${PROJECT_NAME}.desktop
DESTINATION share/applications
)
# Get the other files reachable from the project tree in Qt Creator
file(GLOB_RECURSE IconFiles "icons" "*.png")
set(RESOURCE_FILES ${IconFiles})
file(GLOB_RECURSE QmlFiles "qml/*.qml")
add_custom_target(distfiles
SOURCES
${PROJECT_NAME}.desktop
rpm/${PROJECT_NAME}.spec
rpm/${PROJECT_NAME}.changes.in
rpm/${PROJECT_NAME}.changes.run.in
${QmlFiles}
${TsFiles}
${IconFiles})
file(WRITE "${CMAKE_BINARY_DIR}/QtCreatorDeployment.txt"
"${CMAKE_INSTALL_PREFIX}
${CMAKE_BINARY_DIR}/${PROJECT_NAME}:bin
")