[CMake] CMake: using dlopen

Franck Houssen franck.houssen at inria.fr
Sat Jan 6 11:42:56 EST 2018


----- Mail original -----

> De: "Rainer Poisel" <rainer.poisel at gmail.com>
> À: "J Decker" <d3ck0r at gmail.com>
> Cc: "Franck Houssen" <franck.houssen at inria.fr>, cmake at cmake.org
> Envoyé: Samedi 6 Janvier 2018 17:30:53
> Objet: Re: [CMake] CMake: using dlopen

> Hi,

> I would use ${CMAKE_DL_LIBS} in target_link_libraries:

> * https://cmake.org/cmake/help/v3.0/variable/CMAKE_DL_LIBS.html

But here again, who defined ${CMAKE_DL_LIBS}: I don't see it when I run "cmake -LA ." 

> Regards,
> Rainer

> On Jan 6, 2018 16:19, "J Decker" < d3ck0r at gmail.com > wrote:

> > probably just need target_link_libraries( <target> dl )
> 

> > On Sat, Jan 6, 2018 at 6:34 AM, Franck Houssen < franck.houssen at inria.fr >
> > wrote:
> 

> > > Hello,
> > 
> 

> > > I have an executable that needs dlopen.
> > 
> 

> > > Googled this a bit: seems (surprisingly) there is no FindDLUtils ?!..
> > > Correct
> > > ? If so, why is this ?
> > 
> 
> > > My understanding is that I need to go:
> > 
> 
> > > ~BUILD> cmake -DCMAKE_LD_LIBS="-ldl -L/path/to/dl" ..
> > 
> 
> > > which is, basically, telling to CMake where dl is (although this is the
> > > job
> > > of a build system, no ?!)
> > 
> 

> > > Did I understand correctly ? Did I miss something ?
> > 
> 

> > > Franck
> > 
> 

> > > --
> > 
> 

> > > 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:
> > 
> 
> > > https://cmake.org/mailman/listinfo/cmake
> > 
> 

> > --
> 

> > 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:
> 
> > https://cmake.org/mailman/listinfo/cmake
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180106/9fd2ad39/attachment.html>


More information about the CMake mailing list