From 5812460a212f244a65144c36aded6d2f1ac36eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Tue, 24 Sep 2013 08:32:22 +0200 Subject: [PATCH] Reactivated dev tools in scripts and Travis CI config file --- .travis.yml | 2 +- CMakeLists.txt | 15 ++++++++++----- build.bat | 4 ++-- build.sh | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index e174a18..694e5f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: before_script: - mkdir build - cd build - - cmake .. + - cmake -DSQLITECPP_RUN_CPPLINT=ON -DSQLITECPP_RUN_CPPCHECK=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON .. - ln -s ../examples examples script: make && ctest --output-on-failure diff --git a/CMakeLists.txt b/CMakeLists.txt index d03a805..9e50c9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,11 +140,16 @@ endif (SQLITECPP_RUN_CPPLINT) option(SQLITECPP_RUN_CPPCHECK "Run cppcheck C++ static analysis tool." OFF) if (SQLITECPP_RUN_CPPCHECK) - # add a cppcheck target to the "all" target - add_custom_target(SQLiteCpp_cppcheck - ALL - COMMAND cppcheck -j 4 cppcheck --enable=style --quiet ${CPPCHECK_ARG_TEMPLATE} ${PROJECT_SOURCE_DIR}/src - ) + find_program(CPPCHECK_EXECUTABLE NAMES cppcheck) + if (CPPCHECK_EXECUTABLE) + # add a cppcheck target to the "all" target + add_custom_target(SQLiteCpp_cppcheck + ALL + COMMAND cppcheck -j 4 cppcheck --enable=style --quiet ${CPPCHECK_ARG_TEMPLATE} ${PROJECT_SOURCE_DIR}/src + ) + else (CPPCHECK_EXECUTABLE) + message(STATUS "cppcheck not found") + endif (CPPCHECK_EXECUTABLE) else (SQLITECPP_RUN_CPPCHECK) message(STATUS "SQLITECPP_RUN_CPPCHECK OFF") endif (SQLITECPP_RUN_CPPCHECK) diff --git a/build.bat b/build.bat index d54f281..28637b4 100644 --- a/build.bat +++ b/build.bat @@ -6,7 +6,7 @@ mkdir build cd build @REM generate solution for Visual Studio 2010, and build it -cmake .. -G "Visual Studio 10" +cmake -DSQLITECPP_RUN_CPPLINT=ON -DSQLITECPP_RUN_CPPCHECK=ON -DSQLITECPP_RUN_DOXYGEN=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON .. -G "Visual Studio 10" cmake --build . @REM prepare and launch tests @@ -15,4 +15,4 @@ mkdir examples\example1 copy ..\examples\example1\example.db3 examples\example1 copy ..\examples\example1\logo.png examples\example1 ctest --output-on-failure -cd .. \ No newline at end of file +cd .. diff --git a/build.sh b/build.sh index ceb60ee..4df686f 100755 --- a/build.sh +++ b/build.sh @@ -6,7 +6,7 @@ mkdir -p build cd build # generate solution for GCC -cmake .. +cmake -DSQLITECPP_RUN_CPPLINT=ON -DSQLITECPP_RUN_CPPCHECK=ON -DSQLITECPP_RUN_DOXYGEN=ON -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON .. cmake --build . # prepare and launch tests