Fixed changing cached values causing linking errors
This commit is contained in:
@ -23,6 +23,7 @@ else()
|
|||||||
message(STATUS "Dependencies ok")
|
message(STATUS "Dependencies ok")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
check_dirs()
|
||||||
|
|
||||||
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/modules)
|
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/modules)
|
||||||
|
|
||||||
|
|||||||
23
macros.cmake
23
macros.cmake
@ -71,6 +71,9 @@ macro(check_deps)
|
|||||||
message(FATAL_ERROR "Cannot find dependencies: ${FAILED_DEPS}")
|
message(FATAL_ERROR "Cannot find dependencies: ${FAILED_DEPS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(check_dirs)
|
||||||
# Find the MySQL headers if they were not defined
|
# Find the MySQL headers if they were not defined
|
||||||
if(NOT ( DEFINED MYSQL_DIR ) )
|
if(NOT ( DEFINED MYSQL_DIR ) )
|
||||||
find_path(MYSQL_DIR mysql.h PATH_SUFFIXES mysql mariadb)
|
find_path(MYSQL_DIR mysql.h PATH_SUFFIXES mysql mariadb)
|
||||||
@ -88,29 +91,27 @@ macro(check_deps)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Find the embedded mysql library
|
# Find the embedded mysql library
|
||||||
if( NOT ( DEFINED EMBEDDED_LIB ) )
|
|
||||||
|
|
||||||
if(STATIC_EMBEDDED)
|
if(STATIC_EMBEDDED)
|
||||||
|
|
||||||
find_file(EMBEDDED_LIB libmysqld.a PATHS /usr/lib /usr/lib64 PATH_SUFFIXES mysql mariadb)
|
find_file(EMBEDDED_LIB_STATIC libmysqld.a PATHS /usr/lib /usr/lib64 PATH_SUFFIXES mysql mariadb)
|
||||||
|
set(EMBEDDED_LIB ${EMBEDDED_LIB_STATIC})
|
||||||
if(${EMBEDDED_LIB} STREQUAL "EMBEDDED_LIB-NOTFOUND")
|
if(${EMBEDDED_LIB_STATIC} STREQUAL "EMBEDDED_LIB_STATIC-NOTFOUND")
|
||||||
|
|
||||||
message(WARNING "Warning: Static library not found, looking for dynamic version")
|
message(WARNING "Warning: Static library not found, looking for dynamic version")
|
||||||
find_library(EMBEDDED_LIB mysqld PATHS /usr/lib /usr/lib64 PATH_SUFFIXES mysql mariadb)
|
find_library(EMBEDDED_LIB_DYNAMIC mysqld PATHS /usr/lib /usr/lib64 PATH_SUFFIXES mysql mariadb)
|
||||||
|
set(EMBEDDED_LIB ${EMBEDDED_LIB_DYNAMIC})
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
|
|
||||||
find_library(EMBEDDED_LIB mysqld PATHS /usr/lib /usr/lib64 PATH_SUFFIXES mysql mariadb)
|
find_library(EMBEDDED_LIB_DYNAMIC mysqld PATHS /usr/lib /usr/lib64 PATH_SUFFIXES mysql mariadb)
|
||||||
|
set(EMBEDDED_LIB ${EMBEDDED_LIB_DYNAMIC})
|
||||||
endif()
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Inform the user about the embedded library
|
# Inform the user about the embedded library
|
||||||
if(${EMBEDDED_LIB} STREQUAL "EMBEDDED_LIB-NOTFOUND")
|
if( (${EMBEDDED_LIB} STREQUAL "EMBEDDED_LIB_STATIC-NOTFOUND") OR (${EMBEDDED_LIB} STREQUAL "EMBEDDED_LIB_DYNAMIC-NOTFOUND"))
|
||||||
message(FATAL_ERROR "Library not found: libmysqld. If your install of MySQL is in a non-default location, please provide the location with -DEMBEDDED_LIB=<path to library>")
|
message(FATAL_ERROR "Library not found: libmysqld. If your install of MySQL is in a non-default location, please provide the location with -DEMBEDDED_LIB=<path to library>")
|
||||||
else()
|
else()
|
||||||
get_filename_component(EMBEDDED_LIB ${EMBEDDED_LIB} REALPATH)
|
get_filename_component(EMBEDDED_LIB ${EMBEDDED_LIB} REALPATH)
|
||||||
|
|||||||
Reference in New Issue
Block a user