target_link_libraries generates -llibXX.so.0 ld call

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

target_link_libraries generates -llibXX.so.0 ld call

Rafael Sadowski
Hi CMake-users,

I always run into the same CMmke/ld(1) issue with some KDE
Applications[1] on OpenBSD.

For example artikulate-17.12.3.

artikulatesound library in libsound/src/CMakeLists.txt[2]
-----------------------------------
# enable exceptions for this library
kde_enable_exceptions()

set(sound_LIB_SRCS
    backendinterface.cpp
    capturedevicecontroller.cpp
    outputdevicecontroller.cpp
    capturebackendinterface.cpp
    outputbackendinterface.cpp
    libsound_debug.cpp
)

add_library(artikulatesound SHARED ${sound_LIB_SRCS})
generate_export_header(artikulatesound BASE_NAME libsound)

target_link_libraries(
    artikulatesound
    LINK_PUBLIC
        KF5::CoreAddons
        KF5::I18n
)
# internal library without any API or ABI guarantee
set(GENERIC_LIB_VERSION "0")
set(GENERIC_LIB_SOVERSION "0")
set_target_properties(
    artikulatesound PROPERTIES
    VERSION ${GENERIC_LIB_VERSION}
    SOVERSION ${GENERIC_LIB_SOVERSION}
)

install(
    TARGETS artikulatesound
    ${INSTALL_TARGETS_DEFAULT_ARGS}
)
-----------------------------------

artikulatesound is used in
libsound/src/qtgstreamerbackend/CMakeLists.txt[3]:
-----------------------------------
add_library(qtgstreamerbackend MODULE ${qtgstreamerbackend_SRCS})

target_link_libraries(
    qtgstreamerbackend
    LINK_PUBLIC
        artikulatesound
        KF5::CoreAddons
        ${QTGLIB_LIBRARIES}
        ${QTGLIB_LIBRARY}
        ${QTGSTREAMER_LIBRARIES}
)

install(TARGETS qtgstreamerbackend DESTINATION ${PLUGIN_INSTALL_DIR}/artikulate/libsound)
-----------------------------------

This causes the following issue:
-----------------------------------
FAILED: libsound/src/qtmultimediabackend/qtmultimediabackend.so
: && /usr/ports/pobj/artikulate-17.12.3/bin/c++ -fPIC -O2 -pipe -std=c++0x -fno-operator-names
-Wno-gnu-zero-variadic-macro-arguments -Wall -Wextra -Wcast-align -Wchar-subscripts
-Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual
-Werror=return-type -Wvla -Wdate-time -fdiagnostics-color=always -fexceptions -DNDEBUG
-Wl,--fatal-warnings -Wl,--enable-new-dtags -shared -o libsound/src/qtmultimediabackend/qtmultimediabackend.so
libsound/src/qtmultimediabackend/CMakeFiles/qtmultimediabackend.dir/qtmultimediabackend.cpp.o
libsound/src/qtmultimediabackend/CMakeFiles/qtmultimediabackend.dir/qtmultimediacapturebackend.cpp.o
libsound/src/qtmultimediabackend/CMakeFiles/qtmultimediabackend.dir/qtmultimediaoutputbackend.cpp.o
libsound/src/qtmultimediabackend/CMakeFiles/qtmultimediabackend.dir/
/libsound_debug.cpp.o libsound/src/qtmultimediabackend/CMakeFiles/qtmultimediabackend.dir/qtmultimediabackend_autogen/mocs_compilation.cpp.o
-L/usr/ports/pobj/artikulate-17.12.3/build-amd64/libsound/src  -L/usr/local/lib/qt5/.  -L/usr/local/lib
-Wl,-rpath,/usr/ports/pobj/artikulate-17.12.3/build-amd64/libsound/src:/usr/local/lib/qt5/.:/usr/local/lib:/usr/X11R6/lib:
-llibartikulatesound.so.0 -lQt5Multimedia -lKF5CoreAddons -lKF5I18n -lQt5Network -lQt5Gui -lQt5Core
-Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib && :

/usr/bin/ld: cannot find -llibartikulatesound.so.0
-----------------------------------

I don't think it's an artikulate/KDE issue much more an OpenBSD+CMake
issue.

$ cmake --version
cmake version 3.10.2

$ ninja --version
1.8.2

$  dmesg| head
OpenBSD 6.4-beta (GENERIC.MP) #206: Sun Aug 12 22:55:59 MDT 2018
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

I am grateful for any kind of help.

Rafael Sadowski

[1]: https://www.kde.org/announcements/announce-applications-18.08.0.php
[2]: https://github.com/KDE/artikulate/blob/master/libsound/src/CMakeLists.txt
[3]: https://github.com/KDE/artikulate/blob/master/libsound/src/qtgstreamerbackend/CMakeLists.txt
--

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