View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013433CMakeModulespublic2012-07-24 01:362013-01-09 14:05
ReporterCraig Scott 
Assigned ToClinton Stimpson 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinux 64-bitOSFedoraOS Version16
Product VersionCMake 2.8.8 
Target VersionFixed in Version 
Summary0013433: fixup_qt4_executable fails on Linux when used with CPack or DESTDIR
DescriptionWhen CPack is used on a build where cmake has been run to set up the packaging, the fixup_qt4_executable() functon (defined in the DeployQt4 module) complains that it cannot find the executable. This only occurs on Linux. The same files work as expected on Windows (I don't have access to Mac to test on there, sorry).

What is interesting is that if I look at the cmake_install.cmake file that is generated by CMake, both contain a line like one of the following:

FIXUP_QT4_EXECUTABLE("${CMAKE_INSTALL_PREFIX}/bin/myExe" "" "" "/usr/lib64;/usr/lib64/qt4/bin" "" "")

FIXUP_QT4_EXECUTABLE("${CMAKE_INSTALL_PREFIX}/bin/myExe.exe" "" "" "C:/QtSDK/Desktop/Qt/4.8.1/msvc2008/lib;C:/QtSDK/Desktop/Qt/4.8.1/msvc2008/bin" "" "")

If I run CPack on these, it works fine on Windows, but on Linux it complains that it cannot find the executable. It is as though the DESTDIR used by CPack to get "make install" to install to a private area is not understood by fixup_qt4_executable(). Why it works on Windows but not on Linux is unclear. I also confirm that simply doing a "make DESTDIR=somewhere install" also fails in a similar fashion, so it is not a problem with CPack.
Steps To ReproduceSee the simple example (I'll attach the files shortly). On linux, run cmake and then do a make install with DESTDIR set to somewhere.
Tagsqt
Attached Filestxt file icon CMakeLists.txt [^] (289 bytes) 2012-07-24 01:36 [Show Content]
cpp file icon main.cpp [^] (130 bytes) 2012-07-24 01:36
? file icon CMakeLists.txt.updated [^] (293 bytes) 2012-07-24 01:53

 Relationships

  Notes
(0030114)
Craig Scott (reporter)
2012-07-24 01:54

Sorry, the original CMakeLists.txt had a bad path in the install_qt4_executable() line. The CMakeLists.txt.update is the one to look at (I can't seem to delete the original CMakeLists.txt from this issue, sorry).
(0030115)
Craig Scott (reporter)
2012-07-24 02:20

Er, actually you can reproduce the problem on Windows too with a simple "nmake DESTDIR=somewhere install" as well. Note that CPack *does* happily produce a package on Windows though, so there's something odd going on.

Also, on Windows, the executable passed to install_qt4_executable() should have .exe appended to it.

Finally, to test with CPack, you also need to append a line with "include(CPack)" to the bottom of the CMakeLists.txt file. Sorry, I threw this example together quickly since I was doing my earlier investigations with a much larger and more complex set of files.
(0030117)
Mike McQuaid (reporter)
2012-07-24 04:50

Yes, it's exactly what you suspected: an issue with the DESTDIR. You have to pass the full path to FIXUP_QT4_EXECUTABLE (but it will try the CMAKE_INSTALL_PREFIX which sometimes works).

I'd advise you to use INSTALL_QT4_EXECUTABLE instead or manually set the full path.
(0030121)
Craig Scott (reporter)
2012-07-24 19:41

Unfortunately, that's not possible. Whatever you do with install_qt4_executable, it prepends ${CMAKE_INSTALL_PREFIX} to the executable name. The problem is, the DESTDIR part needs to go *before* CMAKE_INSTALL_PREFIX. You can't modify CMAKE_INSTALL_PREFIX because that's used by CPack when working out the base install path.
(0030122)
Mike McQuaid (reporter)
2012-07-25 04:32

Ah, ok, thanks.
(0030683)
Clinton Stimpson (developer)
2012-08-15 21:40

Fixed.

http://www.cmake.org/gitweb?p=cmake.git;a=commit;h=1e3248c9d0396e9c8b417eb35636ed951ca85988 [^]
(0032071)
Robert Maynard (manager)
2013-01-09 14:05

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-07-24 01:36 Craig Scott New Issue
2012-07-24 01:36 Craig Scott File Added: CMakeLists.txt
2012-07-24 01:36 Craig Scott File Added: main.cpp
2012-07-24 01:53 Craig Scott File Added: CMakeLists.txt.updated
2012-07-24 01:54 Craig Scott Note Added: 0030114
2012-07-24 01:56 Craig Scott Tag Attached: qt
2012-07-24 02:20 Craig Scott Note Added: 0030115
2012-07-24 04:50 Mike McQuaid Note Added: 0030117
2012-07-24 19:41 Craig Scott Note Added: 0030121
2012-07-25 04:32 Mike McQuaid Note Added: 0030122
2012-07-27 16:52 Alex Neundorf Assigned To => Clinton Stimpson
2012-07-27 16:52 Alex Neundorf Status new => assigned
2012-08-15 21:40 Clinton Stimpson Note Added: 0030683
2012-08-15 21:40 Clinton Stimpson Status assigned => resolved
2012-08-15 21:40 Clinton Stimpson Resolution open => fixed
2013-01-09 14:05 Robert Maynard Note Added: 0032071
2013-01-09 14:05 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team