Warning, /office/alkimia/src/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 include(GenerateExportHeader) 0002 include(ECMGenerateHeaders) 0003 include(CMakePackageConfigHelpers) 0004 include(ECMSetupVersion) 0005 0006 include_directories( 0007 ${CMAKE_CURRENT_BINARY_DIR} 0008 ) 0009 0010 ########### target alkimia-internal ########### 0011 0012 set(alkimia_INTERNAL_SRCS 0013 alkapplication.cpp 0014 alkdateformat.cpp 0015 alkexception.cpp 0016 alknewstuffwidget.cpp 0017 alkonlinequoteprocess.cpp 0018 alkquoteitem.cpp 0019 alkquotereceiver.cpp 0020 ) 0021 0022 set(alkimia_INTERNAL_HEADERS 0023 alkapplication.h 0024 alkdateformat.h 0025 alkexception.h 0026 alknewstuffwidget.h 0027 alkonlinequoteprocess.h 0028 alkquoteitem.h 0029 alkquotereceiver.h 0030 ) 0031 0032 set(alkimia_INTERNAL_UI 0033 ) 0034 0035 ki18n_wrap_ui(alkimia_INTERNAL_SRCS ${alkimia_INTERNAL_UI} ) 0036 add_library(alkimia-internal STATIC ${alkimia_INTERNAL_SRCS} ${alkimia_INTERNAL_HEADERS}) 0037 if (QT_MAJOR_VERSION GREATER_EQUAL 5) 0038 list(APPEND ALKIMIA_INTERNAL_LIBS 0039 PRIVATE 0040 Qt${QT_MAJOR_VERSION}::DBus 0041 KF${QT_MAJOR_VERSION}::Completion 0042 KF${QT_MAJOR_VERSION}::CoreAddons 0043 KF${QT_MAJOR_VERSION}::I18n 0044 ) 0045 endif() 0046 0047 target_link_libraries(alkimia-internal PRIVATE 0048 ${ALKIMIA_INTERNAL_LIBS} 0049 ${KF_NEWSTUFF_LIB} 0050 ) 0051 kde_target_enable_exceptions(alkimia-internal PUBLIC) 0052 0053 ########### target alkimia ########### 0054 0055 set(ALKIMIA_LIB_VERSION ${alkimia_VERSION}) 0056 set(ALKIMIA_LIB_SOVERSION "${alkimia_VERSION_MAJOR}") 0057 0058 set(alkimia_LIB_SRCS 0059 alkcompany.cpp 0060 alkenvironment.cpp 0061 alknewstuffengine.cpp 0062 alknewstuffstore.cpp 0063 alknewstuffwidget.cpp 0064 alkonlinequote.cpp 0065 alkonlinequote_p.cpp 0066 alkonlinequotesource.cpp 0067 alkonlinequotesprofile.cpp 0068 alkonlinequotesprofile_p.cpp 0069 alkonlinequotesprofilemanager.cpp 0070 alkonlinequoteswidget.cpp 0071 alkonlinequoteuploaddialog.cpp 0072 alkvalue.cpp 0073 alkutils.cpp 0074 alkwebpage.cpp 0075 ) 0076 0077 set(alkimia_LIB_HEADERS 0078 alkcompany.h 0079 alkenvironment.h 0080 alknewstuffengine.h 0081 alknewstuffstore.h 0082 alkonlinequote.h 0083 alkonlinequotesource.h 0084 alkonlinequotesprofile.h 0085 alkonlinequotesprofilemanager.h 0086 alkonlinequoteswidget.h 0087 alkwebpage.h 0088 ) 0089 0090 set(alkimia_LIB_PRIVATE_HEADERS 0091 alkonlinequote_p.h 0092 alkonlinequotesource_p.h 0093 alkonlinequotesprofile_p.h 0094 alkonlinequoteuploaddialog.h 0095 alkpushbutton.h 0096 alkutils.h 0097 ) 0098 0099 if(ENABLE_FINANCEQUOTE) 0100 list(APPEND alkimia_LIB_SRCS alkfinancequoteprocess.cpp) 0101 list(APPEND alkimia_LIB_HEADERS alkfinancequoteprocess.h) 0102 endif() 0103 0104 set(alkimia_UI 0105 alkonlinequotedetails.ui 0106 alkonlinequotes.ui 0107 alkonlinequotesdebug.ui 0108 alkonlinequotesprofiledetails.ui 0109 alkonlinequotesprofiles.ui 0110 alkonlinequoteuploaddialog.ui 0111 ) 0112 0113 configure_file( 0114 ${CMAKE_CURRENT_SOURCE_DIR}/alkversion.h.in 0115 ${CMAKE_CURRENT_BINARY_DIR}/alkimia/alkversion.h 0116 IMMEDIATE 0117 ) 0118 0119 configure_file( 0120 ${CMAKE_CURRENT_SOURCE_DIR}/alkvalue.h.in 0121 ${CMAKE_CURRENT_BINARY_DIR}/alkimia/alkvalue.h 0122 IMMEDIATE 0123 ) 0124 0125 foreach(header ${alkimia_LIB_HEADERS}) 0126 configure_file( 0127 ${CMAKE_CURRENT_SOURCE_DIR}/${header} 0128 ${CMAKE_CURRENT_BINARY_DIR}/alkimia/${header} 0129 COPYONLY 0130 ) 0131 endforeach() 0132 0133 ki18n_wrap_ui(alkimia_LIB_SRCS ${alkimia_UI} ) 0134 add_library(alkimia ${alkimia_LIB_SRCS} ${alkimia_LIB_HEADERS} ${alkimia_LIB_PRIVATE_HEADERS}) 0135 0136 kde_target_enable_exceptions(alkimia PUBLIC) 0137 target_link_libraries(alkimia PRIVATE 0138 ${QT_NETWORK_LIB} 0139 ${KF_NETWORK_LIB} 0140 ${KF_NEWSTUFF_LIB} 0141 KF${QT_MAJOR_VERSION}::Completion 0142 KF${QT_MAJOR_VERSION}::I18n 0143 KF${QT_MAJOR_VERSION}::IconThemes 0144 KF${QT_MAJOR_VERSION}::TextWidgets 0145 PUBLIC 0146 KF${QT_MAJOR_VERSION}::ConfigCore 0147 ) 0148 0149 add_definitions(-DTRANSLATION_DOMAIN=\"alkimia\") 0150 0151 target_include_directories(alkimia 0152 INTERFACE 0153 ${MP_INCLUDE_DIR} 0154 $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}/alkimia/${ALKIMIA_INCLUDE_SUFFIX}> 0155 ) 0156 0157 target_link_libraries(alkimia 0158 PRIVATE 0159 alkimia-internal 0160 Qt${QT_MAJOR_VERSION}::Core 0161 PUBLIC 0162 ${MP_LIBRARIES} 0163 ${QT_BROWSER_LIB} 0164 ) 0165 0166 if(QT_MAJOR_VERSION GREATER_EQUAL 5 AND MSVC AND BUILD_WITH_WEBKIT) 0167 message(WARNING "Applying fix for broken Qt WebKit package (see https://phabricator.kde.org/T10146 for details)") 0168 target_link_libraries(alkimia 0169 PRIVATE 0170 Qt${QT_MAJOR_VERSION}::Test 0171 ) 0172 endif() 0173 0174 if (NOT INCLUDE_INSTALL_DIR) 0175 set(INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR}) 0176 endif() 0177 install( 0178 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/alkimia 0179 DESTINATION ${INCLUDE_INSTALL_DIR}/alkimia/${ALKIMIA_INCLUDE_SUFFIX} 0180 COMPONENT Devel 0181 ) 0182 0183 generate_export_header(alkimia BASE_NAME alk EXPORT_FILE_NAME alkimia/alk_export.h) 0184 0185 if(BUILD_SHARED_LIBS) 0186 if(WIN32) 0187 set_target_properties(alkimia PROPERTIES SUFFIX "-${ALKIMIA_LIB_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") 0188 else() 0189 set_target_properties(alkimia PROPERTIES VERSION ${ALKIMIA_LIB_VERSION} SOVERSION ${ALKIMIA_LIB_SOVERSION}) 0190 endif() 0191 endif() 0192 set_target_properties(alkimia PROPERTIES OUTPUT_NAME alkimia${ALKIMIA_LIB_SUFFIX}) 0193 set(INCLUDE_INSTALL_DIR include/alkimia/${ALKIMIA_INCLUDE_SUFFIX}) 0194 0195 if(BUILD_SHARED_LIBS) 0196 set(alkimia_export_targets alkimia) 0197 else() 0198 set(alkimia_export_targets alkimia alkimia-internal) 0199 endif() 0200 0201 install(TARGETS ${alkimia_export_targets} 0202 EXPORT alkimiaTargets 0203 ${INSTALL_TARGETS_DEFAULT_ARGS} 0204 ) 0205 0206 if(QT_MAJOR_VERSION LESS 5) 0207 if(WIN32) 0208 set(KDE_INSTALL_KNSRCDIR ${SHARE_INSTALL_DIR}/config) 0209 else() 0210 set(KDE_INSTALL_KNSRCDIR ${SHARE_INSTALL_DIR}/kde4/config) 0211 endif() 0212 set(APPDATA_INSTALL_DIR ${SHARE_INSTALL_DIR}/kde4/apps) 0213 set(FQ_LOCAL_INSTALL_PATH ${CMAKE_BINARY_DIR}/share/apps/alkimia${ALKIMIA_PATH_SUFFIX}/misc) 0214 else() 0215 if(KF5NewStuff_VERSION VERSION_GREATER "5.56.0") 0216 else() 0217 set(KDE_INSTALL_KNSRCDIR ${CONFIG_INSTALL_DIR}) 0218 endif() 0219 set(APPDATA_INSTALL_DIR ${SHARE_INSTALL_DIR}) 0220 set(FQ_LOCAL_INSTALL_PATH ${CMAKE_BINARY_DIR}/share/alkimia${ALKIMIA_PATH_SUFFIX}/misc) 0221 endif() 0222 0223 install(FILES 0224 alkimia-quotes.knsrc 0225 kmymoney-quotes.knsrc 0226 skrooge-quotes.knsrc 0227 DESTINATION ${KDE_INSTALL_KNSRCDIR} 0228 ) 0229 0230 # install perl script in expected location of build dir 0231 # KDE4: set KDEHOME to build dir 0232 # KF5: ??? 0233 if(ENABLE_FINANCEQUOTE) 0234 make_directory(${FQ_LOCAL_INSTALL_PATH}) 0235 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/financequote.pl ${FQ_LOCAL_INSTALL_PATH}/financequote.pl IMMEDIATE COPYONLY) 0236 install(PROGRAMS financequote.pl 0237 DESTINATION ${APPDATA_INSTALL_DIR}/alkimia${ALKIMIA_PATH_SUFFIX}/misc 0238 ) 0239 endif() 0240 0241 if (NOT WIN32) 0242 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libalkimia.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libalkimia${ALKIMIA_PATH_SUFFIX}.pc IMMEDIATE @ONLY) 0243 endif(NOT WIN32) 0244 0245 ########### create package configuration file ########### 0246 0247 ecm_setup_version(${alkimia_VERSION} VARIABLE_PREFIX ALKIMIA 0248 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LibAlkimia${ALKIMIA_PATH_SUFFIX}ConfigVersion.cmake" 0249 COMPATIBILITY SameMajorVersion 0250 ) 0251 0252 configure_package_config_file( 0253 "${CMAKE_CURRENT_SOURCE_DIR}/LibAlkimiaConfig.cmake.in" 0254 "${CMAKE_CURRENT_BINARY_DIR}/LibAlkimia${ALKIMIA_PATH_SUFFIX}Config.cmake" 0255 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 0256 ) 0257 0258 ########### install files ############### 0259 0260 export(TARGETS ${alkimia_export_targets} 0261 FILE "${CMAKE_CURRENT_BINARY_DIR}/LibAlkimia${ALKIMIA_PATH_SUFFIX}Targets.cmake" 0262 NAMESPACE Alkimia:: 0263 ) 0264 0265 install(EXPORT alkimiaTargets 0266 FILE LibAlkimia${ALKIMIA_PATH_SUFFIX}Targets.cmake 0267 NAMESPACE Alkimia:: 0268 DESTINATION ${CMAKECONFIG_INSTALL_DIR} 0269 ) 0270 0271 install(FILES 0272 "${CMAKE_CURRENT_BINARY_DIR}/LibAlkimia${ALKIMIA_PATH_SUFFIX}Config.cmake" 0273 "${CMAKE_CURRENT_BINARY_DIR}/LibAlkimia${ALKIMIA_PATH_SUFFIX}ConfigVersion.cmake" 0274 "../cmake/modules/Find${MP_CMAKE_MODULE}.cmake" 0275 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0276 COMPONENT Devel 0277 ) 0278 0279 if (NOT WIN32) 0280 if (LIB_INSTALL_DIR) 0281 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libalkimia${ALKIMIA_PATH_SUFFIX}.pc 0282 DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) 0283 else() 0284 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libalkimia${ALKIMIA_PATH_SUFFIX}.pc 0285 DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) 0286 endif() 0287 endif(NOT WIN32) 0288 0289 ########### documentation ################### 0290 0291 if(DOXYGEN_FOUND) 0292 set(APIDOC_DIR ${CMAKE_CURRENT_BINARY_DIR}/apidocs) 0293 0294 make_directory(${APIDOC_DIR}) 0295 0296 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libalkimia.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/libalkimia.doxygen IMMEDIATE) 0297 0298 add_custom_target(libalkimia_apidoc ${DOXYGEN} ${CMAKE_CURRENT_BINARY_DIR}/libalkimia.doxygen) 0299 endif(DOXYGEN_FOUND) 0300