[CMake] Windows 260 Char Limit Hit with CPack

David A. Alexander alexanda at txcorp.com
Mon May 21 00:14:12 EDT 2012


We are running CPack remotely through Jenkins [1] to end up running a build/package process on a Windows 2008 Server machine and are seeing errors during the install into the _CPack_Packages directory because file paths exceeds the windows 260 character limit [2].  We have seen posts about this problem [3] where the solution is to build outside of the source directory, but this is not desirable for us because with Jenkins we want to save build artifacts and look at the workspace remotely.  For those not familiar with Jenkins, the shortest build path starts with...

C:\user_name\jenkins\workspace\project_name\configuration_name\machine_name

And any builds that are put under this base directory are then accessible through the web interface, which is very desirable for us.  If we build out-of-place, then CPack works, but we don't see any of the build information through the Jenkins interface.

We can make all of the names short, but we still run over the 260 character because the directories being copied during the install involve many subdirectories. This is due to third-party software that we can not control.  What we would like is to be able to customize the destination directory for the CPack install (i.e. define the _CPack_Packages directory, so that can be in something like C:\tmp\_CPack_Package to stay under the 260 character limit).

Is there any way to set where the _CPack_Packages directory ends up rather than having it under the build directory?  We can build CMake itself and, if necessary, patch it to set this property.  In other words, if we can make some change/customization in CMake where all of the _CPack_Packages directories land under C:\tmp or some other short directory, then that is an acceptable solution.  We just need to know what code to change. 

Thanks,

David A. Alexander
Tech-X Corporation


[1] Jenkins is 
https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins

[2] For more info on the 260 character file path limit on windows see
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/aa365247.aspx

[3] Relevant Posts:
http://www.cmake.org/pipermail/cmake/2011-January/041678.html
http://cmake.3232098.n2.nabble.com/cpack-and-paths-too-long-td7480993.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120520/799ebbc4/attachment.htm>


More information about the CMake mailing list