diff --git a/CMakeLists.txt b/CMakeLists.txt index a0d7335557ca..7b3beeb8cf4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,6 +177,8 @@ target_sources(fishlib PRIVATE ${FISH_HEADERS}) target_link_libraries(fishlib ${CURSES_LIBRARY} ${CURSES_EXTRA_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS} ${PCRE2_LIB} ${Intl_LIBRARIES} ${ATOMIC_LIBRARY}) +target_include_directories(fishlib PRIVATE + ${CURSES_INCLUDE_DIRS}) # Define fish. add_executable(fish src/fish.cpp) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index eb380c342ba4..91f90c62ade5 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -32,6 +32,8 @@ if(NOT ${CURSES_FOUND}) set(CURSES_CURSES_LIBRARY ${CURSES_LIBRARIES}) set(CURSES_LIBRARY ${CURSES_LIBRARIES}) endif() +# Set up extra include directories for CheckIncludeFile +list(APPEND CMAKE_REQUIRED_INCLUDES ${CURSES_INCLUDE_DIRS}) # Fix undefined reference to tparm on RHEL 6 and potentially others # If curses is found via CMake, it also links against tinfo if it exists. But if we use our