Bug 169984 - cmake optional components apparently not optional
Summary: cmake optional components apparently not optional
Status: RESOLVED WORKSFORME
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Matthias Kretz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-28 16:05 UTC by Kevin Hunter
Modified: 2008-12-31 17:39 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Complete typescript conversation (5.77 KB, text/plain)
2008-08-28 16:10 UTC, Kevin Hunter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Hunter 2008-08-28 16:05:43 UTC
Version:            (using Devel)
Compiler:          gnu 4.2.3-2ubuntu7 
OS:                Linux
Installed from:    Compiled sources

I am a KDE dev noob attempting to follow the directions at http://techbase.kde.org/Getting_Started/Build/KDE4/Prerequisites#kdesupport , which basically, in combination with instructions for building kdelibs, say

1. Create a kde-devel user
2. Install our build .bashrc (log out, back in)
3. cs
4. svn checkout our kdesupport
5. cd kdesupport
6. cmakekde

... Things are hunky dory until

-----------------------------------------------------------------------------
-- The following OPTIONAL packages could NOT be located on your system.
-- Consider installing them to enable more features from this software.
+ GStreamer, 0.10: gstreamer 0.10 is required for the multimedia backend <http://gstreamer.freedesktop.org/modules/>
+ GStreamer video plugin, 0.10: The gstreamer video plugin (part of gstreamer-plugins-base 0.10) is required for the multimedia gstreamer backend <http://gstreamer.freedesktop.org/modules/>
+ GStreamer audio plugin, 0.10: The gstreamer audio plugin (part of gstreamer-plugins-base 0.10) is required for the multimedia gstreamer backend <http://gstreamer.freedesktop.org/modules/>
-----------------------------------------------------------------------------

-- Configuring done
make: *** No targets specified and no makefile found.  Stop.

$

Though the text says gstreamer 0.10 is OPTIONAL, it is apparently necessary to build.  As another user, I ran

$ sudo apt-get install libgstreamer0.10-dev
 (Ubuntu Hardy, system)

And that solved the issue; kdesupport was then able to build.

The bug is that the text claims it's optional, but it appears to be required.  This led me to ask on #kde what was up.
Comment 1 Kevin Hunter 2008-08-28 16:10:10 UTC
Created attachment 27102 [details]
Complete typescript conversation

This is the complete typescript conversation I had with the shell, with all of the cmakekde output, etc.
Comment 2 Nicolas L. 2008-08-29 01:05:42 UTC
agreed gstreamer should not be shown as Optionnal.
The same issue exist for Xine 

what about this patch ?
can i commit it ?

Index: phonon/CMakeLists.txt
===================================================================
--- phonon/CMakeLists.txt      (revision 854153)
+++ phonon/CMakeLists.txt      (working copy)
@@ -322,8 +322,12 @@
 endif (Q_WS_WIN)

 if (Q_WS_X11)
+if (GSTREAMER_FOUND)
    add_subdirectory(gstreamer)
+endif (GSTREAMER_FOUND)
+if (XINE_FOUND)
    add_subdirectory(xine)
+endif (XINE_FOUND)
 endif (Q_WS_X11)

 if(NOT WIN32) # pkgconfig file
Comment 3 Alexander Neundorf 2008-09-04 21:18:07 UTC
I think the patch looks good, but this is not really a bug of the build system, but just an issue in one of the "users" of the buildsystem.
The phonon maintainer should have a look at this. 
I reassign the bug.

Alex
Comment 4 Matthias Kretz 2008-09-05 17:42:19 UTC
(In reply to comment #2)
> agreed gstreamer should not be shown as Optionnal.
> The same issue exist for Xine 
> 
> what about this patch ?
> can i commit it ?

The patch looks good to me. Except that there is no warning now if none of the backends gets compiled. Perhaps make that

 if (Q_WS_X11)
+if (GSTREAMER_FOUND)
    add_subdirectory(gstreamer)
+endif (GSTREAMER_FOUND)
+if (XINE_FOUND)
    add_subdirectory(xine)
+else (XINE_FOUND)
+   if (NOT GSTREAMER_FOUND)
+      macro_log_feature(FALSE "Neither GStreamer nor Xine backends can be compiled. You need at least one working backend." ...
+   endif (NOT GSTREAMER_FOUND)
+endif (XINE_FOUND)
 endif (Q_WS_X11)
Comment 5 Matthias Kretz 2008-12-31 17:39:43 UTC
Actually the patch doesn't work since the GStreamer/Xine find macros are called in the subdirs only. Which makes sense, scoping the cmake variables like that.

Also the respective subdirs have checks in place so that this really should be working. I'm assuming the issue got resolved in the meantime, otherwise please reopen.