#+INCLUDE: theme/style.org 
#+TITLE: CPP / C++ - Package Managers 
#+DESCRIPTION: cpp/c++ package managers for better productivity
#+STARTUP: content 

* Package Managers 
** Overview 

  *Package Managers*
 
 There are several solutions for managing dependencies in C++ projects,
 however they are still no widely used or integrated to IDEs and
 building systems. A reasonable set of features for selecting a package
 manager is CMake support, CMake integration, IDE integration, command
 line interface and distributed repositories. Some of them are:

  + [[https://www.conan.io/][Conan]] [Most mature], [BEST] - Dependency manager written in Python which
    can install source packages from multiple repositories, including
    local network and current machine package cache of pre-compiled
    object code.
    + Creator: Diego Rodriguez Losada
    + CMake Support: YES
    + Implementation Issues: As Conan is written in Python, it requires
      a Python installation. 
    + Package authoring: Packages configuration are written in Python.
    + See:
      + [[https://blog.conan.io/2017/05/11/C-C++-Binary-Package-Management-for-Visual-Studio.html][C/C++ Binary Package Management for Visual Studio]]
    + Video:
      + [[https://www.youtube.com/watch?v=xvqH_ck-5Q8][CppCon 2016: Diego Rodriguez-Losada "Conan, a C and C++ package manager for developers"]]
      + Humor, funny: [[https://www.youtube.com/watch?v=nLdB1ErncBg][CppCon 2016: Diego Rodriguez-Losada "Why not Conan?"]]
      + [[https://www.youtube.com/watch?v=CCKiKGn-ew8][Diego Rodriguez-Losada: Conan C++ package manager]]

  + [[https://docs.microsoft.com/en-us/cpp/vcpkg?view=vs-2017][vcpkg]] [Most mature], [BEST] - open source cross-platform C++ package
    manager created by Microsft Inc.
    + Creator: Microsft Inc. MSFT
    + CMake Support: YES
    + Documentation: https://vcpkg.readthedocs.io/en/latest/
    + Repository: https://github.com/Microsoft/vcpkg
    + FAQ: [[https://github.com/Microsoft/vcpkg/blob/master/docs/about/faq.md][VCpkg FAQ]]
    + See:
      + [[https://blog.kitware.com/vcpkg-a-tool-to-build-open-source-libraries-on-windows/][Vcpkg: A tool to build open source libraries on Window]]
      + Video: Microsft - [[https://www.youtube.com/watch?v=zo6nqFVBd5o][Vcpkg a tool to build open source C++ libraries]]
      + Video: Microsft - [[https://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-54-Whats-New-In-Visual-Studio-2017-RC-and-Introduction-To-Vcpkg][GoingNative 54: What's New In Visual Studio 2017 RC and Introduction To Vcpkg]]
      + Video: [[https://www.youtube.com/watch?v=KOeOLOu6nHw][C++ Weekly - Ep 118 - Trying Out The vcpkg Package Manager]]

  + [[http://www.buckaroo.pm/][Buckaroo]] - "A C++ package manager that will take you to your happy place"
    + Creator: LoopPerfect Limited LTD.
    + CMake Support: Backaroo uses Buck build system as its default
      building system, although there is still some limited support to
      CMake. More info. at [[https://github.com/LoopPerfect/buckaroo/wiki/Building-CMake-Projects][Buildign CMake projects]]
    + Repository: https://github.com/LoopPerfect/buckaroo
    + Documentation: https://github.com/LoopPerfect/buckaroo/wiki/
    + Buckaroo-recipes: https://github.com/LoopPerfect/buckaroo-recipes/tree/master/recipes

  + [[https://www.qpm.io/][QPM]] - Pcakge manager for QT.
    + Repository: https://github.com/Cutehacks/qpm
    + CMake Support: ???
    + Package listing: https://www.qpm.io/packages/index.html

  + [[https://github.com/pfultz2/cget][cget]] - "Cmake package retrieval. This can be used to download and
    install cmake packages." Decentralized: Packages can be installed
    from anywhere, from github, urls, or local files. NOTE: It is not a
    package manager.
    + Creator: Paul Fultz
    + CMake Support: YES 
    + Repository: https://github.com/pfultz2/cget

  + [[https://github.com/ruslo/hunter][Hunter]] - Cross-platform package manager for C/C++ fully integrated
    to CMake, it does not need any external configuration file or run
    any application before editing the project or running cmake from
    command line. All the libraries to be installed are set in the
    file CMakeFiles.txt. If they are not available in the system, they
    are automatically downloaded and installed.
    + Creator: Ruslan Baratov
    + CMake Support: YES
    + Documentation: https://docs.hunter.sh
    + Package list: https://docs.hunter.sh/en/latest/packages.html
    + Note: It is still under development, but it seems promising.

  + [[https://cppan.org/][Cppan]] - "CPPPAN is the crossplatform C/C++ dependency manager. It
    is built on top of CMake and also has build system capabilities."
    + Creator: Egor Pugin
    + CMake Support: ???
    + Repository: https://github.com/cppan/cppan
    + Documentation: https://github.com/cppan/cppan/tree/v1/doc

  + [[https://build2.org/][Build2]] - "build2 is an open source (MIT), cross-platform build
    toolchain for developing and packaging C++ code. It is a hierarchy
    of tools that includes the build system, package dependency manager
    (for package consumption), and project dependency manager (for
    project development)."
    + Creator: [[https://codesynthesis.com/][Code Synthesis LTDA]], Boris Kolpackov
    + CMake Support: NO 
    + Package listing: https://cppget.org/
    + Possible shortcoming: No integration with CMake building-system
      and no integration to IDEs like CMake.
    + See:
      + Video: [[https://www.youtube.com/watch?v=Nni2Qu2WitY&feature=youtu.be][CppCon 2018: "C++ Dependency Management: from Package Consumption to Project Development"]]

  + [[https://github.com/iauns/cpm][CPM]] - [NO LONGER MAINTENED] "A C++ Package Manager based on CMake and Git."

  + [[https://spack.io/][Spack]] - "Spack is a package manager for supercomputers, Linux, and
    macOS. It makes installing scientific software easy. With Spack,
    you can build a package with multiple versions, configurations,
    platforms, and compilers, and all of these builds can coexist on
    the same machine."
    + Repository: https://github.com/spack/spack

  + [[https://blogs.msdn.microsoft.com/vcblog/2013/04/26/nuget-for-c/][Nuget]] - A pacakge manager used in Visual Studio for C#, VB.NET,
    Javascript and C++.
    + Creator: Microsft Inc. MSFT
    + CMake Support: NO 
    + Problem: It seems to work only on Windows and Visual Studio.
    + See: 
      + https://blog.nuget.org/20130426/native-support.html
      + Video: [[https://www.youtube.com/watch?v=FIY4FZDIt8Q][Consuming Native NuGet Packages in Visual Studio]]
      + https://blog.scalyr.com/2018/07/getting-started-quickly-c-logging/
      + [[https://www.microsofttranslator.com/bv.aspx?from=&to=en&a=https://qiita.com/nia_tn1012/items/77c3c1b006f7c69d30ac][Let's use Nuget in C++ project]] (Translated from Japanese with Bing Translator.)


  *Considerations for package manager choice*

  + The most mature package managers with CMake integration are Conan
    and Vcpkg. Vcpkg has the largest number of packages available.
    However, it is not possible to install multiple versions of the
    same package or host a local package repository.

  + Conan is more documented and provides more control over package
    versions. It has descentralized repositories and also allows users to
    host local or intranet private repositories. A minor problem
    of Conan is the Python installation requirement, but this issue
    could be quickly solved by turning Conan into a single native
    executable file by packing Conan Python module with the Python
    interpreter with tools like Py2Exe for Windows. 

 Comparative table:

 |-----------------------------------+--------+--------|
 | Feature                           | Conan  | Vcpkg  |
 |-----------------------------------+--------+--------|
 | Standalone                        | NO     | YES    |
 | Decentralized repositories        | YES    | NO     |
 | Local Repository                  | YES    | NO     |
 | Multiple versions of same package | YES    | NO     |
 | Integration with IDEs             | NO     | NO     |
 | Most Simple                       | -      | Winner |
 | More packages                     | -      | Winner |
 | User control                      | Winner | -      |
 |-----------------------------------+--------+--------|
 | Overall                           | Winner | -      |
 |-----------------------------------+--------+--------|

  *Some reasonable set of features for a package managers*

  + CMake integration
  + Default repository, descentralized and local repositories.
  + Cross platform
  + Easier to use from CMake without needing to call any external
    command, the packages to be installed should be defined in the
    CMakeLists.txt file.
  + Command line tools
  + Browse package metadata from command line or IDE like .net's Nuget
    or Python's pip.
  + Integration with IDEs
  + Standalone no depending on any interpreter or
    external dependency or fully packed with the interpreter making
    easier to install and deploy.

  *Low tech approaches for package or dependency management*

  + GIT Submodules

  + Use system-specific package manager for instance: Ubuntu: apt-get;
    Fedora Linux: dnf; BSD Ports: ...
    + Disadvantage: Hard to reproduce compilation across different
      machines as most Linux distributions only provide a single
      version and may not have all necessary libraries and header-only
      libraries.

  + Add libraries manually

  + Install packages manually in the systems:
    + ./configure && make && make install

  + Copy header-only libraries to project-directory


  *Interesting discussions:*

  + Reddit /r/cpp [[https://www.reddit.com/r/cpp/comments/3d1vjq/is_there_a_c_package_manager_if_not_how_do_you/][Is there a C++ package manager? If not, how do you handle dependencies?]]
  + Reddit /r/cpp - [[https://www.reddit.com/r/cpp/comments/5v10r1/downsides_to_conanio/][Downsides to Conan.io?]]
  + Reddit /r/cpp - [[https://www.reddit.com/r/cpp/comments/40cfbk/hunter_crossplatform_package_manager_for_c/][Hunter - Cross-platform package manager for C++]]
  + [[https://news.ycombinator.com/item?id=16915195][Announcing a single C++ library manager for Linux, macOS and Windows: Vcpkg]]

** Conan package Manager
*** Main Web Sites

  + https://conan.io

  + https://twitter.com/conan_io?lang=en - News 

  + https://github.com/conan-io/ - Source code Repositories 

  + https://jfrog.com

*** Benefits and Capabilities

 Benefits: 

  + Reduce compile-time
  + Reduce library installation effort duplication
  + Increase library discoverability
  + Easier cross-compilation for different architectures
  + Host package recipes in local network or remotely 

 Capabilities:

  + *Cache and reuse compilation binaries (aka object-code)*  such as intermediate
    object-code (*.o or *.obj), static libraries and shared libraries
    which reduces compile-time and effort duplication for installing
    a libraries since all projects using the same conan recipe can
    reuse the binaries.

  + *Package with embedded sources*: Sources can be embedded in a
    package. 

  + *Package with remote sources*: Conan packages (aka recipes) can fetch
    source code from remote sources such as Github, Gitlab,
    Sourceforge, FTP or even a *Conan Server* in local network.

  + Conan Recipes can build package's sources with a wide variety of tools such as:
    + GNU autotools
    + CMake
    + GNU Makefile
    + BSD Makefile 

*** Videos 

 Webinar JFrog: 

  * [[https://www.youtube.com/watch?v=xBLjXdyh3zs][{Webinar: Part 1 of 3} Introduction to C/C++ Package Management with Conan]]
  * [[https://www.youtube.com/watch?v=JsijdbjVlXw&feature=youtu.be][{Webinar: Part 2 of 3} Advanced package management for C/C++ with Conan]]
  * [[https://www.youtube.com/watch?v=ExpkMy6DJ6o&feature=youtu.be][{Webinar: Part 3 of 3} Modern DevOps for Modern C/C++ with Conan]] 

 CppCon: 
  + [[https://www.youtube.com/watch?v=xA9yRX4Mdz0][CppCon 2017: D. Rodriguez-Losada Gonzalez “Faster Delivery of Large C/C++ Projects with...]]

*** Selected Articles 

     + [[https://blog.conan.io/2018/01/30/Cross-building-Boost-Android.html][Cross building Boost C++ libraries to Android with Conan]]

     + [[https://blog.conan.io/2019/09/02/Deterministic-builds-with-C-C++.html][An introduction to deterministic builds with C/C++]]

     + [[https://news.ycombinator.com/item?id=20858044][An introduction to deterministic builds with C/C++ | Hacker News]]

     + [[https://blog.conan.io/2019/07/24/C++-build-systems-new-integrations-in-Conan-package-manager.html][C++ build systems new integrations in Conan package manager]]

     + [[https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/driving-c-c-developer-use-cases-for-arm-with-conan][Conan platform manager and C/C++ - Tools, Software and IDEs blog - Software Tools - Arm Community]]

     + [[https://blog.jetbrains.com/clion/2019/05/getting-started-with-the-conan-clion-plugin/][Getting Started with the Conan CLion Plugin | CLion Blog]]

     + [[https://schneide.blog/2019/04/25/migrating-an-existing-c-codebase-to-use-conan/][Migrating an existing C++ codebase to conan | Schneide Blog]]

     + [[https://schneide.blog/2019/06/24/integrating-conan-cmake-and-jenkins/][Integrating conan, CMake and Jenkins | Schneide Blog]]

     + [[https://www.lattix.com/reducing-build-times-for-c-c-projects-with-conan-and-lattix/][Blog:Reducing build times for C/C++ Projects with JFrog's Conan and Lattix -]]

     + [[https://forums.unrealengine.com/community/community-content-tools-and-tutorials/1459614-a-cross-platform-workflow-for-integrating-third-party-libraries-using-the-conan-package-manager][A cross-platform workflow for integrating third-party libraries using the Conan package manager - Unreal Engine Forums]]

     + [[https://blog.conan.io/2018/12/03/Using-Facebook-Folly-with-Conan.html][Using Facebook Folly with Conan]]

     + https://github.com/conan-io/examples
       + Several Conan examples to complement the documentation and blog.

*** Install Conan 

  *Standalone Installers* 

 Conan Standalone Installers for Windows, Linux and Mac OSX which does
 not require previous Python installation.

  + https://conan.io/downloads

  *Installation via PIP* 

 Installing Conan requires a Python installation with pip.

 #+BEGIN_SRC sh 
   $ pip instal conan 
 #+END_SRC

 The easiest way to get Python for any platform, including Windows is
 through Miniconda distribution which is a lightweight version of
 Python Anaconda distribution: 

  + https://docs.conda.io/en/latest/miniconda.html

  *Conan Addons for IDEs* 

 Conan Extension (Addon) for Visual Studio 
  + https://docs.conan.io/en/latest/integrations/ide/visual_studio.html

 Conan Plugin for JetBrains' CLION IDE: 
  + https://plugins.jetbrains.com/plugin/11956-conan

*** Conan Package Repositories 

 Search Conan Packages at Conan Center repository: 

 Repository Lists:
  + https://docs.conan.io/en/latest/uploading_packages/remotes.html

 Some Conan Repositories:

  + Main Repository: https://bintray.com/conan/conan-center
  + Others:
    + [[https://bintray.com/conan/conan-transit][Conan-Transit]]
    + [[https://bintray.com/conan-community/conan][Conan-Community]]
    + [[https://bintray.com/bincrafters/public-conan][Bincrafters]] - https://bincrafters.github.io/

*** Libraries in Conan Center

  *Libraries in Conan Main Repositories* 
 
 All libraries in Conan Community: 
  + https://bintray.com/conan-community/conan  

 All libraries in Conan Bincrafters: 
  + https://bintray.com/bincrafters/public-conan

  *Selected Conan Libraries* 

 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | Conan Recipe                    | Description                                                                                                       |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | *Fundamental*                     |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | [[https://bintray.com/conan-community/conan/boost%253Aconan][Boost]]                           | Boost Libraries                                                                                                   |
 | [[https://bintray.com/pocoproject/conan/Poco%253Apocoproject][Poco libraries]]                  | Poco framework libraries for network, compression, process and database.                                          |
 | [[https://bintray.com/conan-community/conan/abseil%253Aconan][Google's abseil]]                 | Google's abseil library - https://abseil.io/                                                                      |
 | [[https://bintray.com/bincrafters/public-conan/fmt%253Abincrafters/5.3.0%253Astable][fmt]]                             | Fast and type-safe and extensible printf library.                                                                 |
 | [[https://bintray.com/range-v3/range-v3/range-v3%253Aericniebler][ranges-v3]]                       | Ranges library derived from Boost that will be added to C++20 stdandard library.                                  |
 | [[https://bintray.com/cliutils/CLI11/CLI11%253Acliutils/1.8.0%253Astable][CLI11]]                           | Lightweight header-only command line parser.                                                                      |
 | [[https://bintray.com/conan-community/conan/cereal%253Aconan][Cereal]]                          | Header-only serialization library                                                                                 |
 |                                 |                                                                                                                   |
 | [[https://bintray.com/conan-community/conan/parallelstl%253Aconan][parallel stl]]                    | C++ standard library algorithms with support for execution policies                                               |
 | [[https://bintray.com/conan-community/conan/TBB%253Aconan][Intel TBB]]                       | Intel Threading Building Blocks (Intel TBB) for writing parallel C++ programs.                                    |
 |                                 |                                                                                                                   |
 | [[https://bintray.com/bincrafters/public-conan/pugixml%253Abincrafters/1.9%253Astable][PugiXML]]                         | XML Parser library                                                                                                |
 | [[https://bintray.com/conan-community/conan/IrrXML%253Aconan][IrrXML]]                          | Simple and fast open source xml parser for C++                                                                    |
 |                                 |                                                                                                                   |
 |                                 |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | *Unit Testing*                    |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | [[https://bintray.com/bincrafters/public-conan/gtest%253Abincrafters][Google Test]]                     | Google unit testing library, aka GTest                                                                            |
 | [[https://bintray.com/catchorg/Catch2/Catch2:catchorg/2.7.2:stable][Catch2]]                          | Single header unit test framework.                                                                                |
 | [[https://bintray.com/bincrafters/public-conan/doctest%253Abincrafters/2.3.1%253Astable][Doctest]]                         | Header-only unit testing library with fast compile-time.                                                          |
 |                                 |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | *Data Compression*                |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | [[https://bintray.com/conan-community/conan/zlib%253Aconan][Zlib]]                            | Zlib compression library                                                                                          |
 | [[https://bintray.com/conan-community/conan/bzip2%253Aconan][bzip2]]                           | bzip2 is a freely available, patent free (see below), high-quality data compressor.                               |
 |                                 |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | *Scientific / Math*               |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | [[https://bintray.com/conan-community/conan/lapack%253Aconan][Conan Lapack]]                    | Lapack linear algebra library                                                                                     |
 | [[https://bintray.com/conan-community/conan/openblas%253Aconan][Open BLAS]]                       | OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.                                        |
 | [[https://bintray.com/conan-community/conan/eigen%253Aconan][eigen]]                           | Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. |
 |                                 |                                                                                                                   |
 |                                 |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | *Computer Graphics*               |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | [[https://bintray.com/conan-community/conan/libpng%253Aconan][libpng]]                          | Portable Network Graphics An Open, Extensible Image Format with Lossless Compression                              |
 | [[https://bintray.com/bincrafters/public-conan/freetype%253Abincrafters][freetype]]                        | Render text onto bitmaps, and provides support for other font-related operations.                                 |
 | [[https://bintray.com/bincrafters/public-conan/imgui:bincrafters][imgui]]                           | Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies                              |
 | [[https://bintray.com/bincrafters/public-conan/glm%253Ag-truc][glm]]                             | A C++ mathematics library for graphics programming                                                                |
 | [[https://bintray.com/bincrafters/public-conan/sdl2%253Abincrafters/2.0.9%253Astable][sdl2]]                            | Simple Direct Media Layer                                                                                         |
 |                                 |                                                                                                                   |
 | [[https://bintray.com/bincrafters/public-conan/glfw%253Abincrafters][glfw]]                            | GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop.       |
 |                                 | It provides a simple API for creating windows, contexts and surfaces, receiving input and events.                 |
 |                                 |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | *Computer Vision and*             |                                                                                                                   |
 | *AI - Artificial Inteligence*     |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | [[https://bintray.com/conan-community/conan/opencv%253Aconan][OpenCV]]                          | Most well-known Library for computer vision and image processing.                                                 |
 | [[https://bintray.com/conan-community/conan/tiny-dnn%253Aconan][tiny-dnn]]                        | tiny-dnn is a C++14 implementation of deep learning on systems with limited computational resource.               |
 |                                 |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | *Encryption and TSL/SSL*          |                                                                                                                   |
 | [[https://bintray.com/conan-community/conan/OpenSSL:conan][OpenSSL]]                         | Most well-known library TLS/SSL - Transport Layer Security                                                        |
 | [[https://bintray.com/bincrafters/public-conan/cryptopp%253Abincrafters][cryptopp]]                        | Free C++ class library of cryptographic schemes.                                                                  |
 | [[https://bintray.com/bincrafters/public-conan/Botan%253Abincrafters][botan]]                           | Botan is a cryptography library written in C++11                                                                  |
 |                                 |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | *Miscellaneous*                   |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|
 | [[https://bintray.com/conan-community/conan/ncurses%253Aconan][ncurses]]                         | API to write text-based user interfaces, TUIs in a terminal.                                                      |
 | [[https://bintray.com/bincrafters/public-conan/libcurl%253Abincrafters][LibCurl]]                         | curl library that provides clients for many network protocols: http, https, ftp, sftp, ...                        |
 | [[https://bintray.com/conan-community/conan/pybind11%253Aconan][Pybind 11]]                       | Library for creating Python native modules / libraries in C++.                                                    |
 | [[https://bintray.com/conan-community/conan/pistache%253Aconan][pistache]]                        | C++ REST framework written by Mathieu Stefani at Datacratic. It is written in pure C++11.                         |
 | [[https://bintray.com/conan-community/conan/stb%253Aconan][stb - single-file public domain]] | stb single-file public domain libraries for C/C++                                                                 |
 | [[https://bintray.com/conan-community/conan/wiringpi%253Aconan][wiringpi]]                        | GPIO Interface library for the Raspberry Pi                                                                       |
 |                                 |                                                                                                                   |
 |---------------------------------+-------------------------------------------------------------------------------------------------------------------|

*** Command Summary 
**** Search Conan Packages 

 Search for Poco libraries in Conan Center repository: 

 #+BEGIN_SRC sh 
   $ conan search Poco* -r=conan-center
   Existing package recipes:

   Poco/1.7.8p3@pocoproject/stable
   Poco/1.7.9@pocoproject/stable
   Poco/1.7.9p1@pocoproject/stable
   Poco/1.7.9p2@pocoproject/stable
   Poco/1.8.0.1@pocoproject/stable
   Poco/1.8.0@pocoproject/stable
   Poco/1.8.1@pocoproject/stable
   Poco/1.9.0@pocoproject/stable
 #+END_SRC

 Search for Google Test in Conan Center repository: 

 #+BEGIN_SRC sh 
   $ conan search gtest/* -r=conan-center
   Existing package recipes:

   gtest/1.7.0@bincrafters/stable
   gtest/1.8.0@bincrafters/stable
   gtest/1.8.1@bincrafters/stable
 #+END_SRC

 Search for libcurl package on BinCrafters repository:

 #+BEGIN_SRC sh 
   λ conan search libcurl/* -r=bincrafters
   Existing package recipes:

   libcurl/7.50.3@bincrafters/stable
   libcurl/7.52.1@bincrafters/stable
   libcurl/7.56.1@bincrafters/stable
   libcurl/7.60.0@bincrafters/stable
   libcurl/7.61.1@bincrafters/stable
 #+END_SRC

 Search for pybind11 on all conan repositories:

 #+BEGIN_SRC sh 
   $ conan search pybind* -r=all
   Existing package recipes:

   Remote 'conan-center':
   pybind11/2.2.2@conan/stable
   pybind11/2.2.3@conan/stable
   pybind11/2.2.4@conan/stable
   Remote 'conan-transit':
   pybind11/0.1.0@jason2506/testing
   pybind11/1.4@memsharded/stable
   pybind11/any@memsharded/stable

 #+END_SRC

**** List libraries in local cache / local repository

 This command lists packages in local cache or local repository.

 #+BEGIN_SRC sh 
    $ conan search
    Existing package recipes:

    OpenSSL/1.0.2o@conan/stable
    Poco/1.9.0@pocoproject/stable
    gtest/1.8.1@bincrafters/stable
    zlib/1.2.11@conan/stable
 #+END_SRC

 List Conan storage directory ~/.conan on Unix-like (Linux, BSD, OSX ...)

 #+BEGIN_SRC sh 
   $ tree -L 2  ~/.conan/
   /home/archbox/.conan/
   ├── artifacts.properties
   ├── cacert.pem
   ├── conan.conf
   ├── conan.conf.back
   ├── data
   │   ├── gtest
   │   ├── OpenSSL
   │   ├── Poco
   │   └── zlib
   ├── hooks
   │   └── attribute_checker.py
   ├── profiles
   │   └── default
   ├── registry.json
   ├── registry.json.lock
   ├── settings.yml
   └── version.txt

   7 directories, 10 files

 #+END_SRC

 List directory ~/.conan/data 

 #+BEGIN_SRC sh 
   $ tree -L 3  ~/.conan/data
   /home/archbox/.conan/data
   ├── gtest
   │   └── 1.8.1
   │       └── bincrafters
   ├── OpenSSL
   │   └── 1.0.2o
   │       └── conan
   ├── Poco
   │   └── 1.9.0
   │       └── pocoproject
   └── zlib
       └── 1.2.11
           └── conan

   12 directories, 0 files
 #+END_SRC

**** List Remote Repositories: 

 #+BEGIN_SRC sh 
   $ conan remote list

   conan-center: https://conan.bintray.com [Verify SSL: True]
   conan-transit: https://conan-transit.bintray.com [Verify SSL: True]
 #+END_SRC

**** Add more remote repositories 


 Add Repositories: 

  + Add Conan Center (Repository installed by default)

 #+BEGIN_SRC sh 
   $ conan remote add conan-center https://conan.bintray.com
 #+END_SRC

  + Add Conan Community:

 #+BEGIN_SRC sh 
   $ conan remote add conan-community https://api.bintray.com/conan/conan-community/conan
 #+END_SRC

  + Add bincrafters

 #+BEGIN_SRC sh 
   $ conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
 #+END_SRC

**** Install library in local cache 

 Example install package libcurl version 7.61.1 from repository BinCrafters:

  + Installation on Windows 64 bits for 64 bits target. The build type
    is Release, however the installation lacks the debug building.
  + Linux, OS or Nix users don't need to be concerned about
    Debug/Release build type.

 #+BEGIN_SRC sh 
   λ conan install libcurl/7.61.1@bincrafters/stable

   Configuration:
   [settings]
   arch=x86_64
   arch_build=x86_64
   build_type=Release
   compiler=Visual Studio
   compiler.runtime=MD
   compiler.version=15
   os=Windows
   os_build=Windows
   [options]
   [build_requires]
   [env]

   libcurl/7.61.1@bincrafters/stable: Not found in local cache, looking in remotes...
   libcurl/7.61.1@bincrafters/stable: Trying with 'conan-center'...
   Downloading conanmanifest.txt
   [==================================================] 234B/234B
   Downloading conanfile.py
   [==================================================] 19.4KB/19.4KB
   Downloading conan_export.tgz
   [==================================================] 764B/764B
   Decompressing conan_export.tgz: 100%|██████████| 764/764 [00:00<00:00, 46.3kB/s]
   OpenSSL/1.0.2n@conan/stable: Not found in local cache, looking in remotes...
   OpenSSL/1.0.2n@conan/stable: Trying with 'conan-center'...
   Downloading conanmanifest.txt
   [==================================================] 58B/58B
   Downloading conanfile.py
   [==================================================] 20.1KB/20.1KB
   libcurl/7.61.1@bincrafters/stable: Installing package
   Requirements
       OpenSSL/1.0.2n@conan/stable from 'conan-center' - Downloaded
       libcurl/7.61.1@bincrafters/stable from 'conan-center' - Downloaded
       zlib/1.2.11@conan/stable from 'conan-center' - Cache
   Packages
       OpenSSL/1.0.2n@conan/stable:606fdb601e335c2001bdf31d478826b644747077 - Download
       libcurl/7.61.1@bincrafters/stable:ae6191bc1194317ff7cdbc84d4d302ab49975618 - Download
       zlib/1.2.11@conan/stable:6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7 - Cache

   zlib/1.2.11@conan/stable: Already installed!
   OpenSSL/1.0.2n@conan/stable: Retrieving package 606fdb601e335c2001bdf31d478826b644747077 from remote 'conan-center'
   Downloading conanmanifest.txt
   [==================================================] 4.6KB/4.6KB
   Downloading conaninfo.txt
   [==================================================] 1.2KB/1.2KB
   Downloading conan_package.tgz
   [==================================================] 5.6MB/5.6MB
   Decompressing conan_package.tgz: 100%|██████████| 5.32M/5.32M [00:00<00:00, 24.0MB/s]
   OpenSSL/1.0.2n@conan/stable: Package installed 606fdb601e335c2001bdf31d478826b644747077
   libcurl/7.61.1@bincrafters/stable: Retrieving package ae6191bc1194317ff7cdbc84d4d302ab49975618 from remote 'conan-center'
   Downloading conanmanifest.txt
   [==================================================] 1.0KB/1.0KB
   Downloading conaninfo.txt
   [==================================================] 1.8KB/1.8KB
   Downloading conan_package.tgz
   [==================================================] 704.7KB/704.7KB
   Decompressing conan_package.tgz: 100%|██████████| 688k/688k [00:00<00:00, 14.9MB/s]
   libcurl/7.61.1@bincrafters/stable: Package installed ae6191bc1194317ff7cdbc84d4d302ab49975618
 #+END_SRC

 Install debug build of libcurl package:

 #+BEGIN_SRC sh 
   λ conan install libcurl/7.61.1@bincrafters/stable -s build_type=Debug
   Configuration:
   [settings]
   arch=x86_64
   arch_build=x86_64
   build_type=Debug
   compiler=Visual Studio
   compiler.runtime=MDd
   compiler.version=15
   os=Windows
   os_build=Windows
   [options]
   [build_requires]
   [env]

    ...  ...  ...  ...  ... 

   Decompressing conan_package.tgz: 100%|██████████| 967k/967k [00:00<00:00, 15.0MB/s]
   libcurl/7.61.1@bincrafters/stable: Package installed 8f5289d9807917ac37fa3752916c824d2a8061ad
 #+END_SRC

 Install debug and release build of a library compiling it from source:

 #+BEGIN_SRC sh 
   λ conan install libcurl/7.61.1@bincrafters/stable -s build_type=None 
 #+END_SRC

 Install  release builds of libcurl for x86 target (32 bits):

 #+BEGIN_SRC sh 
   λ conan install libcurl/7.61.1@bincrafters/stable -s build_type=Release -s arch=x86
   Configuration:
   [settings]
   arch=x86
   arch_build=x86_64
   build_type=Release
   compiler=Visual Studio
   compiler.runtime=MD
   compiler.version=15
   os=Windows
   os_build=Windows
   [options]
   [build_requires]
   [env]
 #+END_SRC

 List installed library in local cache:

 #+BEGIN_SRC sh 
   λ conan search
   Existing package recipes:

   OpenSSL/1.0.2n@conan/stable
   OpenSSL/1.0.2o@conan/stable
   Poco/1.9.0@pocoproject/stable
   gtest/1.8.1@bincrafters/stable
   libcurl/7.61.1@bincrafters/stable
   zlib/1.2.11@conan/stable
 #+END_SRC

**** Show pacakge information

 #+BEGIN_SRC sh 
    λ conan info libcurl/7.61.1@bincrafters/stable

    OpenSSL/1.0.2n@conan/stable
        ID: 606fdb601e335c2001bdf31d478826b644747077
        BuildID: None
        Remote: conan-center=https://conan.bintray.com
        URL: http://github.com/lasote/conan-openssl
        License: The current OpenSSL licence is an 'Apache style' license: https://www.openssl.org/source/license.html
        Recipe: Cache
        Binary: Cache
        Binary remote: conan-center
        Creation date: 2018-05-10 07:47:33
        Required by:
            libcurl/7.61.1@bincrafters/stable
        Requires:
            zlib/1.2.11@conan/stable
    libcurl/7.61.1@bincrafters/stable
        ID: ae6191bc1194317ff7cdbc84d4d302ab49975618
        BuildID: None
        Remote: conan-center=https://conan.bintray.com
        URL: http://github.com/bincrafters/conan-libcurl
        Homepage: http://curl.haxx.se
        License: MIT
        Author: Bincrafters <bincrafters@gmail.com>
        Recipe: Cache
        Binary: Cache
        Binary remote: conan-center
        Creation date: 2018-11-16 03:42:43
        Required by:
            PROJECT
        Requires:
            OpenSSL/1.0.2n@conan/stable
            zlib/1.2.11@conan/stable
    zlib/1.2.11@conan/stable
        ID: 6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
        BuildID: None
        Remote: conan-center=https://conan.bintray.com
        URL: http://github.com/conan-community/conan-zlib
        Homepage: https://zlib.net
        License: Zlib
        Author: Conan Community
        Recipe: Cache
        Binary: Cache
        Binary remote: conan-center
        Creation date: 2018-12-21 02:01:48
        Required by:
            OpenSSL/1.0.2n@conan/stable
            libcurl/7.61.1@bincrafters/stable
 #+END_SRC

*** Example CMake/Conan project  
***** Project Files

 Gist: https://gist.github.com/caiorss/5067e2981488aff1b5765b02adbfdffc 

 File: *conanfile.txt* 
  + Conan project file.
  + Poco:shared=False => Static link the library.

 #+BEGIN_SRC conf 
   [requires]
   Poco/1.9.0@pocoproject/stable
   gtest/1.8.1@bincrafters/stable

   [generators]
   cmake

   [options]
   Poco:shared=False
 #+END_SRC

 File: *CMakeLists.txt*

 #+BEGIN_SRC cmake 
    cmake_minimum_required(VERSION 3.9)

    #========== Global Configurations =============#
    #----------------------------------------------#
    project(ConanTesting CXX)
    set(CMAKE_CXX_STANDARD 17)     
    set(CMAKE_VERBOSE_MAKEFILE ON)

    # ===>> Conan bootstrap  ===============

    # Automatically install conan packages if they are not installed.
    # Assumptions:
    #  + The file conanfile.txt is in this directory
    #  + This CMakeLists.txt file is in the project ROOT directory.
    #  + The conan application is the project $PATH environment variable
    #    and accessible from command line.
    #-------------------------------------------------
    if(NOT EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
      execute_process(
        COMMAND           conan install . --install-folder "${CMAKE_BINARY_DIR}"
        WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
     )
    endif()

    include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
    conan_basic_setup()

    #========== Targets Configurations ============#

    message(" [INFO] =>> CONAN_LIBS = ${CONAN_LIBS} " )

    # ==> Target for testing POCO Libraries 
    add_executable(poco demo-poco.cpp)
    target_link_libraries(poco PRIVATE ${CONAN_LIBS})

    # ==> Target for testing GogleTest 
    add_executable(agtest demo-gtest.cpp)
    target_link_libraries(agtest PRIVATE ${CONAN_LIBS})

    # Add target to run executable 
    add_custom_target(run-poco
      COMMAND poco 
      DEPENDS poco 
      WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
      )

    add_custom_target(run-gtest
      COMMAND agtest 
      DEPENDS agtest 
      WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
      )

    install(TARGETS poco agtest  DESTINATION ./bin)
 #+END_SRC

 File: *demo-gtest.cpp*

 #+BEGIN_SRC cpp 
   #include <iostream>
   #include <Poco/Process.h>
   #include <gtest/gtest.h>

   auto FunctionObject = [](int n){ return 5 * n + 4; };

   TEST(testA, FunctionObject)
   {
       EXPECT_EQ(19, FunctionObject(3));
   }

   TEST(testC, FunctionObject)
   {
       EXPECT_EQ(123, FunctionObject(5));
   }

   TEST(testB, FunctionObject)
   {
       EXPECT_EQ(24, FunctionObject(4));
   }
 #+END_SRC

 File: *demo-poco.cpp*

 #+BEGIN_SRC cpp
    #include <iostream>
    #include <Poco/Process.h>

    int main()
    {
        std::cout << "Running POCO Libraries Launch." << std::endl;
        std::cout << "Poco Libraries are AWESOME!" << std::endl;

        #if !defined(_WIN32)
          std::cerr << " [INFO] I am running on some Unix-like Operating System." << std::endl;
          Poco::Process::launch("cat", {"/etc/protocols"});
       #else
          std::cerr << " [INFO] I am running on Windows." << std::endl;
          Poco::Process::launch("notepad.exe", {});
       #endif
       return 0;
    }
 #+END_SRC
***** Building on Windows 

 Install Conan packages in the current project at directory ./build/ -
 the packages are download from the default remote repository and
 stored at the Conan cache. Once they were downloaded, further usages
 of those packages will use them from the cache.

 #+BEGIN_SRC sh 
   $  conan install . --install-folder build 

   Configuration:
   [settings]
   arch=x86_64
   arch_build=x86_64
   build_type=Release
   compiler=Visual Studio
   compiler.runtime=MD
   compiler.version=15
   os=Windows
   os_build=Windows
   [options]
   [build_requires]
   [env]

   gtest/1.8.1@bincrafters/stable: WARN: Package is corrupted, removing folder: C:\Users\archbox\.conan\data\gtest\1.8.1\bincrafters\stable\package\3f7b6d42d6c995a23d193db1f844ed23ae943226
   PROJECT: Installing C:\Users\archbox\conan-test\conanfile.txt
   Requirements
       OpenSSL/1.0.2o@conan/stable from 'conan-center' - Cache
       Poco/1.9.0@pocoproject/stable from 'conan-center' - Cache
       gtest/1.8.1@bincrafters/stable from 'conan-center' - Cache
       zlib/1.2.11@conan/stable from 'conan-center' - Cache
   Packages
       OpenSSL/1.0.2o@conan/stable:606fdb601e335c2001bdf31d478826b644747077 - Download
       Poco/1.9.0@pocoproject/stable:09378ed7f51185386e9f04b212b79fe2d12d005c - Download
       gtest/1.8.1@bincrafters/stable:3f7b6d42d6c995a23d193db1f844ed23ae943226 - Download
       zlib/1.2.11@conan/stable:6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7 - Download

    ... ....    ... ....    ... ....    ... ....    ... ....    ... ....    ... .... 

   Poco/1.9.0@pocoproject/stable: Package installed 09378ed7f51185386e9f04b212b79fe2d12d005c
   PROJECT: Generator cmake created conanbuildinfo.cmake
   PROJECT: Generator txt created conanbuildinfo.txt
   PROJECT: Generated conaninfo.txt
   PROJECT: Generated graphinfo
 #+END_SRC

 List ./build directory: 

 #+BEGIN_SRC sh 
   λ ls build\
   conanbuildinfo.cmake  conanbuildinfo.txt  conaninfo.txt  graph_info.json
 #+END_SRC

 Check project packages:

 #+BEGIN_SRC sh 
    $ conan info .

    PROJECT
        ID: 78e985959974aade35877b722f1e41355f5575f4
        BuildID: None
        Requires:
            Poco/1.9.0@pocoproject/stable
    OpenSSL/1.0.2o@conan/stable
        ID: 35ea421ef4c1d32898da44c28e3cc900bc6459dc
        BuildID: None
        Remote: conan-center=https://conan.bintray.com
        URL: http://github.com/lasote/conan-openssl
        License: The current OpenSSL licence is an 'Apache style' license: https://www.openssl.org/source/license.html
        Recipe: Cache
        Binary: Cache
        Binary remote: conan-center
        Creation date: 2018-08-27 04:12:47
        Required by:
            Poco/1.9.0@pocoproject/stable
        Requires:
            zlib/1.2.11@conan/stable
    Poco/1.9.0@pocoproject/stable
        ID: 67516f54281f3227d74b2b66f92537d98ff1103d
        BuildID: None
        Remote: conan-center=https://conan.bintray.com
        URL: http://github.com/pocoproject/conan-poco
        License: The Boost Software License 1.0
        Recipe: Cache
        Binary: Cache
        Binary remote: conan-center
        Creation date: 2018-08-30 08:28:08
        Required by:
            PROJECT
        Requires:
            OpenSSL/1.0.2o@conan/stable
    zlib/1.2.11@conan/stable
        ID: 1d877a3df840030e6a8abb74c5ffb9088d08b47a
        BuildID: None
        Remote: conan-center=https://conan.bintray.com
        URL: http://github.com/conan-community/conan-zlib
        Homepage: https://zlib.net
        License: Zlib
        Author: Conan Community
        Recipe: Cache
        Binary: Cache
        Binary remote: conan-center
        Creation date: 2018-12-21 07:01:48
        Required by:
            OpenSSL/1.0.2o@conan/stable
 #+END_SRC

 Configure CMake on Windows for 64 bits target:

 #+BEGIN_SRC sh
   λ cmake -H. -Bbuild -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=.
 #+END_SRC

 Compile with release build and install at ./bin:

 #+BEGIN_SRC sh 
   λ cmake --build build --target install --config Release

     ...  ...  ...  ...  ...  ...  ...  ...  ... 
   PostBuildEvent:
     setlocal
     "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
     if %errorlevel% neq 0 goto :cmEnd
     :cmEnd
     endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
     :cmErrorLevel
     exit /b %1
     :cmDone
     if %errorlevel% neq 0 goto :VCEnd
     :VCEnd
     -- Install configuration: "Release"
     -- Installing: C:/Users/archbox/conan-test/./bin/poco.exe
     -- Installing: C:/Users/archbox/conan-test/./bin/agtest.exe
   FinalizeBuildStatus:
     Deleting file "x64\Release\INSTALL\INSTALL.tlog\unsuccessfulbuild".
     Touching "x64\Release\INSTALL\INSTALL.tlog\INSTALL.lastbuildstate".
   Done Building Project "C:\Users\archbox\conan-test\build\install.vcxproj" (default targets).


   Build succeeded.
       0 Warning(s)
       0 Error(s)

   Time Elapsed 00:00:11.72
 #+END_SRC

 List directory ./bin 

 #+BEGIN_SRC sh 
   λ where ls
   C:\Program Files\Git\usr\bin\ls.exe

   λ ls bin
   agtest.exe*  poco.exe*
 #+END_SRC

 Run application bin/agtest.exe:

 #+BEGIN_SRC sh 
    λ bin\agtest.exe
    Running main() from gmock_main.cc
    [==========] Running 3 tests from 3 test cases.
    [----------] Global test environment set-up.
    [----------] 1 test from testA
    [ RUN      ] testA.FunctionObject
    [       OK ] testA.FunctionObject (0 ms)
    [----------] 1 test from testA (0 ms total)

    [----------] 1 test from testC
    [ RUN      ] testC.FunctionObject
    C:\Users\archbox\conan-test\demo-gtest.cpp(14): error: Expected equality of these values:
      123
      FunctionObject(5)
        Which is: 29
    [  FAILED  ] testC.FunctionObject (0 ms)
    [----------] 1 test from testC (0 ms total)

    [----------] 1 test from testB
    [ RUN      ] testB.FunctionObject
    [       OK ] testB.FunctionObject (0 ms)
    [----------] 1 test from testB (0 ms total)

    [----------] Global test environment tear-down
    [==========] 3 tests from 3 test cases ran. (4 ms total)
    [  PASSED  ] 2 tests.
    [  FAILED  ] 1 test, listed below:
    [  FAILED  ] testC.FunctionObject

     1 FAILED TEST

 #+END_SRC

 Note: Due to the following code in CMakeLists.txt, it is not needed to
 run the command conan-install before cmake to install the packages as
 this block will automatically run the conan-install command if the
 packages are not installed in the project ./build directory. It allows
 to configure CMake in a single step with $ cmake -Bbuild ... or open the
 project in an IDE which supports CMake without running conan directly.

  + Summary: with this piece of code, it is not necessary to run conan,
    Cmake will run it automatically as a subprocess.

 #+BEGIN_SRC cmake
    if(NOT EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
      execute_process(
        COMMAND           conan install . --install-folder "${CMAKE_BINARY_DIR}"
        WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
     )
    endif()
 #+END_SRC
***** Building on Linux 

 Clone gist:

 #+BEGIN_SRC sh
   $ git clone https://gist.github.com/caiorss/5067e2981488aff1b5765b02adbfdffc conan-test2
   Cloning into 'conan-test2'...
   remote: Enumerating objects: 8, done.
   remote: Counting objects: 100% (8/8), done.
   remote: Compressing objects: 100% (7/7), done.
   remote: Total 8 (delta 1), reused 3 (delta 1), pack-reused 0
   Unpacking objects: 100% (8/8), done.

 #+END_SRC

 List directory:

 #+BEGIN_SRC sh
   $ ls
   CMakeLists.txt  conanfile.txt  demo-gtest.cpp  demo-poco.cpp
 #+END_SRC

 CMake configuration step:
  + Note: The CMakeLists.txt file is set to automatically run Conan in the
    build directory. 
  + Note: The packages weren't download because they are already
    cached.

 #+BEGIN_SRC sh
   $ cmake -H. -Bbuild -G Ninja -DCMAKE_INSTALL_PREFIX=.
   -- Current conanbuildinfo.cmake directory: /home/archbox/root-scripts/conan-test2/build
   -- Conan: Compiler GCC>=5, checking major version 8
   -- Conan: Checking correct version: 8
   -- Conan: Using cmake global configuration
   -- Conan: Adjusting default RPATHs Conan policies
   -- Conan: Adjusting language standard
    [INFO] =>> CONAN_LIBS = PocoMongoDB;PocoNet;PocoNetSSL;PocoCrypto;PocoData;PocoDataSQLite;PocoZip;PocoUtil;PocoXML;PocoJSON;PocoFoundation;rt;gmock_main;gmock;gtest;pthread;ssl;crypto;dl;z 
   -- Configuring done
   -- Generating done
   -- Build files have been written to: /home/archbox/root-scripts/conan-test2/build


   $ ls build/
   bin/         CMakeCache.txt        conanbuildinfo.txt  rules.ninja
   CMakeFiles/  cmake_install.cmake   conaninfo.txt
   build.ninja  conanbuildinfo.cmake  graph_info.json
 #+END_SRC

 Run all targets: (build all executables and libraries)

 #+BEGIN_SRC sh 
   $ cmake --build build --target
   [4/4] Linking CXX executable bin/agtest
 #+END_SRC

 Install: 

 #+BEGIN_SRC sh 
   $ cmake --build build --target install
   [0/1] Install the project...
   -- Install configuration: ""
   -- Installing: /home/archbox/root-scripts/conan-test2/./bin/poco
   -- Set runtime path of "/home/archbox/root-scripts/conan-test2/./bin/poco" to ""
   -- Installing: /home/archbox/root-scripts/conan-test2/./bin/agtest
   -- Set runtime path of "/home/archbox/root-scripts/conan-test2/./bin/agtest" to ""

   $ ls bin/
   agtest*  poco*
 #+END_SRC

 Run the executable bin/agtest.

 #+BEGIN_SRC sh 
   $ bin/agtest --gtest_list_tests
   Running main() from gmock_main.cc
   testA.
     FunctionObject
   testC.
     FunctionObject
   testB.
     FunctionObject


   $ bin/agtest 
   Running main() from gmock_main.cc
   [==========] Running 3 tests from 3 test cases.
   [----------] Global test environment set-up.
   [----------] 1 test from testA
   [ RUN      ] testA.FunctionObject
   [       OK ] testA.FunctionObject (0 ms)
   [----------] 1 test from testA (0 ms total)

   ... ... .... 

    1 FAILED TEST
 #+END_SRC

 Run the executable bin/poco

 #+BEGIN_SRC 
    $ # /etc/protocols:
    # $Id: protocols,v 1.12 2016/07/08 12:27 ovasik Exp $
    #
    # Internet (IP) protocols
    #
    #	from: @(#)protocols	5.1 (Berkeley) 4/17/89
    #
    # Updated for NetBSD based on RFC 1340, Assigned Numbers (July 1992).
    # Last IANA update included dated 2011-05-03
    #
    # See also http://www.iana.org/assignments/protocol-numbers

    ip	0	IP		# internet protocol, pseudo protocol number
    hopopt	0	HOPOPT		# hop-by-hop options for ipv6

    ... .... ... ... .... ... ... .... ... ... .... ... ... .... ... 
 #+END_SRC
*** Example CMake/Conan project with conan-cmake module 
***** Project Files 

 This sample project uses the CMake wrapper [[https://github.com/conan-io/cmake-conan][cmake-conan]] for integrating
 Conan and CMake without the file conanfile.txt or running conan from
 command line before using CMake. 

 CMake Module cmake-conan: 
  + https://github.com/conan-io/cmake-conan

 Project Gist: 
  + https://gist.github.com/caiorss/7b0732f5de5ebc40981521e63a122d8e

 Packages used in this sample project: (Conan reference)
  + [[https://bintray.com/bincrafters/public-conan/gtest%253Abincrafters/1.8.1%253Astable][gtest/1.8.1@bincrafters/stable]]
  + [[https://bintray.com/pocoproject/conan/Poco%253Apocoproject/1.9.0%253Astable][Poco/1.9.0@pocoproject/stable]]


 This project can be downloaded with: 

 #+BEGIN_SRC sh 
   # Clone repository 
   $ git clone https://gist.github.com/caiorss/7b0732f5de5ebc40981521e63a122d8e gist 
   $ cd gist 
 
   # Open in QTCreator IDE 
   $ qtcrator CMakeLists.txt 
 #+END_SRC

  *File: CMakeLists.txt* 

 #+BEGIN_SRC cmake 
   cmake_minimum_required(VERSION 3.9)

   #========== Global Configurations =============#
   #----------------------------------------------#
   project(ConanTesting CXX)
   set(CMAKE_CXX_STANDARD 17)     
   set(CMAKE_VERBOSE_MAKEFILE ON)

   # ============= Conan Bootstrap =============================#

   # Download automatically, you can also just copy the conan.cmake file
   if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
      message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
      file(DOWNLOAD "https://github.com/conan-io/cmake-conan/raw/v0.13/conan.cmake"
                    "${CMAKE_BINARY_DIR}/conan.cmake")
   endif()

   include(${CMAKE_BINARY_DIR}/conan.cmake)

   conan_cmake_run(REQUIRES

                   # Libraries to be installed locally
                   Poco/1.9.0@pocoproject/stable
                   gtest/1.8.1@bincrafters/stable

                   BASIC_SETUP
                   BUILD missing
                   )

   #========== Find Packages =====================#

   find_package(GTest REQUIRED)

   # find_package(Poco  REQUIRED Foundation)

   #========== Targets Configurations ============#


   # ==> Target for testing POCO Libraries 
   add_executable(poco demo-poco.cpp)
   target_link_libraries(poco PRIVATE ${CONAN_LIBS})

   # ==> Target for testing GogleTest 
   add_executable(agtest demo-gtest.cpp)
   target_link_libraries(agtest PRIVATE GTest::GTest GTest::Main)
   add_test(MyGoogleTest agtest)

   install(TARGETS poco agtest  DESTINATION ./bin)
 #+END_SRC

  *File: demog-gtest.cpp* 

 #+BEGIN_SRC cpp 
   #include <iostream>
   #include <Poco/Process.h>
   #include <gtest/gtest.h>

   auto FunctionObject = [](int n){ return 5 * n + 4; };

   TEST(testA, FunctionObject)
   {
           EXPECT_EQ(19, FunctionObject(3));
   }

   TEST(testC, FunctionObject)
   {
           EXPECT_EQ(123, FunctionObject(5));
   }

   TEST(testB, FunctionObject)
   {
           EXPECT_EQ(24, FunctionObject(4));
   }
 #+END_SRC

  *File: poco-test.cpp* 

 #+BEGIN_SRC cpp 
   #include <iostream>
   #include <Poco/Process.h>

   int main()
   {
       std::cout << "Running POCO Libraries Launch." << std::endl;
       std::cout << "Poco Libraries are AWESOME!" << std::endl;

       #if !defined(_WIN32)
         std::cerr << " [INFO] I am running on some Unix-like Operating System." << std::endl;
         Poco::Process::launch("cat", {"/etc/protocols"});
      #else
         std::cerr << " [INFO] I am running on Windows." << std::endl;
         Poco::Process::launch("notepad.exe", {});
       #endif

      return 0;
   }
 #+END_SRC

***** Building on Linux/Unix 

 Clone repository: 

 #+BEGIN_SRC sh 
   $ git clone https://gist.github.com/caiorss/7b0732f5de5ebc40981521e63a122d8e gist 
   Cloning into 'gist'...
   remote: Enumerating objects: 8, done.
   remote: Counting objects: 100% (8/8), done.
   remote: Compressing objects: 100% (8/8), done.
   remote: Total 8 (delta 1), reused 0 (delta 0), pack-reused 0
   Unpacking objects: 100% (8/8), done.
 #+END_SRC

 Show project files: 

 #+BEGIN_SRC sh 
   $ ls gist/
   CMakeLists.txt  demo-gtest.cpp  demo-poco.cpp
 #+END_SRC

 CMake - configuration => Generate project files. 

  + $ cmake -Hgist -Bcache -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=.
    * -Hgist
      * => Set source code location to directory ./gist
    * -Bcache
      * => Set binary output directory to ./cache
    * -GNinja
      + => Use Ninja build instead of Makefile
    * -DCMAKE_BUILD_TYPE=Debug
      + => Enable debug build which generates debugging symbols and disable optimization.
    * -DCMAKE_INSTALL_PREFIX=.
      + => Set install directory to current directory (PWD)

 #+BEGIN_SRC sh 
   $ cmake -Hgist -Bcache -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=. 

   -- The CXX compiler identification is GNU 8.3.1
   -- Check for working CXX compiler: /usr/lib64/ccache/c++
   -- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
   -- Detecting CXX compiler ABI info
   -- Detecting CXX compiler ABI info - done
   -- Detecting CXX compile features
   -- Detecting CXX compile features - done
   -- Downloading conan.cmake from https://github.com/conan-io/cmake-conan
   -- Conan: Automatic detection of conan settings from cmake
   -- Conan: Settings= -s;build_type=Debug;-s;compiler=gcc;-s;compiler.version=8;-s;compiler.libcxx=libstdc++11
   -- Conan executing: conan install . -s build_type=Debug -s compiler=gcc -s compiler.version=8 -s compiler.libcxx=libstdc++11 -g=cmake --build=missing
   -- Configuration:
   [settings]
   arch=x86_64
   arch_build=x86_64
   build_type=Debug
   compiler=gcc
   compiler.libcxx=libstdc++11
   compiler.version=8
   os=Linux
   os_build=Linux
   [options]
   [build_requires]
   [env]

   conanfile.txt: Installing package
   Requirements
       OpenSSL/1.0.2o@conan/stable from 'conan-center' - Cache
       Poco/1.9.0@pocoproject/stable from 'conan-center' - Cache
       gtest/1.8.1@bincrafters/stable from 'conan-center' - Cache
       zlib/1.2.11@conan/stable from 'conan-center' - Cache
   Packages
       OpenSSL/1.0.2o@conan/stable:9c111a8074926a7147291383e3d366f41bac77b3 - Cache
       Poco/1.9.0@pocoproject/stable:5d73f6d80f86b797938bd4121e0ee66b325e7063 - Cache
       gtest/1.8.1@bincrafters/stable:884a98ecd973519f5d71b74c29f9e7ddcbd902d4 - Cache
       zlib/1.2.11@conan/stable:761432f3453a17c960259b5b2605153e3bcffd7d - Cache

   gtest/1.8.1@bincrafters/stable: Already installed!
   zlib/1.2.11@conan/stable: Already installed!
   OpenSSL/1.0.2o@conan/stable: Already installed!
   Poco/1.9.0@pocoproject/stable: Already installed!
   conanfile.txt: Generator cmake created conanbuildinfo.cmake
   conanfile.txt: Generator txt created conanbuildinfo.txt
   conanfile.txt: Generated conaninfo.txt
   conanfile.txt: Generated graphinfo

   -- Conan: Loading conanbuildinfo.cmake
   -- Conan: Adjusting output directories
   -- Conan: Using cmake global configuration
   -- Conan: Adjusting default RPATHs Conan policies
   -- Conan: Adjusting language standard
   -- Current conanbuildinfo.cmake directory: /home/archbox/projects/cache
   -- Conan: Compiler GCC>=5, checking major version 8
   -- Conan: Checking correct version: 8
   -- Found GTest: /home/archbox/.conan/data/gtest/1.8.1/bincrafters/stable/package/884a98ecd973519f5d71b74c29f9e7ddcbd902d4/lib/libgtestd.a  
   -- Looking for C++ include pthread.h
   -- Looking for C++ include pthread.h - found
   -- Looking for pthread_create
   -- Looking for pthread_create - not found
   -- Looking for pthread_create in pthreads
   -- Looking for pthread_create in pthreads - not found
   -- Looking for pthread_create in pthread
   -- Looking for pthread_create in pthread - found
   -- Found Threads: TRUE  
   -- Configuring done
   -- Generating done
   -- Build files have been written to: /home/archbox/projects/cache

 #+END_SRC

 Show cache directory: 

 #+BEGIN_SRC sh 
   $ tree -L 2 cache
   cache
   ├── bin
   │   ├── agtest
   │   └── poco
   ├── build.ninja
   ├── CMakeCache.txt
   ├── CMakeFiles
   │   ├── 3.14.3
   │   ├── agtest.dir
   │   ├── CheckLibraryExists
   │   ├── cmake.check_cache
   │   ├── CMakeError.log
   │   ├── CMakeOutput.log
   │   ├── CMakeTmp
   │   ├── feature_tests.bin
   │   ├── feature_tests.cxx
   │   ├── poco.dir
   │   └── TargetDirectories.txt
   ├── cmake_install.cmake
   ├── conanbuildinfo.cmake
   ├── conanbuildinfo.txt
   ├── conan.cmake
   ├── conanfile.txt
   ├── conaninfo.txt
   ├── graph_info.json
   └── rules.ninja

   7 directories, 18 files
 #+END_SRC

 Build all targets: 

 #+BEGIN_SRC sh 
   $ cmake --build cache --target 
   [4/4] Linking CXX executable bin/agtest
 #+END_SRC

 Run executable agtest (GoogleTest)

 #+BEGIN_SRC sh 
  $ cache/bin/agtest  
 #+END_SRC

 Run executable poco

 #+BEGIN_SRC sh 
   $ cache/bin/poco 
 #+END_SRC

 Install: 

 #+BEGIN_SRC sh 
   $ cmake --build cache --target install
   [0/1] Install the project...
   -- Install configuration: "Debug"
   -- Installing: /home/archbox/projects/./bin/poco
   -- Set runtime path of "/home/archbox/projects/./bin/poco" to ""
   -- Installing: /home/archbox/projects/./bin/agtest
   -- Set runtime path of "/home/archbox/projects/./bin/agtest" to ""

  $ ls bin/
  agtest*  poco*

  # Run app ./agtest 
  $ bin/agtest 
  
  # Run app poco 
  $ bin/poco 
 #+END_SRC
*** Make conan-cmake module globally available 

 The [[https://github.com/conan-io/cmake-conan][cmake-conan]] cmake module can be installed globally in the system
 by moving the file conan.cmake to the default location where CMake
 built-in modules are stored. 

 Those locations are:

  + For Linux
    * //usr/share/cmake/Modules/

  + For Mac OSX
    + Similar path schema to Linux 

  + For Windows NT
    * C:\\Program Files (x86)\CMake\Modules

 Installation on Linux:

 #+BEGIN_SRC sh 
   $ mkdir -p /usr/share/cmake/Modules/custom && cd /usr/share/cmake/Modules/custom
   $ curl -O https://github.com/conan-io/cmake-conan/raw/v0.13/conan.cmake
 #+END_SRC

 Project Usage: 

 #+CAPTION: File - CMakeLists.txt 
 #+BEGIN_SRC cmake 
   cmake_minimum_required(VERSION 2.8)
   project(test-package)

   # ============= Conan Boosttrap =========================#
   include(custom/conan)

   set(CONAN_PROFILE default)
   conan_cmake_run(REQUIRES
                      Poco/1.9.0@pocoproject/stable
                      gtest/1.8.1@bincrafters/stable
                   BASIC_SETUP
                   BUILD missing)

   # ============= Find Package ===========================#
   add_executable(test-package "main.cpp")
   target_link_libraries(test-package hello)
 #+END_SRC


** Vcpkg package manager 
*** Documentation 

  + VCPKG Faq: [[https://github.com/Microsoft/vcpkg/blob/master/docs/about/faq.md][Frequently Asked Questions]]

*** Windows Vcpkg Intallation 

 Assumption: Visual studio development tools are already installed.

 1 Download and install VCPKG 
  + Note: Assumes that vcpkg will be installed at ~C:\vcpkg~

 #+BEGIN_SRC sh 
   $ cd C:\
   $ git clone https://github.com/Microsoft/vcpkg
   $ cd vcpkg/
   $ bootstrap-vcpkg.bat
 #+END_SRC

 2 Run the command Windows Key + R or execute from the terminal the
    following command. It opens the environment variables Window.

 #+BEGIN_SRC sh 
   $ rundll32.exe sysdm.cpl,EditEnvironmentVariables
 #+END_SRC

 3 Set the following environment variables.

  + Set PATH to ~%PATH%;C:\vcpkg~
  + Add new variable VCPKG_ROOT and set it to: ~C:\vcpkg~


 4 Test installation. Open a new terminal and enter:

 #+BEGIN_SRC sh
   # Show where is the vcpkg.exe executable 
   C:\Users\archbox> where vcpkg
   C:\vcpkg\vcpkg.exe

   # Check whether environment variable VCPKG_ROOT is set:
   C:\Users\archbox> echo %VCPKG_ROOT%
   C:\vcpkg

   # List installed package 
   C:\Users\archbox>vcpkg list
   freeglut:x64-windows                               3.0.0-5          Open source implementation of GLUT with source a...
   freeglut:x86-windows                               3.0.0-5          Open source implementation of GLUT with source a...
   libjpeg-turbo:x86-windows                          1.5.3-1          libjpeg-turbo is a JPEG image codec that uses SI...
   libpng:x86-windows                                 1.6.35-1         libpng is a library implementing an interface fo...
   opengl:x86-windows                                 0.0-5            Open Graphics Library (OpenGL)[3][4][5] is a cro...
   pybind11:x64-windows                               2.2.3-1          pybind11 is a lightweight header-only library th...
   python3:x64-windows                                3.6.4-2          The Python programming language as an embeddable...
   zlib:x86-windows                                   1.2.11-3         A compression library
 #+END_SRC

*** Linux Vcpkg Installation

 1 Create install directory 
   + In this instruction: VCPKG will be installed at directory
     $HOME/opt/vcpkg or ~/home/<<MY-USER>/opt/vcpkg/~

 #+BEGIN_SRC sh 
   $ mkdir -p ~/opt && cd ~/opt
 #+END_SRC

 2 Download and compile VCPKG 

 #+BEGIN_SRC sh 
   $ git clone https://github.com/Microsoft/vcpkg
   $ cd vcpkg/
   $ sh bootstrap-vcpkg.sh 
 #+END_SRC

 #+RESULTS:

 3 Run VCPKG:

 #+BEGIN_SRC sh 
   $ ./vcpkg
   Commands:
     vcpkg search [pat]              Search for packages available to be built
     vcpkg install <pkg>...          Install a package
     vcpkg remove <pkg>...           Uninstall a package
     vcpkg remove --outdated         Uninstall all out-of-date packages
     vcpkg list                      List installed packages
     vcpkg update                    Display list of packages for updating

     ... ... ... ... ... ....   ... . .. ... . .. ... .. .... 

   For more help (including examples) see the accompanying README.md.
 #+END_SRC

 4 Add VCPKG to search $PATH variable in order to be able to call it
 from any directory.

  + Edit: ~/.bashrc or ~/.bash_profile and add the following code and
    restart the REPL.

 #+BEGIN_SRC sh 
   # Directory where installed VCPKG
   export VCPKG_ROOT=$HOME/opt/vcpkg/

   # Make vcpkg tool callable from anywhere 
   export PATH=$PATH:$VCPKG_ROOT
  #+END_SRC
*** Show all available packages

  + $ vcpkg search 

 #+BEGIN_SRC sh 
   $ vcpkg search 

   3fd                  2.6.2            C++ Framework For Fast Development
   abseil               2018-11-08-1     an open-source collection designed to augment the C++ standard library. Abseil...
   ace                  6.5.3            The ADAPTIVE Communication Environment
   aixlog               1.2.1            Header-only C++ logging library 
   alac                 2017-11-03-c3... The Apple Lossless Audio Codec (ALAC) is a lossless audio codec developed by A...
   alac-decoder         0.2              ALAC C implementation of a decoder, written from reverse engineering the file ...
   alembic              1.7.10           Alembic is an open framework for storing and sharing scene data that includes ...
   allegro5             5.2.4.0          Allegro is a cross-platform library mainly aimed at video game and multimedia ...

    ... ...  ... ...  ... ...  ... ...  ... ...  ... ...  ... ... 

   aws-sdk-cpp[waf]                      C++ SDK for the AWS waf service
   aws-sdk-cpp[waf-regional]             C++ SDK for the AWS waf-regional service
   aws-sdk-cpp[workdocs]                 C++ SDK for the AWS workdocs service
   aws-sdk-cpp[workmail]                 C++ SDK for the AWS workmail service
   aws-sdk-cpp[workspaces]               C++ SDK for the AWS workspaces service
   aws-sdk-cpp[xray]                     C++ SDK for the AWS xray service

    ... ...  ... ...  ... ...  ... ...  ... ...  ... ...  ... ... 

   boost-polygon        1.68.0           Boost polygon module
   boost-pool           1.68.0           Boost pool module
   boost-predef         1.68.0           Boost predef module
   boost-preprocessor   1.68.0           Boost preprocessor module
   boost-process        1.68.0           Boost process module
   boost-program-opt... 1.68.0           Boost program_options module
   boost-property-map   1.68.0           Boost property_map module
   boost-property-tree  1.68.0           Boost property_tree module
   boost-proto          1.68.0           Boost proto module
   boost-ptr-container  1.68.0           Boost ptr_container module
   boost-python         1.68.0-2         Boost python module
   boost-qvm            1.68.0           Boost qvm module
   boost-random         1.68.0           Boost random module
   boost-range          1.68.0           Boost range module

    ... ...  ... ...  ... ...  ... ...  ... ...  ... ...  ... ... 

 #+END_SRC
*** Removing package 

 #+BEGIN_SRC sh 
   $ vcpkg.exe remove libjpeg-turbo:x86-windows
   Your feedback is important to improve Vcpkg! Please take 3 minutes to complete our survey by running: vcpkg contact --survey
   The following packages will be removed:
       libjpeg-turbo:x86-windows
   Removing package libjpeg-turbo:x86-windows...
   Removing package libjpeg-turbo:x86-windows... done
   Purging package libjpeg-turbo:x86-windows...
   Purging package libjpeg-turbo:x86-windows... done
 #+END_SRC
*** Example: Project with spdlog and Boost Ublas 

 File: *CMakeLists.txt*

 #+BEGIN_SRC cmake 
   cmake_minimum_required(VERSION 3.9)

   if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
     set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
       CACHE STRING "")
     message(" [INFO] VCPKG CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}")
   endif()

   #========== Global Configurations =============#
   #----------------------------------------------#
   project(SpdLogVCPKGTest)
   set(CMAKE_CXX_STANDARD 17)     
   set(CMAKE_VERBOSE_MAKEFILE ON)

   #========== Targets Configurations ============#

   # Build an executable (Unix-like OSes generates ./AppDemo1, on
   # Windows ./opengDemo1.exe)
   # ..........................................
   find_package(spdlog CONFIG REQUIRED)
   add_executable(AppDemo1 demo.cpp)
   target_link_libraries(AppDemo1 PRIVATE spdlog::spdlog)

   # Add target to run executable 
   add_custom_target(run-app
     COMMAND AppDemo1 
     DEPENDS AppDemo1 
     WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
     )

   install(TARGETS AppDemo1 DESTINATION ./bin)
   if(WIN32)
     # Install DLL depedency.
     # The only way to know the required dependencies is to
     # take a look at the build tree directory <<BUILD-TREE>>\Debug
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/fmtd.dll
       DESTINATION "bin")
   endif()
 #+END_SRC

 File: *demo.cpp*

 #+BEGIN_SRC cpp
   #include <iostream>
   #include <spdlog/spdlog.h>
   #include <spdlog/sinks/stdout_sinks.h>

   // Headers for vectors 
   #include <boost/numeric/ublas/vector.hpp>
   #include <boost/numeric/ublas/io.hpp>

   namespace ub = boost::numeric::ublas;

   int main(){
       auto console = spdlog::stdout_logger_mt("stdout-console");
       console->info("Testing logging information to command line");

       console->info("Welcome to spdlog version {}.{}.{} !", SPDLOG_VER_MAJOR, SPDLOG_VER_MINOR, SPDLOG_VER_PATCH);
       console->warn("Easy padding in numbers like {:08d}", 12);
       console->critical("Support for int: {0:d};  hex: {0:x};  oct: {0:o}; bin: {0:b}", 42);
       console->info("Support for floats {:03.2f}", 1.23456);
       console->info("Positional args are {1} {0}..", "too", "supported");
       console->info("{:>8} aligned, {:<8} aligned", "right", "left");

       ub::vector<double> vec1(3, 2.2) ; vec1[2] = -5.1;
       ub::vector<double> vec2(3, -1.2); vec2[2] = 1.1;

       std::cout << "Vec1 = " << vec1 << std::endl;
       std::cout << "3.0 * Vec1 = " << 3.0 * vec1 << std::endl;
       std::cout << "Norm1(Vec1) = " << ub::norm_1(vec1) << std::endl;
       std::cout << "Vec2 - Vec1 = " << vec2 - vec1 << std::endl;

       std::cout << "\n Enter RETURN to exit" << std::endl;
       std::cin.get();
       return 0;
   }
 #+END_SRC

 Install Vcpkg libraries Boost Ublas and spdlog: 

 #+BEGIN_SRC sh 
   # Windows installation 
   $ vcpkg install spdlog:x64-windows
   $ vcpkg install boost-ublas:x64-windows

   # Installation on Linux, OSX, or any other Unix-like OS. 
   $ vcpkg install spdlog
   $ vcpkg install boost-ublas
 #+END_SRC

  *Visual Studio*

  + The project can be compiled, modified, debugged and managed by
    opening it with Visual Studio as a directory or by invoking Visual
    Studio form command developer command prompt with the following
    command.

 #+BEGIN_SRC sh 
   # devenv <PATH-TO-PROJECT DIRECTORY>

   # Assumes that the current directory is the project top directory
   $ devenv .
 #+END_SRC

 All CMake Targets can be viewed from the VS Solution Explorer.

 #+CAPTION: Visual Studio Solution Explorer - CMake Targets 
 [[file:images/solution-explorer-visual-spdlog.png][file:images/solution-explorer-visual-spdlog.png]]

 #+CAPTION: Running CMake project from Visual Studio.
 [[file:images/cmake-project-vs-spdlog.png][file:images/cmake-project-vs-spdlog.png]]

  *Manual Compilation - CMake Configuration Step*

 CMake Configuration on Windows with Visual Studio building tools as backed:

  + In the project directory run: 

 #+BEGIN_SRC sh 
   $ cmake -H. -Bbuild -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=.
 #+END_SRC

 CMake Configuration on Linux using Makefiles: 

 #+BEGIN_SRC sh 
   # Configuration using Makefiles 
   $ cmake -H. -Bbuild -DCMAKE_INSTALL_PREFIX=.

   # Configuration using Ninja building system 
   $ cmake -H. -Bbuild -G Ninja -DCMAKE_INSTALL_PREFIX=.
 #+END_SRC

  *Manual Compilation - CMake Building Step*

 Building all CMake targets (compilation targets to build executables
 and libraries):

 #+BEGIN_SRC sh 
   $ cmake --build build --target 
 #+END_SRC

 Run install target on Windows:

 #+BEGIN_SRC sh 
   $ cmake --build build --target install 

     ... ... ... ... .... 
   PrepareForBuild:
     Creating directory "x64\Debug\INSTALL\".
     Creating directory "x64\Debug\INSTALL\INSTALL.tlog\".
   InitializeBuildStatus:
     Creating "x64\Debug\INSTALL\INSTALL.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
   PostBuildEvent:
     setlocal
     "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
     if %errorlevel% neq 0 goto :cmEnd
     :cmEnd
     endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
     :cmErrorLevel
     exit /b %1
     :cmDone
     if %errorlevel% neq 0 goto :VCEnd
     :VCEnd
     -- Install configuration: "Debug"
     -- Installing: C:/Users/archbox/Desktop/spdlogtest/./bin/AppDemo1.exe
     -- Up-to-date: C:/Users/archbox/Desktop/spdlogtest/bin/fmtd.dll
   FinalizeBuildStatus:
     Deleting file "x64\Debug\INSTALL\INSTALL.tlog\unsuccessfulbuild".
     Touching "x64\Debug\INSTALL\INSTALL.tlog\INSTALL.lastbuildstate".
   Done Building Project "C:\Users\archbox\Desktop\spdlogtest\build\install.vcxproj" (default targets).
   Build succeeded.
    .... ... .... ... .... ... .... ...
 #+END_SRC

 Run install target on Linux:

 #+BEGIN_SRC sh 
   $ cmake --build build --target install
   [2/3] Install the project...
   -- Install configuration: ""
   -- Installing: /home/archbox/root-scripts/spdlog/./bin/AppDemo1
 #+END_SRC

 Check install output on Windows:

 #+BEGIN_SRC sh 
   $ ls bin
   AppDemo1.exe*  fmtd.dll*
 #+END_SRC

 Check install output on Linux:

 #+BEGIN_SRC sh 
   $ ls bin/
   AppDemo1*
 #+END_SRC

 Run program: 

 #+BEGIN_SRC sh 
    # Run on Windows
    bin\AppDemo1.exe 

    [2019-01-09 16:17:13.360] [stdout-console] [info] Testing logging information to command line
    [2019-01-09 16:17:13.361] [stdout-console] [info] Welcome to spdlog version 1.2.0 !
    [2019-01-09 16:17:13.361] [stdout-console] [warning] Easy padding in numbers like 00000012
    [2019-01-09 16:17:13.361] [stdout-console] [critical] Support for int: 42;  hex: 2a;  oct: 52; bin: 101010
    [2019-01-09 16:17:13.361] [stdout-console] [info] Support for floats 1.23
    [2019-01-09 16:17:13.362] [stdout-console] [info] Positional args are supported too..
    [2019-01-09 16:17:13.362] [stdout-console] [info]    right aligned, left     aligned
    Vec1 = [3](2.2,2.2,-5.1)
    3.0 * Vec1 = [3](6.6,6.6,-15.3)
    Norm1(Vec1) = 9.5
    Vec2 - Vec1 = [3](-3.4,-3.4,6.2)

     Enter RETURN to exit
 #+END_SRC

*** Example: Project with OpenGL + FreeGLUT 

 GIST: [[https://gist.github.com/caiorss/4e36d7423cfd456f39c26ba476873a3c][Cmake C++ project with VCPKG package manager and OpengGL/FreeGlut]]

 File: *CMakeLists.txt*

 #+BEGIN_SRC cmake 
   cmake_minimum_required(VERSION 3.9)

   if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
     set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
       CACHE STRING "")
       message(" [INFO] VCPKG CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}")
   endif()

   #========== Global Configurations =============#
   #----------------------------------------------#
   project(OpengGL_Widnows)
   set(CMAKE_CXX_STANDARD 17)     
   set(CMAKE_VERBOSE_MAKEFILE ON)

   find_package(OpenGL REQUIRED)
   find_package(GLUT REQUIRED)
   find_package(GLU  REQUIRED)

   #========== Targets Configurations ============#

   # Build an executable (Unix-like OSes generates ./openglDemo1, on
   # Windows ./opengDemo1.exe)
   # ..........................................
   add_executable(openglDemo1 opengl1.cpp)
   target_link_libraries(openglDemo1 PRIVATE GLUT::GLUT)

   if(UNIX)
     target_link_libraries(openglDemo1 PRIVATE GL)
   endif()

   # Add extension .bin to executable name to make it easier
   # to identify that the binary file is an executable.
   # So, it turns  openglDemo1 becomes openglDemo1.bin 
   if(UNIX)
     set_target_properties(openglDemo1 PROPERTIES SUFFIX ".bin")
   endif()

   # Add target to run executable 
   add_custom_target(run-ex1
       COMMAND openglDemo1 
       DEPENDS openglDemo1 
       WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
   )

   # It installs (copies) the target files to a path relative to CMAKE_INSTALL_PREFIX
   # So, it will copy the built files to ${CMAKE_INSTALL_PREFIX}/out
   message(" Freeglut DLL = ${GLUT_RUNTIME_LIBRARY} ${FREEGLUT_DYNAMIC}
   ") install(TARGETS openglDemo1 DESTINATION out) install(FILES
   "${CMAKE_CURRENT_BINARY_DIR}/freeglut.dll" DESTINATION out)
 #+END_SRC

 File: *opengl1.cpp*

 #+BEGIN_SRC cpp 
   #include <iostream>
   #if defined(_WIN32)
     #include <windows.h>
   #endif 
   #include <GL/gl.h>
   #include <GL/glu.h>
   #include <GL/glut.h>

   void renderFunction();

   int main(int argc, char ** argv){

       std::cerr << "[INFO] Starting OpenGL main loop." << std::endl;
	
       glutInit(&argc, argv);  
       glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
       glutInitWindowSize(500, 500);
       glutCreateWindow("Window 1");
       // Display Callback Function 
       glutDisplayFunc(&renderFunction);
       // Start main loop 
       glutMainLoop();
       std::cerr << "[INFO] Exit OpenGL main loop." << std::endl;
       return 0;
   }

   void renderFunction(){
           std::cerr << "[INFO] Running loop." << std::endl;
       // Clear the current output buffer
       glClear(GL_COLOR_BUFFER_BIT);   

       // Rotate 10 degrees counterclockwise around z axis
       glRotated(10, 0, 0, 1);

       // Set the current color (RGB) drawing to blue
       glColor3f(0.0, 0.0, 1.0);

       // Start polygon 
       glBegin(GL_POLYGON);
       glVertex3f(-0.5, -0.5, 0);
       glVertex3f( 0.5, -0.5, 0);
       glVertex3f( 0.5,  0.5, 0);
       glVertex3f(-0.5,  0.5, 0);
       // End polygon 
       glEnd();

       glFlush();
   }

 #+END_SRC

 Install FreeGlut library: 

 Search FreeGlut library: 

 #+BEGIN_SRC sh 
    $ vcpkg search freeglut

    freeglut             3.0.0-5          Open source implementation of GLUT with source and binary backwards compatibil...

    If your library is not listed, please open an issue at and/or consider making a pull request:
        https://github.com/Microsoft/vcpkg/issues
 #+END_SRC

 Install FreeGlut Library:

  + $ vcpkg install freeglut:x64-Windows
    + Install library compiled for 64 bits target. 

  + $ vcpkg install freeglut:x86-Windows
    + Install library compiled for x86 bits target. 

 #+BEGIN_SRC sh 
   $ vcpkg install freeglut:x64-Windows

   The following packages will be built and installed:
       freeglut[core]:x64-windows
   Starting package 1/1: freeglut:x64-windows
   Building package freeglut[core]:x64-windows...
   A suitable version of git was not found (required v2.20.0). Downloading portable git v2.20.0...
   Downloading git...
     https://github.com/git-for-windows/git/releases/download/v2.20.0.windows.1/PortableGit-2.20.0-32-bit.7z.exe -> C:\vcpkg\downloads\PortableGit-2.20.0-32-bit.7z.exe
   Extracting git...
   A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
   Downloading 7zip...
     https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> C:\vcpkg\downloads\7-zip.commandline.18.1.0.nupkg
   Extracting 7zip...
   A suitable version of nuget was not found (required v4.6.2). Downloading portable nuget v4.6.2...
   Downloading nuget...
     https://dist.nuget.org/win-x86-commandline/v4.6.2/nuget.exe -> C:\vcpkg\downloads\nuget.exe
   -- Downloading http://downloads.sourceforge.net/project/freeglut/freeglut/3.0.0/freeglut-3.0.0.tar.gz...
   -- Extracting source C:/vcpkg/downloads/freeglut-3.0.0.tar.gz
   -- Configuring x64-windows
   -- Building x64-windows-dbg
   -- Building x64-windows-rel
   -- Performing post-build validation
   -- Performing post-build validation done
   Building package freeglut[core]:x64-windows... done
   Installing package freeglut[core]:x64-windows...
   Installing package freeglut[core]:x64-windows... done
   Elapsed time for package freeglut:x64-windows: 2.215 min

   Total elapsed time: 2.215 min

   The package freeglut is compatible with built-in CMake targets:

       find_package(GLUT REQUIRED)
       target_link_libraries(main PRIVATE GLUT::GLUT)
 #+END_SRC

 Clone the GIST for avoiding crating the sources manually: 

 #+BEGIN_SRC sh 
   $ git clone https://gist.github.com/caiorss/4e36d7423cfd456f39c26ba476873a3c opengl-cmake-demo
   Cloning into 'opengl-cmake-demo'...
   remote: Enumerating objects: 4, done.
   remote: Counting objects: 100% (4/4), done.
   remote: Compressing objects: 100% (4/4), done.
   Unpacking objects: 100% (4/4), done.
   remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0

   $ cd opengl-cmake-demo\

   $ dir
    Volume in drive C has no label.
    Volume Serial Number is 

    Directory of C:\Users\archbox\Desktop\opengl-cmake-demo

   01/08/2019  05:57 PM    <DIR>          .
   01/08/2019  05:57 PM    <DIR>          ..
   01/08/2019  05:57 PM             1,630 CMakeLists.txt
   01/08/2019  05:57 PM             1,188 opengl1.cpp
                  2 File(s)          2,818 bytes
                  2 Dir(s)   1,157,586,944 bytes free

 #+END_SRC

 Perform CMake configuration step generating building scripts:

 #+BEGIN_SRC sh 
     $ cmake -H. -Bbuild -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=.
      [INFO] VCPKG CMAKE_TOOLCHAIN_FILE = C:\vcpkg/scripts/buildsystems/vcpkg.cmake
     -- The C compiler identification is MSVC 19.16.27025.1
     -- The CXX compiler identification is MSVC 19.16.27025.1
      ... ...  ... ...  ... ...  ... ...  ... ...  ... ...  ... ... 
     -- Detecting CXX compiler ABI info - done
     -- Detecting CXX compile features
     -- Detecting CXX compile features - done
     -- Found OpenGL: opengl32
     -- Found GLUT: C:/vcpkg/installed/x64-windows/debug/lib/freeglut.lib
     -- WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead
      Freeglut DLL =
     -- Configuring done
     -- Generating done
     -- Build files have been written to: C:/Users/archbox/Desktop/opengl-cmake-demo/build
 #+END_SRC

 Build all targets: 

  + $ cmake --build build --config debug
  + $ cmake --build build --config release 
 
 #+BEGIN_SRC sh 
   $ cmake --build build --config debug

   Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
   Copyright (C) Microsoft Corporation. All rights reserved.

   Build started 1/8/2019 6:02:01 PM.
   Project "C:\Users\archbox\Desktop\opengl-cmake-demo\build\ALL_BUILD.vcxproj" on node 1 (default targets).
   Project "C:\Users\archbox\Desktop\opengl-cmake-demo\build\ALL_BUILD.vcxproj" (1) is building "C:\Users\archbox\Desktop\opengl-cmake-demo\buil d\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).

    .. .. .   ... .. .   ... .. .   ... .. .   ... .. .   ... .. .   ... .. .   ... .. .   ... .. . 

   ClCompile:
     C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\CL.exe /c /I"C:\vcpkg\installed\x6
     4-windows\include" /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /M
     Dd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++17 /Fo"openglDemo1.dir\Debug\\" /Fd"openglDemo1.dir\Debug\vc141.pdb" /Gd
      /TP /errorReport:queue "C:\Users\archbox\Desktop\opengl-cmake-demo\opengl1.cpp"
     Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27025.1 for x64
     opengl1.cpp
     Copyright (C) Microsoft Corporation.  All rights reserved.

     cl /c /I"C:\vcpkg\installed\x64-windows\include" /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"
     " /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++17 /Fo"openglDemo1.dir\Debug\\" /Fd"opengl
     Demo1.dir\Debug\vc141.pdb" /Gd /TP /errorReport:queue "C:\Users\archbox\Desktop\opengl-cmake-demo\opengl1.cpp"

   Link:
     C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:"
     C:\Users\archbox\Desktop\opengl-cmake-demo\build\Debug\openglDemo1.exe" /INCREMENTAL /NOLOGO "C:\vcpkg\installed\x64-windows\debug\lib\free
     glut.lib" kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /M
     ANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:/Users/archbox/Desktop/opengl-cmake-demo/build/Debug/openglD
     emo1.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/Users/archbox/Desktop/opengl-cmake-demo/build/Debug/openglDemo1.li
     b" /MACHINE:X64  /machine:x64 openglDemo1.dir\Debug\opengl1.obj

   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   ....   .... 

   Done Building Project "C:\Users\archbox\Desktop\opengl-cmake-demo\build\ALL_BUILD.vcxproj" (default targets).


   Build succeeded.
       0 Warning(s)
       0 Error(s)

   Time Elapsed 00:00:06.76
 #+END_SRC

 Run executable (target run-ex1):

  + This is conveniced target was added for making easier to run the
    executable from the terminal. It is not needed for IDEs like Visual
    Studio, JetBrains - Clion and so on. 

 #+BEGIN_SRC sh 
   $ cmake --build build --target run-ex1
 #+END_SRC


 Compile and run on Linux: 

 #+BEGIN_SRC sh 
   $ vcpkg install freeglut   
   $ git clone https://gist.github.com/caiorss/4e36d7423cfd456f39c26ba476873a3c opengl
   $ cd opengl 
   $ cmake -H. -Bbuild 
   $ cmake --build build --target run-ex1 
 #+END_SRC

*** Example: Project with Nana GUI Library 

 GIST: [[https://gist.github.com/caiorss/724942d43cd11c6ee5b3461ac067c846][Nana GUI + VCPKG + CMake project]]

 File: *CMakeLists.txt*

 #+BEGIN_SRC cmake 
    cmake_minimum_required(VERSION 3.9)

    if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
      set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
        CACHE STRING "")
        message(" [INFO] VCPKG CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}")
    endif()

    #======= Global Project Configuration =========#

    project(DummyProject)
    set(CMAKE_CXX_STANDARD 17)     

    #========== Targets Configurations ============#

    ## ==> Target: gui1 - Executable: gui1

    find_package(unofficial-nana CONFIG REQUIRED)
    add_executable(gui1 gui1.cpp)
    target_link_libraries(gui1 PRIVATE
      unofficial::nana::nana fontconfig stdc++fs)

    # Add target to run executable gui1 (similar to $ make run)
    add_custom_target(run-gui1
        COMMAND gui1
        DEPENDS gui1
        WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
    )

    # Install directory relative to ${CMAKE_PREFIX_PATH}
    install(TARGETS gui1 DESTINATION ./bin)
 #+END_SRC

 File: *gui1.cpp*

  + Note: Demo code taken from - http://nanapro.org/en-us/

 #+BEGIN_SRC cpp 
   #include <nana/gui.hpp>
   #include <nana/gui/widgets/label.hpp>
   #include <nana/gui/widgets/button.hpp>

   int main()
   {
       using namespace nana;

       //Define a form.
       form fm;
       //Define a label and display a text.
       label lab{fm, "Hello, <bold blue size=16>Nana C++ Library</>"};
       lab.format(true);
       //Define a button and answer the click event.
       button btn{fm, "Quit"};
       btn.events().click([&fm]{
           fm.close();
       });
       //Layout management
       fm.div("vert <><<><weight=80% text><>><><weight=24<><button><>><>");
       fm["text"]<<lab;
       fm["button"] << btn;
       fm.collocate();
       //Show the form
       fm.show();
       //Start to event loop process, it blocks until the form is closed.
       exec();
   }
 #+END_SRC

 Project directory: 

 #+BEGIN_SRC sh 
   $ tree -L 1
   .
   ├── build
   ├── CMakeLists.txt
   └── gui1.cpp

   1 directory, 2 files
 #+END_SRC

 Install Linux dependency libraries (Tested on Linux Fedora): 

  + Note: Sometimes VCPKG cannot install system libraries. In this
    case, it is necessary to use the current distribution package
    manager. 

 #+BEGIN_SRC sh 
   $ sudo dnf install libX11-devel.x86_x64
   $ sudo dnf install libXft-devel.x86_64
 #+END_SRC

 Clone gist containing the project: 

 #+BEGIN_SRC sh 
   $ git clone https://gist.github.com/caiorss/724942d43cd11c6ee5b3461ac067c846 sample-vcpkg-proj
   $ cd sample-vcpkg-proj
 #+END_SRC

 #+RESULTS:

  *Install package Nana with vcpkg:*

 #+BEGIN_SRC sh 
   $ vcpkg install nana

    ...  ...  ...  ... 
   -- Using cached /home/archbox/opt/vcpkg/downloads/cnjinhao-nana-v1.6.2.tar.gz
   -- Using source at /home/archbox/opt/vcpkg/buildtrees/nana/src/v1.6.2-51b575c248
   -- Configuring x64-linux-dbg
   -- Configuring x64-linux-rel
   -- Building x64-linux-dbg
   -- Building x64-linux-rel
   -- Performing post-build validation
   -- Performing post-build validation done
   Building package nana[core]:x64-linux... done
   Installing package nana[core]:x64-linux... 
   Installing package nana[core]:x64-linux... done
   Elapsed time for package nana:x64-linux: 1.825 min

   Total elapsed time: 1.825 min

   The package nana:x64-linux provides CMake targets:

       find_package(unofficial-nana CONFIG REQUIRED)
       target_link_libraries(main PRIVATE unofficial::nana::nana)
 #+END_SRC

 List installed packages: 

 #+BEGIN_SRC sh 
    $ vcpkg list
    boost-accumulators:x64-linux                       1.68.0           Boost accumulators module
    boost-algorithm:x64-linux                          1.68.0           Boost algorithm module
    boost-any:x64-linux                                1.68.0           Boost any module
    boost-array:x64-linux                              1.68.0           Boost array module

    ... ... ...   ... ... ...   ... ... ...   ... ... ...   ... ... ...   ... ... ...   ... ... ...
  
    gsl:x64-linux                                      2.4-3            The GNU Scientific Library is a numerical librar...
    gtest:x64-linux                                    1.8.1-1          GoogleTest and GoogleMock testing frameworks.
    libiconv:x64-linux                                 1.15-5           GNU Unicode text conversion
    libjpeg-turbo:x64-linux                            1.5.3-1          libjpeg-turbo is a JPEG image codec that uses SI...
    liblzma:x64-linux                                  5.2.4            Compression library with an API similar to that ...
    libpng:x64-linux                                   1.6.35-1         libpng is a library implementing an interface fo...
    nana:x64-linux                                     1.6.2            Cross-platform library for GUI programming in mo...
    pybind11:x64-linux                                 2.2.3-1          pybind11 is a lightweight header-only library th...
    spdlog:x64-linux                                   1.2.1            Very fast, header only, C++ logging library
    zlib:x64-linux                                     1.2.11-3         A compression librar
 #+END_SRC

 Filter nana package: 

 #+BEGIN_SRC sh 
    $ vcpkg list | grep nana
    nana:x64-linux                                     1.6.2            Cross-platform library for GUI programming in mo...
 #+END_SRC

  *Building with CMake Ninja or Makefile*

 Cmake configuration step

  + Default system building system
    + $ cmake -H. -Bbuild 

  + Ninja building System:
    + $ cmake -H. -Bbuild -G Ninja

 #+BEGIN_SRC sh 
   # Install executable at (.) curret directory
   $ cmake -H. -Bbuild -G Ninja  -DCMAKE_PREFIX_PATH=.

    [INFO] VCPKG CMAKE_TOOLCHAIN_FILE = /home/archbox/opt/vcpkg/scripts/buildsystems/vcpkg.cmake
   -- The C compiler identification is GNU 8.2.1
   -- The CXX compiler identification is GNU 8.2.1
   -- Check for working C compiler: /usr/lib64/ccache/cc

    ... ... ... ... ... ... 

   -- Found Freetype: /home/archbox/build/vcpkg/installed/x64-linux/lib/libfreetype.a (found version "2.8.1") 
   -- Found ZLIB: /home/archbox/build/vcpkg/installed/x64-linux/debug/lib/libz.a (found version "1.2.11") 
   -- Found PNG: /home/archbox/build/vcpkg/installed/x64-linux/share/png/../../lib/libpng16.a (found version "1.6.35") 
   -- Found BZip2: /home/archbox/build/vcpkg/installed/x64-linux/lib/libbz2.a (found version "1.0.6") 
   -- Looking for BZ2_bzCompressInit
   -- Looking for BZ2_bzCompressInit - found
   -- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
   -- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found

    ... ... ... ... ... ... 

   -- Looking for shmat - found
   -- Found X11: /usr/lib64/libX11.so
   -- Found JPEG: /home/archbox/build/vcpkg/installed/x64-linux/debug/lib/libjpeg.a  
   -- Configuring done
   -- Generating done
   -- Build files have been written to: /home/archbox/root-scripts/vcpkg2/build
 #+END_SRC

 Build all targets: 

 #+BEGIN_SRC sh 
  $ cmake --build build --target 
 #+END_SRC

 Build and run executable target gui1 (target: run-gui1)

 #+BEGIN_SRC sh 
   $ cmake --build build --target run-gui1
   [3/3] cd /home/archbox/root-scripts/vcpkg2/build && /home/archbox/root-scripts/vcpkg2/build/gui1
 #+END_SRC

 Install executable: 

 #+BEGIN_SRC sh 
   $ cmake --build build --target install
   [2/3] Install the project...
   -- Install configuration: ""
   -- Installing: /home/archbox/root-scripts/vcpkg2/./bin/gui1
 #+END_SRC

 Run installed executable at ./bin 

 #+BEGIN_SRC sh 
   $ bin/gui1 
 #+END_SRC

 Directory after compilation: 

 #+BEGIN_SRC sh 
   $ tree . -L 2
   .
   ├── bin
   │   └── gui1
   ├── build
   │   ├── build.ninja
   │   ├── CMakeCache.txt
   │   ├── CMakeFiles
   │   ├── cmake_install.cmake
   │   ├── gui1
   │   ├── install_manifest.txt
   │   └── rules.ninja
   ├── CMakeLists.txt
   └── gui1.cpp

   3 directories, 9 files
 #+END_SRC

  *Analyse executable:*

 Check binary format 

 #+BEGIN_SRC sh 
   $ file bin/gui1 

   bin/gui1: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux),
   dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
   GNU/Linux 3.2.0,
   BuildID[sha1]=b2273c2b397213af8c8b8e8808da1ebc195d3b4d, with
   debug_info, not stripped
 #+END_SRC

 Check file size 

 #+BEGIN_SRC sh
   # File size 
   $ du -h bin/gui1
   19M	bin/gui1
   19M	total
 #+END_SRC

 Remove debugging symbols 

 #+BEGIN_SRC sh 
   $ strip bin/gui1 
 #+END_SRC

 Check file size again: 

 #+BEGIN_SRC sh 
   $ du -h bin/gui1
   3.3M	bin/gui1
   3.3M	total
 #+END_SRC

 Check shared libraries dependencies:

 #+BEGIN_SRC sh 
    $ ldd bin/gui1
            linux-vdso.so.1 (0x00007fff18930000)
            libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007f5f73116000)
            libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5f72ef7000)
            libX11.so.6 => /lib64/libX11.so.6 (0x00007f5f72bb6000)
            libXext.so.6 => /lib64/libXext.so.6 (0x00007f5f729a4000)
            libXft.so.2 => /lib64/libXft.so.2 (0x00007f5f7278d000)
            libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f5f723fa000)
            libm.so.6 => /lib64/libm.so.6 (0x00007f5f72066000)
            libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f5f71e4e000)
            libc.so.6 => /lib64/libc.so.6 (0x00007f5f71a8f000)
            libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007f5f717d8000)
            libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f5f7159d000)
            libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f5f71396000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f5f7335a000)
            libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f5f7116d000)
            libdl.so.2 => /lib64/libdl.so.2 (0x00007f5f70f69000)
            libXrender.so.1 => /lib64/libXrender.so.1 (0x00007f5f70d5e000)
            libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f5f70b4d000)
            libpng16.so.16 => /lib64/libpng16.so.16 (0x00007f5f70919000)
            libz.so.1 => /lib64/libz.so.1 (0x00007f5f70702000)
            libXau.so.6 => /lib64/libXau.so.6 (0x00007f5f704fe000)
 #+END_SRC




