<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 16 sept. 2019 à 18:12, Ashish Sadanandan <<a href="mailto:ashish.sadanandan@gmail.com">ashish.sadanandan@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Sep 12, 2019 at 4:57 AM Eric Noulard <<a href="mailto:eric.noulard@gmail.com" target="_blank">eric.noulard@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> Le jeu. 12 sept. 2019 à 02:27, Ashish Sadanandan <<a href="mailto:ashish.sadanandan@gmail.com" target="_blank">ashish.sadanandan@gmail.com</a>> a écrit :<br><br>
><br>
> Now may be you can tell CPack to ignore some of you installed files/directory by using: CPACK_RPM_USER_FILELIST<br>
>  <a href="https://cmake.org/cmake/help/v3.15/cpack_gen/rpm.html#cpack_gen:CPack%20RPM%20Generator" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/v3.15/cpack_gen/rpm.html#cpack_gen:CPack%20RPM%20Generator</a><br>
><br>
<br>
Sorry, I should've mentioned in the original email that the files are<br>
required, so ignoring is not what I want.<br></blockquote><div><br></div><div>My answer wasn't clear, using   CPACK_RPM_USER_FILELIST enables you to specify the de %file and/or %dir </div><div>directive you want and it thus make CPackRPM avoid using its ownn generated file list  (i.e. ignore it).</div><div><br></div><div>You can somehow override the builtin file and dir discovery of CPack.</div><div> </div><div>As the doc says:</div><div>"<span style="color:rgb(68,68,68);font-family:sans-serif;font-size:16px;text-align:justify">Since the CPack RPM generator is generating the list of files (and directories) the user specified files of the </span><code class="gmail-docutils gmail-literal gmail-notranslate" style="background-color:rgb(236,240,243);padding:0px 1px;font-size:0.95em;color:rgb(68,68,68);text-align:justify"><span class="gmail-pre" style="hyphens: none;">CPACK_RPM_<COMPONENT>_USER_FILELIST</span></code><span style="color:rgb(68,68,68);font-family:sans-serif;font-size:16px;text-align:justify"> list will be removed from the generated list. If referring to directories do not add a trailing slash."</span></div><div><span style="color:rgb(68,68,68);font-family:sans-serif;font-size:16px;text-align:justify"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>> I'm not claiming this is the reason for CPack being slow, I came across this while investigating performance and if nothing else, this will result in a cleaner looking spec file.<br>
><br>
><br>
> For performance sake you can try CPACK_RPM_USER_BINARY_SPECFILE, CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE<br>
> and handcraft your "user" spec file in order to see if it helps the packaging performance.<br>
> and/or you can set CPACK_RPM_PACKAGE_DEBUG to 1 in order to get more timed traces of CPackRPM execution.<br>
><br>
<br>
Thanks, this looks promising but I'm having trouble getting CPack to<br>
use my custom spec file. This is what I've added to my CMakeLists.txt<br>
so far (using cmake 3.6.3)<br></blockquote><div><br></div><div><br></div><div>Then be sure to read the corresponding documentation: <a href="https://cmake.org/cmake/help/v3.6/module/CPackRPM.html">https://cmake.org/cmake/help/v3.6/module/CPackRPM.html</a></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
    # We're already using component install<br>
    set(CPACK_RPM_COMPONENT_INSTALL ON)<br>
    set(CPACK_RPM_TESTS_FILE_NAME<br>
        "${CPACK_PACKAGE_NAME}-tests-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}.rpm"<br>
    )<br>
    install(DIRECTORY ${CMAKE_BINARY_DIR}/tests<br>
            DESTINATION tests<br>
            COMPONENT tests<br>
    )<br>
    set(CPACK_RPM_TESTS_USER_BINARY_SPECFILE<br>
        "${CMAKE_CURRENT_SOURCE_DIR}/tests.spec"<br>
    )<br>
<br>
But CPack is still generating a spec file for the tests RPM instead of<br>
using my spec file. I've even tried using an absolute path to the spec<br>
file but still the same behavior. What am I doing wrong?<br></blockquote><div><br></div><div>Difficult to say without seeing your CMakeLists.txt or verbose CPack output.</div><div> </div><div>Did you set those variables before or after include(CPack) ?</div><div>Those vars should be set *before*  include(CPack) otherwise they won't be taken into account.</div><div><br></div><div>Did you try running CPack in debug mode:</div></div><br clear="all"><div><font face="monospace">cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM<br></font></div><div><font face="monospace"><br></font></div><div>in order to have more verbose output?</div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div>