You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use cmake, there are two supported ways how to use it with cmake (if another works as well or should be supported, open an issue).
770
775
771
-
then you can just include `sqlite_orm.h` that is installed in system-wide header files location or in case you use cmake build system you can just add below commands in CMakeLists.txt
776
+
Either way you choose, the include path as well as the dependency sqlite3 will be set automatically on your target. So usage is straight forward, but you need to have installed sqlite3 on your system (see Requirements below)
777
+
778
+
## Find Package
779
+
780
+
If you have installed the lib system wide and it's in your PATH, you can use find_package to include it in cmake. It will make a target `sqlite_orm::sqlite_orm` available which you can link against. Have a look at examples/find_package for a full example.
Or just put `include/sqlite_orm/sqlite_orm.h` into you folder with headers. Also it is recommended to keep project libraries' sources in separate folders cause there is no dominant normal dependency manager for C++ yet.
788
+
## Fetch Content (Recommended)
789
+
790
+
Alternatively, cmake can download the project directly from github during configure stage and therefore you don't need to install the lib before.
791
+
Againt a target `sqlite_orm::sqlite_orm` will be available which you can link against. Have a look at examples/fetch_content for a full example.
792
+
793
+
## No CMake
794
+
795
+
If you want to use the lib directly with Make or something else, just set the inlcude path correctly (should be correct on Linux already), so `sqlite_orm/sqlite_orm.h` is found. As this is a header only lib, there is nothing more you have to do.
780
796
781
797
# Requirements
782
798
783
799
* C++14 compatible compiler (not C++11 cause of templated lambdas in the lib).
784
-
* libsqlite3 linked to your binary
800
+
* Sqlite3 installed on your system and in the path, so cmake can find it (or linked to you project if you don't use cmake)
801
+
802
+
# Video from conference
803
+
804
+
[](https://www.youtube.com/watch?v=ngsilquWgpo)
805
+
806
+
# SqliteMan
807
+
808
+
In case you need a native SQLite client for macOS or Windows 10 you can use SqliteMan https://sqliteman.dev. It is not a commercial. It is a free native client being developed by the maintainer of this repo.
* add `static_assert` in crud `get*` functions in case user passes `where_t` instead of id to make compilation error more clear (example https://github.com/fnc12/sqlite_orm/issues/485)
0 commit comments