SHARE
TWEET

plugins api work

a guest Sep 6th, 2019 120 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/cmake/modules/FindPsiPluginsApi.cmake b/cmake/modules/FindPsiPluginsApi.cmake
  2. index 74897750..d127a8ad 100644
  3. --- a/cmake/modules/FindPsiPluginsApi.cmake
  4. +++ b/cmake/modules/FindPsiPluginsApi.cmake
  5. @@ -53,9 +53,11 @@ find_path(
  6.      ${ABS_PLUGINS_ROOT_DIR}/cmake/modules
  7.      PATH_SUFFIXES
  8.      src/plugins/cmake/modules
  9. -    share/psi/plugins
  10. -    share/psi-plus/plugins
  11. -    CMAKE_FIND_ROOT_PATH_BOTH
  12. +    if(NOT WIN32)
  13. +        share/psi/plugins
  14. +        share/psi-plus/plugins
  15. +        CMAKE_FIND_ROOT_PATH_BOTH
  16. +    endif()
  17.  )
  18.  
  19.  find_path(
  20. @@ -67,9 +69,11 @@ find_path(
  21.      ${ABS_PLUGINS_ROOT_DIR}/include
  22.      PATH_SUFFIXES
  23.      src/plugins/include
  24. -    share/psi/plugins/include
  25. -    share/psi-plus/plugins/include
  26. -    CMAKE_FIND_ROOT_PATH_BOTH
  27. +    if(NOT WIN32)
  28. +        include/psi/plugins
  29. +        include/psi-plus/plugins
  30. +        CMAKE_FIND_ROOT_PATH_BOTH
  31. +    endif()
  32.  )
  33.  
  34.  include(FindPackageHandleStandardArgs)
  35. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
  36. index ccedc37a..a08a5b55 100644
  37. --- a/src/CMakeLists.txt
  38. +++ b/src/CMakeLists.txt
  39. @@ -447,15 +447,18 @@ if(LINUX)
  40.              install(FILES ${DOC_FILES} DESTINATION "${PROJECT_OUTPUT_DATA_DIR}")
  41.          endif()
  42.          if(INSTALL_PLUGINS_SDK)
  43. +            set(API_OUTPUT_DATA_DIR "${DATA_INSTALL_DIR}/${SHARE_SUFF}")
  44. +            set(API_INCLUDES_DIR "${CMAKE_INSTALL_PREFIX}/include/${SHARE_SUFF}/plugins")
  45.              set(plugins_dir "${PSI_LIBDIR}/plugins")
  46. -            set(data_dir ${PROJECT_OUTPUT_DATA_DIR})
  47. +            set(data_dir "${API_OUTPUT_DATA_DIR}")
  48. +            set(plugins_includes_dir "${API_INCLUDES_DIR}")
  49.              configure_file(${PROJECT_SOURCE_DIR}/src/plugins/pluginsconf.pri.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pluginsconf.pri @ONLY)
  50.              configure_file(${PROJECT_SOURCE_DIR}/src/plugins/variables.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/variables.cmake @ONLY)
  51. -            install(FILES ${PLUGINS_INCLUDES} DESTINATION ${PROJECT_OUTPUT_DATA_DIR}/plugins/include)
  52. -            install(FILES ${CMAKE_CURRENT_BINARY_DIR}/variables.cmake DESTINATION ${PROJECT_OUTPUT_DATA_DIR}/plugins)
  53. -            install(FILES ${PROJECT_SOURCE_DIR}/src/plugins/plugins.pri DESTINATION ${PROJECT_OUTPUT_DATA_DIR}/plugins)
  54. -            install(FILES ${PROJECT_SOURCE_DIR}/src/plugins/psiplugin.pri DESTINATION ${PROJECT_OUTPUT_DATA_DIR}/plugins)
  55. -            install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pluginsconf.pri DESTINATION ${PROJECT_OUTPUT_DATA_DIR}/plugins)
  56. +            install(FILES ${PLUGINS_INCLUDES} DESTINATION ${API_INCLUDES_DIR})
  57. +            install(FILES ${CMAKE_CURRENT_BINARY_DIR}/variables.cmake DESTINATION ${API_OUTPUT_DATA_DIR}/plugins)
  58. +            install(FILES ${PROJECT_SOURCE_DIR}/src/plugins/plugins.pri DESTINATION ${API_OUTPUT_DATA_DIR}/plugins)
  59. +            install(FILES ${PROJECT_SOURCE_DIR}/src/plugins/psiplugin.pri DESTINATION ${API_OUTPUT_DATA_DIR}/plugins)
  60. +            install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pluginsconf.pri DESTINATION ${API_OUTPUT_DATA_DIR}/plugins)
  61.              install(FILES ${PROJECT_SOURCE_DIR}/cmake/modules/FindPsiPluginsApi.cmake DESTINATION ${DATA_INSTALL_DIR}/cmake/Modules)
  62.          endif()
  63.      endif()
  64. diff --git a/src/plugins/cmake/modules/FindPsiPluginsApi.cmake b/src/plugins/cmake/modules/FindPsiPluginsApi.cmake
  65. index d8e39b7a..e2708f1e 100644
  66. --- a/src/plugins/cmake/modules/FindPsiPluginsApi.cmake
  67. +++ b/src/plugins/cmake/modules/FindPsiPluginsApi.cmake
  68. @@ -47,9 +47,11 @@ find_path(
  69.      ${ABS_PLUGINS_ROOT_DIR}/cmake/modules
  70.      PATH_SUFFIXES
  71.      src/plugins/cmake/modules
  72. -    share/psi/plugins
  73. -    share/psi-plus/plugins
  74. -    CMAKE_FIND_ROOT_PATH_BOTH
  75. +    if(NOT WIN32)
  76. +        share/psi/plugins
  77. +        share/psi-plus/plugins
  78. +        CMAKE_FIND_ROOT_PATH_BOTH
  79. +    endif()
  80.  )
  81.  
  82.  find_path(
  83. @@ -62,9 +64,11 @@ find_path(
  84.      ${ABS_PLUGINS_ROOT_DIR}/include
  85.      PATH_SUFFIXES
  86.      src/plugins/include
  87. -    share/psi/plugins/include
  88. -    share/psi-plus/plugins/include
  89. -    CMAKE_FIND_ROOT_PATH_BOTH
  90. +    if(NOT WIN32)
  91. +        include/psi/plugins
  92. +        include/psi-plus/plugins
  93. +        CMAKE_FIND_ROOT_PATH_BOTH
  94. +    endif()
  95.  )
  96.  
  97.  include(FindPackageHandleStandardArgs)
  98. diff --git a/src/plugins/plugins.pri b/src/plugins/plugins.pri
  99. index 7b48c995..23062c03 100644
  100. --- a/src/plugins/plugins.pri
  101. +++ b/src/plugins/plugins.pri
  102. @@ -1,44 +1,44 @@
  103. -INCLUDEPATH += $$PWD/include
  104. +INCLUDEPATH += $$psi_plugins_include_dir
  105.  
  106.  HEADERS += \
  107. -    $$PWD/include/psiplugin.h \
  108. -    $$PWD/include/stanzafilter.h \
  109. -    $$PWD/include/stanzasender.h \
  110. -    $$PWD/include/stanzasendinghost.h \
  111. -    $$PWD/include/iqfilter.h \
  112. -    $$PWD/include/iqnamespacefilter.h \
  113. -    $$PWD/include/iqfilteringhost.h \
  114. -    $$PWD/include/eventfilter.h \
  115. -    $$PWD/include/optionaccessor.h \
  116. -    $$PWD/include/optionaccessinghost.h \
  117. -    $$PWD/include/popupaccessor.h \
  118. -    $$PWD/include/popupaccessinghost.h \
  119. -    $$PWD/include/shortcutaccessor.h \
  120. -    $$PWD/include/shortcutaccessinghost.h\
  121. -    $$PWD/include/iconfactoryaccessor.h \
  122. -    $$PWD/include/iconfactoryaccessinghost.h\
  123. -    $$PWD/include/activetabaccessor.h \
  124. -    $$PWD/include/activetabaccessinghost.h \
  125. -    $$PWD/include/applicationinfoaccessor.h \
  126. -    $$PWD/include/applicationinfoaccessinghost.h \
  127. -    $$PWD/include/accountinfoaccessor.h \
  128. -    $$PWD/include/accountinfoaccessinghost.h\
  129. -    $$PWD/include/gctoolbariconaccessor.h \
  130. -    $$PWD/include/toolbariconaccessor.h \
  131. -    $$PWD/include/menuaccessor.h \
  132. -    $$PWD/include/contactstateaccessor.h \
  133. -    $$PWD/include/contactstateaccessinghost.h \
  134. -    $$PWD/include/plugininfoprovider.h \
  135. -    $$PWD/include/psiaccountcontroller.h\
  136. -    $$PWD/include/psiaccountcontrollinghost.h \
  137. -    $$PWD/include/eventcreatinghost.h \
  138. -    $$PWD/include/eventcreator.h \
  139. -    $$PWD/include/contactinfoaccessor.h \
  140. -    $$PWD/include/contactinfoaccessinghost.h \
  141. -    $$PWD/include/soundaccessor.h \
  142. -    $$PWD/include/soundaccessinghost.h \
  143. -    $$PWD/include/chattabaccessor.h \
  144. -    $$PWD/include/webkitaccessor.h \
  145. -    $$PWD/include/webkitaccessinghost.h
  146. +    $$psi_plugins_include_dir/psiplugin.h \
  147. +    $$psi_plugins_include_dir/stanzafilter.h \
  148. +    $$psi_plugins_include_dir/stanzasender.h \
  149. +    $$psi_plugins_include_dir/stanzasendinghost.h \
  150. +    $$psi_plugins_include_dir/iqfilter.h \
  151. +    $$psi_plugins_include_dir/iqnamespacefilter.h \
  152. +    $$psi_plugins_include_dir/iqfilteringhost.h \
  153. +    $$psi_plugins_include_dir/eventfilter.h \
  154. +    $$psi_plugins_include_dir/optionaccessor.h \
  155. +    $$psi_plugins_include_dir/optionaccessinghost.h \
  156. +    $$psi_plugins_include_dir/popupaccessor.h \
  157. +    $$psi_plugins_include_dir/popupaccessinghost.h \
  158. +    $$psi_plugins_include_dir/shortcutaccessor.h \
  159. +    $$psi_plugins_include_dir/shortcutaccessinghost.h\
  160. +    $$psi_plugins_include_dir/iconfactoryaccessor.h \
  161. +    $$psi_plugins_include_dir/iconfactoryaccessinghost.h\
  162. +    $$psi_plugins_include_dir/activetabaccessor.h \
  163. +    $$psi_plugins_include_dir/activetabaccessinghost.h \
  164. +    $$psi_plugins_include_dir/applicationinfoaccessor.h \
  165. +    $$psi_plugins_include_dir/applicationinfoaccessinghost.h \
  166. +    $$psi_plugins_include_dir/accountinfoaccessor.h \
  167. +    $$psi_plugins_include_dir/accountinfoaccessinghost.h\
  168. +    $$psi_plugins_include_dir/gctoolbariconaccessor.h \
  169. +    $$psi_plugins_include_dir/toolbariconaccessor.h \
  170. +    $$psi_plugins_include_dir/menuaccessor.h \
  171. +    $$psi_plugins_include_dir/contactstateaccessor.h \
  172. +    $$psi_plugins_include_dir/contactstateaccessinghost.h \
  173. +    $$psi_plugins_include_dir/plugininfoprovider.h \
  174. +    $$psi_plugins_include_dir/psiaccountcontroller.h\
  175. +    $$psi_plugins_include_dir/psiaccountcontrollinghost.h \
  176. +    $$psi_plugins_include_dir/eventcreatinghost.h \
  177. +    $$psi_plugins_include_dir/eventcreator.h \
  178. +    $$psi_plugins_include_dir/contactinfoaccessor.h \
  179. +    $$psi_plugins_include_dir/contactinfoaccessinghost.h \
  180. +    $$psi_plugins_include_dir/soundaccessor.h \
  181. +    $$psi_plugins_include_dir/soundaccessinghost.h \
  182. +    $$psi_plugins_include_dir/chattabaccessor.h \
  183. +    $$psi_plugins_include_dir/webkitaccessor.h \
  184. +    $$psi_plugins_include_dir/webkitaccessinghost.h
  185.  
  186.  OTHER_FILES += $$PWD/psiplugin.pri
  187. diff --git a/src/plugins/pluginsconf.pri b/src/plugins/pluginsconf.pri
  188. index f2c07c57..9ecc048a 100644
  189. --- a/src/plugins/pluginsconf.pri
  190. +++ b/src/plugins/pluginsconf.pri
  191. @@ -1 +1,2 @@
  192.  psi_plugins_dir = $$(HOME)/.local/share/psi+/plugins
  193. +psi_plugins_include_dir = $$PWD/include
  194. diff --git a/src/plugins/pluginsconf.pri.cmake.in b/src/plugins/pluginsconf.pri.cmake.in
  195. index 79f12f0e..8e6c718c 100644
  196. --- a/src/plugins/pluginsconf.pri.cmake.in
  197. +++ b/src/plugins/pluginsconf.pri.cmake.in
  198. @@ -1,2 +1,3 @@
  199.  psi_plugins_dir="@plugins_dir@"
  200.  psi_data_dir="@data_dir@"
  201. +psi_plugins_include_dir="@plugins_includes_dir@"
  202. \ No newline at end of file
  203. diff --git a/src/plugins/variables.cmake.in b/src/plugins/variables.cmake.in
  204. index a368950f..d4deda14 100644
  205. --- a/src/plugins/variables.cmake.in
  206. +++ b/src/plugins/variables.cmake.in
  207. @@ -3,5 +3,5 @@ set( PLUGINS_INSTALL_PATH "@plugins_dir@" CACHE STRING "Install path for plugins
  208. set( PLUGINS_DATA_PATH "@data_dir@/plugins" CACHE STRING "Path to plugins datadir" )
  209. set( MAIN_PROGRAM_NAME "@SHARE_SUFF@" CACHE STRING "Name of main client" )
  210. add_definitions( -DQT_PLUGIN )
  211. -include_directories("${PLUGINS_DATA_PATH}/include")
  212. +include_directories("@plugins_includes_dir@")
  213. set(CMAKE_CXX_STANDARD 14)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top