<div dir="ltr">set `CPACK_INSTALL_PREFIX` to `/usr`... by default it set to `CMAKE_INSTALL_PREFIX` which is `/usr/local` if you don't set it at `cmake` run<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 30, 2016 at 2:39 AM, Robert J. Hansen <span dir="ltr"><<a href="mailto:rjh@sixdemonbag.org" target="_blank">rjh@sixdemonbag.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> Use `|CPACK_RPM_EXCLUDE_FROM_AUTO_<wbr>FILELIST_ADDITION` to add a man's dir<br>
> to 'exclude' list, so RPM package wouldn't have a dir, but files from<br>
> it... so it wouldn't conflict w/ `filesystem` package.<br>
<br>
</span>Thank you; that solved one problem and exposed another.<br>
<br>
In my old Autotools build, I used preprocessor defines to set at<br>
compile-time where the binary should look for its data files.  In my<br>
top-level CMakeLists.txt I set a CMake variable as:<br>
<br>
        set(PKGDATADIR ${CMAKE_INSTALL_FULL_DATADIR}/<wbr>nsrlsvr)<br>
<br>
And in src/CMakeLists.txt I set the preprocessor define:<br>
<br>
        add_definitions(-DPKGDATADIR="<wbr>${PKGDATADIR}")<br>
<br>
When I build the RPM and install it, though, something weird happens:<br>
<br>
        [rjh@localhost nsrlsvr]$ /usr/bin/nsrlsvr --help<br>
        nsrlsvr options:<br>
          ... (output omitted) ...<br>
          -f [ --file ] arg (=/usr/local/share/nsrlsvr/<wbr>hashes.txt)<br>
                                                hash file<br>
<br>
The default argument for -f is not /usr/share/nsrlsvr/hashes.txt, as it<br>
should be for an RPM, but /usr/local/share/nsrlsvr/<wbr>hashes.txt, as if it<br>
were a locally-compiled package.<br>
<br>
My first thought was that I should replace CMAKE_INSTALL_FULL_DATADIR<br>
with CMAKE_INSTALL_DATADIR, but that was also less than useful:<br>
<br>
        nsrlsvr options:<br>
          ... (output omitted) ...<br>
          -f [ --file ] arg (=share/nsrlsvr/hashes.txt)<br>
                                                hash file<br>
<br>
How can I fix this?<br>
<br>
("Have your code use a relative offset from where the binary is located"<br>
is an acceptable answer; I'm hoping there's a better one, though!)<br>
<div class="HOEnZb"><div class="h5">--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>