diff --git a/CMakeLists.txt b/CMakeLists.txt index e251275..a4258ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,11 +2,14 @@ cmake_minimum_required(VERSION 3.30) project(hardwareDB VERSION 0.0.1) # set(SOURCE_FILES main.cpp) +# find_package(SQLite3) # This is used when building against the system library target_link_libraries below + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/lists) add_executable(${PROJECT_NAME} src/main.cpp) +# target_link_libraries(${PROJECT_NAME} SQLite::SQLite3) # This targets the system sqlite3 -add_subdirectory(lib) +add_subdirectory(lib) #This will build the sqlite3 lib from source diff --git a/src/main.cpp b/src/main.cpp index 452a062..ec532f1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,17 +10,17 @@ #include // Begin testing of SQLite3 -// static int createDB(const char* s); -// static int createTable(const char* s); +static int createDB(const char* s); +static int createTable(const char* s); int main() { - // const char* dbfile = "hardware.db"; - // sqlite3* hardwareDB; + const char* dir = "hardware.db"; + sqlite3* hardwareDB; - // createDB(dbfile); - // createTable(dbfile); + createDB(dir); + // createTable(dir); @@ -50,3 +50,16 @@ int main() { system("sleep 1s"); return 0; } + +static int createDB(const char* s) { + + sqlite3* hardwareDB; + int exit = 0; + + exit = sqlite3_open(s, &hardwareDB); + + sqlite3_close(hardwareDB); + + return 0; +} +