Debian Codegraph @

src/cmake_plugins.cmake

raw
1 function(prepare_rssguard_plugin plugin_target_name)
2 message(STATUS "Preparing plugin ${plugin_target_name}.")
3
4 if(NOT DEFINED LIBRSSGUARD_SOURCE_PATH)
5 set(LIBRSSGUARD_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..")
6 endif()
7
8 qt_wrap_ui(SOURCES ${UI_FILES})
9
10 if(WIN32)
11 enable_language("RC")
12 list(APPEND SOURCES "${CMAKE_BINARY_DIR}/rssguard.rc")
13 endif()
14
15 add_library(${PLUGIN_TARGET} SHARED ${SOURCES} ${QM_FILES})
16
17 target_link_libraries(${plugin_target_name} PUBLIC
18 rssguard
19 )
20
21 target_compile_definitions(${plugin_target_name}
22 PRIVATE
23 RSSGUARD_DLLSPEC=Q_DECL_IMPORT
24 )
25
26 target_include_directories(${plugin_target_name}
27 PUBLIC
28 ${LIBRSSGUARD_SOURCE_PATH}
29 )
30
31 if((WIN32 AND NOT BUILD_MSYS2) OR OS2)
32 install(TARGETS ${plugin_target_name} DESTINATION plugins)
33 elseif((MINGW AND BUILD_MSYS2) OR (UNIX AND NOT APPLE AND NOT ANDROID))
34 include (GNUInstallDirs)
35 install(TARGETS ${plugin_target_name}
36 DESTINATION ${CMAKE_INSTALL_LIBDIR}/rssguard
37 )
38 elseif(APPLE)
39 install(TARGETS ${plugin_target_name}
40 DESTINATION Contents/MacOS
41 )
42 endif()
43
44 message(STATUS "Plugin ${plugin_target_name} is prepared.")
45 endfunction()