(fix for the commit  8b17eefadf)
This commit is contained in:
HarpyWar 2014-11-02 22:31:52 +03:00
parent c2f5732611
commit 91204db81a

View file

@ -54,25 +54,26 @@ else()
"/usr/mysql/lib/mysql"
"/usr/mysql/lib64/mysql" )
endif()
if( MYSQL_INCLUDE_DIR 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 DEFAULT_MSG
REQUIRED_VARS MYSQL_LIBRARY MYSQL_INCLUDE_DIR
VERSION_VAR MYSQL_VERSION_STRING )
set( MYSQL_INCLUDE_DIRS ${MYSQL_INCLUDE_DIR} )
set( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
mark_as_advanced( MYSQL_INCLUDE_DIR MYSQL_LIBRARY )
IF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
SET(MYSQL_FOUND TRUE)
SET( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
SET(MYSQL_FOUND FALSE)
SET( MYSQL_LIBRARIES )
ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
IF (MYSQL_FOUND)
MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARY}")
ELSE (MYSQL_FOUND)
IF (MySQL_FIND_REQUIRED)
MESSAGE(STATUS "Looked for MySQL libraries named ${MYSQL_NAMES}.")
MESSAGE(FATAL_ERROR "Could NOT find MySQL library")
ENDIF (MySQL_FIND_REQUIRED)
ENDIF (MYSQL_FOUND)
MARK_AS_ADVANCED(
MYSQL_LIBRARY
MYSQL_INCLUDE_DIR
)