summaryrefslogtreecommitdiffstats
path: root/tools/assistant/CMakeLists.txt
blob: 8ce054e213c85e3e6ca480be297e225a61c0a77d (plain)
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

include_directories(
  ${CMAKE_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_SOURCE_DIR}/mkspecs/linux-g++-64
  ${CMAKE_BINARY_DIR}/include
  ${ZLIB_INCLUDE_DIRS}
)

link_directories()


##### subdirectories

tde_auto_add_subdirectories()


##### tqassistant (executable)

set( target tqassistant )

tde_add_executable( ${target}
  SOURCES
    main.cpp
    helpwindow.cpp
    topicchooserimpl.cpp
    docuparser.cpp
    helpdialogimpl.cpp
    settingsdialogimpl.cpp
    index.cpp
    profile.cpp
    config.cpp

    mainwindow.ui
    topicchooser.ui
    finddialog.ui
    helpdialog.ui
    settingsdialog.ui
    tabbedbrowser.ui

    embed_image_collection.cpp

  LINK
    tqt-mt-shared
    tqassistantclient-shared

  DESTINATION
    ${BIN_INSTALL_DIR}

  DEPENDENCIES
    tquic
)

set_property(
  TARGET ${target}
  APPEND PROPERTY COMPILE_DEFINITIONS
    QT_INTERNAL_NETWORK
    QT_INTERNAL_XML
)

tqt_automoc( ${target} )


##### embed images

file(
    GLOB ${target}_IMAGES
    RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/images/*.png
)
list( SORT ${target}_IMAGES )
add_custom_command( OUTPUT embed_image_collection.cpp
    COMMAND ${UIC_EXECUTABLE} -embed ${target} ${${target}_IMAGES}
      -o ${CMAKE_CURRENT_BINARY_DIR}/embed_image_collection.cpp
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
    DEPENDS tquic
    COMMENT "Embed images for ${target}"
)
add_custom_target( ${target}-embed-images
    COMMENT "Generate embed images for ${target}"
    DEPENDS ${CURRENT_CMAKE_BINARY_DIR}/embed_image_collection.cpp
)


##### other data

tde_create_translated_desktop(
  SOURCE ${target}.desktop
  DESTINATION ${QT_INSTALL_SHARE}/applications
)

if( BUILD_TRANSLATIONS )
  tqt_create_translation()
endif()

install(
  FILES images/appicon.png
  DESTINATION ${QT_INSTALL_SHARE}/pixmaps
  RENAME ${target}.png
)