----- Mail original ----- > De: "Konstantin Tokarev" <annu...@yandex.ru> > À: "Franck Houssen" <franck.hous...@inria.fr> > Cc: cmake@cmake.org, "Roger Leigh" <rle...@codelibre.net> > Envoyé: Dimanche 7 Janvier 2018 17:50:40 > Objet: Re: [CMake] CMake: using dlopen > > > > 07.01.2018, 19:36, "Franck Houssen" <franck.hous...@inria.fr>: > > ----- Mail original ----- > >> De: "Konstantin Tokarev" <annu...@yandex.ru> > >> À: "Franck Houssen" <franck.hous...@inria.fr> > >> Cc: cmake@cmake.org, "Roger Leigh" <rle...@codelibre.net> > >> Envoyé: Dimanche 7 Janvier 2018 15:20:08 > >> Objet: Re: [CMake] CMake: using dlopen > >> > >> > ----- Mail original ----- > >> > > >> >> De: "Roger Leigh" <rle...@codelibre.net> > >> >> À: cmake@cmake.org > >> >> Envoyé: Samedi 6 Janvier 2018 18:42:11 > >> >> Objet: Re: [CMake] CMake: using dlopen > >> >> > >> >> On 06/01/18 17:01, J Decker wrote: > >> >>> CMake/shared/modules will define the CMAKE_DL_LIBS which a very high > >> >>> percentage of the time will just be library 'dl' . > >> > > >> > OK. I didn't know that. But if so, why don't you see CMAKE_DL_LIBS when > >> > you > >> > run "cmake -LA ." and/or when you toggle adanced mode in ccmake ? > >> > What's > >> > the correct way to see all variables ? > >> > >> Because cmake -L shows only cached variables, not all variables > > > > How to see all variables ? > > See first part of https://stackoverflow.com/a/9328525 >
OK, I see ! Thanks > > > >> > > >> >>> > >> >>> Pretty much any man page on dlopen defines 'dl' > >> >> > >> >> On Linux. On MaxOSX and FreeBSD not at all, where the dl functions are > >> >> in libSystem and libc, respectively. Using CMAKE_DL_LIBS does the > >> >> right > >> >> thing on all platforms (though I wish it was an imported target to > >> >> make > >> >> exports a bit nicer). > >> > > >> > OK, thanks. So, I go with: target_link_libraries(main PUBLIC ... > >> > ${CMAKE_DL_LIBS}) > >> > > >> >> Regards, > >> >> Roger > >> >> -- > >> >> > >> >> 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 > >> -- > >> Regards, > >> Konstantin > > -- > Regards, > Konstantin > -- 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