PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/cmake/FindMySQL.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 48 lines | 30 code | 8 blank | 10 comment | 0 complexity | 60dcd2300874ec0ed1bbec3bfa2fa8a3 MD5 | raw file
 1# -*- cmake -*-
 2
 3# - Find MySQL
 4# Find the MySQL includes and library
 5# This module defines
 6#  MYSQL_INCLUDE_DIR, where to find mysql.h, etc.
 7#  MYSQL_LIBRARIES, the libraries needed to use Mysql.
 8#  MYSQL_FOUND, If false, do not try to use Mysql.
 9# also defined, but not for general use are
10#  MYSQL_LIBRARY, where to find the Mysql library.
11
12FIND_PATH(MYSQL_INCLUDE_DIR mysql/mysql.h
13/usr/local/include
14/usr/include
15)
16
17SET(MYSQL_NAMES ${MYSQL_NAMES} mysqlclient)
18FIND_LIBRARY(MYSQL_LIBRARY
19  NAMES ${MYSQL_NAMES}
20  PATHS /usr/lib/mysql /usr/lib /usr/local/lib/mysql /usr/local/lib
21  )
22
23IF (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
24    SET(MYSQL_LIBRARIES ${MYSQL_LIBRARY})
25    SET(MYSQL_FOUND "YES")
26ELSE (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
27  SET(MYSQL_FOUND "NO")
28ENDIF (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
29
30
31IF (MYSQL_FOUND)
32   IF (NOT MYSQL_FIND_QUIETLY)
33      MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARIES}")
34   ENDIF (NOT MYSQL_FIND_QUIETLY)
35ELSE (MYSQL_FOUND)
36   IF (MYSQL_FIND_REQUIRED)
37      MESSAGE(FATAL_ERROR "Could not find MySQL library")
38   ENDIF (MYSQL_FIND_REQUIRED)
39ENDIF (MYSQL_FOUND)
40
41# Deprecated declarations.
42SET (NATIVE_MYSQL_INCLUDE_PATH ${MYSQL_INCLUDE_DIR} )
43GET_FILENAME_COMPONENT (NATIVE_MYSQL_LIB_PATH ${MYSQL_LIBRARY} PATH)
44
45MARK_AS_ADVANCED(
46  MYSQL_LIBRARY
47  MYSQL_INCLUDE_DIR
48  )