Glib.cmake 940 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # -*- cmake -*-
  2. if (GLIB_CMAKE_INCLUDED)
  3. return()
  4. endif (GLIB_CMAKE_INCLUDED)
  5. set (GLIB_CMAKE_INCLUDED TRUE)
  6. include(Prebuilt)
  7. set(GLIB_LIBRARIES "")
  8. if (USESYSTEMLIBS AND LINUX)
  9. include(FindPkgConfig)
  10. set(PKGCONFIG_PACKAGES
  11. gio-2.0
  12. gobject-2.0
  13. gmodule-2.0
  14. glib-2.0
  15. gthread-2.0
  16. )
  17. foreach(pkg ${PKGCONFIG_PACKAGES})
  18. pkg_check_modules(${pkg} REQUIRED ${pkg})
  19. include_directories(SYSTEM ${${pkg}_INCLUDE_DIRS})
  20. link_directories(${${pkg}_LIBRARY_DIRS})
  21. list(APPEND GLIB_LIBRARIES ${${pkg}_LIBRARIES})
  22. add_definitions(${${pkg}_CFLAGS_OTHERS})
  23. endforeach(pkg)
  24. else (USESYSTEMLIBS AND LINUX)
  25. if (LINUX)
  26. use_prebuilt_binary(glib)
  27. list(APPEND GLIB_LIBRARIES
  28. gio-2.0
  29. gobject-2.0
  30. gmodule-2.0
  31. glib-2.0
  32. gthread-2.0
  33. )
  34. include_directories(SYSTEM ${LIBS_PREBUILT_DIR}/include/glib-2.0)
  35. endif (LINUX)
  36. endif (USESYSTEMLIBS AND LINUX)