From 98e35bddcfbd999ef93f2717317ac038ad78de82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Mon, 2 Sep 2013 22:12:14 +0200 Subject: [PATCH] Adding a build script - using the generic command "cmake --build ." instead of "make" - using the generic command "ctest" instead of "make test" - updated readme --- README.md | 20 ++++++++------------ build.bat | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 build.bat diff --git a/README.md b/README.md index a9c33f0..8460d2d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..1373f6b --- /dev/null +++ b/build.bat @@ -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 .