[Ctk-developers] CMake Install bug found

Bentley, Michael (GE Healthcare) michael.bentley at ge.com
Thu Aug 2 22:08:05 UTC 2012


Hi everyone,

In trying to install CTK on my linux box, I found that two files try to install themselves in the /designer/ directory.  I figured it was put there by mistake, so I tracked down the location where this mistake occurs.

In <source_directory>/CMake/ctkMacroBuildQtPlugin.cmake, on line 130, you set the variable CTK_INSTALL_QTPLUGIN_DIR to the same as CTK_INSTALL_LIB_DIR unless it has been manually defined by the user.  Unfortunately, even when it isn't defined by the user, it never enters this if statement to perform that assignment, and hence CTK_INSTALL_QTPLUGIN_DIR has no value when setting the install paths a few lines later.  The reason is because it IS defined, but has no value.

In the SuperBuild.cmake file in the source directory, the CTK_INSTALL_QTPLUGIN_DIR value is being passed into the next invocation of CMake which will set up this install setup when we build the project for the first time.  This means that even if CTK_INSTALL_QTPLUGIN_DIR is not defined for the first call to CMake by the user, it will have been defined for the internal CMake call made by the Makefile during the build step.  This is why CTK_INSTALL_QTPLUGIN_DIR never is set to the default value inside of the ctkMacroBuildQtPlugin.cmake file, because it is defined through the command-line interface through the Makefile.  (At least this is what I gather is going on).

A simple fix would be to replace line 130 in <source_directory>/CMake/ctkMacroBuildQtPlugin.cmake and change it from
  if (NOT DEFINED CTK_INSTALL_QTPLUGIN_DIR)
to
  if (CTK_INSTALL_QTPLUGIN_DIR STREQUAL "")
This completely fixes the problem and the Qt Designer plugins are installed into the intended directory.

Thanks,
Michael



More information about the Ctk-developers mailing list