[CMake] TGZ installer following links

John R. Cary cary at txcorp.com
Thu Jun 16 14:16:23 EDT 2011


On 6/16/11 12:09 PM, Eric Noulard wrote:
> 2011/6/16 John R. Cary<cary at txcorp.com>:
>> I am using the TGZ packager.

Sorry, my error in not providing more complete info:

> Which version of CMake/CPack ?
> On which platform(s) ?

octet.cary$ cmake --version
cmake version 2.8.3
octet.cary$ uname -a
Linux octet.carys.home 2.6.30.10-105.2.23.fc11.x86_64 #1 SMP Thu Feb 11 
07:06:34 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
octet.cary$


> Do you use CPack alone or CMake+CPack?

I have CPACK inside my CMakeLists.txt.

>> My dist looks something like
>>
>>         topdir
>>
>>   nextdir  link ->  nextdir/lowerdir
>>
>>   lowerdir
>>
>> It seems that CPACK, instead of copying the link, follows the link
>> so that I get two copies of lowerdir.
>>
>> Is this expected?
> I guess not, symlinks should be packaged just fine on platform where
> it is supported.
>
>> Can I change this behavior?
> Where does the symlinks comes from ?
> In which CMake INSTALL commands are they found?

if (NOT Win32)
   install(CODE
     "
     foreach (subdir foo bin current)
       execute_process(COMMAND ln -s Bar/\${subdir} .
         WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/${FLAVOR_INSTALL_ROOT}
       )
     endforeach ()
     "
   )
endif ()



> I use CMake generated symlinks (for versioned shared libs) all the time
> and this works well with CPack TGZs?

I am using links for a directory instead of a library.
> May be you can provide us with a minimal example project exhibiting the issue
> or at least send us your CPackConfig.cmake file.
>

If the above does not immediately suggest a solution to someone, I
will create a test case.

Thx for your help.....John Cary


More information about the CMake mailing list