[CMake] CPack 2.6.2: can't create temporary directory

David Cole david.cole at kitware.com
Tue Oct 14 16:44:55 EDT 2008


Scratch my last reply somewhat.....
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.

So. It does work with CPack 2.6.0 and I will work on the fix....

:-)

Sorry for the pilot error,
David


On Tue, Oct 14, 2008 at 4:24 PM, David Cole <david.cole at kitware.com> wrote:

> 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 2.6.2.
> Maybe you lost permissions to your "/opt" directory at the same time that
> you upgraded to CMake 2.6.2.....??
>
> 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.
>
>
> Thanks,
> David Cole
> Kitware, Inc.
>
>
> On Mon, Oct 13, 2008 at 6:05 AM, Petri Hodju <petrihodju at yahoo.com> wrote:
>
>> Hi!
>>
>> I have put together a custom way of building packages inspired by Stuart
>> Herring posted here earlier:
>>
>> Fri Apr 4 20:39:04 EDT 2008
>> [CMake] CPack: Building Multiple Packages
>>
>> Everything is working fine with version 2.6.0 but things break up with
>> 2.6.2. The
>> error I get is like:
>>
>> CPack Error: Problem creating temporary directory: /opt/test
>>
>> 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.
>>
>> I have attached to this mail a tar package containing full example of the
>> problem.
>>
>> 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:
>>
>> CMakeLists.txt:
>>
>>
>> #===============================================================================
>> # Top level project makefile
>>
>> #===============================================================================
>>
>> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
>>
>> PROJECT(test)
>>
>> SET(VERSION_MAJOR 0)
>> SET(VERSION_MINOR 1)
>> SET(VERSION_PATCH 2)
>> SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
>>
>>
>> #-------------------------------------------------------------------------------
>> # macro for creating packages.
>>
>> #-------------------------------------------------------------------------------
>>
>> ADD_CUSTOM_TARGET(pack)
>>
>> MACRO(ADD_PACKAGE COMPONENT)
>>   SET(TARGET pack-${COMPONENT})
>>   SET(CONFIG "CPackConfig-${COMPONENT}.cmake")
>>   SET(PACKAGE ${COMPONENT})
>>   CONFIGURE_FILE("CPackConfig.in" "${CONFIG}" @ONLY)
>>   ADD_CUSTOM_TARGET(${TARGET} COMMAND cpack --config "${CONFIG}")
>>   ADD_DEPENDENCIES(pack ${TARGET})
>> ENDMACRO(ADD_PACKAGE)
>>
>>
>> #-------------------------------------------------------------------------------
>> # installation path settings
>>
>> #-------------------------------------------------------------------------------
>>
>> SET(CMAKE_SET_DESTDIR "ON")
>> SET(CMAKE_INSTALL_PREFIX "/opt/test")
>> SET(CPACK_GENERATOR "DEB" "RPM")
>>
>>
>> #-------------------------------------------------------------------------------
>> # create test binary
>>
>> #-------------------------------------------------------------------------------
>>
>> ADD_EXECUTABLE(bin1 "bin1.cc")
>> INSTALL(TARGETS bin1 DESTINATION "bin" COMPONENT "binaries")
>> ADD_PACKAGE(binaries)
>>
>> CPackConfig.in:
>>
>>
>> #===============================================================================
>> # template for package generation
>>
>> #===============================================================================
>>
>> SET(CMAKE_SET_DESTDIR "@CMAKE_SET_DESTDIR@")
>> SET(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
>> SET(CPACK_SET_DESTDIR "@CMAKE_SET_DESTDIR@")
>> SET(CPACK_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
>>
>> SET(CPACK_PACKAGE_VERSION_MAJOR @VERSION_MAJOR@)
>> SET(CPACK_PACKAGE_VERSION_MINOR @VERSION_MINOR@)
>> SET(CPACK_PACKAGE_VERSION_PATCH @VERSION_PATCH@)
>>
>> SET(CPACK_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
>> SET(CPACK_GENERATOR "@CPACK_GENERATOR@")
>>
>> SET(CPACK_INSTALL_CMAKE_PROJECTS "@PROJECT_BINARY_DIR@;@PROJECT_NAME@
>> ;@PACKAGE@;/")
>> SET(CPACK_PACKAGE_FILE_NAME "@PROJECT_NAME at -@PACKAGE at -@VERSION@
>> - at CMAKE_SYSTEM_NAME@")
>> SET(CPACK_PACKAGE_NAME "@PROJECT_NAME@")
>> SET(CPACK_PACKAGE_VENDOR "Test Vendor")
>> SET(CPACK_PACKAGE_CONTACT "test at vendor.org")
>> SET(CPACK_PACKAGE_DESCRIPTION_FILE "@PROJECT_BINARY_DIR@
>> /Description.txt")
>> SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test @PACKAGE@ Package")
>> SET(CPACK_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
>>
>> and finally here is the output I get with cmake 2.6.0 and 2.6.2
>>
>> Best regards,
>> Petri Hodju
>>
>> --------------------------- with cmake 2.6.0
>> ---------------------------------
>>
>> pho at host:~/misc/code/cpack$ cmake --version
>> cmake version 2.6-patch 0
>>
>> pho at host:~/misc/code/cpack$ cpack --version
>> cpack version 2.6-patch 0
>>
>> pho at host:~/misc/code/cpack$ cmake .
>> -- The C compiler identification is GNU
>> -- The CXX compiler identification is GNU
>> -- Check for working C compiler: /usr/bin/gcc
>> -- Check for working C compiler: /usr/bin/gcc -- works
>> -- Detecting C compiler ABI info
>> -- Detecting C compiler ABI info - done
>> -- Check for working CXX compiler: /usr/bin/c++
>> -- Check for working CXX compiler: /usr/bin/c++ -- works
>> -- Detecting CXX compiler ABI info
>> -- Detecting CXX compiler ABI info - done
>> -- Configuring done
>> -- Generating done
>> -- Build files have been written to: /home/pho/misc/code/cpack
>>
>> pho at host:~/misc/code/cpack$ make
>> Scanning dependencies of target bin1
>> [100%] Building CXX object CMakeFiles/bin1.dir/bin1.cc.o
>> Linking CXX executable bin1
>> [100%] Built target bin1
>>
>> pho at host:~/misc/code/cpack$ make pack
>> Scanning dependencies of target pack-binaries
>> CPack: Create package using DEB
>> CPack: Install projects
>> CPack: - Run preinstall target for: test
>> CPack: - Install project: test
>> CPack: Compress package
>> CPack: Finalize package
>> CPack: Package /home/pho/misc/code/cpack/test-binaries-0.1.2-Linux.deb
>> generated.
>> CPack: Create package using RPM
>> CPack: Install projects
>> CPack: - Run preinstall target for: test
>> CPack: - Install project: test
>> CPack: Compress package
>> CPack: Finalize package
>> CPack: Package /home/pho/misc/code/cpack/test-binaries-0.1.2-Linux.rpm
>> generated.
>> Built target pack-binaries
>> Scanning dependencies of target pack
>> Built target pack
>>
>> --------------------------- with cmake 2.6.2
>> ---------------------------------
>>
>> pho at host:~/misc/code/cpack$ cmake --version
>> cmake version 2.6-patch 2
>>
>> pho at host:~/misc/code/cpack$ cpack --version
>> cpack version 2.6-patch 2
>>
>> pho at host:~/misc/code/cpack$ cmake .
>> -- The C compiler identification is GNU
>> -- The CXX compiler identification is GNU
>> -- Check for working C compiler: /usr/bin/gcc
>> -- Check for working C compiler: /usr/bin/gcc -- works
>> -- Detecting C compiler ABI info
>> -- Detecting C compiler ABI info - done
>> -- Check for working CXX compiler: /usr/bin/c++
>> -- Check for working CXX compiler: /usr/bin/c++ -- works
>> -- Detecting CXX compiler ABI info
>> -- Detecting CXX compiler ABI info - done
>> -- Configuring done
>> -- Generating done
>> -- Build files have been written to: /home/pho/misc/code/cpack
>>
>> pho at host:~/misc/code/cpack$ make
>> Scanning dependencies of target bin1
>> [100%] Building CXX object CMakeFiles/bin1.dir/bin1.cc.o
>> Linking CXX executable bin1
>> [100%] Built target bin1
>>
>> pho at host:~/misc/code/cpack$ make pack
>> Scanning dependencies of target pack-binaries
>> CPack: Create package using DEB
>> CPack: Install projects
>> CPack: - Run preinstall target for: test
>> CPack: - Install project: test
>> CPack Error: Problem creating temporary directory: /opt/test
>> CPack Error: Error when generating package: test
>> make[3]: *** [CMakeFiles/pack-binaries] Error 1
>> make[2]: *** [CMakeFiles/pack-binaries.dir/all] Error 2
>> make[1]: *** [CMakeFiles/pack.dir/rule] Error 2
>> make: *** [pack] Error 2
>>
>>
>> _______________________________________________
>> CMake mailing list
>> CMake at cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081014/03bc9e4a/attachment-0001.htm>


More information about the CMake mailing list