A C++ DAL / ORM code generation framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2 KiB

  1. # - Find mysqlclient
  2. # Find the native MySQL includes and library
  3. #
  4. # MYSQL_INCLUDE_DIR - where to find mysql.h, etc.
  5. # MYSQL_LIBRARIES - List of libraries when using MySQL.
  6. # MYSQL_FOUND - True if MySQL found.
  7. IF (MYSQL_INCLUDE_DIR)
  8. # Already in cache, be silent
  9. SET(MYSQL_FIND_QUIETLY TRUE)
  10. ENDIF (MYSQL_INCLUDE_DIR)
  11. FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
  12. /usr/local/include/mysql
  13. /usr/include/mysql
  14. )
  15. SET(MYSQL_NAMES mysqlclient mysqlclient_r)
  16. FIND_LIBRARY(MYSQL_LIBRARY
  17. NAMES ${MYSQL_NAMES}
  18. PATHS /usr/lib /usr/local/lib /usr/local/mysql/lib
  19. PATH_SUFFIXES mysql
  20. )
  21. IF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
  22. SET(MYSQL_FOUND TRUE)
  23. SET( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
  24. ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
  25. SET(MYSQL_FOUND FALSE)
  26. SET( MYSQL_LIBRARIES )
  27. ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
  28. IF (MYSQL_FOUND)
  29. IF (NOT MYSQL_FIND_QUIETLY)
  30. MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARY}")
  31. ENDIF (NOT MYSQL_FIND_QUIETLY)
  32. ELSE (MYSQL_FOUND)
  33. IF (MYSQL_FIND_REQUIRED)
  34. MESSAGE(STATUS "Looked for MySQL libraries named ${MYSQL_NAMES}.")
  35. MESSAGE(FATAL_ERROR "Could NOT find MySQL library")
  36. ENDIF (MYSQL_FIND_REQUIRED)
  37. ENDIF (MYSQL_FOUND)
  38. MARK_AS_ADVANCED(
  39. MYSQL_LIBRARY
  40. MYSQL_INCLUDE_DIR
  41. )