Allow MediaCD to build against udev _and_ HAL, or even without both
[platform/upstream/libzypp.git] / zypp / CMakeLists.txt
index d14f83a..ca0f768 100644 (file)
@@ -601,6 +601,19 @@ INSTALL(  FILES
   DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/target
 )
 
+IF(NOT UDEV_FOUND)
+IF(HAL_FOUND)
+SET( zypp_target_hal_SRCS
+  target/hal/HalContext.cc
+)
+SET( zypp_target_hal_HEADERS
+  target/hal/HalContext.h
+  target/hal/HalException.h
+)
+ENDIF(HAL_FOUND)
+ENDIF(NOT UDEV_FOUND)
+# as HAL is deprecated, we don't install headers
+
 SET( zypp_target_modalias_SRCS
   target/modalias/Modalias.cc
 )
@@ -816,6 +829,7 @@ ${zypp_repo_yum_SRCS}
 ${zypp_repo_susetags_SRCS}
 ${zypp_repo_data_SRCS}
 ${zypp_target_rpm_SRCS}
+${zypp_target_hal_SRCS}
 ${zypp_target_modalias_SRCS}
 ${zypp_target_SRCS}
 ${zypp_solver_detail_SRCS}
@@ -918,7 +932,15 @@ TARGET_LINK_LIBRARIES(zypp ${SATSOLVER_LIBRARY} ${SATSOLVER_EXT_LIBRARY} ${EXPAT
 TARGET_LINK_LIBRARIES(zypp ${OPENSSL_LIBRARIES} )
 TARGET_LINK_LIBRARIES(zypp ${CRYPTO_LIBRARIES} )
 TARGET_LINK_LIBRARIES(zypp ${SIGNALS_LIBRARY} )
-TARGET_LINK_LIBRARIES(zypp ${UDEV_LIBRARY} )
+
+IF ( UDEV_FOUND )
+  TARGET_LINK_LIBRARIES(zypp ${UDEV_LIBRARY} )
+ELSE ( UDEV_FOUND )
+  IF ( HAL_FOUND )
+    TARGET_LINK_LIBRARIES(zypp ${HAL_LIBRARY} ${HAL_STORAGE_LIBRARY} ${DBUS_LIBRARY} )
+  ENDIF ( HAL_FOUND )
+ENDIF ( UDEV_FOUND )
+
 TARGET_LINK_LIBRARIES(zypp ${LIBPROXY_LIBRARIES} )
 
 INSTALL(TARGETS zypp LIBRARY DESTINATION ${LIB_INSTALL_DIR} )