Fix library searching

This commit is contained in:
Přemysl Eric Janouch 2015-08-06 21:58:13 +02:00
parent 5b208547c4
commit aa77bc41d0

View File

@ -34,23 +34,18 @@ if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1)
endif ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
# iconv may or may not be present in libc
find_library (iconv_LIBRARIES iconv)
if (iconv_LIBRARIES)
list (APPEND project_libraries ${iconv_LIBRARIES})
endif (iconv_LIBRARIES)
list (APPEND project_libraries ${libssl_LIBRARIES})
include_directories (${libssl_INCLUDE_DIRS})
link_directories (${libssl_LIBRARY_DIRS})
# -lpthread is only there for debugging (gdb & errno)
# -lrt is only for glibc < 2.17
foreach (extra rt pthread)
find_library (extra_lib ${extra})
if (extra_lib)
# -liconv may or may not be a part of libc
foreach (extra iconv rt pthread)
find_library (extra_lib_${extra} ${extra})
if (extra_lib_${extra})
list (APPEND project_libraries ${extra})
endif (extra_lib)
endif (extra_lib_${extra})
endforeach (extra)
if (ncursesw_FOUND)