mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 09:46:02 -04:00
Adding a basic CMake configuration file
This commit is contained in:
parent
aeea5c4e6d
commit
a02c80d157
12
CMakeLists.txt
Normal file
12
CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
project (SQLiteCpp)
|
||||
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 -Wsuggest-attribute=noreturn)
|
||||
add_library(SQLiteCpp
|
||||
src/Column.cpp
|
||||
src/Database.cpp
|
||||
src/Statement.cpp
|
||||
src/Transaction.cpp
|
||||
)
|
||||
add_executable(example1 examples/example1/main.cpp)
|
||||
target_link_libraries (example1 SQLiteCpp sqlite3)
|
||||
|
2
Makefile
2
Makefile
@ -51,7 +51,7 @@ $(BUILD): $(BUILD)/
|
||||
|
||||
|
||||
$(BUILD)/example1: $(SQLITE_EXAMPLE1_OBJECTS)
|
||||
$(CXX) -o $@ $(SQLITE_EXAMPLE1_OBJECTS) $(LINK_FLAGS) -lsqlite3 -lpthread
|
||||
$(CXX) -o $@ $(SQLITE_EXAMPLE1_OBJECTS) $(LINK_FLAGS) -lsqlite3
|
||||
|
||||
|
||||
$(BUILD)/main.o: examples/example1/main.cpp
|
||||
|
19
README.md
19
README.md
@ -79,6 +79,25 @@ in a custom shared pointer (See the inner class "Statement::Ptr").
|
||||
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.
|
||||
|
||||
### Buildng the examples:
|
||||
|
||||
A basic Makefile is provided, tested under Linux/Ubuntu 12.10, requiring the sqlite3 static library (sqlite3-dev Debian/Ubuntu package)
|
||||
Solutions for Visual Studio 2008 and 2010 are provided in the "msvc/" directory, directly using the sqlite3.c source code for ease of use.
|
||||
|
||||
#### CMake
|
||||
A CMake configuration file is also provided for other platform support.
|
||||
Generating the Linux Makefile and building in Debug:
|
||||
mkdir Debug
|
||||
cd Debug
|
||||
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug
|
||||
make -j
|
||||
|
||||
And for the Release version:
|
||||
mkdir Release
|
||||
cd Release
|
||||
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
|
||||
make -j
|
||||
|
||||
### License
|
||||
|
||||
Copyright (c) 2012-2013 Sébastien Rombauts (sebastien.rombauts@gmail.com)
|
||||
|
Loading…
x
Reference in New Issue
Block a user