[CMake] Change cpack install folder

David Cole david.cole at kitware.com
Sat Dec 17 14:12:19 EST 2011


On Sat, Dec 17, 2011 at 1:48 PM, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2011/12/17 David Cole <david.cole at kitware.com>:
>> On Sat, Dec 17, 2011 at 12:32 PM, Eric Noulard <eric.noulard at gmail.com> wrote:
>>> 2011/12/17 Totte Karlsson <totte at dunescientific.com>:
>>>>
>>>> But I found this NSIS specific setting
>>>> CPACK_NSIS_INSTALL_ROOT
>>>> But setting that as C:\\ still create the error: "Function missing ending
>>>> ")" ".
>>>>
>>>> Not sure how to get this one right..
>>>
>>> set(CPACK_NSIS_INSTALL_ROOT "C:")
>>>
>>> should work.
>>>
>>> It is awkward but since the template contains:
>>>
>>> InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
>>>
>>> you cannot remove middle "\", thus the unexpected "C:" (not back
>>> slashes whatsoever)
>>>
>>>
>>> --
>>> Erk
>>> Membre de l'April - « promouvoir et défendre le logiciel libre » -
>>> http://www.april.org
>>> --
>>>
>>> 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
>>
>> I disagree that "C:" is awkward compared to "C:\\" -- it follows the
>> unwritten rule of "thou shalt never end a directory name with a
>> trailing slash when using it as a variable value when the variable is
>> meant to be composed into a longer full path name".
>>
>> (But I understand why you say it's awkward...)
>>
>> That variable was added as a bug fix in this commit last January:
>>
>>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5a9e8e701e6e55ddacbc465f4bfb0da3d028ccb0
>>
>> CPACK_NSIS_INSTALL_ROOT is available in CPack 2.8.4 and later.
>
> Too bad one did not use CPACK_PACKAGING_INSTALL_PREFIX...
> they look like both have the same meaning.
>
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org

Their meaning is similar, but subtly different, I think.

CPack uses the value of CPACK_PACKAGING_INSTALL_PREFIX as the prefix
of its own "make install" tree of your project that it uses in its
build tree as it's assembling the tree that gets passed as input to
the native packaging tool. That prefix does not necessarily have
anything to do with the default value that an end user installer
program displays to the end user about where to install a program by
default.

I suppose they *could* be the same values, but I think it's a good
thing to have separate variables for each concept.

CPACK_PACKAGING_INSTALL_PREFIX is used internally by CPack generators
and may (or may not) be used to set values that get communicated to
the end user.

CPACK_NSIS_INSTALL_ROOT is used only for the NSIS packager, and only
to change the root of the default suggestion from "Program Files" to
something else.


David


More information about the CMake mailing list