[CMake] CPack, MinGW, strip

Peter Kümmel syntheticpp at gmx.net
Wed Feb 2 09:01:46 EST 2011


On 02.02.2011 13:43, Eric Noulard wrote:
> 2011/2/2 Peter Kümmel<syntheticpp at gmx.net>:
>> CMake 2.8.3:
>>
>> When I install with "mingw32-make install/strip"
>> the installed files are stripped.
>>
>> But when I set CPACK_STRIP_FILES to 1 and
>> use NSIS with "mingw32-make package" the binaries
>> are not stripped.
>>
>> CPackConfig.cmake looks correct:
>>
>> SET(CPACK_BINARY_NSIS "ON")
>> ...
>> SET(CPACK_CMAKE_GENERATOR "MinGW Makefiles")
>> ...
>> SET(CPACK_STRIP_FILES "1")
>>
>>
>> Is this a bug, or is there a simple fix.
>
> Should work for any generator.
> Could you try with a fresh clean build tree?
>
> Would you try with ZIP or any other CPack generator?
>
> Could you confirm you are on Windows?
>
> Would you be able to give 2.8.4-rc2 a try?
> http://www.cmake.org/files/v2.8/?C=M;O=D
> (to be sure the problem is there too).

Tried on Windows with master and a fresh clean build and
it is still there.

The problem is a missing slash in the generated install rule
in cmake_install.cmake:

     IF(CMAKE_INSTALL_DO_STRIP)
       EXECUTE_PROCESS(COMMAND ".../strip.exe" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}...")
     ENDIF(CMAKE_INSTALL_DO_STRIP)


DESTDIR is a path without a slash at the end.

Attached patch helps, but I don't know if this ts the right place to add the fix.
Better would be when the if checks if the unpacked variable starts with a slash.
Or maybe checking CPACK_TEMPORARY_INSTALL_DIRECTORY?


Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: destdir_slash.patch
Type: text/x-patch
Size: 659 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110202/540932c4/attachment-0001.bin>


More information about the CMake mailing list