Browse Source

Ensure CTK_INSTALL_QTPLUGIN_DIR is properly set

When configuring the inner project, the variable was
passed without making sure it was defined or set to a
non empty value.

This commit ensure that the variable is passed only
if it's set to a non empty value. That way the
macro ctkMacroBuildQtPlugin will properly default
to "CTK_INSTALL_LIB_DIR"

See issue #65
Jean-Christophe Fillion-Robin 13 years ago
parent
commit
de2625bc30
2 changed files with 7 additions and 2 deletions
  1. 1 1
      CMake/ctkMacroBuildQtPlugin.cmake
  2. 6 1
      SuperBuild.cmake

+ 1 - 1
CMake/ctkMacroBuildQtPlugin.cmake

@@ -127,7 +127,7 @@ macro(ctkMacroBuildQtPlugin)
   # 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 CTK_INSTALL_QTPLUGIN_DIR)
+  if(NOT DEFINED CTK_INSTALL_QTPLUGIN_DIR)
     set(CTK_INSTALL_QTPLUGIN_DIR "${CTK_INSTALL_LIB_DIR}")
   endif()
   install(TARGETS ${lib_name}

+ 6 - 1
SuperBuild.cmake

@@ -137,6 +137,12 @@ endif()
 #
 set(proj CTK-Configure)
 
+if(NOT "${CTK_INSTALL_QTPLUGIN_DIR}" STREQUAL "")
+  list(APPEND CTK_SUPERBUILD_EP_ARGS
+    -DCTK_INSTALL_QTPLUGIN_DIR:STRING=${CTK_INSTALL_QTPLUGIN_DIR}
+    )
+endif()
+
 ExternalProject_Add(${proj}
   DOWNLOAD_COMMAND ""
   CMAKE_GENERATOR ${gen}
@@ -161,7 +167,6 @@ 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_EXTERNAL_LIBRARY_DIRS:STRING=${CTK_EXTERNAL_LIBRARY_DIRS}