MantisBT - CMake
View Issue Details
0007410CMakeCPackpublic2008-07-28 10:002010-12-11 17:25
Yuri 
Eric NOULARD 
normalminoralways
closedfixed 
CMake-2-6 
CMake 2.8.3 
0007410: CPack SET_DESTDIR feature is broken by Components installation
I'm playing with cmake-2.6.1-RC11 (from CMake-2.6 CVS branch). I try to create RPM package with CPACK_SET_DESTDIR ON, but this fails:
=(%:~/devel/distrib/cmake-2.6/build)=- ./bin/cpack --config cpack-test.cmake
CPack: Create package using RPM
CPack: Install projects
CPack: - Run preinstall target for: CMake
CPack: - Install project: CMake
CPack Error: Problem creating temporary directory: /opt/cmake
CPack Error: Error when generating package: cmake

In cmake-2.6 this works.
No tags attached.
related to 0007000closed Eric NOULARD CPack RPM generator should always "CPACK_SET_DESTDIR" 
? cpack-test.cmake (564) 2008-07-28 10:00
https://public.kitware.com/Bug/file/1622/cpack-test.cmake
patch cpack_set_destdir_fix.patch (995) 2008-07-28 10:06
https://public.kitware.com/Bug/file/1623/cpack_set_destdir_fix.patch
Issue History
2008-07-28 10:00YuriNew Issue
2008-07-28 10:00YuriFile Added: cpack-test.cmake
2008-07-28 10:06YuriFile Added: cpack_set_destdir_fix.patch
2008-07-28 10:09YuriNote Added: 0012835
2008-07-28 10:53Bill HoffmanStatusnew => assigned
2008-07-28 10:53Bill HoffmanAssigned To => Douglas Gregor
2008-07-28 16:17Douglas GregorNote Added: 0012838
2008-07-29 03:01YuriNote Added: 0012848
2008-09-05 10:57Brad KingRelationship addedrelated to 0007000
2010-12-08 10:32David ColeAssigned ToDouglas Gregor => Eric NOULARD
2010-12-08 12:11Eric NOULARDNote Added: 0023799
2010-12-11 17:25Eric NOULARDNote Added: 0023898
2010-12-11 17:25Eric NOULARDStatusassigned => closed
2010-12-11 17:25Eric NOULARDResolutionopen => fixed
2010-12-11 17:25Eric NOULARDFixed in Version => CMake 2.8.3

Notes
(0012835)
Yuri   
2008-07-28 10:09   
When using CPACK_SET_DESTDIR, there may be no CPACK_INSTALL_PREFIX directory or it may be inaccessible. Proposed patch work for me.
(0012838)
Douglas Gregor   
2008-07-28 16:17   
This patch will break generation of packages for empty components on Mac OS X (and, possibly, NSIS). How about we make the creation of the temporary directory only occur when CPACK_SET_DESTDIR is not set?
(0012848)
Yuri   
2008-07-29 03:01   
Hmm... This patch does it. I removed mktmpdir only when set_destdir is on (in one branch of condition). I supposed you've added this code to both branches by mistake.

I think your comment is reasonable: when you don't use DESTDIR you know full path and free to create it. But with DESTDIR is set, creating CPACK_INSTALL_PREFIX looses any sense: Usually it points to some system path, but package is built under restricted user.
(0023799)
Eric NOULARD   
2010-12-08 12:11   
I'll have a look,
but I think this one is clearly oldish
and should certainly be closed.

CPack 2.8.3 should be able to handle all know cases:

- With ou Without Absolute Path in install rules
- CPACK_SET_DESTDIR OFF or ON

The "only" trouble is that if CPACK_SET_DESTDIR is ON
and there are one or more Absolute Path in install rules
then the generated RPM will not be relocatable.

I'll close it after some tests.
(0023898)
Eric NOULARD   
2010-12-11 17:25   
This bug is now obsolete.
I did not do backward search in order to see when exactly
but as of CMake 2.8.3 this is not an issue any longer.

Closing it.