From aa77bc41d08aba90dd468e96f1cc662583d673ba Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Thu, 6 Aug 2015 21:58:13 +0200
Subject: Fix library searching
---
CMakeLists.txt | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
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)
--
cgit v1.2.3-70-g09d2