Adding a build script

- using the generic command "cmake --build ." instead of "make"
 - using the generic command "ctest" instead of "make test"
 - updated readme
This commit is contained in:
Sébastien Rombauts 2013-09-02 22:12:14 +02:00
parent 2b5d66eb25
commit 98e35bddcf
2 changed files with 25 additions and 12 deletions

View File

@ -95,24 +95,20 @@ Solutions for Visual Studio 2008 and 2010 are provided in the "msvc/" directory,
#### CMake and test
A CMake configuration file is also provided for better multiplatform support and testing.
Generating the Visual Studio 2010 Solution (similar for any other VS up to 2013):
cmake . -G "Visual Studio 10"
Typical generic build (see also "build.bat" or "./build.sh"):
mkdir build
cd build
cmake .. # cmake .. -G "Visual Studio 10" # for Visual Studio 2010
cmake --build . # make
ctest . # make test
Generating the Linux Makefile, building in Debug and executing the tests:
mkdir Debug
cd Debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j
cmake --build . # make
ln -s ../examples examples
make test
And for the Release version:
mkdir Release
cd Release
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
ln -s ../examples examples
make test
ctest . # make test
### Continuous Integration

17
build.bat Normal file
View File

@ -0,0 +1,17 @@
@REM Copyright (c) 2013 Sébastien Rombauts (sebastien.rombauts@gmail.com)
@REM
@REM Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
@REM or copy at http://opensource.org/licenses/MIT)
mkdir build
cd build
@REM generate solution for Visual Studio 2010, and build it
cmake .. -G "Visual Studio 10"
cmake --build .
@REM prepare and launch tests
mkdir examples
mkdir examples\example1
cp ../examples/example1/example.db3 examples/example1/
cp ../examples/example1/logo.png examples/example1/
ctest .