"Fossies" - the Fresh Open Source Software Archive

Member "mariadb-connector-c-3.0.8-src/cmake/SearchLibrary.cmake" (18 Dec 2018, 800 Bytes) of package /linux/misc/mariadb-connector-c-3.0.8-src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) CMake source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "SearchLibrary.cmake": 3.0.2-src_vs_3.0.3-src.

    1 #
    2 #  Copyright (C) 2013-2016 MariaDB Corporation AB
    3 #
    4 #  Redistribution and use is allowed according to the terms of the New
    5 #  BSD license.
    6 #  For details see the COPYING-CMAKE-SCRIPTS file.
    7 #
    8 INCLUDE(CheckFunctionExists)
    9 INCLUDE(CheckLibraryExists)
   10  
   11 FUNCTION(SEARCH_LIBRARY library_name function liblist)
   12   IF(${${library_name}})
   13     RETURN()
   14   ENDIF()
   15   CHECK_FUNCTION_EXISTS(${function} IS_${function}_LIBC_FUNC)
   16   IF(IS_${function}_LIBC_FUNC)
   17     SET(${library_name} "" PARENT_SCOPE)
   18     RETURN()
   19   ENDIF()
   20   FOREACH(lib ${liblist})
   21     CHECK_LIBRARY_EXISTS(${lib} ${function} "" HAVE_${function}_IN_${lib})
   22     IF(HAVE_${function}_IN_${lib})
   23       SET(${library_name} ${lib} PARENT_SCOPE)
   24       SET(HAVE_${library_name} 1 PARENT_SCOPE)
   25       RETURN()
   26     ENDIF()
   27   ENDFOREACH()
   28 ENDFUNCTION()
   29