FindPOPT.cmake 1013 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # - Try to find the popt options processing library
  2. # The module will set the following variables
  3. #
  4. # POPT_FOUND - System has popt
  5. # POPT_INCLUDE_DIR - The popt include directory
  6. # POPT_LIBRARY - The libraries needed to use popt
  7. # use pkg-config to get the directories and then use these values
  8. # in the FIND_PATH() and FIND_LIBRARY() calls
  9. find_package(PkgConfig QUIET)
  10. if (PKG_CONFIG_FOUND)
  11. pkg_search_module(PC_POPT QUIET popt)
  12. endif ()
  13. # Find the include directories
  14. FIND_PATH(POPT_INCLUDE_DIR
  15. NAMES popt.h
  16. HINTS
  17. ${PC_POPT_INCLUDEDIR}
  18. ${PC_POPT_INCLUDE_DIRS}
  19. DOC "Path containing the popt.h include file"
  20. )
  21. FIND_LIBRARY(POPT_LIBRARY
  22. NAMES popt
  23. HINTS
  24. ${PC_POPT_LIBRARYDIR}
  25. ${PC_POPT_LIBRARY_DIRS}
  26. DOC "popt library path"
  27. )
  28. include(FindPackageHandleStandardArgs)
  29. FIND_PACKAGE_HANDLE_STANDARD_ARGS(POPT
  30. REQUIRED_VARS POPT_INCLUDE_DIR POPT_LIBRARY
  31. VERSION_VAR PC_POPT_VERSION)
  32. MARK_AS_ADVANCED(POPT_INCLUDE_DIR POPT_LIBRARY)