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