FindGTK3.cmake 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # - Try to find GTK3
  2. #
  3. # $Id: FindGTK3.cmake 39970 2011-11-21 15:39:25Z jmayer $
  4. #
  5. # Once done this will define
  6. #
  7. # GTK3_FOUND - System has GTK3
  8. # GTK3_INCLUDE_DIRS - The GTK3 include directory
  9. # GTK3_LIBRARIES - The libraries needed to use GTK3
  10. # GTK3_DEFINITIONS - Compiler switches required for using GTK3
  11. #=============================================================================
  12. # Copyright 2011 Duncan Mac-Vicar P. <duncan@kde.org>
  13. #
  14. # Distributed under the OSI-approved BSD License (the "License");
  15. # see accompanying file COPYING-CMAKE-SCRIPTS for details.
  16. #
  17. # This software is distributed WITHOUT ANY WARRANTY; without even the
  18. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  19. # See the License for more information.
  20. #=============================================================================
  21. # (To distribute this file outside of CMake, substitute the full
  22. # License text for the above reference.)
  23. # use pkg-config to get the directories and then use these values
  24. # in the FIND_PATH() and FIND_LIBRARY() calls
  25. find_package(PkgConfig)
  26. pkg_check_modules(PC_GTK3 gtk+-3.0 QUIET)
  27. # MESSAGE(STATUS "PC_GTK3_LIBRARIES: ${PC_GTK3_LIBRARIES}")
  28. # MESSAGE(STATUS "PC_GTK3_LIBRARY_DIRS: ${PC_GTK3_LIBRARY_DIRS}")
  29. # MESSAGE(STATUS "PC_GTK3_LDFLAGS: ${PC_GTK3_LDFLAGS}")
  30. # MESSAGE(STATUS "PC_GTK3_LDFLAGS_OTHER: ${PC_GTK3_LDFLAGS_OTHER}")
  31. set(GTK3_DEFINITIONS ${PC_GTK3_CFLAGS_OTHER})
  32. #FIND_PATH(GTK3_INCLUDE_DIR NAMES "gtk/gtk.h"
  33. # HINTS
  34. # ${PC_GTK3_INCLUDEDIR}
  35. # ${PC_GTK3_INCLUDE_DIRS}
  36. # PATH_SUFFIXES "gtk-3.0"
  37. # )
  38. set(GTK3_INCLUDE_DIRS ${PC_GTK3_INCLUDE_DIRS})
  39. #FIND_LIBRARY(GTK3_LIBRARIES NAMES gtk-3 gtk3
  40. # HINTS
  41. # ${PC_GTK3_LIBDIR}
  42. # ${PC_GTK3_LIBRARY_DIRS}
  43. # )
  44. set(GTK3_LIBRARIES ${PC_GTK3_LIBRARIES})
  45. # handle the QUIETLY and REQUIRED arguments and set GTK3_FOUND to TRUE if
  46. # all listed variables are TRUE
  47. include(FindPackageHandleStandardArgs)
  48. find_package_handle_standard_args(GTK3 DEFAULT_MSG GTK3_LIBRARIES GTK3_INCLUDE_DIRS)
  49. mark_as_advanced(GTK3_INCLUDE_DIRS GTK3_LIBRARIES)