CMake - add check for libedit

Signed-off-by: Daniel Gryniewicz <dang@fprintf.net>
This commit is contained in:
Daniel Gryniewicz 2015-09-21 12:29:51 -04:00
parent 4d02f8746c
commit a866a8947d
2 changed files with 34 additions and 1 deletions

View File

@ -67,7 +67,6 @@ CHECK_INCLUDE_FILES("utime.h" HAVE_UTIME_H)
CHECK_INCLUDE_FILES("${CMAKE_SOURCE_DIR}/src/include/fiemap.h" HAVE_FIEMAP_H)
CHECK_INCLUDE_FILES("fuse/fuse_lowlevel.h" HAVE_FUSE_LOWLEVEL_H)
CHECK_INCLUDE_FILES("fuse/fuse.h" HAVE_FUSE_H)
CHECK_INCLUDE_FILES("libedit/vis.h" HAVE_LIBEDIT_VIS_H)
CHECK_INCLUDE_FILES("fcgi_config.h" HAVE_FASTCGI_CONFIG_H)
CHECK_INCLUDE_FILES("fastcgi.h" HAVE_FASTCGI_H)
CHECK_INCLUDE_FILES("fcgiapp.h" FASTCGI_FASTCGI_APP_DIR)
@ -176,6 +175,8 @@ find_package(libuuid REQUIRED)
find_package(libcurl REQUIRED)
find_package(libedit REQUIRED)
option(USE_CRYPTOPP "Cryptopp is ON" ON)
find_package(cryptopp)
if(CRYPTOPP_FOUND)

View File

@ -0,0 +1,32 @@
# Try to find libedit
# Once done, this will define
#
# LIBEDIT_FOUND - system has Profiler
# LIBEDIT_INCLUDE_DIR - the Profiler include directories
# LIBEDIT_LIBRARIES - link these to use Profiler
if(LIBEDIT_INCLUDE_DIR AND LIBEDIT_LIBRARIES)
set(LIBEDIT_FIND_QUIETLY TRUE)
endif(LIBEDIT_INCLUDE_DIR AND LIBEDIT_LIBRARIES)
INCLUDE(CheckCXXSymbolExists)
# include dir
find_path(LIBEDIT_INCLUDE_DIR histedit.h NO_DEFAULT_PATH PATHS
/usr/include
/opt/local/include
/usr/local/include
)
# finally the library itself
find_library(LIBLIBEDIT NAMES edit)
set(LIBEDIT_LIBRARIES ${LIBLIBEDIT})
# handle the QUIETLY and REQUIRED arguments and set LIBEDIT_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libedit DEFAULT_MSG LIBEDIT_LIBRARIES LIBEDIT_INCLUDE_DIR)
mark_as_advanced(LIBEDIT_LIBRARIES LIBEDIT_INCLUDE_DIR)