$ cmake -DBUILD_SHARED_LIBS:BOOL=ON .
[...]
CMake Error at src/core/CMakeLists.txt:24 (install):
install TARGETS given no LIBRARY DESTINATION for shared library target
"kid3-core".
CMake Error at src/gui/CMakeLists.txt:24 (install):
install TARGETS given no LIBRARY DESTINATION for shared library target
"kid3-gui".
Just a guess, maybe "DESTINATION" should be replaced with "LIBRARY DESTINATION" in these files? Also, ${WITH_BINDIR} sounds suspicious as a location for shared libs, shouldn't it be some library dir, not a bin dir?
Thanks for the report. I do not get an error, but the installation location for shared libraries should be different on Linux (I tested it on Windows). Shared libraries are now installed to WITH_LIBDIR with a default of "lib" on Linux. Fixed in Git.
The fix on http://kid3.git.sourceforge.net/git/gitweb.cgi?p=kid3/kid3;a=commitdiff;h=ed22f2027b56af1207a936fb7a518e4d68ba3242;hp=638fe80a29bf23feb97276079067d3800fed25d6 doesn't work for me, it still fails with the same error of this bug report. I'm using the following cmake command:
/usr/bin/cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64 -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DCMAKE_BUILD_TYPE=release -DLIB_SUFFIX=64 -DCMAKE_SKIP_RPATH:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF '-DCMAKE_MODULE_LINKER_FLAGS=-Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags' -DKDE4_ENABLE_FPIE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_DEFAULT_HOME=.kde4 '-DKDE_DISTRIBUTION_TEXT=Mageia release 2 (Cauldron) for x86_64' -DKDE4_USE_ALWAYS_FULL_RPATH=OFF -DKDE4_DATA_DIR=/usr/share/apps -DENABLE_FAM=ON -DPHONON_INCLUDE_DIR=/usr/include -DDBUS_SERVICES_INSTALL_DIR=/usr/share/dbus-1/services -DDBUS_INTERFACES_INSTALL_DIR=/usr/share/dbus-1/interfaces
@jbaptiste: Thanks for the report, you are right, building with BUILD_SHARED_LIBS did not work when KDE is enabled. With the small fix at
http://kid3.git.sourceforge.net/git/gitweb.cgi?p=kid3/kid3;a=commitdiff;h=1a8b4b3a59b7a372bb13d582762b9937356a480b
you will be able to build the shared libraries.
Unfortunately, you won't be able to link against these generated shared
libraries because all symbols are hidden. This is done in the KDE build
system by setting -fvisibility=hidden and can probably only be
circumvented by using KDE_EXPORT and KDE_IMPORT macros for all classes
(see http://techbase.kde.org/Development/Tutorials/Creating_Libraries).
I hoped to see such crap only on Windows.
I do not think that it is worth adding all these macros to the classes because these kid3 libraries are not really meant to be used as shared libraries. At the moment, they are only a way to structure the code and manage dependencies. If you know a better way to make the shared libraries work with KDE, please let me know.
@jbaptiste:
I found a way how to build the KDE version with shared libraries: Add -D__KDE_HAVE_GCC_VISIBILITY:BOOL=OFF to the cmake options (and you need the patch mentioned in my comment from yesterday).
Thanks, with latest patch and cmake option everything works. Now we have Mandriva and Mageia packages :)
Fixed in version 2.0.1.
With Kid3 2.1, the "-D__KDE_HAVE_GCC_VISIBILITY:BOOL=OFF" option is no longer necessary. Building with shared libraries works out of the box.