katie/cmake/modules/FindMySQL.cmake
Ivailo Monev 223d0b4567 rewrite some CMake modules, improve others
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2016-01-09 23:55:09 +02:00

41 lines
948 B
CMake

# - Try to find MySQL
# Once done this will define
#
# MYSQL_FOUND - system has MySQL
# MYSQL_INCLUDES - the MySQL include directory
# MYSQL_LIBRARIES - The libraries needed to use MySQL
#
# Copyright (c) 2015, Ivailo Monev, <xakepa10@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
if(MYSQL_INCLUDES AND MYSQL_LIBRARIES)
set(MYSQL_FIND_QUIETLY TRUE)
endif()
# Neither MySQL nor MariaDB provide pkg-config files
find_path(MYSQL_INCLUDES
NAMES
mysql.h
PATH_SUFFIXES mysql
HINTS
$ENV{MYSQLDIR}/include
/usr/include
/usr/local/include
${INCLUDE_INSTALL_DIR}
)
find_library(MYSQL_LIBRARIES
mysqld
HINTS
$ENV{MYSQLDIR}/lib
/usr/lib
/usr/local/lib
${LIB_INSTALL_DIR}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MySQL DEFAULT_MSG MYSQL_INCLUDES MYSQL_LIBRARIES)
mark_as_advanced(MYSQL_INCLUDES MYSQL_LIBRARIES)