Pārlūkot izejas kodu

Merge branch 'ctkMacroBuildQtPlugin-CTK_INSTALL_QTPLUGIN_DIR'

* ctkMacroBuildQtPlugin-CTK_INSTALL_QTPLUGIN_DIR:
  Support custom location for Qt plugin install dir
Julien Finet 13 gadi atpakaļ
vecāks
revīzija
3913324c58
2 mainītis faili ar 10 papildinājumiem un 3 dzēšanām
  1. 9 3
      CMake/ctkMacroBuildQtPlugin.cmake
  2. 1 0
      SuperBuild.cmake

+ 9 - 3
CMake/ctkMacroBuildQtPlugin.cmake

@@ -120,10 +120,16 @@ macro(ctkMacroBuildQtPlugin)
   target_link_libraries(${lib_name} ${my_libs})
 
   # Install the library
+  # CTK_INSTALL_QTPLUGIN_DIR:STRING can be passed when configuring CTK
+  # By default, it is the same path as CTK_INSTALL_LIB_DIR
+  # Plugins are installed in a subdirectory corresponding to their types (e.g. designer, iconengines, imageformats...)
+  if (NOT DEFINED CTK_INSTALL_QTPLUGIN_DIR)
+    set(CTK_INSTALL_QTPLUGIN_DIR "${CTK_INSTALL_LIB_DIR}")
+  endif()
   install(TARGETS ${lib_name}
-    RUNTIME DESTINATION ${CTK_INSTALL_LIB_DIR}/${MY_PLUGIN_DIR} COMPONENT RuntimePlugins
-    LIBRARY DESTINATION ${CTK_INSTALL_LIB_DIR}/${MY_PLUGIN_DIR} COMPONENT RuntimePlugins
-    ARCHIVE DESTINATION ${CTK_INSTALL_LIB_DIR}/${MY_PLUGIN_DIR} COMPONENT Development
+    RUNTIME DESTINATION ${CTK_INSTALL_QTPLUGIN_DIR}/${MY_PLUGIN_DIR} COMPONENT RuntimePlugins
+    LIBRARY DESTINATION ${CTK_INSTALL_QTPLUGIN_DIR}/${MY_PLUGIN_DIR} COMPONENT RuntimePlugins
+    ARCHIVE DESTINATION ${CTK_INSTALL_QTPLUGIN_DIR}/${MY_PLUGIN_DIR} COMPONENT Development
     )
 
   # Install headers - Are headers required ?

+ 1 - 0
SuperBuild.cmake

@@ -145,6 +145,7 @@ ExternalProject_Add(${proj}
     -DCTK_CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CTK_CMAKE_RUNTIME_OUTPUT_DIRECTORY}
     -DCTK_INSTALL_BIN_DIR:STRING=${CTK_INSTALL_BIN_DIR}
     -DCTK_INSTALL_LIB_DIR:STRING=${CTK_INSTALL_LIB_DIR}
+    -DCTK_INSTALL_QTPLUGIN_DIR:STRING=${CTK_INSTALL_QTPLUGIN_DIR}
     -DCTK_INSTALL_INCLUDE_DIR:STRING=${CTK_INSTALL_INCLUDE_DIR}
     -DCTK_INSTALL_DOC_DIR:STRING=${CTK_INSTALL_DOC_DIR}
     -DCTK_BUILD_SHARED_LIBS:BOOL=${CTK_BUILD_SHARED_LIBS}