From ea6462037c6bfa69496b3a35173a6d09e8347e7a Mon Sep 17 00:00:00 2001 From: Javier Steinaker Date: Sat, 3 Sep 2022 09:12:54 +1000 Subject: Fix build: readline env variables should only be used when readline is detected diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index b82248c..dd75599 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -49,7 +49,12 @@ else() endif() add_executable(aft-mtp-cli ${CLI_SOURCES}) -target_include_directories(aft-mtp-cli SYSTEM PRIVATE ${Readline_INCLUDE_DIR}) +if (READLINE_FOUND) + target_include_directories(aft-mtp-cli SYSTEM PRIVATE ${Readline_INCLUDE_DIR}) +else() + target_include_directories(aft-mtp-cli SYSTEM PRIVATE) +endif() + target_link_libraries(aft-mtp-cli ${MTP_LIBRARIES} ${CLI_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS aft-mtp-cli RUNTIME DESTINATION bin) -- 2.36.1