Only depend on iconv if found

This commit is contained in:
Mike Gelfand 2016-02-07 12:00:15 +00:00
parent 96ea2c82fd
commit 990dea4dd3
1 changed files with 8 additions and 2 deletions

View File

@ -200,7 +200,6 @@ include_directories(
${ZLIB_INCLUDE_DIRS}
${CRYPTO_INCLUDE_DIRS}
${CURL_INCLUDE_DIRS}
${ICONV_INCLUDE_DIRS}
${EVENT2_INCLUDE_DIRS}
${NATPMP_INCLUDE_DIRS}
${MINIUPNPC_INCLUDE_DIRS}
@ -209,6 +208,10 @@ include_directories(
${B64_INCLUDE_DIRS}
)
if(ICONV_FOUND)
include_directories(${ICONV_INCLUDE_DIRS})
endif()
if(ENABLE_UTP)
include_directories(${TP_TOP}/libutp)
endif()
@ -233,7 +236,6 @@ target_link_libraries(${TR_NAME}
${ZLIB_LIBRARIES}
${CRYPTO_LIBRARIES}
${CURL_LIBRARIES}
${ICONV_LIBRARIES}
${EVENT2_LIBRARIES}
${NATPMP_LIBRARIES}
${MINIUPNPC_LIBRARIES}
@ -244,6 +246,10 @@ target_link_libraries(${TR_NAME}
${LIBM_LIBRARY}
)
if(ICONV_FOUND)
target_link_libraries(${TR_NAME} ${ICONV_LIBRARIES})
endif()
if(WIN32)
target_link_libraries(${TR_NAME} iphlpapi ws2_32)
endif()