From 2c316e3037228223164adf5cd3446cf47f1744a4 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 31 Oct 2024 22:50:43 +0900 Subject: CMake conversion Signed-off-by: Michele Calgaro --- src/backends/CMakeLists.txt | 31 +++++++++++++++++++++++++++++++ src/backends/MySQL/CMakeLists.txt | 12 ++++++++++++ src/backends/PostgreSQL/CMakeLists.txt | 16 ++++++++++++++++ src/backends/SQLite/CMakeLists.txt | 13 +++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 src/backends/CMakeLists.txt create mode 100644 src/backends/MySQL/CMakeLists.txt create mode 100644 src/backends/PostgreSQL/CMakeLists.txt create mode 100644 src/backends/SQLite/CMakeLists.txt (limited to 'src/backends') diff --git a/src/backends/CMakeLists.txt b/src/backends/CMakeLists.txt new file mode 100644 index 0000000..42ba0e8 --- /dev/null +++ b/src/backends/CMakeLists.txt @@ -0,0 +1,31 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### subfolders + +tde_conditional_add_subdirectory( WITH_MYSQL MySQL ) +tde_conditional_add_subdirectory( WITH_POSTGRESQL PostgreSQL ) +tde_conditional_add_subdirectory( WITH_SQLITE3 SQLite ) + + +##### krecipesdbs (static) + +# backend libraries list +set( BACKEND_LIBRARIES "" ) +if( WITH_MYSQL ) + list( APPEND BACKEND_LIBRARIES "krecmysql-static" ) +endif( ) +if( WITH_POSTGRESQL ) + list( APPEND BACKEND_LIBRARIES "krecpsql-static" ) +endif( ) +if( WITH_SQLITE3 ) + list( APPEND BACKEND_LIBRARIES "krecsqlite-static" ) +endif( ) + +tde_add_library( krecipesdbs STATIC_PIC AUTOMOC + SOURCES recipedb.cpp qsqlrecipedb.cpp progressinterface.cpp + LINK ${BACKEND_LIBRARIES} +) diff --git a/src/backends/MySQL/CMakeLists.txt b/src/backends/MySQL/CMakeLists.txt new file mode 100644 index 0000000..60d9a0c --- /dev/null +++ b/src/backends/MySQL/CMakeLists.txt @@ -0,0 +1,12 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### krecmysql (static) + +tde_add_library( krecmysql STATIC_PIC AUTOMOC + SOURCES mysqlrecipedb.cpp + LINK krecipesdbs-static ${MYSQL_LIBRARIES} +) diff --git a/src/backends/PostgreSQL/CMakeLists.txt b/src/backends/PostgreSQL/CMakeLists.txt new file mode 100644 index 0000000..fa825e0 --- /dev/null +++ b/src/backends/PostgreSQL/CMakeLists.txt @@ -0,0 +1,16 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) + +link_directories( + ${LIBPQ_LIBRARY_DIRS} +) + +##### krecpsql (static) + +tde_add_library( krecpsql STATIC_PIC AUTOMOC + SOURCES psqlrecipedb.cpp + LINK krecipesdbs-static ${LIBPQ_LIBRARIES} +) + diff --git a/src/backends/SQLite/CMakeLists.txt b/src/backends/SQLite/CMakeLists.txt new file mode 100644 index 0000000..c039413 --- /dev/null +++ b/src/backends/SQLite/CMakeLists.txt @@ -0,0 +1,13 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) + + +##### krecsqlite (static) + +tde_add_library( krecsqlite STATIC_PIC AUTOMOC + SOURCES literecipedb.cpp + LINK krecipesdbs-static ${SQLITE3_LIBRARIES} +) + -- cgit v1.2.1