<div dir="ltr">This is fixed now in CVS HEAD:<div><div>&nbsp;&nbsp; &nbsp;/cvsroot/CMake/CMake/Source/CPack/cmCPackGenerator.cxx,v &nbsp;&lt;-- &nbsp;Source/CPack/cmCPackGenerator.cxx</div><div>&nbsp;&nbsp; &nbsp;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&nbsp;&quot;${CMAKE_CPACK_COMMAND}&quot; 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 &quot;make pack&quot; 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">&lt;<a href="mailto:petrihodju@yahoo.com">petrihodju@yahoo.com</a>&gt;</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&#39;t have full understanding of the big picture, I won&#39;t get it right without breaking something else somewhere... So, I&#39;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>&lt;<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>&gt;</i></b> wrote:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px">
From: David Cole &lt;<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>&gt;<br>Subject: Re: [CMake] CPack 2.6.2: can&#39;t create temporary directory<br>To: &quot;Petri Hodju&quot; &lt;<a href="mailto:petrihodju@yahoo.com" target="_blank">petrihodju@yahoo.com</a>&gt;<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 &quot;cpack&quot; 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">&lt;<a rel="nofollow" href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>&gt;</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 &quot;/opt&quot; on my Linux machine.&nbsp;So... the error message is not really surprising to me.&nbsp;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 &quot;/opt&quot; 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">&lt;<a rel="nofollow" href="mailto:petrihodju@yahoo.com" target="_blank">petrihodju@yahoo.com</a>&gt;</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&#39;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&#39;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&#39;t bother with the tar file here is written out the CMakeLists.txt &amp; 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 &quot;${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}&quot;)<br><br>#-------------------------------------------------------------------------------<br># macro for creating packages.<br>


#-------------------------------------------------------------------------------<br><br>ADD_CUSTOM_TARGET(pack)<br><br>MACRO(ADD_PACKAGE COMPONENT)<br>&nbsp; SET(TARGET pack-${COMPONENT})<br>&nbsp; SET(CONFIG &quot;CPackConfig-${COMPONENT}.cmake&quot;)<br>


&nbsp; SET(PACKAGE ${COMPONENT})<br>&nbsp; CONFIGURE_FILE(&quot;CPackConfig.in&quot; &quot;${CONFIG}&quot; @ONLY)<br>&nbsp; ADD_CUSTOM_TARGET(${TARGET} COMMAND cpack --config &quot;${CONFIG}&quot;)<br>&nbsp; ADD_DEPENDENCIES(pack
 ${TARGET})<br>ENDMACRO(ADD_PACKAGE)<br><br>#-------------------------------------------------------------------------------<br># installation path settings<br>#-------------------------------------------------------------------------------<br>


<br>SET(CMAKE_SET_DESTDIR &quot;ON&quot;)<br>SET(CMAKE_INSTALL_PREFIX &quot;/opt/test&quot;)<br>SET(CPACK_GENERATOR &quot;DEB&quot; &quot;RPM&quot;)<br><br>#-------------------------------------------------------------------------------<br>


# create test binary<br>#-------------------------------------------------------------------------------<br><br>ADD_EXECUTABLE(bin1 &quot;bin1.cc&quot;)<br>INSTALL(TARGETS bin1 DESTINATION &quot;bin&quot; COMPONENT &quot;binaries&quot;)<br>


ADD_PACKAGE(binaries)<br><br>CPackConfig.in:<br><br>#===============================================================================<br># template for package generation<br>#===============================================================================<br>


<br>SET(CMAKE_SET_DESTDIR
 &quot;@CMAKE_SET_DESTDIR@&quot;)<br>SET(CMAKE_INSTALL_PREFIX &quot;@CMAKE_INSTALL_PREFIX@&quot;)<br>SET(CPACK_SET_DESTDIR &quot;@CMAKE_SET_DESTDIR@&quot;)<br>SET(CPACK_INSTALL_PREFIX &quot;@CMAKE_INSTALL_PREFIX@&quot;)<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 &quot;@CMAKE_GENERATOR@&quot;)<br>


SET(CPACK_GENERATOR &quot;@CPACK_GENERATOR@&quot;)<br><br>SET(CPACK_INSTALL_CMAKE_PROJECTS &quot;@PROJECT_BINARY_DIR@;@PROJECT_NAME@;@PACKAGE@;/&quot;)<br>SET(CPACK_PACKAGE_FILE_NAME &quot;@PROJECT_NAME@-@PACKAGE@-@VERSION@-@CMAKE_SYSTEM_NAME@&quot;)<br>


SET(CPACK_PACKAGE_NAME &quot;@PROJECT_NAME@&quot;)<br>SET(CPACK_PACKAGE_VENDOR &quot;Test Vendor&quot;)<br>SET(CPACK_PACKAGE_CONTACT &quot;<a rel="nofollow" href="mailto:test@vendor.org" target="_blank">test@vendor.org</a>&quot;)<br>
SET(CPACK_PACKAGE_DESCRIPTION_FILE &quot;@PROJECT_BINARY_DIR@/Description.txt&quot;)<br>

SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY &quot;Test @PACKAGE@ Package&quot;)<br>SET(CPACK_SYSTEM_NAME &quot;@CMAKE_SYSTEM_NAME@&quot;)<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>