MantisBT - CMake
View Issue Details
0013051CMakeCMakepublic2012-03-18 09:122016-06-10 14:31
Daniel Franke 
Clinton Stimpson 
normalminoralways
closedmoved 
x86_64MAC OS X10.7.3
CMake 2.8.7 
 
0013051: DeployQt4.cmake: INSTALL not scriptable
As DeployQt4 is based on BundleUtilities, I figured I can use it in the same way, namely:

  install (CODE "include (DeployQt4)
                 FIXUP_QT4_EXECUTABLE (\"${PREFIX}/${APP_DEFAULT_ARGS}.app\"
                                       \"${PLUGINS}\"
                                       \"\"
                                       \"${PREFIX}/Frameworks\"
                                       \"${PREFIX}/Frameworks/Plugins\")")

Which is described here: http://www.cmake.org/Wiki/BundleUtilitiesExample [^]

However, when run, one gets:
CMake Error at /Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/DeployQt4.cmake:211 (install):
  Command install() is not scriptable
Call Stack (most recent call first):
  /Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/DeployQt4.cmake:221 (install_qt4_plugin_path)
  /Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/DeployQt4.cmake:144 (install_qt4_plugin)
  saxsview/svplot/cmake_install.cmake:48 (FIXUP_QT4_EXECUTABLE)
No tags attached.
gz bug13051.tar.gz (566) 2012-04-04 14:11
https://public.kitware.com/Bug/file/4287/bug13051.tar.gz
gz bug13051-2.tar.gz (599) 2012-04-04 14:21
https://public.kitware.com/Bug/file/4288/bug13051-2.tar.gz
Issue History
2012-03-18 09:12Daniel FrankeNew Issue
2012-03-18 13:08Eric NOULARDNote Added: 0028932
2012-03-19 08:43Brad KingAssigned To => Clinton Stimpson
2012-03-19 08:43Brad KingStatusnew => assigned
2012-03-19 10:29Clinton StimpsonNote Added: 0028936
2012-04-04 14:11Daniel FrankeFile Added: bug13051.tar.gz
2012-04-04 14:21Daniel FrankeFile Added: bug13051-2.tar.gz
2012-04-04 14:24Daniel FrankeNote Added: 0029080
2012-04-06 17:01Clinton StimpsonNote Added: 0029091
2012-04-11 12:28Daniel FrankeNote Added: 0029126
2012-04-11 12:47Daniel FrankeNote Added: 0029127
2012-04-13 17:24Clinton StimpsonNote Added: 0029154
2012-08-13 23:28Clinton StimpsonStatusassigned => backlog
2016-06-10 14:28Kitware RobotNote Added: 0042008
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0028932)
Eric NOULARD   
2012-03-18 13:08   
install(CODE ...) runs the provided script snipped at install time
using CMake in "script mode" (like cmake -P ...). In this mode
some command may not be used (add_library, add_executable, install, etc...)
thus the error.

The solution must be discussed with the DeployQt4 author,
but sometimes [depending on the context]

install(FILES ...)

commands may be replaced by

file(INSTALL ...)

The later is scriptable BUT it is NOT doing the same work.
Read the documentation:
cmake --help-command FILE
cmake --help-command INSTALL
(0028936)
Clinton Stimpson   
2012-03-19 10:29   
Does your PLUGINS variable contain absolute paths to plugins? It should.
Also, if you need someone else to look at it, can you please make a simple test case to demonstrate the problem?
(0029080)
Daniel Franke   
2012-04-04 14:24   
Please disregard the first file, I messed up the packing.

The updated file (bug13051-2.tar.gz) contains two files, a dummy cpp and the corresponding CMakeLists.txt.

$ tar xfz bug13051-2.tar.gz
$ cd bug13051
$ mkdir build
$ cd build
$ cmake ..
$ make all install DESTDIR=/tmp
[...]
CMake Error at /Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/DeployQt4.cmake:211 (install):
  Command install() is not scriptable
[...]

P.S. If one removes the plugin, one ends up at report 0013052 ...
(0029091)
Clinton Stimpson   
2012-04-06 17:01   
You need to use absolute paths to the plugin files.
It doesn't work to give it the directory containing the plugins.
(0029126)
Daniel Franke   
2012-04-11 12:28   
> It doesn't work to give it the directory containing the plugins.

No idea how the filename didn't make it into the package?! However, without the file, one gets a different error. Try adding a plugin name.

-- fixup_qt4_executable
-- executable='/Applications/saxsview/'
-- qtplugins='/Developer/Applications/Qt/plugins/imageformats/libqjpeg.dylib'
[...]
Command install() is not scriptable
(0029127)
Daniel Franke   
2012-04-11 12:47   
Eric, your suggestion seems to actually fix it. With the change below, my project gets properly deployed:

--- /Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/DeployQt4.cmake 2011-12-30 17:40:14.000000000 +0100
+++ ../cmake/DeployQt4.cmake 2012-04-11 18:36:47.000000000 +0200
@@ -208,7 +208,7 @@
                         else()
                                 unset(configurations)
                         endif()
- install(FILES "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component})
+ file(INSTALL "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component})
                 endif()
                 set(${installed_plugin_path_var} ${${installed_path_var}} "${plugins_path}/${plugin_name}" PARENT_SCOPE)
         endif()
(0029154)
Clinton Stimpson   
2012-04-13 17:24   
I don't think we can apply your patch. It would break the non-scripted usage of that function, where we actually want to use the install() command. Though, I do wish the non-scriptable and scriptable code was kept separate.

Can you please try it off of 2.8.8 RC or git master. DeployQt4.cmake was quite broken in 2.8.7.
(0042008)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.