Cleanup and improvement to build script

- no googletest on appveyor as cloning this submodule does not wordk
This commit is contained in:
Sébastien Rombauts 2015-03-20 13:05:35 +01:00
parent ef974c2be6
commit 9d4829ab1e
6 changed files with 290 additions and 279 deletions

View File

@ -1,4 +1,4 @@
# Copyright (c) 2012-2015 Sébastien Rombauts (sebastien.rombauts@gmail.com)
# Copyright (c) 2012-2015 Sebastien Rombauts (sebastien.rombauts@gmail.com)
language: cpp
@ -16,9 +16,10 @@ before_install:
before_script:
- mkdir build
- cd build
- cmake -DSQLITECPP_RUN_CPPLINT=ON -DSQLITECPP_RUN_CPPCHECK=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON ..
- cmake -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_RUN_DOXYGEN=OFF ..
- ln -s ../examples examples
# build and run tests
script: make && ctest --output-on-failure
# build examples, and run tests (ie make & make test)
script:
- cmake --build .
- ctest --output-on-failure

View File

@ -1,4 +1,5 @@
IF(BIICODE)
if (BIICODE)
include(${CMAKE_HOME_DIRECTORY}/biicode.cmake)
# Initializes block variables
INIT_BIICODE_BLOCK()
@ -13,8 +14,9 @@ IF(BIICODE)
ENDIF()
ENDIF()
ELSE()
# Main CMake file for compiling the library itself, examples and tests.
else (BIICODE)
# Main CMake file for compiling the library itself, examples and tests.
#
# Copyright (c) 2012-2015 Sebastien Rombauts (sebastien.rombauts@gmail.com)
#
@ -121,6 +123,8 @@ source_group(doc FILES ${SQLITECPP_DOC})
# list of script files of the library
set(SQLITECPP_SCRIPT
.travis.yml
appveyor.yml
biicode.conf
build.bat
build.sh
cpplint.py
@ -154,7 +158,7 @@ endif (WIN32)
# Optional additional targets:
option(SQLITECPP_RUN_CPPLINT "Run cpplint.py tool for Google C++ StyleGuide." OFF)
option(SQLITECPP_RUN_CPPLINT "Run cpplint.py tool for Google C++ StyleGuide." ON)
if (SQLITECPP_RUN_CPPLINT)
# add a cpplint target to the "all" target
add_custom_target(SQLiteCpp_cpplint
@ -165,7 +169,7 @@ else (SQLITECPP_RUN_CPPLINT)
message(STATUS "SQLITECPP_RUN_CPPLINT OFF")
endif (SQLITECPP_RUN_CPPLINT)
option(SQLITECPP_RUN_CPPCHECK "Run cppcheck C++ static analysis tool." OFF)
option(SQLITECPP_RUN_CPPCHECK "Run cppcheck C++ static analysis tool." ON)
if (SQLITECPP_RUN_CPPCHECK)
find_program(CPPCHECK_EXECUTABLE NAMES cppcheck)
if (CPPCHECK_EXECUTABLE)
@ -181,7 +185,7 @@ else (SQLITECPP_RUN_CPPCHECK)
message(STATUS "SQLITECPP_RUN_CPPCHECK OFF")
endif (SQLITECPP_RUN_CPPCHECK)
option(SQLITECPP_RUN_DOXYGEN "Run Doxygen C++ documentation tool." OFF)
option(SQLITECPP_RUN_DOXYGEN "Run Doxygen C++ documentation tool." ON)
if (SQLITECPP_RUN_DOXYGEN)
find_package(Doxygen)
if (DOXYGEN_FOUND)
@ -234,4 +238,5 @@ if (SQLITECPP_BUILD_TESTS)
else (SQLITECPP_BUILD_TESTS)
message(STATUS "SQLITECPP_BUILD_TESTS OFF")
endif (SQLITECPP_BUILD_TESTS)
ENDIF()
endif (BIICODE)

View File

@ -1,13 +1,14 @@
# Copyright (c) 2012-2015 Sébastien Rombauts (sebastien.rombauts@gmail.com)
# Copyright (c) 2012-2015 Sebastien Rombauts (sebastien.rombauts@gmail.com)
# build format
version: "{build}"
# scripts that run after cloning repository
# NOTE : not updating submodule as cloning googletest does not work on AppVeyor
install:
- git submodule update --init --recursive
- sudo apt-get update -qq
- sudo apt-get install -qq cppcheck
# - git submodule update --init --recursive
# configurations to add to build matrix
configuration:
@ -16,13 +17,14 @@ configuration:
# scripts to run before build
# using a symbolic link to get the "make test" to work as if launched from the root directorys
# NOTE : no unit tests as cloning googletest does not work on AppVeyor
before_build:
- mkdir build
- cd build
- cmake -DSQLITECPP_RUN_CPPLINT=ON -DSQLITECPP_RUN_CPPCHECK=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON ..
- cmake -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=OFF -DSQLITECPP_RUN_DOXYGEN=OFF ..
- ln -s ../examples examples
# build examples, and run tests (ie make & make test)
build_script:
- cmake --build .
- ctest --output-on-failure
# - ctest --output-on-failure

View File

@ -1,12 +1,14 @@
@REM Copyright (c) 2012-2015 Sébastien Rombauts (sebastien.rombauts@gmail.com)
@REM Copyright (c) 2012-2015 Sebastien 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, and build it
cmake -DSQLITECPP_RUN_CPPLINT=ON -DSQLITECPP_RUN_CPPCHECK=ON -DSQLITECPP_RUN_DOXYGEN=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON ..
@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 prepare and launch tests

View File

@ -2,14 +2,15 @@
#
# Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
# or copy at http://opensource.org/licenses/MIT)
mkdir -p build
cd build
# generate solution for GCC
cmake -DSQLITECPP_RUN_CPPLINT=ON -DSQLITECPP_RUN_CPPCHECK=ON -DSQLITECPP_RUN_DOXYGEN=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON ..
# 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 .
# prepare and launch tests
# Prepare and run unit-tests (ie 'make test')
mkdir -p examples/example1
cp ../examples/example1/example.db3 examples/example1
cp ../examples/example1/logo.png examples/example1