# Copyright (C) 2007-2009 LuaDist. # Created by Peter Kapec # Redistribution and use of this file is allowed according to the terms of the MIT license. # For details see the COPYRIGHT file distributed with LuaDist. # Note: # Searching headers and libraries is very simple and is NOT as powerful as scripts # distributed with CMake, because LuaDist defines directories to search for. # Everyone is encouraged to contact the author with improvements. Maybe this file # becomes part of CMake distribution sometimes. # - Find mysql # Find the native MYSQL headers and libraries. # # MYSQL_INCLUDE_DIRS - where to find mysql.h, etc. # MYSQL_LIBRARIES - List of libraries when using mysql. # MYSQL_FOUND - True if mysql found. # Look for the header file. FIND_PATH(MYSQL_INCLUDE_DIR NAMES mysql.h /usr/local/include/mysql /usr/include/mysql ) # Look for the library. FIND_LIBRARY(MYSQL_LIBRARY NAMES mysqlclient mysqlclient_r PATHS /usr/lib /usr/local/lib PATH_SUFFIXES mysql ) # Handle the QUIETLY and REQUIRED arguments and set MYSQL_FOUND to TRUE if all listed variables are TRUE. INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(MYSQL DEFAULT_MSG MYSQL_LIBRARY MYSQL_INCLUDE_DIR) # Copy the results to the output variables. IF(MYSQL_FOUND) SET(MYSQL_LIBRARIES ${MYSQL_LIBRARY}) SET(MYSQL_INCLUDE_DIRS ${MYSQL_INCLUDE_DIR}) ELSE(MYSQL_FOUND) SET(MYSQL_LIBRARIES) SET(MYSQL_INCLUDE_DIRS) ENDIF(MYSQL_FOUND) MARK_AS_ADVANCED(MYSQL_INCLUDE_DIRS MYSQL_LIBRARIES)