add support for compiling fully static LAMMPS executable with libcurl
This commit is contained in:
@ -518,9 +518,17 @@ endif()
|
||||
find_package(CURL QUIET)
|
||||
option(WITH_CURL "Enable libcurl support" ${CURL_FOUND})
|
||||
if(WITH_CURL)
|
||||
find_package(CURL REQUIRED)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_CURL)
|
||||
target_link_libraries(lammps PRIVATE CURL::libcurl)
|
||||
|
||||
# need to use pkgconfig for fully static bins to find custom static libs
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "LinuxMUSL")
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(CURL IMPORTED_TARGET libcurl libssl libcrypto)
|
||||
target_link_libraries(lammps PUBLIC PkgConfig::CURL)
|
||||
else()
|
||||
find_package(CURL REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE CURL::libcurl)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tweak jpeg library names to avoid linker errors with MinGW cross-compilation
|
||||
|
||||
Reference in New Issue
Block a user