[CMake] Example use of CPACK_INSTALL_COMMANDS

Eric Noulard eric.noulard at gmail.com
Tue Aug 6 05:33:43 EDT 2013


2013/8/6 Anil Gunturu <anil.gunturu at skyfab.com>:
> Thanks for the pointers. I got component based install working. However, I
> found the documentation pretty scarce, I had to find many things to trail
> and error.
>
> For example, CPACK_INSTALLED_DIRECTORIES takes directory name and component
> tuples, where as the documentation says "Extra directories to install".

I think CPACK_INSTALLED_DIRECTORIES should contains a list of "pairs"
first element being tne name of the directory to be installed and the second
being the relative path in th toplevel install directory.

And yes the CPack documentation is scarce in many places, contributions
(embedded documentation patches, new/update of Wiki) are welcome.

for example the documentation of "CPACK_INSTALLED_DIRECTORIES"
is embedded in "Modules/CPack.cmake" you may propose a patch for that.

> I would be glad to share some working examples, in case we have a place to
> post such examples.

Sharing example is good and may be done in Wiki page
(http://www.cmake.org/Wiki/CMake#CPack)
or could be added as a CPack testcase in the CMake source tree too.


Beware not to drop the list address (unless you really want private
communication).



>
>
> On Thu, Jul 18, 2013 at 2:08 AM, Eric Noulard <eric.noulard at gmail.com>
> wrote:
>>
>> 2013/7/18 Anil Gunturu <anil.gunturu at skyfab.com>:
>> > Can someone please share an example using CPACK_INSTALL_COMMAND?
>> >
>> > More specifically, I am trying to avoid cpack installing the files using
>> > the
>> > "make install". I prefer to use CPACK_INSTALLED_DIRECTORIES to get a
>> > fine
>> > grain control. Is there a way to override the default files that CPACK
>> > installs?
>>
>> The design and purpose of CPack is to install **every** bits specified
>> by CMake 'install(...)' command found in your CMakeLists.txt.
>>
>> Some vars like CPACK_INSTALL_COMMANDS or CPACK_INSTALLED_DIRECTORIES
>> makes it possible to install extra files/directories.
>>
>> Now if you want to filter out some parts appearing in 'install(...)'
>> you'd better use COMPONENT with your install commands and select the
>> COMPONENT to be installed by CPack using CPACK_COMPONENTS_ALL
>> see
>>
>> http://www.cmake.org/cmake/help/v2.8.8/cpack.html#variable:CPACK_COMPONENTS_ALL
>> or
>> cpack --help-variable CPACK_COMPONENTS_ALL
>>
>>
>> --
>> Erk
>> L'élection n'est pas la démocratie -- http://www.le-message.org
>
>



-- 
Erk
L'élection n'est pas la démocratie -- http://www.le-message.org


More information about the CMake mailing list