Changeset View
Standalone View
kmymoney/plugins/checkprinting/CMakeLists.txt
1 | # patch the version with the version defined in the build system | 1 | # patch the version with the version defined in the build system | ||
---|---|---|---|---|---|
2 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/checkprinting.json.in ${CMAKE_CURRENT_BINARY_DIR}/checkprinting.json @ONLY) | 2 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/checkprinting.json.in ${CMAKE_CURRENT_BINARY_DIR}/checkprinting.json @ONLY) | ||
3 | 3 | | |||
4 | set(checkprinting_PART_SRCS | 4 | set(checkprinting_PART_SRCS | ||
5 | numbertowords.cpp | 5 | numbertowords.cpp | ||
6 | checkprinting.cpp | 6 | checkprinting.cpp | ||
7 | ../../widgets/selectedtransaction.cpp | 7 | ../../widgets/selectedtransaction.cpp | ||
8 | ) | 8 | ) | ||
9 | 9 | | |||
10 | kconfig_add_kcfg_files(checkprinting_PART_SRCS pluginsettings.kcfgc) | 10 | kconfig_add_kcfg_files(checkprinting_PART_SRCS pluginsettings.kcfgc) | ||
11 | 11 | | |||
12 | add_library(checkprinting MODULE ${checkprinting_PART_SRCS}) | 12 | kcoreaddons_add_plugin(checkprinting SOURCES ${checkprinting_PART_SRCS} JSON "${CMAKE_CURRENT_BINARY_DIR}/checkprinting.json" INSTALL_NAMESPACE "kmymoney") | ||
13 | set_target_properties(checkprinting PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${KMM_PLUGIN_OUTPUT_DIRECTORY}") | ||||
13 | 14 | | |||
14 | target_link_libraries(checkprinting | 15 | target_link_libraries(checkprinting | ||
15 | Qt5::PrintSupport | 16 | Qt5::PrintSupport | ||
16 | KF5::I18n | 17 | KF5::I18n | ||
17 | kmm_mymoney | 18 | kmm_mymoney | ||
18 | kmm_plugin | 19 | kmm_plugin | ||
19 | ) | 20 | ) | ||
20 | 21 | | |||
Show All 19 Lines | |||||
40 | 41 | | |||
41 | set(kcm_checkprinting_PART_SRCS | 42 | set(kcm_checkprinting_PART_SRCS | ||
42 | kcm_checkprinting.cpp | 43 | kcm_checkprinting.cpp | ||
43 | ) | 44 | ) | ||
44 | 45 | | |||
45 | kconfig_add_kcfg_files(kcm_checkprinting_PART_SRCS pluginsettings.kcfgc) | 46 | kconfig_add_kcfg_files(kcm_checkprinting_PART_SRCS pluginsettings.kcfgc) | ||
46 | 47 | | |||
47 | ki18n_wrap_ui(kcm_checkprinting_PART_SRCS pluginsettingsdecl.ui) | 48 | ki18n_wrap_ui(kcm_checkprinting_PART_SRCS pluginsettingsdecl.ui) | ||
48 | 49 | | |||
49 | kcoreaddons_add_plugin(kcm_checkprinting SOURCES ${kcm_checkprinting_PART_SRCS} JSON "${CMAKE_CURRENT_BINARY_DIR}/checkprinting.json" INSTALL_NAMESPACE "kmymoney") | 50 | add_library(kcm_checkprinting MODULE ${kcm_checkprinting_PART_SRCS}) | ||
wojnilowicz: That looks nice and as I see it should put plugin automatically in correct place. | |||||
It does not place the plugins into the right place if find_package(ECM 5.38 …) (or any later version) is used. As mentioned previously, it will write to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/kmymoney/… but ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/kmymoney is also our executable. So the manual setting of the output directory will always be required (once we want ECM >= 5.38). The main benefit of using this function is that changes to the json file will trigger the right files to be recompiled. christiand: It does not place the plugins into the right place if `find_package(ECM 5.38 …)` (or any later… | |||||
You put kcm_checkprinting in KMM_PLUGIN_OUTPUT_DIRECTORY but forgot to put wojnilowicz: You put **kcm_checkprinting** in KMM_PLUGIN_OUTPUT_DIRECTORY but forgot to put… | |||||
50 | set_target_properties(kcm_checkprinting PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${KMM_PLUGIN_OUTPUT_DIRECTORY}") | | |||
51 | | ||||
52 | kcoreaddons_desktop_to_json(kcm_checkprinting kcm_checkprinting.desktop) | 51 | kcoreaddons_desktop_to_json(kcm_checkprinting kcm_checkprinting.desktop) | ||
53 | 52 | | |||
54 | target_link_libraries(kcm_checkprinting | 53 | target_link_libraries(kcm_checkprinting | ||
55 | Qt5::PrintSupport | 54 | Qt5::PrintSupport | ||
56 | KF5::I18n | 55 | KF5::I18n | ||
57 | KF5::ConfigWidgets | 56 | KF5::ConfigWidgets | ||
58 | KF5::Completion | 57 | KF5::Completion | ||
59 | KF5::KIOWidgets | 58 | KF5::KIOWidgets | ||
Show All 14 Lines |
That looks nice and as I see it should put plugin automatically in correct place.