Fix BSD build

This commit is contained in:
Přemysl Eric Janouch 2015-08-06 01:15:11 +02:00
parent 871ae9be8e
commit c0ff71e9be
1 changed files with 12 additions and 3 deletions

View File

@ -29,6 +29,7 @@ pkg_check_modules (ncursesw ncursesw)
if (ncursesw_FOUND) if (ncursesw_FOUND)
set (project_libraries ${ncursesw_LIBRARIES}) set (project_libraries ${ncursesw_LIBRARIES})
include_directories (${ncursesw_INCLUDE_DIRS}) include_directories (${ncursesw_INCLUDE_DIRS})
link_directories (${ncursesw_LIBRARY_DIRS})
elseif (CURSES_FOUND) elseif (CURSES_FOUND)
set (project_libraries ${CURSES_LIBRARY}) set (project_libraries ${CURSES_LIBRARY})
include_directories (${CURSES_INCLUDE_DIR}) include_directories (${CURSES_INCLUDE_DIR})
@ -42,13 +43,21 @@ if (WITH_LUA)
pkg_search_module (lua REQUIRED lua5.3 lua-5.3 lua>=5.3) pkg_search_module (lua REQUIRED lua5.3 lua-5.3 lua>=5.3)
list (APPEND project_libraries ${lua_LIBRARIES}) list (APPEND project_libraries ${lua_LIBRARIES})
include_directories (${lua_INCLUDE_DIRS}) include_directories (${lua_INCLUDE_DIRS})
link_directories (${lua_LIBRARY_DIRS})
endif (WITH_LUA) endif (WITH_LUA)
list (APPEND project_libraries ${libssl_LIBRARIES} ${jansson_LIBRARIES})
include_directories (${libssl_INCLUDE_DIRS} ${jansson_INCLUDE_DIRS})
link_directories (${libssl_LIBRARY_DIRS} ${jansson_LIBRARY_DIRS})
# -lpthread is only there for debugging (gdb & errno) # -lpthread is only there for debugging (gdb & errno)
# -lrt is only for glibc < 2.17 # -lrt is only for glibc < 2.17
list (APPEND project_libraries foreach (extra iconv dl rt pthread)
${libssl_LIBRARIES} ${jansson_LIBRARIES} rt dl pthread) find_library (extra_lib ${extra})
include_directories (${libssl_INCLUDE_DIRS} ${jansson_INCLUDE_DIRS}) if (extra_lib)
list (APPEND project_libraries ${extra})
endif (extra_lib)
endforeach (extra)
# Project source files # Project source files
set (project_sources ${PROJECT_NAME}.c) set (project_sources ${PROJECT_NAME}.c)