[CMake] Setting CPACK_PACKAGE_FILE_NAME per COMPONENT
Iosif Neitzke
iosif.neitzke+cmake at gmail.com
Fri Jan 30 09:48:02 EST 2015
Unfortunately it would take more than one run of CPack, but you may
find useful something like:
in CMakeLists.txt:
set( CPACK_PROJECT_CONFIG_FILE
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeCPackOptions.cmake" )
in CMakeCPackOptions.cmake:
set( CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}" )
which would let you run for each component:
cpack -G DEB -D CPACK_COMPONENTS_ALL="ComponentX" -P PackageNameForComponentX
to produce a PackageNameForComponentX.deb for each run of cpack
https://github.com/Kitware/CMake/blob/master/CMakeCPackOptions.cmake.in
On Fri, Jan 30, 2015 at 6:05 AM, Rob Harris <rob.harris at gmail.com> wrote:
> On 01/29/2015 11:24 PM, Iosif Neitzke wrote:
>>
>> Where for a single run of CPack, each component name produces a
>> corresponding named .deb file or ...?
>
> Yes. Exactly.
>>
>> Have you tried using CPACK_PROJECT_CONFIG_FILE [0]? This allows you
>> to set a few options at packaging time which can change the final
>> output package file name.
>>
>> [0] http://www.cmake.org/cmake/help/v3.1/module/CPack.html
>
> Maybe I'm missing something, but how does that help me if there isn't an
> accessible variable that contains the name of the component actively being
> packaged?
>
> -R
>
More information about the CMake
mailing list