KDE/kdebase/runtime/phonon
Maciej Mrozowski
reavertm at gmail.com
Wed Mar 17 04:52:21 CET 2010
SVN commit 1104237 by mmrozowski:
Forward port of 1104235 from 4.4 branch:
(More) gracefully handle building runtime/phonon without alsa:
- move version checks to phonon toplevel directory (there were two copies, one commented out)
- guard linking with ALSA_FOUND
- move include_directories to phonon toplevel dir (used in multiple places)
- make building tests optional (they require OpenGL)
Still there's chicken-egg problem caused by FindAlsa.cmake, (macro_optional_find_package cannot be used because of alsa_configure_file invocation)
CCMAIL: kde-buildsystem at kde.org
M +23 -5 CMakeLists.txt
M +8 -17 kded-module/CMakeLists.txt
M +1 -15 libkaudiodevicelist/CMakeLists.txt
M +17 -10 platform_kde/CMakeLists.txt
--- trunk/KDE/kdebase/runtime/phonon/CMakeLists.txt #1104236:1104237
@@ -19,15 +19,33 @@
macro_log_feature(_phonon_version_ok "Phonon" "Phonon library" "svn.kde.org/home/kde/trunk/kdesupport/phonon" TRUE "${PHONON_MIN_VERSION}" "STRONGLY RECOMMENDED: Required for playing audio and video throughout KDE")
find_package(Alsa)
+ option(WITH_ALSA "Use ALSA, if found" ON)
+ if(NOT WITH_ALSA)
+ set(ALSA_FOUND FALSE)
+ set(ASOUND_LIBRARY NOTFOUND)
+ set(HAVE_LIBASOUND2 FALSE)
+ set(ALSA_INCLUDES NOTFOUND)
+ endif(NOT WITH_ALSA)
+
alsa_configure_file(${CMAKE_CURRENT_BINARY_DIR}/config-alsa.h)
- if(NOT ALSA_FOUND)
- set(ALSA_INCLUDES "")
- set(ASOUND_LIBRARY "")
- endif(NOT ALSA_FOUND)
+ set(HAVE_CURRENT_ALSA FALSE)
+ if(ALSA_FOUND)
+ include_directories(${ALSA_INCLUDES})
+ alsa_version_string(ALSA_VERSION_STR)
+ if(ALSA_VERSION_STR AND NOT WIN32)
+ if(ALSA_VERSION_STR MATCHES "^1\\.(0\\.(1[4-9]|[2-9][0-9]+)|[1-9][0-9]*\\.)")
+ add_definitions(-DHAS_LIBASOUND_DEVICE_NAME_HINT)
+ set(HAVE_CURRENT_ALSA TRUE)
+ endif(ALSA_VERSION_STR MATCHES "^1\\.(0\\.(1[4-9]|[2-9][0-9]+)|[1-9][0-9]*\\.)")
+ endif(ALSA_VERSION_STR AND NOT WIN32)
+ endif(ALSA_FOUND)
+ if(NOT WIN32)
+ macro_log_feature(HAVE_CURRENT_ALSA "ALSA" "The Advanced Linux Sound Architecture (ALSA) library" "http://www.alsa-project.org/" FALSE "1.0.14a" "A current ALSA library is needed for dmix and virtual device listing")
+ endif(NOT WIN32)
add_subdirectory(kded-module)
add_subdirectory(platform_kde)
- add_subdirectory(tests)
+ macro_optional_add_subdirectory(tests)
add_subdirectory(kcm)
endif(KDEBASE_DISABLE_MULTIMEDIA)
--- trunk/KDE/kdebase/runtime/phonon/kded-module/CMakeLists.txt #1104236:1104237
@@ -1,27 +1,18 @@
-alsa_version_string(ALSA_VERSION_STR)
-set(HAVE_CURRENT_ALSA FALSE)
-#if(ALSA_VERSION_STR AND NOT WIN32)
-# if(ALSA_VERSION_STR MATCHES "^1\\.(0\\.(1[4-9]|[2-9][0-9]+)|[1-9][0-9]*\\.)")
-# set(HAVE_CURRENT_ALSA TRUE)
-# endif(ALSA_VERSION_STR MATCHES "^1\\.(0\\.(1[4-9]|[2-9][0-9]+)|[1-9][0-9]*\\.)")
-#endif(ALSA_VERSION_STR AND NOT WIN32)
-#if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-# macro_log_feature(HAVE_CURRENT_ALSA "ALSA" "current alsa-lib is needed for dmix and virtual device listing" "http://www.alsa-project.org/" TRUE "1.0.14a")
-#endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-
-include_directories(${ALSA_INCLUDES})
-
set(kded_phonon_SRCS
phononserver.cpp
audiodevice.cpp
audiodeviceaccess.cpp
hardwaredatabase.cpp
- )
+)
kde4_add_plugin(kded_phononserver ${kded_phonon_SRCS})
-target_link_libraries(kded_phononserver ${KDE4_KDEUI_LIBS} ${KDE4_PHONON_LIBS} ${KDE4_SOLID_LIBS} ${ASOUND_LIBRARY})
-install(TARGETS kded_phononserver DESTINATION ${PLUGIN_INSTALL_DIR})
-install(FILES phononserver.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded)
+target_link_libraries(kded_phononserver ${KDE4_KDEUI_LIBS} ${KDE4_PHONON_LIBS} ${KDE4_SOLID_LIBS})
+if(ALSA_FOUND)
+ target_link_libraries(kded_phononserver ${ASOUND_LIBRARY})
+endif(ALSA_FOUND)
+
+install(TARGETS kded_phononserver DESTINATION ${PLUGIN_INSTALL_DIR})
+install(FILES phononserver.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded)
install(FILES hardwaredatabase DESTINATION ${DATA_INSTALL_DIR}/libphonon)
--- trunk/KDE/kdebase/runtime/phonon/libkaudiodevicelist/CMakeLists.txt #1104236:1104237
@@ -1,22 +1,8 @@
-ALSA_VERSION_STRING(ALSA_VERSION_STR)
-SET(HAVE_CURRENT_ALSA FALSE)
-IF(ALSA_VERSION_STR AND NOT WIN32)
- IF(ALSA_VERSION_STR MATCHES "^1\\.(0\\.(1[4-9]|[2-9][0-9]+)|[1-9][0-9]*\\.)")
- ADD_DEFINITIONS(-DHAS_LIBASOUND_DEVICE_NAME_HINT)
- SET(HAVE_CURRENT_ALSA TRUE)
- ENDIF(ALSA_VERSION_STR MATCHES "^1\\.(0\\.(1[4-9]|[2-9][0-9]+)|[1-9][0-9]*\\.)")
-ENDIF(ALSA_VERSION_STR AND NOT WIN32)
-if(NOT WIN32)
- macro_log_feature(HAVE_CURRENT_ALSA "ALSA" "The Advanced Linux Sound Architecture (ALSA) library" "http://www.alsa-project.org/" FALSE "1.0.14a" "A current ALSA library is needed for dmix and virtual device listing")
-endif(NOT WIN32)
-
-include_directories(${ALSA_INCLUDES})
-
set(kaudiodevicelist_LIB_SRCS
audiodevice.cpp
audiodeviceenumerator.cpp
hardwaredatabase.cpp
- )
+)
if(ALSA_FOUND)
qt4_add_resources(kaudiodevicelist_LIB_SRCS resources.qrc)
--- trunk/KDE/kdebase/runtime/phonon/platform_kde/CMakeLists.txt #1104236:1104237
@@ -1,24 +1,31 @@
-include_directories(${KDE4_KIO_INCLUDES} ${ALSA_INCLUDES})
+include_directories(${KDE4_KIO_INCLUDES})
+
set(kde_PART_SRCS
kdeplatformplugin.cpp
kiomediastream.cpp
- devicelisting.cpp
- )
+ devicelisting.cpp
+)
if(ALSA_FOUND)
qt4_add_resources(kde_PART_SRCS resources.qrc)
endif(ALSA_FOUND)
kde4_add_plugin(kde ${kde_PART_SRCS})
-target_link_libraries(kde ${KDE4_PHONON_LIBS} ${KDE4_KIO_LIBS} ${ASOUND_LIBRARY})
+target_link_libraries(kde ${KDE4_PHONON_LIBS} ${KDE4_KIO_LIBS})
+
+if(ALSA_FOUND)
+ target_link_libraries(kde ${ASOUND_LIBRARY})
+endif(ALSA_FOUND)
+
if(NOT WIN32)
- set_target_properties(kde PROPERTIES
- INSTALL_RPATH_USE_LINK_PATH TRUE
- SKIP_BUILD_RPATH TRUE
- BUILD_WITH_INSTALL_RPATH TRUE
- INSTALL_RPATH ${LIB_INSTALL_DIR}
- )
+ set_target_properties(kde PROPERTIES
+ INSTALL_RPATH_USE_LINK_PATH TRUE
+ SKIP_BUILD_RPATH TRUE
+ BUILD_WITH_INSTALL_RPATH TRUE
+ INSTALL_RPATH ${LIB_INSTALL_DIR}
+ )
endif(NOT WIN32)
+
install(TARGETS kde DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/phonon_platform)
install(FILES phonon.notifyrc DESTINATION ${DATA_INSTALL_DIR}/phonon)
install(FILES phononbackend.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
More information about the Kde-buildsystem
mailing list