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