MantisBT - CMake
View Issue Details
0015400CMakeModulespublic2015-02-10 09:212016-06-10 14:31
Ruslan Baratov 
Kitware Robot 
normalminoralways
closedmoved 
Windows 7
CMake 3.1.2 
 
0015400: fixup_bundle does not work on cpack stage
fixup_bundle works as expected if cmake installs target, but not when cpack creating a package.
Example with Visual Studio 12, Qt and NSIS generator (see attached CMakeLists.txt and main.cpp):
1. cmake -H. -B_builds "-GVisual Studio 12 2013" -DCMAKE_INSTALL_PREFIX=_install -DCPACK_GENERATOR=NSIS
2. cmake --build _builds --config Release --target install
3. dependent Qt libraries installed in local _install directory:
  -- fixup_bundle: copying...
  -- 1/14: *NOT* copying '.../_install/bin/foo.exe'
  -- 2/14: copying '.../bin/Qt5Core.dll'
  -- 3/14: copying '.../bin/Qt5Gui.dll'
  -- 4/14: copying '.../bin/Qt5Widgets.dll'
  -- 5/14: copying '.../bin/icudt53.dll'
  -- 6/14: copying '.../bin/icuin53.dll'
  -- 7/14: copying '.../bin/icuuc53.dll'
  -- fixup_bundle: fixing...
  -- 8/14: fix-up not required on this platform '.../_install/bin/foo.exe'
  -- 9/14: fix-up not required on this platform '.../_install/bin/Qt5Core.dll'
  -- 10/14: fix-up not required on this platform '.../_install/bin/Qt5Gui.dll'
  -- 11/14: fix-up not required on this platform '.../_install/bin/Qt5Widgets.dll'
  -- 12/14: fix-up not required on this platform '.../_install/bin/icudt53.dll'
  -- 13/14: fix-up not required on this platform '.../_install/bin/icuin53.dll'
  -- 14/14: fix-up not required on this platform '.../_install/bin/icuuc53.dll'
4. But not if cpack build installer:
  > cd _builds
  > cpack --verbose -C Release -GNSIS
  CPack Verbose: fixup_bundle: copying...
  CPack Verbose: 1/2: *NOT* copying '.../_builds/_CPack_Packages/win32/NSIS/Foo-1.0.0-win32/bin/foo.exe'
  CPack Verbose: fixup_bundle: fixing...
  CPack Verbose: 2/2: fix-up not required on this platform '.../_builds/_CPack_Packages/win32/NSIS/Foo-1.0.0-win32/bin/foo.exe'
  CPack Verbose: fixup_bundle: cleaning up...
  CPack Verbose: fixup_bundle: verifying...
No tags attached.
txt CMakeLists.txt (819) 2015-02-10 09:21
https://public.kitware.com/Bug/file/5379/CMakeLists.txt
cpp main.cpp (117) 2015-02-10 09:21
https://public.kitware.com/Bug/file/5380/main.cpp
Issue History
2015-02-10 09:21Ruslan BaratovNew Issue
2015-02-10 09:21Ruslan BaratovFile Added: CMakeLists.txt
2015-02-10 09:21Ruslan BaratovFile Added: main.cpp
2015-02-10 10:58Brad KingNote Added: 0037953
2015-02-10 11:18Ruslan BaratovNote Added: 0037954
2015-02-10 11:30Ruslan BaratovNote Added: 0037955
2016-06-10 14:29Kitware RobotNote Added: 0042712
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0037953)
Brad King   
2015-02-10 10:58   
CPack may be using DESTDIR for the staging area. Try using this:

 \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}

CMake itself does that to fix up cmake-gui here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/QtDialog/CMakeLists.txt;hb=v3.1.2#l187 [^]
(0037954)
Ruslan Baratov   
2015-02-10 11:18   
Nope, doesn't work. Actually I've added 'message' commands to see the values of '$ENV{DESTDIR}' and '${CMAKE_INSTALL_PREFIX}' to 'install(CODE' section:
* 'DESTDIR' is empty on both install and pack stage
* 'CMAKE_INSTALL_PREFIX' is a full path: on install = '.../_install', on pack = '.../_builds/_CPack_Packages/win32/NSIS/Foo-1.0.0-win32'
(0037955)
Ruslan Baratov   
2015-02-10 11:30   
I see this message while packing (gp_cmd not found):
  CPack Verbose: warning: could not find 'objdump' - cannot analyze prerequisites...

On install stage variable 'gp_cmd' (module GetPrerequisites) set to location of successfully founded dumpbin.exe tool: /.../msvc/2013/VC/bin/dumpbin.exe

But even when I hardcode location of dumpbin it still not working.

In function 'fixup_bundle' (module BundleUtilities) call to 'get_bundle_keys' returns keys:
* install keys: foo_exe;qt5core_dll;qt5gui_dll;qt5widgets_dll;icudt53_dll;icuin53_dll;icuuc53_dll
* package keys: foo_exe
(0042712)
Kitware Robot   
2016-06-10 14:29   
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.