cmake: Don't try to use readline if you don't also have curses.
Fixes #17.
This commit is contained in:
parent
ca34091863
commit
395cccbd24
|
@ -208,13 +208,15 @@ if(PHYSFS_BUILD_TEST)
|
||||||
find_path(HISTORY_H readline/history.h)
|
find_path(HISTORY_H readline/history.h)
|
||||||
if(READLINE_H AND HISTORY_H)
|
if(READLINE_H AND HISTORY_H)
|
||||||
find_library(CURSES_LIBRARY NAMES curses ncurses)
|
find_library(CURSES_LIBRARY NAMES curses ncurses)
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
|
if(CURSES_LIBRARY)
|
||||||
find_library(READLINE_LIBRARY readline)
|
set(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
|
||||||
if(READLINE_LIBRARY)
|
find_library(READLINE_LIBRARY readline)
|
||||||
set(HAVE_SYSTEM_READLINE TRUE)
|
if(READLINE_LIBRARY)
|
||||||
set(TEST_PHYSFS_LIBS ${TEST_PHYSFS_LIBS} ${READLINE_LIBRARY} ${CURSES_LIBRARY})
|
set(HAVE_SYSTEM_READLINE TRUE)
|
||||||
include_directories(SYSTEM ${READLINE_H} ${HISTORY_H})
|
set(TEST_PHYSFS_LIBS ${TEST_PHYSFS_LIBS} ${READLINE_LIBRARY} ${CURSES_LIBRARY})
|
||||||
add_definitions(-DPHYSFS_HAVE_READLINE=1)
|
include_directories(SYSTEM ${READLINE_H} ${HISTORY_H})
|
||||||
|
add_definitions(-DPHYSFS_HAVE_READLINE=1)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
add_executable(test_physfs test/test_physfs.c)
|
add_executable(test_physfs test/test_physfs.c)
|
||||||
|
|
Loading…
Reference in New Issue