dhewm / dhewm3

dhewm 3 main repository
https://dhewm3.org/
GNU General Public License v3.0
1.8k stars 346 forks source link

Missing link libraries because of ${CURL_LIBRARY} not set in CMakeLists.txt #541

Closed jopadan closed 10 months ago

jopadan commented 10 months ago
find_package(CURL QUIET)
if(CURL_FOUND)
        set(ID_ENABLE_CURL ON)
        include_directories(${CURL_INCLUDE_DIR})
        message(STATUS "libcurl found and enabled")
else()
        message(WARNING "libcurl not found, server downloads won't be available (apart from that dhewm3 will work)")
        set(ID_ENABLE_CURL OFF)
        set(CURL_LIBRARY "")
endif()

Manually adding the missing dependencies:

set(CURL_LIBRARY CURL::libcurl -lgssapi_krb5 -lnghttp2 -lgnutls -lrustls -lbrotlidec -lzstd -lidn2 -lnettle -lrtmp -lcares)

compiles.

Platform is:

jopadan commented 10 months ago

Updating FindCURL.cmake and reinstalling fixed it.

DanielGibson commented 10 months ago

You shouldn't have to link all those libs manually - unless you statically link curl, which doesn't seem like a supergood idea to me. If you link libcurl dynamically, libcurl.so.4 (or whatever it's called on your system) links against the required libs and dhewm3 only needs to link against libcurl itself.