<div dir="ltr">This is fixed now in CVS HEAD:<div><div> /cvsroot/CMake/CMake/Source/CPack/cmCPackGenerator.cxx,v <-- Source/CPack/cmCPackGenerator.cxx</div><div> new revision: 1.16; previous revision: 1.15</div>
<div><br></div><div>It will also be merged over to the CMake-2-6 branch and appear in CMake 2.6.3 when that is released...<br></div><div><br></div><div>Thanks for the report, Petri.</div><div><br></div><div>One recommendation for you: if you are doing packaging this way via a custom target, use "${CMAKE_CPACK_COMMAND}" instead of cpack as the command you execute. This will guarantee using the cpack associated with the cmake used to configure regardless of PATH or any other environment issues. (That way, when I do a "make pack" on your project, I get the correct cpack being used rather than whichever one is available in my environment...)</div>
<div><br></div><div>Sorry for the hassle,</div><div>David Cole</div><div><br></div><div><br><div class="gmail_quote">On Wed, Oct 15, 2008 at 12:46 AM, Petri Hodju <span dir="ltr"><<a href="mailto:petrihodju@yahoo.com">petrihodju@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">Great news!<br><br>
I started to browse through the source code myself but figured out that as I don't have full understanding of the big picture, I won't get it right without breaking something else somewhere... So, I'm happy to wait for your solution : ) Meanwhile I get along with 2.6.0<br>
<br>Thanks David!<br><br>Br,<br>Petri<br><br>--- On <b>Tue, 10/14/08, David Cole <i><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></i></b> wrote:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px">
From: David Cole <<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>><br>Subject: Re: [CMake] CPack 2.6.2: can't create temporary directory<br>To: "Petri Hodju" <<a href="mailto:petrihodju@yahoo.com" target="_blank">petrihodju@yahoo.com</a>><br>
Cc: <a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a><br>Date: Tuesday, October 14, 2008, 1:44 PM<div><div></div><div class="Wj3C7c"><br><br><div><div dir="ltr">Scratch my last reply somewhat.....<div><br>
</div><div>Your
CMakeLists file runs "cpack" as the custom command, which was picking up cpack 2.6.2 from my PATH rather than using the same cpack that goes with the cmake 2.6.0 which I was using by fullpath to configure the project.</div>
<div><br></div><div>So. It does work with CPack 2.6.0 and I will work on the fix....</div><div><br></div><div>:-)</div><div><br></div><div>Sorry for the pilot error,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">
On Tue, Oct 14, 2008 at 4:24 PM, David Cole <span dir="ltr"><<a rel="nofollow" href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div dir="ltr">OK.... so when I reproduce this issue, I see that I do not have directory creation permissions in "/opt" on my Linux machine. So... the error message is not really surprising to me. Plus, I get the same error with CMake 2.6.0 and CMake <a rel="nofollow" href="http://2.6.2." target="_blank">2.6.2.</a><div>
<div><br></div><div>Maybe you lost permissions to your "/opt" directory at the same time that you upgraded to CMake <a rel="nofollow" href="http://2.6.2." target="_blank">2.6.2.</a>....??</div><div><br></div><div>
Let me know if you still think this is a CMake issue after you verify that you really have different behavior between 2.6.0 and 2.6.2 on the same machine.</div>
<div><br></div><div><br></div><div>Thanks,</div><div>David Cole</div><font color="#888888"><div>Kitware, Inc.</div><div><br></div><div><br></div></font><div><div class="gmail_quote"><div><div></div><div>On Mon, Oct 13, 2008 at 6:05 AM, Petri Hodju <span dir="ltr"><<a rel="nofollow" href="mailto:petrihodju@yahoo.com" target="_blank">petrihodju@yahoo.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:inherit;line-height:inherit;font-size-adjust:inherit;font-stretch:inherit" valign="top">
Hi!<br><br>I have put together a custom way of building packages inspired by Stuart Herring posted here earlier:<br>
<br>Fri Apr 4 20:39:04 EDT 2008<br>[CMake] CPack: Building Multiple Packages<br><br>Everything is working fine with version 2.6.0 but things break up with <a rel="nofollow" href="http://2.6.2." target="_blank">2.6.2.</a> The<br>
error I get is like:<br>
<br>CPack Error: Problem creating temporary directory: /opt/test<br><br>So, I'm not sure if there is a bug in 2.6.2 or has something changed between 2.6.0 and 2.6.2 which I don't take into account. <br><br>I have attached to this mail a tar package containing full example of the problem.<br>
<br>For those who can't bother with the tar file here is written out the CMakeLists.txt & CPackConfig.in files, which make it all happen:<br><br>CMakeLists.txt:<br><br>#===============================================================================<br>
# Top level
project makefile<br>#===============================================================================<br><br>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)<br><br>PROJECT(test)<br><br>SET(VERSION_MAJOR 0)<br>SET(VERSION_MINOR 1)<br>
SET(VERSION_PATCH 2)<br>SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")<br><br>#-------------------------------------------------------------------------------<br># macro for creating packages.<br>
#-------------------------------------------------------------------------------<br><br>ADD_CUSTOM_TARGET(pack)<br><br>MACRO(ADD_PACKAGE COMPONENT)<br> SET(TARGET pack-${COMPONENT})<br> SET(CONFIG "CPackConfig-${COMPONENT}.cmake")<br>
SET(PACKAGE ${COMPONENT})<br> CONFIGURE_FILE("CPackConfig.in" "${CONFIG}" @ONLY)<br> ADD_CUSTOM_TARGET(${TARGET} COMMAND cpack --config "${CONFIG}")<br> ADD_DEPENDENCIES(pack
${TARGET})<br>ENDMACRO(ADD_PACKAGE)<br><br>#-------------------------------------------------------------------------------<br># installation path settings<br>#-------------------------------------------------------------------------------<br>
<br>SET(CMAKE_SET_DESTDIR "ON")<br>SET(CMAKE_INSTALL_PREFIX "/opt/test")<br>SET(CPACK_GENERATOR "DEB" "RPM")<br><br>#-------------------------------------------------------------------------------<br>
# create test binary<br>#-------------------------------------------------------------------------------<br><br>ADD_EXECUTABLE(bin1 "bin1.cc")<br>INSTALL(TARGETS bin1 DESTINATION "bin" COMPONENT "binaries")<br>
ADD_PACKAGE(binaries)<br><br>CPackConfig.in:<br><br>#===============================================================================<br># template for package generation<br>#===============================================================================<br>
<br>SET(CMAKE_SET_DESTDIR
"@CMAKE_SET_DESTDIR@")<br>SET(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")<br>SET(CPACK_SET_DESTDIR "@CMAKE_SET_DESTDIR@")<br>SET(CPACK_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")<br>
<br>SET(CPACK_PACKAGE_VERSION_MAJOR @VERSION_MAJOR@)<br>SET(CPACK_PACKAGE_VERSION_MINOR @VERSION_MINOR@)<br>SET(CPACK_PACKAGE_VERSION_PATCH @VERSION_PATCH@)<br><br>SET(CPACK_CMAKE_GENERATOR "@CMAKE_GENERATOR@")<br>
SET(CPACK_GENERATOR "@CPACK_GENERATOR@")<br><br>SET(CPACK_INSTALL_CMAKE_PROJECTS "@PROJECT_BINARY_DIR@;@PROJECT_NAME@;@PACKAGE@;/")<br>SET(CPACK_PACKAGE_FILE_NAME "@PROJECT_NAME@-@PACKAGE@-@VERSION@-@CMAKE_SYSTEM_NAME@")<br>
SET(CPACK_PACKAGE_NAME "@PROJECT_NAME@")<br>SET(CPACK_PACKAGE_VENDOR "Test Vendor")<br>SET(CPACK_PACKAGE_CONTACT "<a rel="nofollow" href="mailto:test@vendor.org" target="_blank">test@vendor.org</a>")<br>
SET(CPACK_PACKAGE_DESCRIPTION_FILE "@PROJECT_BINARY_DIR@/Description.txt")<br>
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test @PACKAGE@ Package")<br>SET(CPACK_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")<br><br>and finally
here is the output I get with cmake 2.6.0 and 2.6.2<br><br>Best regards,<br>Petri Hodju<br><br>--------------------------- with cmake 2.6.0 ---------------------------------<br><br>pho@host:~/misc/code/cpack$ cmake --version<br>
cmake version 2.6-patch 0<br><br>pho@host:~/misc/code/cpack$ cpack --version<br>cpack version 2.6-patch 0<br><br>pho@host:~/misc/code/cpack$ cmake .<br>-- The C compiler identification is GNU<br>-- The CXX compiler identification is GNU<br>
-- Check for working C compiler: /usr/bin/gcc<br>-- Check for working C compiler: /usr/bin/gcc -- works<br>-- Detecting C compiler ABI info<br>-- Detecting C compiler ABI info - done<br>-- Check for working CXX compiler: /usr/bin/c++<br>
-- Check for working CXX compiler: /usr/bin/c++ -- works<br>-- Detecting CXX compiler ABI info<br>-- Detecting CXX compiler ABI info - done<br>-- Configuring done<br>-- Generating done<br>-- Build files have been written to:
/home/pho/misc/code/cpack<br><br>pho@host:~/misc/code/cpack$ make<br>Scanning dependencies of target bin1<br>[100%] Building CXX object CMakeFiles/bin1.dir/bin1.cc.o<br>Linking CXX executable bin1<br>[100%] Built target bin1<br>
<br>pho@host:~/misc/code/cpack$ make pack<br>Scanning dependencies of target pack-binaries<br>CPack: Create package using DEB<br>CPack: Install projects<br>CPack: - Run preinstall target for: test<br>CPack: - Install project: test<br>
CPack: Compress package<br>CPack: Finalize package<br>CPack: Package /home/pho/misc/code/cpack/test-binaries-0.1.2-Linux.deb generated.<br>CPack: Create package using RPM<br>CPack: Install projects<br>CPack: - Run preinstall target for: test<br>
CPack: - Install project: test<br>CPack: Compress package<br>CPack: Finalize package<br>CPack: Package /home/pho/misc/code/cpack/test-binaries-0.1.2-Linux.rpm generated.<br>Built target pack-binaries<br>Scanning dependencies of target pack<br>
Built target
pack<br><br>--------------------------- with cmake 2.6.2 ---------------------------------<br><br>pho@host:~/misc/code/cpack$ cmake --version<br>cmake version 2.6-patch 2<br><br>pho@host:~/misc/code/cpack$ cpack --version<br>
cpack version 2.6-patch 2<br><br>pho@host:~/misc/code/cpack$ cmake .<br>-- The C compiler identification is GNU<br>-- The CXX compiler identification is GNU<br>-- Check for working C compiler: /usr/bin/gcc<br>-- Check for working C compiler: /usr/bin/gcc -- works<br>
-- Detecting C compiler ABI info<br>-- Detecting C compiler ABI info - done<br>-- Check for working CXX compiler: /usr/bin/c++<br>-- Check for working CXX compiler: /usr/bin/c++ -- works<br>-- Detecting CXX compiler ABI info<br>
-- Detecting CXX compiler ABI info - done<br>-- Configuring done<br>-- Generating done<br>-- Build files have been written to: /home/pho/misc/code/cpack<br><br>pho@host:~/misc/code/cpack$ make<br>Scanning dependencies of target bin1<br>
[100%]
Building CXX object CMakeFiles/bin1.dir/bin1.cc.o<br>Linking CXX executable bin1<br>[100%] Built target bin1<br><br>pho@host:~/misc/code/cpack$ make pack<br>Scanning dependencies of target pack-binaries<br>CPack: Create package using DEB<br>
CPack: Install projects<br>CPack: - Run preinstall target for: test<br>CPack: - Install project: test<br>CPack Error: Problem creating temporary directory: /opt/test<br>CPack Error: Error when generating package: test<br>
make[3]: *** [CMakeFiles/pack-binaries] Error 1<br>make[2]: *** [CMakeFiles/pack-binaries.dir/all] Error 2<br>make[1]: *** [CMakeFiles/pack.dir/rule] Error 2<br>make: *** [pack] Error 2<br></td></tr></tbody></table><br>
<br></div></div><div>_______________________________________________<br>
CMake mailing list<br>
<a rel="nofollow" href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><br>
</div><div><a rel="nofollow" href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div>
</div></div></div></blockquote></td></tr></tbody></table><br>
</blockquote></div><br></div></div></div>