You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
2.8 KiB
CMake
98 lines
2.8 KiB
CMake
15 years ago
|
# - Find MySQL
|
||
|
# Find the MySQL includes and client library
|
||
|
# This module defines
|
||
|
# MYSQL_INCLUDE_DIR, where to find mysql.h
|
||
|
# MYSQL_LIBRARIES, the libraries needed to use MySQL.
|
||
|
# MYSQL_FOUND, If false, do not try to use MySQL.
|
||
|
#
|
||
|
# Copyright (c) 2006, Jaroslaw Staniek, <js@iidea.pl>
|
||
|
#
|
||
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
||
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||
|
|
||
|
IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
||
|
SET(MYSQL_FOUND TRUE)
|
||
|
|
||
10 years ago
|
ELSE()
|
||
15 years ago
|
|
||
|
FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
|
||
6 years ago
|
PATH_SUFFIXES mysql mariadb
|
||
9 years ago
|
PATHS
|
||
15 years ago
|
/usr/include/mysql
|
||
6 years ago
|
/usr/include/mariadb
|
||
15 years ago
|
/usr/local/include/mysql
|
||
6 years ago
|
/usr/local/include/mariadb
|
||
15 years ago
|
/opt/local/include/mysql5/mysql
|
||
9 years ago
|
/opt/local/include/mysql55/mysql
|
||
|
/opt/local/include/mysql51/mysql
|
||
15 years ago
|
$ENV{ProgramFiles}/MySQL/*/include
|
||
|
$ENV{SystemDrive}/MySQL/*/include)
|
||
|
|
||
|
IF(WIN32 AND MSVC)
|
||
6 years ago
|
FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES libmysql mysqlclient libmariadb mariadbclient
|
||
14 years ago
|
PATHS
|
||
|
$ENV{ProgramFiles}/MySQL/*/lib/opt
|
||
|
$ENV{SystemDrive}/MySQL/*/lib/opt)
|
||
6 years ago
|
FIND_LIBRARY(MYSQL_LIBRARY_DEBUG NAMES libmysqld mysqlclientd libmariadb mariadbclient
|
||
15 years ago
|
PATHS
|
||
|
$ENV{ProgramFiles}/MySQL/*/lib/opt
|
||
|
$ENV{SystemDrive}/MySQL/*/lib/opt)
|
||
10 years ago
|
ELSE()
|
||
6 years ago
|
FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES mysqlclient mariadbclient
|
||
14 years ago
|
PATHS
|
||
|
/usr/lib
|
||
|
/usr/local/lib
|
||
6 years ago
|
/usr/lib/mariadb
|
||
14 years ago
|
/usr/lib/mysql
|
||
|
/usr/local/lib/mysql
|
||
6 years ago
|
/usr/local/lib/mariadb
|
||
14 years ago
|
/opt/local/lib/mysql5/mysql
|
||
9 years ago
|
/opt/local/lib/mysql55/mysql
|
||
|
/opt/local/lib/mysql51/mysql
|
||
14 years ago
|
)
|
||
|
|
||
6 years ago
|
FIND_LIBRARY(MYSQL_LIBRARY_DEBUG NAMES mysqlclientd mariadbclientd
|
||
15 years ago
|
PATHS
|
||
|
/usr/lib
|
||
|
/usr/local/lib
|
||
|
/usr/lib/mysql
|
||
|
/usr/local/lib/mysql
|
||
15 years ago
|
/opt/local/lib/mysql5/mysql
|
||
9 years ago
|
/opt/local/lib/mysql55/mysql
|
||
|
/opt/local/lib/mysql51/mysql
|
||
15 years ago
|
)
|
||
10 years ago
|
ENDIF()
|
||
15 years ago
|
|
||
14 years ago
|
IF(MYSQL_INCLUDE_DIR)
|
||
|
IF(MYSQL_LIBRARY_RELEASE)
|
||
|
IF(MYSQL_LIBRARY_DEBUG)
|
||
10 years ago
|
SET(MYSQL_LIBRARIES optimized ${MYSQL_LIBRARY_RELEASE} debug ${MYSQL_LIBRARY_DEBUG})
|
||
|
ELSE()
|
||
|
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARY_RELEASE})
|
||
|
ENDIF()
|
||
13 years ago
|
FIND_PACKAGE(OpenSSL)
|
||
|
IF(OPENSSL_FOUND)
|
||
7 years ago
|
IF(WIN32)
|
||
|
SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib)
|
||
|
ENDIF()
|
||
13 years ago
|
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES})
|
||
10 years ago
|
ENDIF()
|
||
|
ENDIF()
|
||
|
ENDIF()
|
||
14 years ago
|
|
||
15 years ago
|
IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
|
||
|
SET(MYSQL_FOUND TRUE)
|
||
|
MESSAGE(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}")
|
||
6 years ago
|
IF (MYSQL_LIBRARIES MATCHES "libmariadb" OR MYSQL_LIBRARIES MATCHES "mariadbclient")
|
||
|
SET(MARIADB_FOUND TRUE)
|
||
|
MESSAGE(STATUS "Found MariaDB.")
|
||
|
ENDIF()
|
||
10 years ago
|
ELSE()
|
||
15 years ago
|
SET(MYSQL_FOUND FALSE)
|
||
|
MESSAGE(STATUS "MySQL not found.")
|
||
10 years ago
|
ENDIF()
|
||
15 years ago
|
|
||
14 years ago
|
MARK_AS_ADVANCED(MYSQL_LIBRARY_RELEASE MYSQL_LIBRARY_DEBUG)
|
||
15 years ago
|
|
||
10 years ago
|
ENDIF()
|