aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-08-06 01:15:11 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-08-06 01:15:11 +0200
commitc0ff71e9bebffc3d6d8976bd5032a8bd98a5dcf0 (patch)
tree34fb46f496063547e4e52eae0feb3807fb62c99b
parent871ae9be8e064aa1a4db575f0209cc87a2c849c7 (diff)
downloadponymap-c0ff71e9bebffc3d6d8976bd5032a8bd98a5dcf0.tar.gz
ponymap-c0ff71e9bebffc3d6d8976bd5032a8bd98a5dcf0.tar.xz
ponymap-c0ff71e9bebffc3d6d8976bd5032a8bd98a5dcf0.zip
Fix BSD build
-rw-r--r--CMakeLists.txt15
1 files changed, 12 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1053a35..35d3688 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,7 @@ pkg_check_modules (ncursesw ncursesw)
if (ncursesw_FOUND)
set (project_libraries ${ncursesw_LIBRARIES})
include_directories (${ncursesw_INCLUDE_DIRS})
+ link_directories (${ncursesw_LIBRARY_DIRS})
elseif (CURSES_FOUND)
set (project_libraries ${CURSES_LIBRARY})
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)
list (APPEND project_libraries ${lua_LIBRARIES})
include_directories (${lua_INCLUDE_DIRS})
+ link_directories (${lua_LIBRARY_DIRS})
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)
# -lrt is only for glibc < 2.17
-list (APPEND project_libraries
- ${libssl_LIBRARIES} ${jansson_LIBRARIES} rt dl pthread)
-include_directories (${libssl_INCLUDE_DIRS} ${jansson_INCLUDE_DIRS})
+foreach (extra iconv dl rt pthread)
+ find_library (extra_lib ${extra})
+ if (extra_lib)
+ list (APPEND project_libraries ${extra})
+ endif (extra_lib)
+endforeach (extra)
# Project source files
set (project_sources ${PROJECT_NAME}.c)