Commit 491a0a31 authored by aleajactaest's avatar aleajactaest

Merge branch '46-error-build-debian-buster-with-static-option' into 'develop'

Resolve "error when build with static option on debian buster"

Closes #46

See merge request !44
parents 7e3079b9 351894a2
Pipeline #752 passed with stages
in 67 minutes and 58 seconds
This diff is collapsed.
......@@ -150,8 +150,9 @@ IF(WITH_STATIC)
IF(UNIX)
# under Linux and OS X, recent libxml2 versions are linked against liblzma
FIND_PACKAGE(LibLZMA)
FIND_PACKAGE(gnutls)
IF(LIBLZMA_LIBRARIES)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES})
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES} ${GNUTLS_LIBRARY})
ENDIF()
ENDIF()
ENDIF()
......
......@@ -80,6 +80,15 @@ ELSE()
ENDIF()
ENDIF()
IF(WITH_STATIC)
IF(UNIX)
FIND_PACKAGE(gnutls)
IF(GNUTLS_FOUND)
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${GNUTLS_LIBRARY})
ENDIF()
ENDIF()
ENDIF()
IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
SET(MYSQL_FOUND TRUE)
MESSAGE(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}")
......
# - Locate gnutls library
# This module defines
# GNUTLS_LIBRARY, the library to link against
# GNUTLS_FOUND, if false, do not try to link to JPEG
# GNUTLS_INCLUDE_DIR, where to find headers.
IF(NOT UNIX)
MESSAGE(STATUS "Ignore gnutls: It's not Unix enviroment")
RETURN()
ENDIF()
GET_CMAKE_PROPERTY(_variableNames VARIABLES)
LIST (SORT _variableNames)
FOREACH (_variableName ${_variableNames})
MESSAGE(STATUS "${_variableName}=${${_variableName}}")
ENDFOREACH()
IF(GNUTLS_LIBRARY AND GNUTLS_INCLUDE_DIR)
# in cache already
SET(GNUTLS_FIND_QUIETLY TRUE)
ENDIF()
# Save default suffixes
SET(_OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
# Define specific suffixes
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
FIND_PATH(GNUTLS_INCLUDE_DIR
gnutls.h
PATHS
$ENV{GNUTLS_DIR}/include
/usr/local/include
/usr/include/gnutls
/usr/include
/sw/include
/opt/local/include
/opt/csw/include
/opt/include
PATH_SUFFIXES gnutls
)
FIND_LIBRARY(GNUTLS_LIBRARY
NAMES gnutls libgnutls
PATHS
$ENV{GNUTLS_DIR}/lib
/usr/local/lib
/usr/lib
/usr/lib/x86_64-linux-gnu/
/usr/local/X11R6/lib
/usr/X11R6/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
# Restore default suffixes
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_OLD_SUFFIXES})
IF(GNUTLS_LIBRARY AND GNUTLS_INCLUDE_DIR)
SET(GNUTLS_FOUND "YES")
IF(NOT GNUTLS_FIND_QUIETLY)
MESSAGE(STATUS "Found gnutls: ${GNUTLS_LIBRARY}")
ENDIF()
ELSE()
IF(NOT GNUTLS_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find gnutls!")
ENDIF()
ENDIF()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment