More on making dkp non required
[gregoa/zavai.git] / src / CMakeLists.txt
index 62050819afe433e35981b3d376bf0690da49a20d..5bd4bd89b591826c487d923fbb3ab476d80cfa73 100644 (file)
@@ -3,7 +3,7 @@ include(../vala.cmake)
 
 set(zavai_version 0.1)
 
-set(packages gtk+-2.0 dbus-glib-1>=0.80 libwnck-1.0>=2.26.0 devkit-power-gobject>=010 libomhacks)
+set(packages gtk+-2.0 dbus-glib-1>=0.80 libwnck-1.0>=2.26.0 libomhacks)
 add_packages(ZAVAI ${packages})
 
 set(VALA_PACKAGES ${packages} posix linux-input dbus-extra gtkfisheyelist)
@@ -11,12 +11,15 @@ set(VFLAGS --vapidir=${zavai_SOURCE_DIR} --vapidir=${gtkfisheyelist_BINARY_DIR})
 add_definitions(-Wall)
 # -Werror 
 
-if (ZAVAI_devkit-power-gobject_VERSION)
-  message("Using devkit-power-gobject version ${ZAVAI_devkit-power-gobject_VERSION}")
-  add_definitions(-DUSE_DKP)
+pkg_check_modules(DKP devkit-power-gobject>=010)
+if (DKP_VERSION)
+  message("-- Using devkit-power-gobject version ${DKP_VERSION}")
   set(VFLAGS ${VFLAGS} --define=USE_DKP)
+  set(VALA_PACKAGES ${VALA_PACKAGES} devkit-power-gobject)
+  add_definitions(-DUSE_DKP ${DKP_CFLAGS})
+  link_libraries(${DKP_LDFLAGS})
 else()
-  message("Not using devkit-power-gobject")
+  message("-- Not using devkit-power-gobject")
 endif ()
 
 file(GLOB libvala [a-y]*.vala widgets/*.vala)