Skip to content
/ SampleCppProject Public template

Sample setup using vscode + CMake + Conan pkg manager to easily develop cpp.

License

Notifications You must be signed in to change notification settings

GiulianoWF/SampleCppProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements:

  • install conan package manager

  • install cmake

  • install g++ or windows equivalent c++ compiler (clang-> "LLVM pre build binary installer")

  • Setup conan compiler

    • Get conan path to profile folder "/path/to/profile/" with
      • conan config home
    • Set compiler variables
      • Windows
        • conan profile update settings.compiler=clang "/path/to/profile/"profiles/default
        • conan profile update settings.compiler.version=11 "/path/to/profile/"profiles/default
  • install visual studio code

  • visual studio code extensions:

    • C/C++
    • CMake Tools

Steps to first compilation:

  • Download the repository

  • Open the repository's base folder on command line

  • In the command line:

    • mkdir build
    • cd build
    • conan install .. --build=missing
  • On vscode editor press:

    • F7     ->To compile
    • Choose the compiler on the drop box
    • F5     ->To run

To add a library:

Add the name of the library to conanfile.txt, under the tag [required]

ex.: (To add boost)

  • Add to conanfile.txt:
    •      [requires]
    •      ....
    •      boost/1.72.0
  • Run "conan istall .." command in the build folder  
  • Add to main.cpp:
    •      #include <boost/optional.hpp>

You can search for packages on https://conan.io/center/

About

Sample setup using vscode + CMake + Conan pkg manager to easily develop cpp.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published