ubuntu cmake 源码 编译 安装 libcurl

ubuntu cmake 源码 编译 安装 libcurl

1. git clone https://github.com/curl/curl.git
2. cd curl
3. make build
4. cd build
5. cmake …
6. make -j4
7. make install

CMakeLists.txt使用

find_package(CURL REQUIRED)
if (CURL_FOUND)
    include_directories(${CURL_INCLUDE_DIRS})
    set(LIB_LIST ${LIB_LIST} ${CURL_LIBRARIES})
endif (CURL_FOUND)
add_executable(${EXEC_NAME} ${SRC_LIST})
target_link_libraries(${EXEC_NAME}  ${LIB_LIST})

你可能感兴趣的:(ubuntu)