<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">CMake won’t and in my opinion shouldn’t implicitly invoke ldconfig for you. There are many scenarios and platforms where this is incorrect behavior and some such as running install to prepare for packaging that CMake wouldn’t reliably be able to detect.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">If you want to provide the functionality for your users you could add something like the following to your CMakeLists.txt:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">install(CODE “execute_process(COMMAND ldconfig)”)</div> <div><br></div><div>This will need to run after your other installed targets. I can’t find any way in the CMake documentation to force install ordering but it seems like as long as CMake processes that install command last it will perform it last. So at the very end of your top level CMakeLists.txt file should do the trick. </div><br> <div id="bloop_sign_1466081480127023104" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Matt Keeler<br><br></div></div> <br><p class="airmail_on">On June 15, 2016 at 22:12:09, Young Yang (<a href="mailto:afe.young@gmail.com">afe.young@gmail.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>


<title></title>


<div dir="ltr">
<div>Hi,</div>
<div>I've encountered some problem when writing install target with
cmake.</div>
<div><br></div>
<div>I use `install (TARGETS <my_shared_library> DESTINATION
lib)` to install my shared_library.</div>
<div>However, when I run `make install`. It just install the .so to
/usr/local/lib and didn't run the ldconfig.</div>
<div><br></div>
<div>I think it is strange and inconvenient to tell the user he
should run ldconfig by himself or herself.</div>
<div><br></div>
<div>What is the best way to make the ldconfig run
automatically?</div>
<div><br></div>
<div><br></div>
<div>Thanks in advance :)</div>
<div><br></div>
--<br>
<div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div style="font-size:12.8px"><span style="font-size:small">Best
wishes,</span><br></div>
<div><font size="2">Young Yang</font></div>
</div>
</div>
</div>
</div>
</div>
</div>


--  
<br>
<br>Powered by <a href="http://www.kitware.com">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">http://www.cmake.org/Wiki/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">http://cmake.org/cmake/help/support.html</a>
<br>CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html">http://cmake.org/cmake/help/consulting.html</a>
<br>CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html">http://cmake.org/cmake/help/training.html</a>
<br>
<br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
<br>
<br>Follow this link to subscribe/unsubscribe:
<br><a href="http://public.kitware.com/mailman/listinfo/cmake">http://public.kitware.com/mailman/listinfo/cmake</a></div></div></span></blockquote></body></html>