Coder Social home page Coder Social logo

CMakeLists.txt example about restinio HOT 5 CLOSED

stiffstream avatar stiffstream commented on May 22, 2024
CMakeLists.txt example

from restinio.

Comments (5)

ngrodzitski avatar ngrodzitski commented on May 22, 2024

Hi!

For vcpkg, try also to include find_package(unofficial-http-parser REQUIRED) to a list of packages you search.
I guess this would work (if no, let me know, I'll make a sample from scratch).

cmake_minimum_required(VERSION 3.8.0)
project (helloworld)
add_executable(helloworld helloworld.cpp)

# RESTinio dependencies:
# 1. ASIO or Boost::ASIO (goes as headers, vcpkg knows where)
# 2. HTTP parser
find_package(unofficial-http-parser REQUIRED)
# 3. fmtlib
find_package(fmt REQUIRED)
# RESTinio itself
find_package(restinio REQUIRED)

# Make your project dependent on restinio, 
# and let cmake deal with all the headers paths and linked libs.
target_link_libraries(helloworld PRIVATE restinio::restinio)

from restinio.

jm130794 avatar jm130794 commented on May 22, 2024

Hi,

Your example works... and thanks for the quick response.
We learn CMake at the same time. Sorry if the question seem silly.

You should add this example in the documentation in the CMake section.

Jean-Marc

from restinio.

ngrodzitski avatar ngrodzitski commented on May 22, 2024

It a usual question. I periodically go through the similar issues with 3rd party libs myself. It's clear for the authors how to put all dependencies together but for a fresher, it might be tricky. So feel free to ask for any help with RESTinio.

You should add this example in the documentation in the CMake section.

Yeah, sounds reasonable. Will keep the issue opened until adding notes to docs.

from restinio.

ngrodzitski avatar ngrodzitski commented on May 22, 2024

A working sample added to https://stiffstream.com/en/docs/restinio/0.4/obtaining.html#vcpkg

from restinio.

ras0219-msft avatar ras0219-msft commented on May 22, 2024

@ngrodzitski You might look at adding a find_dependency() call to your -config.cmake file: https://cmake.org/cmake/help/latest/module/CMakeFindDependencyMacro.html

from restinio.

Related Issues (20)

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.