Warning, /frameworks/kcodecs/src/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 add_library(KF5Codecs) 0002 add_library(KF5::Codecs ALIAS KF5Codecs) 0003 0004 ecm_create_qm_loader(KF5Codecs kcodecs5_qt) 0005 0006 ecm_gperf_generate(kentities.gperf ${CMAKE_CURRENT_BINARY_DIR}/kentities.h KF5Codecs 0007 GENERATION_FLAGS "--key-positions=* -D -s 2") 0008 0009 # gperf < 3.1 always adds a "register" keyword to function arguments, 0010 # which itself is removed from C++17, 0011 # so sources including the generated header need to use C++14 only. 0012 # Only kcharsets.cpp is affected, but right now nothing else needs C++17, 0013 # so simply set standard for the while library 0014 # Current version of FindGperf in ECM does not support a version check yet, 0015 # so for now always lower to C++14. 0016 set_target_properties(KF5Codecs PROPERTIES CXX_STANDARD 14) 0017 0018 target_sources(KF5Codecs PRIVATE 0019 kcharsets.cpp 0020 kcharsets.h 0021 kcodecsbase45.cpp 0022 kcodecsbase64.cpp 0023 kcodecsbase64.h 0024 kcodecs.cpp 0025 kcodecs.h 0026 kcodecsidentity.cpp 0027 kcodecsidentity.h 0028 kcodecs_p.h 0029 kcodecsqp.cpp 0030 kcodecsqp.h 0031 kcodecsuuencode.cpp 0032 kcodecsuuencode.h 0033 kemailaddress.cpp 0034 kemailaddress.h 0035 kencodingprober.cpp 0036 kencodingprober.h 0037 kusasciitextcodec.cpp 0038 kusasciitextcodec.h 0039 probers/CharDistribution.cpp 0040 probers/CharDistribution.h 0041 probers/ChineseGroupProber.cpp 0042 probers/ChineseGroupProber.h 0043 probers/JapaneseGroupProber.cpp 0044 probers/JapaneseGroupProber.h 0045 probers/JpCntx.cpp 0046 probers/JpCntx.h 0047 probers/LangBulgarianModel.cpp 0048 probers/LangCyrillicModel.cpp 0049 probers/LangGreekModel.cpp 0050 probers/LangHebrewModel.cpp 0051 probers/LangHungarianModel.cpp 0052 probers/LangThaiModel.cpp 0053 probers/nsBig5Prober.cpp 0054 probers/nsBig5Prober.h 0055 probers/nsCharSetProber.cpp 0056 probers/nsCharSetProber.h 0057 probers/nsCodingStateMachine.h 0058 probers/nsEscCharsetProber.cpp 0059 probers/nsEscCharsetProber.h 0060 probers/nsEscSM.cpp 0061 probers/nsEUCJPProber.cpp 0062 probers/nsEUCJPProber.h 0063 probers/nsEUCKRProber.cpp 0064 probers/nsEUCKRProber.h 0065 probers/nsGB2312Prober.cpp 0066 probers/nsGB2312Prober.h 0067 probers/nsHebrewProber.cpp 0068 probers/nsHebrewProber.h 0069 probers/nsLatin1Prober.cpp 0070 probers/nsLatin1Prober.h 0071 probers/nsMBCSGroupProber.cpp 0072 probers/nsMBCSGroupProber.h 0073 probers/nsMBCSSM.cpp 0074 probers/nsPkgInt.h 0075 probers/nsSBCharSetProber.cpp 0076 probers/nsSBCharSetProber.h 0077 probers/nsSBCSGroupProber.cpp 0078 probers/nsSBCSGroupProber.h 0079 probers/nsSJISProber.cpp 0080 probers/nsSJISProber.h 0081 probers/nsUniversalDetector.cpp 0082 probers/nsUniversalDetector.h 0083 probers/UnicodeGroupProber.cpp 0084 probers/UnicodeGroupProber.h 0085 ) 0086 0087 ecm_qt_declare_logging_category(KF5Codecs 0088 HEADER kcodecs_debug.h 0089 IDENTIFIER KCODECS_LOG 0090 CATEGORY_NAME kf.codecs 0091 OLD_CATEGORY_NAMES kf5.kcodecs 0092 DESCRIPTION "KCodecs" 0093 EXPORT KCODECS 0094 ) 0095 0096 ecm_generate_export_header(KF5Codecs 0097 BASE_NAME KCodecs 0098 GROUP_BASE_NAME KF 0099 VERSION ${KF_VERSION} 0100 DEPRECATED_BASE_VERSION 0 0101 DEPRECATION_VERSIONS 5.5 5.56 5.101 0102 EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} 0103 ) 0104 0105 target_include_directories(KF5Codecs INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KCodecs>") 0106 0107 target_link_libraries(KF5Codecs PUBLIC Qt${QT_MAJOR_VERSION}::Core) 0108 if (TARGET Qt6::Core5Compat) 0109 target_link_libraries(KF5Codecs PUBLIC Qt6::Core5Compat) # QTextCodec 0110 endif() 0111 0112 set_target_properties(KF5Codecs PROPERTIES VERSION ${KCODECS_VERSION} 0113 SOVERSION ${KCODECS_SOVERSION} 0114 EXPORT_NAME Codecs 0115 ) 0116 0117 ecm_generate_headers(KCodecs_HEADERS 0118 HEADER_NAMES 0119 KCharsets 0120 KCodecs 0121 KEncodingProber 0122 KEmailAddress 0123 REQUIRED_HEADERS KCodecs_HEADERS 0124 ) 0125 0126 install(TARGETS KF5Codecs EXPORT KF5CodecsTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) 0127 0128 install(FILES 0129 ${CMAKE_CURRENT_BINARY_DIR}/kcodecs_export.h 0130 ${KCodecs_HEADERS} 0131 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KCodecs COMPONENT Devel 0132 ) 0133 0134 ecm_qt_install_logging_categories( 0135 EXPORT KCODECS 0136 FILE kcodecs.categories 0137 DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} 0138 ) 0139 0140 if(BUILD_QCH) 0141 ecm_add_qch( 0142 KF5Codecs_QCH 0143 NAME KCodecs 0144 BASE_NAME KF5Codecs 0145 VERSION ${KF_VERSION} 0146 ORG_DOMAIN org.kde 0147 SOURCES # using only public headers, to cover only public API 0148 ${KCodecs_HEADERS} 0149 MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md" 0150 LINK_QCHS 0151 Qt5Core_QCH 0152 INCLUDE_DIRS 0153 ${CMAKE_CURRENT_BINARY_DIR} 0154 BLANK_MACROS 0155 KCODECS_EXPORT 0156 KCODECS_DEPRECATED 0157 KCODECS_DEPRECATED_EXPORT 0158 "KCODECS_DEPRECATED_VERSION(x, y, t)" 0159 TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} 0160 QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} 0161 COMPONENT Devel 0162 ) 0163 endif() 0164 0165 include(ECMGeneratePriFile) 0166 ecm_generate_pri_file(BASE_NAME KCodecs LIB_NAME KF5Codecs DEPS "core" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KCodecs) 0167 install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})