Warning, /libraries/ktextaddons/textcustomeditor/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0002 # SPDX-License-Identifier: BSD-3-Clause
0003 add_definitions(-DTRANSLATION_DOMAIN=\"libtextcustomeditor\")
0004
0005 if(TARGET Qt${QT_MAJOR_VERSION}::TextToSpeech)
0006 set(HAVE_KTEXTADDONS_TEXT_TO_SPEECH_SUPPORT TRUE)
0007 endif()
0008
0009 configure_file(config-textcustomeditor.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-textcustomeditor.h)
0010
0011 ########### CMake Config Files ###########
0012 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF${KF_MAJOR_VERSION}TextCustomEditor")
0013
0014 ecm_setup_version(PROJECT VARIABLE_PREFIX TEXTCUSTOMEDITOR
0015 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/textcustomeditor_version.h"
0016 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF${KF_MAJOR_VERSION}TextCustomEditorConfigVersion.cmake"
0017 SOVERSION 1
0018 )
0019
0020 add_library(KF${KF_MAJOR_VERSION}TextCustomEditor)
0021 add_library(KF${KF_MAJOR_VERSION}::TextCustomEditor ALIAS KF${KF_MAJOR_VERSION}TextCustomEditor)
0022
0023 target_sources(KF${KF_MAJOR_VERSION}TextCustomEditor PRIVATE
0024 plaintexteditor/plaintexteditfindbar.cpp
0025 plaintexteditor/plaintexteditor.cpp
0026 plaintexteditor/plaintexteditorwidget.cpp
0027 plaintexteditor/plaintextsyntaxspellcheckinghighlighter.cpp
0028 widgets/findutils.cpp
0029 widgets/textfindreplacewidget.cpp
0030 widgets/texteditfindbarbase.cpp
0031 widgets/textgotolinewidget.cpp
0032 widgets/textmessageindicator.cpp
0033 richtexteditor/richtexteditor.cpp
0034 richtexteditor/richtexteditfindbar.cpp
0035 richtexteditor/richtexteditorwidget.cpp
0036 plaintexteditor/plaintexteditfindbar.h
0037 plaintexteditor/plaintexteditor.h
0038 plaintexteditor/plaintexteditorwidget.h
0039 plaintexteditor/plaintextsyntaxspellcheckinghighlighter.h
0040 widgets/findutils.h
0041 widgets/textfindreplacewidget.h
0042 widgets/texteditfindbarbase.h
0043 widgets/textgotolinewidget.h
0044 widgets/textmessageindicator.h
0045 richtexteditor/richtexteditor.h
0046 richtexteditor/richtexteditfindbar.h
0047 richtexteditor/richtexteditorwidget.h
0048
0049 richtextbrowser/richtextbrowser.cpp
0050 richtextbrowser/richtextbrowser.h
0051 richtextbrowser/richtextbrowserwidget.cpp
0052 richtextbrowser/richtextbrowserwidget.h
0053 richtextbrowser/richtextbrowserfindbar.cpp
0054 richtextbrowser/richtextbrowserfindbar.h
0055
0056 core/texteditorcompleter.h
0057 core/texteditorcompleter.cpp
0058 )
0059
0060 target_link_libraries(KF${KF_MAJOR_VERSION}TextCustomEditor
0061 PRIVATE
0062 KF${KF_MAJOR_VERSION}::ConfigWidgets
0063 KF${KF_MAJOR_VERSION}::SonnetUi
0064 KF${KF_MAJOR_VERSION}::SonnetCore
0065 KF${KF_MAJOR_VERSION}::WidgetsAddons
0066 KF${KF_MAJOR_VERSION}::KIOWidgets
0067 KF${KF_MAJOR_VERSION}::I18n
0068 KF${KF_MAJOR_VERSION}::SyntaxHighlighting
0069 KF${KF_MAJOR_VERSION}::TextUtils
0070 KF${KF_MAJOR_VERSION}::TextEmoticonsWidgets
0071 KF${KF_MAJOR_VERSION}::TextAddonsWidgets
0072 )
0073
0074 if (TARGET Qt${QT_MAJOR_VERSION}::TextToSpeech)
0075 target_link_libraries(KF${KF_MAJOR_VERSION}TextCustomEditor PRIVATE KF${KF_MAJOR_VERSION}TextEditTextToSpeech
0076 )
0077 endif()
0078
0079 ecm_qt_declare_logging_category(KF${KF_MAJOR_VERSION}TextCustomEditor HEADER textcustomeditor_debug.h
0080 IDENTIFIER TEXTCUSTOMEDITOR_LOG
0081 CATEGORY_NAME org.kde.kf.textcustomeditor
0082 OLD_CATEGORY_NAMES org.kde.kf${KF_MAJOR_VERSION}.textcustomeditor
0083 DESCRIPTION "KF${KF_MAJOR_VERSION} (textcustomeditor)" EXPORT KTEXTADDONS)
0084
0085 if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
0086 set_target_properties(KF${KF_MAJOR_VERSION}TextCustomEditor PROPERTIES UNITY_BUILD ON)
0087 endif()
0088 generate_export_header(KF${KF_MAJOR_VERSION}TextCustomEditor BASE_NAME TextCustomEditor)
0089
0090 target_include_directories(KF${KF_MAJOR_VERSION}TextCustomEditor INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/TextCustomEditor;>")
0091
0092
0093 set_target_properties(KF${KF_MAJOR_VERSION}TextCustomEditor PROPERTIES
0094 VERSION ${TEXTCUSTOMEDITOR_VERSION}
0095 SOVERSION ${TEXTCUSTOMEDITOR_SOVERSION}
0096 EXPORT_NAME TextCustomEditor
0097 )
0098
0099 install(TARGETS KF${KF_MAJOR_VERSION}TextCustomEditor EXPORT KF${KF_MAJOR_VERSION}TextCustomEditorTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0100
0101 ecm_generate_headers(TextCustomEditor_CamelCasetextrichtexteditor_HEADERS
0102 HEADER_NAMES
0103 RichTextEditorWidget
0104 RichTextEditor
0105 RichTextEditFindBar
0106 REQUIRED_HEADERS TextCustomEditor_richtexteditor_HEADERS
0107 PREFIX TextCustomEditor
0108 RELATIVE richtexteditor
0109 )
0110
0111 ecm_generate_headers(TextCustomEditor_CamelCaserichtextbrowser_HEADERS
0112 HEADER_NAMES
0113 RichTextBrowserWidget
0114 RichTextBrowser
0115 RichTextBrowserFindBar
0116 REQUIRED_HEADERS TextCustomEditor_richtextbrowser_HEADERS
0117 PREFIX TextCustomEditor
0118 RELATIVE richtextbrowser
0119 )
0120
0121 ecm_generate_headers(TextCustomEditor_CamelCaseplaintexteditor_HEADERS
0122 HEADER_NAMES
0123 PlainTextEditor
0124 PlainTextEditorWidget
0125 PlainTextEditFindBar
0126 PlainTextSyntaxSpellCheckingHighlighter
0127 REQUIRED_HEADERS TextCustomEditor_plaintexteditor_HEADERS
0128 PREFIX TextCustomEditor
0129 RELATIVE plaintexteditor
0130 )
0131
0132 ecm_generate_headers(TextCustomEditor_CamelCasetexteditor_widgets_HEADERS
0133 HEADER_NAMES
0134 TextGotoLineWidget
0135 TextEditFindBarBase
0136 REQUIRED_HEADERS TextCustomEditor_texteditor_widgets_HEADERS
0137 PREFIX TextCustomEditor
0138 RELATIVE widgets
0139 )
0140
0141 ecm_generate_headers(TextCustomEditor_CamelCasetexteditor_core_HEADERS
0142 HEADER_NAMES
0143 TextEditorCompleter
0144 REQUIRED_HEADERS TextCustomEditor_texteditor_core_HEADERS
0145 PREFIX TextCustomEditor
0146 RELATIVE core
0147 )
0148
0149 install(FILES
0150 ${TextCustomEditor_texteditor_core_HEADERS}
0151 ${TextCustomEditor_richtexteditor_HEADERS}
0152 ${TextCustomEditor_texteditor_widgets_HEADERS}
0153 ${TextCustomEditor_plaintexteditor_HEADERS}
0154 ${TextCustomEditor_richtextbrowser_HEADERS}
0155 ${CMAKE_CURRENT_BINARY_DIR}/textcustomeditor_export.h
0156 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/TextCustomEditor/textcustomeditor
0157 COMPONENT Devel
0158 )
0159 install(FILES
0160 ${TextCustomEditor_CamelCasetexteditor_core_HEADERS}
0161 ${TextCustomEditor_CamelCasetextrichtexteditor_HEADERS}
0162 ${TextCustomEditor_CamelCaseplaintexteditor_HEADERS}
0163 ${TextCustomEditor_CamelCasetexteditor_widgets_HEADERS}
0164 ${TextCustomEditor_CamelCaserichtextbrowser_HEADERS}
0165 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/TextCustomEditor/TextCustomEditor/
0166 COMPONENT Devel
0167 )
0168
0169
0170 install(FILES
0171 "${CMAKE_CURRENT_BINARY_DIR}/KF${KF_MAJOR_VERSION}TextCustomEditorConfig.cmake"
0172 "${CMAKE_CURRENT_BINARY_DIR}/KF${KF_MAJOR_VERSION}TextCustomEditorConfigVersion.cmake"
0173 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0174 COMPONENT Devel
0175 )
0176
0177 install(EXPORT KF${KF_MAJOR_VERSION}TextCustomEditorTargets
0178 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0179 FILE KF${KF_MAJOR_VERSION}TextCustomEditorTargets.cmake
0180 NAMESPACE KF${KF_MAJOR_VERSION}::
0181 )
0182
0183 install(FILES
0184 ${CMAKE_CURRENT_BINARY_DIR}/textcustomeditor_version.h
0185 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/TextCustomEditor
0186 COMPONENT Devel
0187 )
0188
0189
0190 if (BUILD_QCH)
0191 ecm_add_qch(
0192 KF${KF_MAJOR_VERSION}TextCustomEditor_QCH
0193 NAME KF${KF_MAJOR_VERSION}TextCustomEditor
0194 BASE_NAME KF${KF_MAJOR_VERSION}TextCustomEditor
0195 VERSION ${TEXTCUSTOMEDITOR_VERSION}
0196 ORG_DOMAIN org.kde
0197 SOURCES # using only public headers, to cover only public API
0198 ${TextCustomEditor_richtexteditor_HEADERS}
0199 ${TextCustomEditor_texteditor_widgets_HEADERS}
0200 ${TextCustomEditor_plaintexteditor_HEADERS}
0201 ${TextCustomEditor_texteditor_core_HEADERS}
0202 ${TextCustomEditor_richtextbrowser_HEADERS}
0203 LINK_QCHS
0204 Qt${QT_MAJOR_VERSION}Core_QCH
0205 INCLUDE_DIRS
0206 ${CMAKE_CURRENT_BINARY_DIR}
0207 BLANK_MACROS
0208 TEXTCUSTOMEDITOR_EXPORT
0209 TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0210 QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0211 COMPONENT Devel
0212 )
0213 endif()
0214
0215 if (BUILD_QCH)
0216 ecm_install_qch_export(
0217 TARGETS KF${KF_MAJOR_VERSION}TextCustomEditor_QCH
0218 FILE KF${KF_MAJOR_VERSION}TextCustomEditorQchTargets.cmake
0219 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0220 COMPONENT Devel
0221 )
0222 set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF${KF_MAJOR_VERSION}TextCustomEditorQchTargets.cmake\")")
0223 endif()
0224
0225 configure_package_config_file(
0226 "${CMAKE_CURRENT_SOURCE_DIR}/KFTextCustomEditorConfig.cmake.in"
0227 "${CMAKE_CURRENT_BINARY_DIR}/KF${KF_MAJOR_VERSION}TextCustomEditorConfig.cmake"
0228 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0229 )
0230
0231 if (BUILD_TESTING)
0232 add_subdirectory(plaintexteditor/autotests)
0233 add_subdirectory(richtexteditor/autotests)
0234 add_subdirectory(richtextbrowser/autotests)
0235 add_subdirectory(widgets/autotests)
0236 add_subdirectory(plaintexteditor/tests)
0237 add_subdirectory(richtexteditor/tests)
0238 add_subdirectory(richtextbrowser/tests)
0239 endif()
0240
0241 if(BUILD_DESIGNERPLUGIN)
0242 add_subdirectory(designer)
0243 endif()
0244