GithubHelp home page GithubHelp logo

hupratt / cmake-find-curlpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guimauveb/cmake-find-curlpp

0.0 0.0 0.0 6 KB

A CMake script using LibFindMacros.cmake to look for the cURLpp library in an environment.

CMake 100.00%

cmake-find-curlpp's Introduction

CMake cURLpp find_package script

A CMake script using LibFindMacros.cmake to look for the cURLpp library in an environment

Usage

  1. In your project folder add the cmake directory cloned from this repo
~/project_folder/
|-- include
|   |-- header.hxx        
|-- source
|   |-- source.cxx
|-- cmake
|   |-- FindCURLPP.cmake        
|   |-- LibFindMacros.cmake        
|-- CMakeLists.txt
|-- main.cxx
|-- README.md

  1. Add the following code to your CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(Project)
#...
# cURLpp requires libcurl to be installed
message(STATUS "Looking for curl...")
find_package(CURL REQUIRED)

if (CURL_FOUND)
    message(STATUS "Found curl version: ${CURL_VERSION_STRING}")
    message(STATUS "Using curl version: ${CURL_INCLUDE_DIRS}")
    message(STATUS "Using curl libraries: ${CURL_LIBRARIES}\n")
    list(APPEND Project_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
else()
    message(FATAL_ERROR "Could not find curl.")
endif()


message(STATUS "Looking for curlpp...")
find_package(CURLPP REQUIRED)

if (CURLPP_FOUND)
    message(STATUS "Found curlpp version: ${CURLPP_VERSION}")
    message(STATUS "Using curlpp include dir: ${CURLPP_INCLUDE_DIR}")
    message(STATUS "Using curlpp libraries: ${CURLPP_LIBRARY}\n")
    list(APPEND Project_INCLUDE_DIRS ${CURLPP_INCLUDE_DIR})
else()
    message(FATAL_ERROR "Could not find curlpp.")
endif()

target_link_libraries(Project ${CURL_LIBRARIES})
target_link_libraries(Project ${CURLPP_LIBRARY})

cmake-find-curlpp's People

Contributors

guimauveb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.