> I would like to end up with the following in the specs file:
>
> ...
> %file
> ...
> %if 0%{fedora} >= 14
> "/path/to/some/file"
> %endif
>
> I tried to use CPACK_RPM_USER_FILELIST as
>
> set(CPACK_RPM_USER_FILELIST ${CPACK_RPM_USER_FILELIST}
>     "%if 0%{fedora} >= 14"
>     "/path/to/some/file"
>     "%endif"
> )
>
> but this results in
>
> %if "0%{fedora} >= 14"
> "/path/to/some/file"
> %endif "%endif"
> which is not quite right.
>
> Is there something I am missing? Or is it a fundamental limitation of CPack
> RPM generator?

This seems to be a bug in CPackRPM. Please report it in bug tracker.

> If so, would there be any workaround? Thanks in advance for
> any help.

You could either fix it in CPackRPM.cmake and provide a patch.

Alternatively you could simply copy spec file template from
CPackRPM.cmake, save it into your own spec template file and extend it
with your own CPACK_* variable that will be substituted during
packaging. Then use CPACK_RPM_USER_BINARY_SPECFILE or
CPACK_RPM_<COMPONENT>_USER_BINARY_SPECFILE for component packages.

See documentation of this variable for details:
http://www.cmake.org/cmake/help/v3.2/module/CPackRPM.html

Regards,
Domen
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to