Detect libedit
Jeffrey Pfau jeffrey@endrift.com
Tue, 12 Aug 2014 22:02:34 -0700
1 files changed,
11 insertions(+),
7 deletions(-)
jump to
M
CMakeLists.txt
→
CMakeLists.txt
@@ -70,13 +70,17 @@ endif()
set(DEBUGGER_SRC "${CMAKE_SOURCE_DIR}/src/debugger/debugger.c;${CMAKE_SOURCE_DIR}/src/debugger/memory-debugger.c") -if(USE_CLI_DEBUGGER AND NOT WIN32) - # Win32 doesn't have a usable command line, nor libedit, so this is useless on Windows - add_definitions(-DUSE_CLI_DEBUGGER) - list(APPEND DEBUGGER_SRC "${CMAKE_SOURCE_DIR}/src/debugger/cli-debugger.c") - list(APPEND DEBUGGER_SRC "${CMAKE_SOURCE_DIR}/src/debugger/parser.c") - pkg_search_module(EDIT libedit REQUIRED) - set(DEBUGGER_LIB ${EDIT_LIBRARIES}) +if(USE_CLI_DEBUGGER) + pkg_search_module(EDIT libedit) + if(EDIT_FOUND) + add_definitions(-DUSE_CLI_DEBUGGER) + list(APPEND DEBUGGER_SRC "${CMAKE_SOURCE_DIR}/src/debugger/cli-debugger.c") + list(APPEND DEBUGGER_SRC "${CMAKE_SOURCE_DIR}/src/debugger/parser.c") + set(DEBUGGER_LIB ${EDIT_LIBRARIES}) + else() + message(WARNING "Could not find libedit for CLI debugger support") + set(USE_CLI_DEBUGGER OFF) + endif() else() set(DEBUGGER_LIB "") endif()