[CMake] CMake: using dlopen
Konstantin Tokarev
annulen at yandex.ru
Sun Jan 7 11:50:40 EST 2018
07.01.2018, 19:36, "Franck Houssen" <franck.houssen at inria.fr>:
> ----- Mail original -----
>> De: "Konstantin Tokarev" <annulen at yandex.ru>
>> À: "Franck Houssen" <franck.houssen at inria.fr>
>> Cc: cmake at cmake.org, "Roger Leigh" <rleigh at codelibre.net>
>> Envoyé: Dimanche 7 Janvier 2018 15:20:08
>> Objet: Re: [CMake] CMake: using dlopen
>>
>> > ----- Mail original -----
>> >
>> >> De: "Roger Leigh" <rleigh at codelibre.net>
>> >> À: cmake at 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
>
>> >
>> >>>
>> >>> 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
More information about the CMake
mailing list