Skip to content

Commit

Permalink
Fix #66: Update documentation on installation, CMake and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SRombauts committed Sep 6, 2015
1 parent 2c62e95 commit f39b84c
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,51 @@ Thus this SQLiteCpp repository can directly be used as a Git submoldule.

Under Debian/Ubuntu/Mint Linux, install the libsqlite3-dev package.

### Building the examples:
### Building examples and unit-tests:

#### CMake and test
Use git to clone the repository. Then init and update submodule "googletest".

```Shell
git clone https://github.com/SRombauts/SQLiteCpp.git
cd SQLiteCpp
git submodule init
git submodule update
```

#### CMake and tests
A CMake configuration file is also provided for multiplatform support and testing.

Typical generic build (see also "build.bat" or "./build.sh"):
Typical generic build for MS Visual Studio under Windows (from [build.bat](build.bat)):

```bash
```Batchfile
mkdir build
cd build
cmake .. # cmake .. -G "Visual Studio 10" # for Visual Studio 2010
cmake --build . # make
ctest . # make test
@REM Generate a Visual Studio solution for latest version found
cmake -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON ..
@REM Build default configuration (ie 'Debug')
cmake --build .
@REM Build and run tests
ctest --output-on-failure
```

Generating the Linux Makefile, building in Debug and executing the tests:
Generating the Linux Makefile, building in Debug and executing the tests (from [build.sh](build.sh)):

```bash
```Shell
mkdir Debug
cd Debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake --build . # make
ln -s ../examples examples
ctest . # make test

# Generate a Makefile for GCC (or Clang, depanding on CC/CXX envvar)
cmake -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON ..

# Build (ie 'make')
cmake --build .

# Build and run unit-tests (ie 'make test')
ctest --output-on-failure
```

#### CMake options
Expand Down

0 comments on commit f39b84c

Please sign in to comment.