CMakeLists.txt 4.25 KB
Newer Older
1 2
project( oktetagui )

3 4 5 6 7 8
ecm_setup_version( ${OKTETALIBS_LIB_VERSION}
    VARIABLE_PREFIX OKTETAGUI
    SOVERSION ${OKTETALIBS_LIB_SOVERSION}
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/OktetaGuiConfigVersion.cmake"
)

9 10
add_definitions(-DTRANSLATION_DOMAIN=\"liboktetagui\")

11
include_directories(
12
  libcolumnsview
13 14 15 16 17 18 19 20 21
)

set( libcontroller_SRCS
  controller/kchareditor.cpp
  controller/kcontroller.cpp
  controller/keditor.cpp
  controller/knavigator.cpp
  controller/ktabcontroller.cpp
  controller/kvalueeditor.cpp
22 23 24 25
  controller/abstractmousecontroller.cpp
  controller/mousenavigator.cpp
  controller/mousepaster.cpp
#   controller/dragger.cpp
26 27 28
  controller/abstractwheelcontroller.cpp
  controller/zoomwheelcontroller.cpp
  controller/dropper.cpp
29 30
)

31
set( libcolumnsview_SRCS
32
  libcolumnsview/abstractcolumnstylist.cpp
33
  libcolumnsview/abstractcolumnrenderer.cpp
34
  libcolumnsview/columnsview.cpp
35 36
)

37 38
ecm_generate_headers(libcolumnsview_CCHDRS
  HEADER_NAMES
39
    KAdds # TODO: this header needs to be redone
40 41 42 43 44 45
    AbstractColumnStylist
    AbstractColumnRenderer
    ColumnsView
  RELATIVE libcolumnsview
  PREFIX Okteta
  REQUIRED_HEADERS libcolumnsview_HDRS
46 47
)

48
set( libabstractbytearrayview_SRCS
49
  widgetcolumnstylist.cpp
50 51 52 53
  abstractbytearrayview_p.cpp
  abstractbytearrayview.cpp
)

54 55 56 57 58 59
set( bytearrayrowview_SRCS
  bytearrayrowcolumnrenderer.cpp
  bytearrayrowview_p.cpp
  bytearrayrowview.cpp
)

60 61 62 63 64
set( bytearraycolumnview_SRCS
  bytearraycolumnview_p.cpp
  bytearraycolumnview.cpp
)

65
set( oktetagui_LIB_SRCS
66
  ${libcolumnsview_SRCS}
67
  ${libcontroller_SRCS}
68
  ${libabstractbytearrayview_SRCS}
69 70 71 72 73
  bordercolumnrenderer.cpp
  offsetcolumnrenderer.cpp
  abstractbytearraycolumnrenderer.cpp
  valuebytearraycolumnrenderer.cpp
  charbytearraycolumnrenderer.cpp
74
  offsetformat.cpp
75
  bytearraytablecursor.cpp
76
  bytearraytablelayout.cpp
77
  bytearraytableranges.cpp
78
  kcursor.cpp
79
  coordrangelist.cpp
80
  ${bytearraycolumnview_SRCS}
81
  ${bytearrayrowview_SRCS}
82
  oktetagui.cpp
83
)
84

85 86
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/kcursor.cpp PROPERTIES LABELS OktetaLabel)

87 88
set( oktetagui_LIB_HDRS
  ${libcolumnsview_HDRS}
89
  ${CMAKE_CURRENT_BINARY_DIR}/oktetagui_export.h
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
)

set(oktetagui_LIB_CCHDRS
    ${libcolumnsview_CCHDRS}
)

ecm_generate_headers(oktetagui_LIB_CCHDRS
  HEADER_NAMES
    OktetaGui

    LinePosition
    Line
    LinePositionRange
    LineRange

    Coord
    CoordRange
    CoordRangeList
    Selection

    AbstractByteArrayColumnRenderer
    CharByteArrayColumnRenderer
    ValueByteArrayColumnRenderer
    ByteArrayRowColumnRenderer
    OffsetColumnRenderer
    BorderColumnRenderer

    AbstractByteArrayView
    ByteArrayColumnView

    OffsetFormat
    ByteArrayTableRanges
    ByteArrayRowView
    ByteArrayTableLayout
    WidgetColumnStylist
  PREFIX Okteta
  REQUIRED_HEADERS oktetagui_LIB_HDRS
127 128
)

129
add_library( OktetaGui  SHARED ${oktetagui_LIB_SRCS} )
130

131
generate_export_header( OktetaGui )
132

133
target_link_libraries( OktetaGui
134
PUBLIC
135
  OktetaCore
136
  Qt5::Widgets
137 138 139
PRIVATE
  KF5::I18n
  KF5::ConfigWidgets
140
)
141

142
target_include_directories(OktetaGui PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/okteta>")
143

144
set_target_properties( OktetaGui  PROPERTIES
145
  EXPORT_NAME "OktetaGui"
146
  OUTPUT_NAME okteta${OKTETALIBS_ABI_VERSION}gui
147 148
  VERSION     ${OKTETAGUI_VERSION}
  SOVERSION   ${OKTETAGUI_SOVERSION}
149
)
150

151
install( TARGETS OktetaGui  EXPORT OktetaGuiTargets ${INSTALL_TARGETS_DEFAULT_ARGS} )
152

153 154 155 156
install( FILES ${oktetagui_LIB_HDRS}
  DESTINATION ${OKTETALIBS_INCLUDE_INSTALL_DIR}
  COMPONENT Devel
)
157 158 159 160
install( FILES ${oktetagui_LIB_CCHDRS}
  DESTINATION ${OKTETALIBS_CCINCLUDE_INSTALL_DIR}
  COMPONENT Devel
)
161

162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/Okteta")

ecm_configure_package_config_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/OktetaGuiConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/OktetaGuiConfig.cmake"
  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)

install( FILES
    "${CMAKE_CURRENT_BINARY_DIR}/OktetaGuiConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/OktetaGuiConfigVersion.cmake"
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

178
install(EXPORT OktetaGuiTargets
179
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
180
  FILE OktetaGuiTargets.cmake
181 182
)

183

184
add_subdirectory( test )
185
#   add_library( testoktetacore STATIC ${oktetagui_LIB_SRCS} )
186