diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e73552f8..bed6c2b44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -276,6 +276,9 @@ endif() # Check for iconv find_package(Iconv) if(ICONV_FOUND) + if(ICONV_LIBRARY) + list(APPEND EXTRA_LIBS ${ICONV_LIBRARY}) + endif() add_definitions(-DHAVE_ICONV) endif() @@ -297,6 +300,9 @@ add_subdirectory(icons) if(ENABLE_NLS) find_package(Gettext REQUIRED) + if(LIBINTL_LIBRARY) + list(APPEND EXTRA_LIBS ${LIBINTL_LIBRARY}) + endif() find_package(Intl REQUIRED) include_directories(${Intl_INCLUDE_DIRS}) list(APPEND EXTRA_LIBS "${Intl_LIBRARIES}") diff --git a/src/gui/curses/CMakeLists.txt b/src/gui/curses/CMakeLists.txt index de2371ce6..2223a33e7 100644 --- a/src/gui/curses/CMakeLists.txt +++ b/src/gui/curses/CMakeLists.txt @@ -37,14 +37,6 @@ if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") list(APPEND EXTRA_LIBS "pthread") endif() -if(ICONV_LIBRARY) - list(APPEND EXTRA_LIBS ${ICONV_LIBRARY}) -endif() - -if(LIBINTL_LIBRARY) - list(APPEND EXTRA_LIBS ${LIBINTL_LIBRARY}) -endif() - list(APPEND EXTRA_LIBS "m") if(ENABLE_NCURSES) diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt index c4c169771..54e5384bc 100644 --- a/tests/fuzz/CMakeLists.txt +++ b/tests/fuzz/CMakeLists.txt @@ -56,14 +56,6 @@ if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") list(APPEND EXTRA_LIBS "pthread") endif() -if(ICONV_LIBRARY) - list(APPEND EXTRA_LIBS ${ICONV_LIBRARY}) -endif() - -if(LIBINTL_LIBRARY) - list(APPEND EXTRA_LIBS ${LIBINTL_LIBRARY}) -endif() - list(APPEND EXTRA_LIBS "m") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 8c3fbf865..d54ca35de 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -206,10 +206,6 @@ endif() add_library(weechat_unit_tests_plugins MODULE ${LIB_WEECHAT_UNIT_TESTS_PLUGINS_SRC}) -if(ICONV_LIBRARY) - list(APPEND EXTRA_LIBS ${ICONV_LIBRARY}) -endif() - if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") list(APPEND EXTRA_LIBS "intl") if(HAVE_BACKTRACE)