[CMake] CMake, Cpack and NSIS woes.

Andrew Maclean andrew.amaclean at gmail.com
Mon Oct 12 01:09:22 EDT 2009


CPack woes continued!

I implemented it the way you recommended to avoid \\\\ hell.
You can unzip the attachment and try it out.

... And it almost works.
I can install/uninstall into C:\Program Files\MyStuff\CMakeTest 1.1
I can create an NSIS package that installs/uninstalls into C:\Program
Files\MyStuff\CMakeTest 1.1 and sets the Start Menu to
MyStuff\CMakeTest 1.1.

But it is not quite correct ...

When I look at CpackConfig.cmake,
SET(CPACK_NSIS_DISPLAY_NAME "MyStuff\CMakeTest 1.1")
SET(CPACK_NSIS_PACKAGE_NAME "MyStuff\CMakeTest 1.1")
Are set to the same value even though in CPackOptions.cmake.in
  set(CPACK_NSIS_DISPLAY_NAME "CMakeTest
@CMakeTest_VERSION_MAJOR at .@CMakeTest_VERSION_MINOR@ some sort of
program.")
  set(CPACK_NSIS_PACKAGE_NAME "@MY_INSTALL_DIRECTORY@\\CMakeTest
@CMakeTest_VERSION_MAJOR at .@CMakeTest_VERSION_MINOR@")

Manually changing CPACK_NSIS_DISPLAY_NAME  and CPACK_NSIS_PACKAGE_NAME
 has no effect.




Also
CMake Warning (dev) at
C:/Users/amaclean/Code/Projects/CPP/CMakeTest/build/CPackConfig.cmake:54
(SET):
3>  Syntax error in cmake code at
3>    C:/Users/amaclean/Code/Projects/CPP/CMakeTest/build/CPackConfig.cmake:54
3>  when parsing string
3>    MyStuff\CMakeTest 1.1
3>  Invalid escape sequence \C
3>  Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
3>  "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
3>  command to set the policy and suppress this warning.
3>This warning is for project developers.  Use -Wno-dev to suppress it.
3>CPack: Create package using NSIS

This should not happen as "MyStuff\CMakeTest 1.1" is a valid
subdirectory name in windows.
Additionally setting
cmake_policy(SET CMP0010 OLD)
in the top-level CMake file has no effect. The same message as above
occurs whether old or new is set.


I am using CMake 2.9.20091009
I am also making sure to delete the whole build directory each time.


Regards
   Andrew



On Thu, Oct 8, 2009 at 9:12 AM, Andrew Maclean
<andrew.amaclean at gmail.com> wrote:
> Thankyou very much for this hint. I will try it out.
>
> Regards
>   Andrew
>
>
> On Wed, Oct 7, 2009 at 10:56 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>> Andrew Maclean wrote:
>>>
>>> The only way that I can get this to work is to do this:
>>>
>>>  string(REPLACE "/" "\\\\" NATIVE_CMAKE_INSTALL_PATH ${INSTALL_DIRECTORY})
>>>  set(CPACK_PACKAGE_INSTALL_DIRECTORY ${NATIVE_CMAKE_INSTALL_PATH}
>>> CACHE INTERNAL "")
>>
>> So, to avoid \\\\\\ hell with CPack, you can do what we do in CMake:
>>
>> We configure the CPackOptions into a file:
>>
>>  CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
>>    "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
>>  SET(CPACK_PROJECT_CONFIG_FILE
>> "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
>> # then set this CPack variable before including CPack
>>  SET(CPACK_PROJECT_CONFIG_FILE
>> "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
>>
>> The problem with CPack is that the variables get run through the CMake
>> parser too many times.   By using the CPACK_PROJECT_CONFIG_FILE, that file
>> gets included at CPack time and only has one CMake parse on the variables
>> inside it.
>>
>> I will look at the DESTDIR issue with NSIS...
>>
>>
>>
>> -Bill
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>
>
>
> --
> ___________________________________________
> Andrew J. P. Maclean
> Centre for Autonomous Systems
> The Rose Street Building J04
> The University of Sydney  2006  NSW
> AUSTRALIA
> Ph: +61 2 9351 3283
> Fax: +61 2 9351 7474
> URL: http://www.acfr.usyd.edu.au/
> ___________________________________________
>



-- 
___________________________________________
Andrew J. P. Maclean
Centre for Autonomous Systems
The Rose Street Building J04
The University of Sydney  2006  NSW
AUSTRALIA
Ph: +61 2 9351 3283
Fax: +61 2 9351 7474
URL: http://www.acfr.usyd.edu.au/
___________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeTest.zip
Type: application/zip
Size: 22326 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091012/7291fd69/attachment-0001.zip>


More information about the CMake mailing list