diff --git a/CMakeLists.txt b/CMakeLists.txt index 51d856c36..3e8da3de7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,11 +305,14 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang") endif() set(NEEDED_HEADERS - libintl.h stdbool.h sys/statvfs.h xfs/xfs.h) +if(ENABLE_NLS) + list(APPEND NEEDED_HEADERS libintl.h) +endif() + foreach(H ${NEEDED_HEADERS}) tr_make_id("${H}" H_ID) check_include_file(${H} HAVE_${H_ID}) @@ -356,6 +359,13 @@ endforeach() # endif() # endif() +if(ENABLE_NLS) + check_library_exists(intl libintl_gettext "" HAVE_LIBINTL) + if(HAVE_LIBINTL) + set(LIBINTL_LIBRARY intl) + endif() +endif() + check_library_exists(m sqrt "" HAVE_LIBM) if(HAVE_LIBM) set(LIBM_LIBRARY m) diff --git a/cmake/TrMacros.cmake b/cmake/TrMacros.cmake index f1f7ef36b..ac66d2ba5 100644 --- a/cmake/TrMacros.cmake +++ b/cmake/TrMacros.cmake @@ -62,6 +62,7 @@ macro(tr_add_external_auto_library ID LIBNAME) ${ARGN} PREFIX "${${ID}_PREFIX}" CMAKE_ARGS + "-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}" "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}" "-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}" "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" diff --git a/libtransmission/CMakeLists.txt b/libtransmission/CMakeLists.txt index c50f0637d..bf69cff7a 100644 --- a/libtransmission/CMakeLists.txt +++ b/libtransmission/CMakeLists.txt @@ -202,6 +202,7 @@ target_link_libraries(${TR_NAME} ${MINIUPNPC_LIBRARIES} ${DHT_LIBRARIES} ${UTP_LIBRARIES} + ${LIBINTL_LIBRARY} ${LIBM_LIBRARY} )