summaryrefslogtreecommitdiffstats
path: root/kmymoney2/CMakeLists.txt
blob: 16173e2cdcfaedb9b1f315ab4b9794f5865ef2d2 (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
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

add_subdirectory( mymoney )
add_subdirectory( widgets )
add_subdirectory( dialogs )
add_subdirectory( wizards )
add_subdirectory( views )
add_subdirectory( converter )
add_subdirectory( pics )
add_subdirectory( icons )
add_subdirectory( html )
add_subdirectory( plugins )
add_subdirectory( reports )
add_subdirectory( misc )


include_directories(
  ${CMAKE_BINARY_DIR}
  ${CMAKE_SOURCE_DIR}
  ${CMAKE_BINARY_DIR}/include
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}/dialogs
  ${CMAKE_SOURCE_DIR}/libkdchart
  ${TDE_INCLUDE_DIR}
  ${TQT_INCLUDE_DIRS}
)

link_directories(
  ${TQT_LIBRARY_DIRS}
)


##### kmymoneysettings (static)

tde_add_library( kmymoneysettings STATIC_PIC AUTOMOC
  SOURCES
    kmymoneysettings.kcfgc
    kmymoneyglobalsettings.cpp
    kmymoneyutils.cpp

  LINK
    dialogs-static

  DEPENDENCIES
    kmm-includes
)


##### kmymoney2 (executable) ####################

tde_add_executable( kmymoney2 AUTOMOC
  SOURCES
    kstartuplogo.cpp
    kmymoney2.cpp
    main.cpp
    kmymoney2.stub
    kmymoney2.skel

  LINK
    kmymoneysettings-static kgpgfile-static
    settings-static views-static interfaces-static
    newaccountwizard-static newuserwizard-static wizardpages-static
    kmm_mymoney-shared kmm_plugin-shared kmm_kdchart-shared
    tdecore-shared tdeui-shared tdeio-shared tdehtml-shared tdeabc-shared

  DESTINATION ${BIN_INSTALL_DIR}
)

add_custom_command(
  OUTPUT kmymoney
  COMMENT "Creating kmymoney symlink"
  COMMAND ln -s kmymoney2 kmymoney
  DEPENDS kmymoney2
)
add_custom_target( kmymoney-symlink ALL
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/kmymoney
)

install(
  FILES ${CMAKE_CURRENT_BINARY_DIR}/kmymoney
  DESTINATION ${BIN_INSTALL_DIR}
)


##### kmymoneytest (test) #######################

tde_add_check_executable( kmymoneytest AUTOMOC
  SOURCES
    kmymoneytest.cpp

  LINK
    kmymoneysettings-static
    convertertest-static
    mymoneytest-static
    reportstest-static
    storagetest-static
    kmm_mymoney-shared
    tdeio-shared
    ${CPPUNIT_LIBRARY}
)


##### other data

tde_install_icons()

file( GLOB mimetype_icons RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} mimetype*.png )
list( SORT mimetype_icons )
foreach( mimetype_icon IN LISTS mimetype_icons )
  string( REGEX MATCH "^([0-9a-zA-Z]+)_([a-z]+)_(.*)\\.png$" _dummy "${mimetype_icon}" )
  set( _type  "${CMAKE_MATCH_1}" )
  set( _name  "${CMAKE_MATCH_2}" )
  set( _size  "${CMAKE_MATCH_3}" )
  install(
    FILES ${mimetype_icon}
    DESTINATION ${ICON_INSTALL_DIR}/hicolor/${_size}/mimetypes RENAME ${_name}.png
  )
endforeach()

tde_create_translated_desktop( kmymoney2.desktop )

tde_create_translated_desktop(
  SOURCE x-kmymoney2.desktop
  DESTINATION ${MIME_INSTALL_DIR}/application
)

install(
  FILES kmymoney2ui.rc tips
  DESTINATION ${DATA_INSTALL_DIR}/kmymoney2
)

install(
  FILES kmymoney2.kcfg
  DESTINATION ${KCFG_INSTALL_DIR}
)

install(
  DIRECTORY templates/
  DESTINATION ${DATA_INSTALL_DIR}/kmymoney2/templates
  PATTERN "Makefile.am" EXCLUDE
)

kmm_install_includes(
  FILES
    export.h
    kmymoneyutils.h
    kmymoneyglobalsettings.h
    ${CMAKE_CURRENT_BINARY_DIR}/kmymoneysettings.h
  DESTINATION ${INCLUDE_INSTALL_DIR}/kmymoney
)