I reproduced this. In the CPackConfig.cmake that ends up in the binary tree, the following contents are found:<br><br>SET(CPACK_NSIS_DISPLAY_NAME "MyStuff\CMakeTest 1.1")<br>SET(CPACK_NSIS_PACKAGE_NAME "MyStuff\CMakeTest 1.1")<br>
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "MyStuff\\CMakeTest 1.1")<br><br>The display name and package name values are not properly escaped... they come from the default value for CPACK_PACKAGE_INSTALL_DIRECTORY, but that cannot contain backslashes because then variables go through multiple levels of escaping. So.... <br>
<br>my recommendation is to leave CPACK_PACKAGE_INSTALL_DIRECTORY at its default value and not put any backslashes in it. Then change it inside your <a href="http://CPackOptions.cmake.in">CPackOptions.cmake.in</a> file along with the NSIS variables you are already setting.<br>
<br>If I comment out line 23 of CMakeFiles/CPack.cmake, then the NSIS package builds successfully. Then you can tweak from there (I hope!) to get your desired settings.<br><br><br>Hope this helps,<br>David<br><br><br><div class="gmail_quote">
On Mon, Oct 12, 2009 at 1:09 AM, Andrew Maclean <span dir="ltr"><<a href="mailto:andrew.amaclean@gmail.com">andrew.amaclean@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
CPack woes continued!<br>
<br>
I implemented it the way you recommended to avoid \\\\ hell.<br>
You can unzip the attachment and try it out.<br>
<br>
... And it almost works.<br>
I can install/uninstall into C:\Program Files\MyStuff\CMakeTest 1.1<br>
I can create an NSIS package that installs/uninstalls into C:\Program<br>
Files\MyStuff\CMakeTest 1.1 and sets the Start Menu to<br>
MyStuff\CMakeTest 1.1.<br>
<br>
But it is not quite correct ...<br>
<br>
When I look at CpackConfig.cmake,<br>
SET(CPACK_NSIS_DISPLAY_NAME "MyStuff\CMakeTest 1.1")<br>
SET(CPACK_NSIS_PACKAGE_NAME "MyStuff\CMakeTest 1.1")<br>
Are set to the same value even though in <a href="http://CPackOptions.cmake.in" target="_blank">CPackOptions.cmake.in</a><br>
set(CPACK_NSIS_DISPLAY_NAME "CMakeTest<br>
@CMakeTest_VERSION_MAJOR@.@CMakeTest_VERSION_MINOR@ some sort of<br>
program.")<br>
set(CPACK_NSIS_PACKAGE_NAME "@MY_INSTALL_DIRECTORY@\\CMakeTest<br>
@CMakeTest_VERSION_MAJOR@.@CMakeTest_VERSION_MINOR@")<br>
<br>
Manually changing CPACK_NSIS_DISPLAY_NAME and CPACK_NSIS_PACKAGE_NAME<br>
has no effect.<br>
<br>
<br>
<br>
<br>
Also<br>
CMake Warning (dev) at<br>
C:/Users/amaclean/Code/Projects/CPP/CMakeTest/build/CPackConfig.cmake:54<br>
<div class="im">(SET):<br>
3> Syntax error in cmake code at<br>
</div>3> C:/Users/amaclean/Code/Projects/CPP/CMakeTest/build/CPackConfig.cmake:54<br>
3> when parsing string<br>
3> MyStuff\CMakeTest 1.1<br>
3> Invalid escape sequence \C<br>
<div class="im">3> Policy CMP0010 is not set: Bad variable reference syntax is an error. Run<br>
3> "cmake --help-policy CMP0010" for policy details. Use the cmake_policy<br>
3> command to set the policy and suppress this warning.<br>
3>This warning is for project developers. Use -Wno-dev to suppress it.<br>
</div>3>CPack: Create package using NSIS<br>
<br>
This should not happen as "MyStuff\CMakeTest 1.1" is a valid<br>
subdirectory name in windows.<br>
Additionally setting<br>
cmake_policy(SET CMP0010 OLD)<br>
in the top-level CMake file has no effect. The same message as above<br>
occurs whether old or new is set.<br>
<br>
<br>
I am using CMake 2.9.20091009<br>
I am also making sure to delete the whole build directory each time.<br>
<br>
<br>
Regards<br>
<font color="#888888"> Andrew<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
On Thu, Oct 8, 2009 at 9:12 AM, Andrew Maclean<br>
<<a href="mailto:andrew.amaclean@gmail.com">andrew.amaclean@gmail.com</a>> wrote:<br>
> Thankyou very much for this hint. I will try it out.<br>
><br>
> Regards<br>
> Andrew<br>
><br>
><br>
> On Wed, Oct 7, 2009 at 10:56 PM, Bill Hoffman <<a href="mailto:bill.hoffman@kitware.com">bill.hoffman@kitware.com</a>> wrote:<br>
>> Andrew Maclean wrote:<br>
>>><br>
>>> The only way that I can get this to work is to do this:<br>
>>><br>
>>> string(REPLACE "/" "\\\\" NATIVE_CMAKE_INSTALL_PATH ${INSTALL_DIRECTORY})<br>
>>> set(CPACK_PACKAGE_INSTALL_DIRECTORY ${NATIVE_CMAKE_INSTALL_PATH}<br>
>>> CACHE INTERNAL "")<br>
>><br>
>> So, to avoid \\\\\\ hell with CPack, you can do what we do in CMake:<br>
>><br>
>> We configure the CPackOptions into a file:<br>
>><br>
>> CONFIGURE_FILE("${CMake_SOURCE_DIR}/<a href="http://CMakeCPackOptions.cmake.in" target="_blank">CMakeCPackOptions.cmake.in</a>"<br>
>> "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)<br>
>> SET(CPACK_PROJECT_CONFIG_FILE<br>
>> "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")<br>
>> # then set this CPack variable before including CPack<br>
>> SET(CPACK_PROJECT_CONFIG_FILE<br>
>> "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")<br>
>><br>
>> The problem with CPack is that the variables get run through the CMake<br>
>> parser too many times. By using the CPACK_PROJECT_CONFIG_FILE, that file<br>
>> gets included at CPack time and only has one CMake parse on the variables<br>
>> inside it.<br>
>><br>
>> I will look at the DESTDIR issue with NSIS...<br>
>><br>
>><br>
>><br>
>> -Bill<br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the CMake FAQ at:<br>
>> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> ___________________________________________<br>
> Andrew J. P. Maclean<br>
> Centre for Autonomous Systems<br>
> The Rose Street Building J04<br>
> The University of Sydney 2006 NSW<br>
> AUSTRALIA<br>
> Ph: +61 2 9351 3283<br>
> Fax: +61 2 9351 7474<br>
> URL: <a href="http://www.acfr.usyd.edu.au/" target="_blank">http://www.acfr.usyd.edu.au/</a><br>
> ___________________________________________<br>
><br>
<br>
<br>
<br>
--<br>
___________________________________________<br>
Andrew J. P. Maclean<br>
Centre for Autonomous Systems<br>
The Rose Street Building J04<br>
The University of Sydney 2006 NSW<br>
AUSTRALIA<br>
Ph: +61 2 9351 3283<br>
Fax: +61 2 9351 7474<br>
URL: <a href="http://www.acfr.usyd.edu.au/" target="_blank">http://www.acfr.usyd.edu.au/</a><br>
___________________________________________<br>
</div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>