diff options
author | Trojal <trojal@gmail.com> | 2013-01-10 20:09:39 -0800 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-01-12 05:56:35 -0200 |
commit | c55855fcf627478f864c0f82a1a2f201fd407a38 (patch) | |
tree | b7f6d11b2058248d026f2d9944e8f4b6ac288d50 /3rdparty/cmake/FindMYSQL.cmake | |
parent | 51bfeb38eb139e97e0e1c096c85c15fba234f35b (diff) | |
parent | 38e583df21eccd9e4f31d38acaae32579c6f0d27 (diff) | |
download | hercules-c55855fcf627478f864c0f82a1a2f201fd407a38.tar.gz hercules-c55855fcf627478f864c0f82a1a2f201fd407a38.tar.bz2 hercules-c55855fcf627478f864c0f82a1a2f201fd407a38.tar.xz hercules-c55855fcf627478f864c0f82a1a2f201fd407a38.zip |
Test1, testing for the commit widget, need to edit something.
Test2, testing for the commit widget, need to edit something.
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to '3rdparty/cmake/FindMYSQL.cmake')
-rw-r--r-- | 3rdparty/cmake/FindMYSQL.cmake | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/3rdparty/cmake/FindMYSQL.cmake b/3rdparty/cmake/FindMYSQL.cmake new file mode 100644 index 000000000..9da72073a --- /dev/null +++ b/3rdparty/cmake/FindMYSQL.cmake @@ -0,0 +1,37 @@ +# - Find libmysql/mysqlclient +# Find the native MySQL includes and library +# +# MYSQL_INCLUDE_DIRS - where to find mysql.h, etc. +# MYSQL_LIBRARIES - mysqlclient library. +# MYSQL_FOUND - True if mysqlclient is found. +# + +find_path( MYSQL_INCLUDE_DIRS "mysql.h" + PATHS + "/usr/include/mysql" + "/usr/local/include/mysql" + "/usr/mysql/include/mysql" + "$ENV{PROGRAMFILES}/MySQL/*/include" + "$ENV{SYSTEMDRIVE}/MySQL/*/include" ) + +find_library( MYSQL_LIBRARIES + NAMES "libmysql" "mysqlclient" "mysqlclient_r" + PATHS + "/usr/lib/mysql" + "/usr/local/lib/mysql" + "/usr/mysql/lib/mysql" + "$ENV{PROGRAMFILES}/MySQL/*/lib" + "$ENV{SYSTEMDRIVE}/MySQL/*/lib" ) +mark_as_advanced( MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS ) + +if( MYSQL_INCLUDE_DIRS AND EXISTS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" ) + file( STRINGS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" MYSQL_VERSION_H REGEX "^#define[ \t]+MYSQL_SERVER_VERSION[ \t]+\"[^\"]+\".*$" ) + string( REGEX REPLACE "^.*MYSQL_SERVER_VERSION[ \t]+\"([^\"]+)\".*$" "\\1" MYSQL_VERSION_STRING "${MYSQL_VERSION_H}" ) +endif() + +# 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 + REQUIRED_VARS MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS + VERSION_VAR MYSQL_VERSION_STRING ) |