|
1 | | -# Example CMake file for compiling & linking a project with the the SQLiteCpp wrapper |
2 | | -# |
3 | | -# Copyright (c) 2012-2023 Sebastien Rombauts ([email protected]) |
4 | | -# |
5 | | -# Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt |
6 | | -# or copy at http://opensource.org/licenses/MIT) |
7 | | -cmake_minimum_required(VERSION 3.1) # for "CMAKE_CXX_STANDARD" version |
8 | | -project(SQLiteCpp_Example VERSION 2.0) |
9 | | - |
10 | | -# SQLiteC++ 3.x now requires C++11 compiler |
11 | | -set(CMAKE_CXX_STANDARD 11) |
12 | | -set(CMAKE_CXX_STANDARD_REQUIRED ON) |
13 | | - |
14 | | -# Add SQLite3 C++ wrapper around sqlite3 library (and sqlite3 itself provided for ease of use) |
15 | | -# Here you can set CMake variables to avoid building Example, as well as cpplint, cppcheck... |
16 | | -# or set them in the cmake command line (see for instance provided build.bat/build.sh scripts) |
17 | | -set(SQLITECPP_RUN_CPPCHECK OFF CACHE BOOL "" FORCE) |
18 | | -set(SQLITECPP_RUN_CPPLINT OFF CACHE BOOL "" FORCE) |
19 | | -set(SQLITECPP_USE_STATIC_RUNTIME OFF CACHE BOOL "" FORCE) |
20 | | -add_subdirectory(../.. SQLiteCpp) # out-of-source build requires explicit subdir name for compilation artifacts |
21 | | - |
22 | | -# Add main.cpp example source code to the executable |
23 | | -add_executable(SQLiteCpp_Example src/main.cpp) |
24 | | - |
25 | | -# Link SQLiteCpp_example1 with SQLiteCpp |
26 | | -target_link_libraries(SQLiteCpp_Example SQLiteCpp) |
| 1 | +# Example CMake file for compiling & linking a project with the the SQLiteCpp wrapper |
| 2 | +# |
| 3 | +# Copyright (c) 2012-2023 Sebastien Rombauts ([email protected]) |
| 4 | +# |
| 5 | +# Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt |
| 6 | +# or copy at http://opensource.org/licenses/MIT) |
| 7 | +cmake_minimum_required(VERSION 3.5...4.0) |
| 8 | +project(SQLiteCpp_Example VERSION 2.0) |
| 9 | + |
| 10 | +# SQLiteC++ 3.x now requires C++11 compiler |
| 11 | +set(CMAKE_CXX_STANDARD 11) |
| 12 | +set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 13 | + |
| 14 | +# Add SQLite3 C++ wrapper around sqlite3 library (and sqlite3 itself provided for ease of use) |
| 15 | +# Here you can set CMake variables to avoid building Example, as well as cpplint, cppcheck... |
| 16 | +# or set them in the cmake command line (see for instance provided build.bat/build.sh scripts) |
| 17 | +set(SQLITECPP_RUN_CPPCHECK OFF CACHE BOOL "" FORCE) |
| 18 | +set(SQLITECPP_RUN_CPPLINT OFF CACHE BOOL "" FORCE) |
| 19 | +set(SQLITECPP_USE_STATIC_RUNTIME OFF CACHE BOOL "" FORCE) |
| 20 | +add_subdirectory(../.. SQLiteCpp) # out-of-source build requires explicit subdir name for compilation artifacts |
| 21 | + |
| 22 | +# Add main.cpp example source code to the executable |
| 23 | +add_executable(SQLiteCpp_Example src/main.cpp) |
| 24 | + |
| 25 | +# Link SQLiteCpp_example1 with SQLiteCpp |
| 26 | +target_link_libraries(SQLiteCpp_Example SQLiteCpp) |
0 commit comments