FindCrypt.cmake 928 B

1234567891011121314151617181920212223242526272829303132333435
  1. # - Find libcrypt
  2. # Find the libcrypt includes and the libcrypt libraries
  3. # This module defines
  4. # LIBCRYPT_INCLUDE_DIR, root crypt include dir. Include crypt with crypt.h
  5. # LIBCRYPT_LIBRARY, the path to libcrypt
  6. # LIBCRYPT_FOUND, whether libcrypt was found
  7. if( CMAKE_SYSTEM MATCHES "FreeBSD" )
  8. # FreeBSD has crypt(3) declared in unistd.h, which lives in
  9. # libc; the libcrypt found here is not used.
  10. find_path( CRYPT_INCLUDE_DIR NAMES unistd.h )
  11. add_definitions( -DNO_CRYPT_H )
  12. else()
  13. find_path( CRYPT_INCLUDE_DIR
  14. NAMES crypt.h
  15. HINTS
  16. ${CMAKE_INSTALL_INCLUDEDIR}
  17. NO_CACHE
  18. )
  19. endif()
  20. find_library( CRYPT_LIBRARIES
  21. NAMES crypt
  22. HINTS
  23. ${CMAKE_INSTALL_LIBDIR}
  24. )
  25. include( FindPackageHandleStandardArgs )
  26. find_package_handle_standard_args(
  27. Crypt
  28. REQUIRED_VARS CRYPT_LIBRARIES CRYPT_INCLUDE_DIR
  29. )
  30. mark_as_advanced( CRYPT_INCLUDE_DIR CRYPT_LIBRARIES )