mirror of
https://github.com/transmission/transmission
synced 2025-03-03 18:25:35 +00:00
CMake support for Solaris
This commit is contained in:
parent
f48c0cc130
commit
448d8f39f6
4 changed files with 31 additions and 5 deletions
|
@ -518,6 +518,21 @@ if(HAVE_LIBM)
|
||||||
set(LIBM_LIBRARY m)
|
set(LIBM_LIBRARY m)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(TR_NETWORK_LIBRARIES)
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND TR_NETWORK_LIBRARIES iphlpapi ws2_32)
|
||||||
|
else()
|
||||||
|
tr_select_library("c;socket;net" socket "" LIB)
|
||||||
|
if(NOT LIB MATCHES "^(|c)$")
|
||||||
|
list(APPEND TR_NETWORK_LIBRARIES ${LIB})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
tr_select_library("c;nsl;bind" gethostbyname "" LIB)
|
||||||
|
if(NOT LIB MATCHES "^(|c)$")
|
||||||
|
list(APPEND TR_NETWORK_LIBRARIES ${LIB})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_TESTS)
|
if(ENABLE_TESTS)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -13,7 +13,7 @@ if(UNIX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_path(EVENT2_INCLUDE_DIR NAMES event2/event.h HINTS ${_EVENT2_INCLUDEDIR})
|
find_path(EVENT2_INCLUDE_DIR NAMES event2/event.h HINTS ${_EVENT2_INCLUDEDIR})
|
||||||
find_library(EVENT2_LIBRARY NAMES event HINTS ${_EVENT2_LIBDIR})
|
find_library(EVENT2_LIBRARY NAMES event-2.1 event-2.0 event HINTS ${_EVENT2_LIBDIR})
|
||||||
|
|
||||||
if(EVENT2_INCLUDE_DIR)
|
if(EVENT2_INCLUDE_DIR)
|
||||||
if(_EVENT2_VERSION)
|
if(_EVENT2_VERSION)
|
||||||
|
|
|
@ -139,3 +139,17 @@ function(tr_win32_app_info OVAR DESCR INTNAME ORIGFNAME)
|
||||||
|
|
||||||
set(${OVAR} "${CMAKE_CURRENT_BINARY_DIR}/${INTNAME}-app-info.rc" PARENT_SCOPE)
|
set(${OVAR} "${CMAKE_CURRENT_BINARY_DIR}/${INTNAME}-app-info.rc" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(tr_select_library LIBNAMES FUNCNAME DIRS OVAR)
|
||||||
|
set(LIBNAME)
|
||||||
|
foreach(X ${LIBNAMES})
|
||||||
|
set(VAR_NAME "HAVE_${FUNCNAME}_IN_LIB${X}")
|
||||||
|
string(TOUPPER "${VAR_NAME}" VAR_NAME)
|
||||||
|
check_library_exists("${X}" "${FUNCNAME}" "${DIRS}" ${VAR_NAME})
|
||||||
|
if(${VAR_NAME})
|
||||||
|
set(LIBNAME "${X}")
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(${OVAR} "${LIBNAME}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
|
@ -254,16 +254,13 @@ target_link_libraries(${TR_NAME}
|
||||||
${B64_LIBRARIES}
|
${B64_LIBRARIES}
|
||||||
${LIBINTL_LIBRARY}
|
${LIBINTL_LIBRARY}
|
||||||
${LIBM_LIBRARY}
|
${LIBM_LIBRARY}
|
||||||
|
${TR_NETWORK_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ICONV_FOUND)
|
if(ICONV_FOUND)
|
||||||
target_link_libraries(${TR_NAME} ${ICONV_LIBRARIES})
|
target_link_libraries(${TR_NAME} ${ICONV_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
target_link_libraries(${TR_NAME} iphlpapi ws2_32)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_TESTS)
|
if(ENABLE_TESTS)
|
||||||
add_library(${TR_NAME}-test STATIC
|
add_library(${TR_NAME}-test STATIC
|
||||||
libtransmission-test.c
|
libtransmission-test.c
|
||||||
|
|
Loading…
Reference in a new issue