From b2a34a1ee4c6d64b4cdd00898b3feef9791e2cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Sun, 23 Feb 2014 11:35:18 +0100 Subject: [PATCH] Small cleanup to CMake config and updated copyright date --- CMakeLists.txt | 35 +++++++++++++++++++++++++---------- LICENSE.txt | 2 +- README.md | 16 ++++++++-------- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e87d36..71cd7f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,23 +21,30 @@ if (SQLITE_ENABLE_ASSERT_HANDLER) add_definitions(-DSQLITECPP_ENABLE_ASSERT_HANDLER) endif () -# Define useful variables to handle OS/Compiler differences +# Define useful variables to handle OS differences: +if (WIN32) + set(DEV_NULL "NUL") +else (WIN32) + set(DEV_NULL "/dev/null") +endif (WIN32) +# then Compiler/IDE differences: if (MSVC) set(CPPLINT_ARG_OUTPUT "--output=vs7") set(CPPCHECK_ARG_TEMPLATE "--template=vs") - set(DEV_NULL "NUL") - # build the SQLite3 C library for Windows (for ease of use) - add_subdirectory(sqlite3) - include_directories("${PROJECT_SOURCE_DIR}/sqlite3") # disable Visual Studio warnings for fopen() used in the example add_definitions(-D_CRT_SECURE_NO_WARNINGS) -elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +else (MSVC) set(CPPLINT_ARG_OUTPUT "--output=eclipse") set(CPPCHECK_ARG_TEMPLATE "--template=gcc") - set(DEV_NULL "/dev/null") - # GCC flags - add_definitions(-rdynamic -fstack-protector-all -Wall -Wextra -pedantic -Weffc++ -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wundef -Wshadow -Wcast-qual -Wconversion -Wlogical-op -Winline -Wsuggest-attribute=pure -Wsuggest-attribute=const) -endif () + if (CMAKE_COMPILER_IS_GNUCXX) + # GCC flags + add_definitions(-rdynamic -fstack-protector-all -Wall -Wextra -pedantic -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wshadow -Wcast-qual -Wconversion -Wlogical-op -Winline -Wsuggest-attribute=pure -Wsuggest-attribute=const) + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # Clang flags + add_definitions(-fstack-protector-all -Wall -Wextra -pedantic -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wshadow -Wcast-qual -Wconversion -Winline) + endif (CMAKE_COMPILER_IS_GNUCXX) +endif (MSVC) +# and then common variables set(CPPLINT_ARG_VERBOSE "--verbose=3") set(CPPLINT_ARG_LINELENGTH "--linelength=120") @@ -70,6 +77,14 @@ if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Cl endif(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) +# SQLite3 library (Windows only) + +if (WIN32) + # build the SQLite3 C library for Windows (for ease of use) versus Linux sqlite3-dev package + add_subdirectory(sqlite3) + include_directories("${PROJECT_SOURCE_DIR}/sqlite3") +endif (WIN32) + # Optional additional targets: option(SQLITECPP_RUN_CPPLINT "Run cpplint.py tool for Google C++ StyleGuide." OFF) diff --git a/LICENSE.txt b/LICENSE.txt index c0f5c44..c535de5 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2012-2013 Sebastien Rombauts (sebastien.rombauts@gmail.com) +Copyright (c) 2012-2014 Sebastien Rombauts (sebastien.rombauts@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 049ff33..461d91a 100644 --- a/README.md +++ b/README.md @@ -42,18 +42,18 @@ where assert() are used instead). Each SQLiteC++ object must be constructed with a valid SQLite database connection, and then is always valid until destroyed. -### Suported platforms: +### Supported platforms: -Developements and tests are done under the following OSs : -- Debian 7 (testing) +Developements and tests are done under the following OSs: +- Debian 7 - Ubuntu 12.10 - Windows XP/7/8 And following IDEs/Compilers -- GCC 4.7.x with a provided Makefile +- GCC 4.7.2 with a provided Makefile - Eclipse CDT under Linux, using the provided Makefile -- Visual Studio Express 2008/2010/2012 for testing compatibility purpose +- Visual Studio Express 2008/2010/2012/2013 for testing compatibility purpose -### Dependencies: +### Dependencies - a STL implementation (even an old one, like the one provided with VC6 should work) - exception support (the class Exception inherit from std::runtime_error) @@ -61,7 +61,7 @@ And following IDEs/Compilers or by adding its source file in your project code base (source code provided in src/sqlite3 for Windows), with the SQLITE_ENABLE_COLUMN_METADATA macro defined (see http://www.sqlite.org/compile.html#enable_column_metadata). -### Installation: +### Installation To use this wrappers, you need to add the 10 SQLiteC++ source files from the src/ directory in your project code base, and compile/link against the sqlite library. @@ -142,7 +142,7 @@ in a custom shared pointer (See the inner class "Statement::Ptr"). ### License -Copyright (c) 2012-2013 Sébastien Rombauts (sebastien.rombauts@gmail.com) +Copyright (c) 2012-2014 Sébastien Rombauts (sebastien.rombauts@gmail.com) Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt or copy at http://opensource.org/licenses/MIT)