Warning, /multimedia/amarok/cmake/modules/FindMariaDB.cmake is written in an unsupported language. File is not indexed.
0001 # - Try to find MariaDB library 0002 # Find the MariaDB includes and client library 0003 # This module defines 0004 # MYSQL_INCLUDE_DIR, where to find mysql.h 0005 # MYSQL_LIBRARIES, the libraries needed to use MariaDB. 0006 # MariaDB_FOUND, If false, do not try to use MariaDB. 0007 0008 # Copyright (c) 2006-2018, Jarosław Staniek <staniek@kde.org> 0009 # 0010 # Redistribution and use is allowed according to the terms of the BSD license. 0011 # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 0012 0013 include(CheckCXXSourceCompiles) 0014 include(CMakePushCheckState) 0015 0016 # First try to get information from mariadb_config which might be a shell script 0017 # or an executable. Unfortunately not every distro has pkgconfig files for 0018 # MariaDB. 0019 find_program(MARIADBCONFIG_EXECUTABLE 0020 NAMES mariadb_config 0021 HINTS ${BIN_INSTALL_DIR} 0022 ) 0023 0024 if(MARIADBCONFIG_EXECUTABLE) 0025 execute_process( 0026 COMMAND ${MARIADBCONFIG_EXECUTABLE} --libs 0027 RESULT_VARIABLE MC_return_libraries 0028 OUTPUT_VARIABLE MYSQL_LIBRARIES 0029 OUTPUT_STRIP_TRAILING_WHITESPACE 0030 ) 0031 endif() 0032 0033 # Try searching manually via find_path/find_library, possibly with hints 0034 # from pkg-config 0035 find_package(PkgConfig) 0036 pkg_check_modules(PC_MARIADB libmariadb) 0037 0038 find_path(MYSQL_INCLUDE_DIR mysql.h 0039 PATHS 0040 $ENV{MYSQL_INCLUDE_DIR} 0041 $ENV{MYSQL_DIR}/include 0042 ${PC_MARIADB_INCLUDEDIR} 0043 ${PC_MARIADB_INCLUDE_DIRS} 0044 /usr/local/mariadb/include 0045 /opt/mariadb/mariadb/include 0046 PATH_SUFFIXES 0047 mariadb 0048 ) 0049 0050 if(PC_MARIADB_VERSION) 0051 set(MySQL_VERSION_STRING ${PC_MARIADB_VERSION}) 0052 endif() 0053 0054 include(FindPackageHandleStandardArgs) 0055 0056 find_package_handle_standard_args(MariaDB 0057 REQUIRED_VARS MYSQL_LIBRARIES MYSQL_INCLUDE_DIR 0058 VERSION_VAR MySQL_VERSION_STRING 0059 ) 0060 0061 mark_as_advanced(MYSQL_INCLUDE_DIR MYSQL_LIBRARIES) 0062 0063 set_package_properties(MariaDB PROPERTIES 0064 DESCRIPTION "MariaDB Client Library (libmariadb)" 0065 URL "https://mariadb.org/" 0066 )