Skip to content

Sample C++ Hello World program using CMake, Conan.io package manager and SQLite3 library.

Notifications You must be signed in to change notification settings

misuo/test-sqlite-conan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a small C++ Hello World program testing a project build using CMake as build generator with integrated conan.io package manager consuming (using and linking) with SQLite3 library.

The C++ program main.cpp itself is trivial:

#include <iostream>
#include <sqlite3.h>

int main()
{
  std::cout << "Hello World!" << std::endl;
  std::cout << "SQLite3 version " << sqlite3_libversion() << std::endl;

  return 0; // Success
}

Requirements

How to build - on Mac OS X and *nix:

First establish out-of-source build/ folder, so that source folder is not polluted:

$ mkdir build
$ cd build

Initialize your project with conan - this is using the conanfile.txt specifying that SQLite (v3.15.2) is an dependency and that conan should integrate with CMake:

$ conan install ..

💡 If you see error Try to build from source with --build then do the following to build the actual SQLite library from its source:

$ conan install --build SQLite3

Generate the build files using CMake:

$ cmake ..

Build the project:

$ make

If everything went successfully, you can run the built executable:

$ bin/mytest

Expected output:

Hello World!
SQLite version 3.15.2

About

Sample C++ Hello World program using CMake, Conan.io package manager and SQLite3 library.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published