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