diff --git a/CMakeLists.txt b/CMakeLists.txt index 8170ce2..107a151 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)