drogonCMS-cmake #27

Merged
sharpetronics merged 3 commits from drogonCMS-cmake into master 2024-02-23 18:46:28 -05:00
10 changed files with 47 additions and 30 deletions

2
.gitignore vendored
View File

@ -49,6 +49,8 @@ vendors/drogon/trantor/TrantorConfigVersion.cmake
vendors/drogon/trantor/exports/
vendors/database/
postgresql-prefix/
CPM_modules/
_deps/
# https://www.gnu.org/software/libtool/

View File

@ -39,10 +39,12 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# add CPM for C
# add CPM Deps. for C
# Note: only packages that have a CMakeLists.txt..
include(vendors/cmake/CPM_0.38.7.cmake)
#CPMAddPackage("gh:postgres/postgres#7.1.3")
#CPMAddPackage("gh:nlohmann/json@3.10.5")
# This is your project statement. You should always list languages;
# Listing the version is nice here since it sets lots of useful variables
@ -52,6 +54,9 @@ project(
VERSION 1.0.0
)
# Adding something we can run - Output name matches target name
add_executable(DrogonCMS src/base.c)
#===============================================================================
# Setting compilation flags for various compilers and build types:
#===============================================================================
@ -110,35 +115,45 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()
# Find packages go here.
# Find PkgConfig.
find_package(PkgConfig REQUIRED)
find_package(PostgreSQL REQUIRED)
pkg_check_modules(GTK4 REQUIRED gtk4>=4.0)
message("GTK4 include dir: ${GTK4_INCLUDE_DIRS}")
message("GTK4 libraries: ${GTK4_LIBRARY_DIRS}")
message("GTK4 Other CFlags: ${GTK4_CFLAGS_OTHER}")
message("GTK4 other Cflags: ${GTK4_CFLAGS_OTHER}")
pkg_check_modules(ADW REQUIRED libadwaita-1>=1.3.5)
message("ADW include dir: ${ADW_INCLUDE_DIRS}")
message("ADW libraries: ${ADW_LIBRARY_DIRS}")
message("ADW Other CFlags: ${ADW_CFLAGS_OTHER}")
message("ADW other Cflags: ${ADW_CFLAGS_OTHER}")
#pkg_check_modules(SSL REQUIRED openssl>=3.1.2)
#message("SSL libraries: ${SSL_LIBRARY_DIRS}")
#pkg_check_modules(SSL REQUIRED zlib>=1.3)
# Make use of PostgreSQL if FOUND, else use SQLite3
find_package (PostgreSQL)
if (PostgreSQL_FOUND)
message("POSTGRESQL include dir: ${PostgreSQL_INCLUDE_DIRS}")
message("POSTGRESQL libraries: ${PostgreSQL_LIBRARIES}")
include_directories(${PostgreSQL_INCLUDE_DIRS} ${PostgreSQL_SERVER_INCLUDE_DIRS})
target_link_libraries (${PROJECT_NAME} PUBLIC ${PostgreSQL_LIBRARIES})
#pkg_check_modules(SQLite3 REQUIRED sqlite3>=3.43.1)
elseif (SQLITE3_FOUND)
find_package (SQLite3)
message("SQLITE3 include dir: ${SQLITE3_INCLUDE_DIRS}")
message("SQLITE3 libraries: ${SQLITE3_LIBRARIES}")
include_directories(${SQLITE3_INCLUDE_DIRS})
target_link_libraries (${PROJECT_NAME} PUBLIC ${SQLITE3_LIBRARIES})
endif (PostgreSQL_FOUND)
# Setup CMake to use GTK+, tell the compiler where to look for headers
# and to the linker where to look for libraries
include_directories(${GTK4_INCLUDE_DIRS} ${ADW_INCLUDE_DIRS} ${PostgreSQL_INCLUDE_DIRS} ${PostgreSQL_SERVER_INCLUDE_DIRS})
include_directories(${GTK4_INCLUDE_DIRS} ${ADW_INCLUDE_DIRS})
link_directories(${GTK4_LIBRARY_DIRS} ${ADW_LIBRARY_DIRS})
add_definitions(${GTK4_CFLAGS_OTHER} ${ADW_CFLAGS_OTHER})
# Adding something we can run - Output name matches target name
add_executable(DrogonCMS src/base.c)
#add_executable(PG_Store vendors/postgresql-db/main.cc)
# Include drogon source code locally
add_subdirectory(vendors/api-server/)
add_subdirectory(vendors/simple-reverse-proxy/)
@ -153,16 +168,11 @@ add_subdirectory(vendors/simple-reverse-proxy/)
# Make sure you link your targets with this command. It can also link libraries and
# even flags, so linking a target that does not exist will not give a configure-time error.
target_include_directories(${PROJECT_NAME} PUBLIC ${GTK4_LIBRARIES} ${ADW_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PRIVATE ${GTK4_LIBRARIES} ${ADW_LIBRARIES} PostgreSQL::PostgreSQL)
target_link_libraries(${PROJECT_NAME} PRIVATE ${GTK4_LIBRARIES} ${ADW_LIBRARIES})
# Target Compile Options
target_compile_options(${PROJECT_NAME} PRIVATE ${WARNING_LEVELS_GCC} $<$<CONFIG:DEBUG>:${WARNING_LEVELS_GCC_DEBUG}>)
# This part is so the Modern CMake book can verify this example builds. For your code,
# you'll probably want tests too
enable_testing()
#add_test(NAME MyExample COMMAND MyExample)
#===============================================================================
# Package generation:
#===============================================================================

View File

@ -34,7 +34,6 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <stdio.h>
/*#include <drogon/drogon.h>*/
/*
Static Variables

View File

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.14.0 -->
<!--License: GPL-3.0-->
<!--License: GPL-3.0
Security: IGSC, FSF-->
<interface domain="https://sharpetronics.com">
<!-- interface-name drogon-dashboard.ui -->
<!-- interface-description A secure Drogon dashboard for managing content from a Drogon web server.

View File

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.14.0 -->
<!--License: GPL-3.0-->
<!--License: GPL-3.0
Security: IGSC, FSF-->
<interface domain="https://sharpetronics.com">
<!-- interface-description A secure Drogon dashboard for managing content from a Drogon web server.

View File

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.14.0 -->
<!--License: GPL-3.0-->
<!--License: GPL-3.0
Security: IGSC, FSF-->
<interface>
<!-- interface-description A secure Drogon dashboard for managing content from a Drogon web server.

View File

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.14.0 -->
<!--License: GPL-3.0-->
<!--License: GPL-3.0
Security: IGSC, FSF-->
<interface>
<!-- interface-name database-configure.ui -->
<!-- interface-description A secure Drogon dashboard for managing content from a Drogon web server.

View File

@ -2,12 +2,12 @@
<!DOCTYPE cambalache-project SYSTEM "cambalache-project.dtd">
<cambalache-project version="0.13.1" target_tk="gtk-4.0">
<ui>
(1,None,"drogon-dashboard.ui","admin-dashboard.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe admin dashboard after login user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,"https://sharpetronics.com","License: GPL-3.0",None),
(2,None,None,"login.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe login user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,"https://sharpetronics.com","License: GPL-3.0",None),
(3,None,None,"admin-register.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe admin user registration user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,"https://sharpetronics.com","License: GPL-3.0",None),
(4,None,None,"password-recovery.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe password recovery user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,None,"License: GPL-3.0",None),
(6,None,None,"content-manager.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe content manager user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,None,"License: GPL-3.0",None),
(8,None,"database-configure.ui","database-configure.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe admin user registration user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,None,"License: GPL-3.0",None)
(1,None,"drogon-dashboard.ui","admin-dashboard.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe admin dashboard after login user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,"https://sharpetronics.com","License: GPL-3.0\nSecurity: IGSC, FSF",None),
(2,None,None,"login.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe login user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,"https://sharpetronics.com","License: GPL-3.0\nSecurity: IGSC, FSF",None),
(3,None,None,"admin-register.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe admin user registration user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,"https://sharpetronics.com","License: GPL-3.0\nSecurity: IGSC, FSF",None),
(4,None,None,"password-recovery.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe password recovery user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,None,"License: GPL-3.0\nSecurity: IGSC, FSF",None),
(6,None,None,"content-manager.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe content manager user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,None,"License: GPL-3.0\nSecurity: IGSC, FSF",None),
(8,None,"database-configure.ui","database-configure.ui","A secure Drogon dashboard for managing content from a Drogon web server.\n\nThe admin user registration user interface.","SharpeTronics, LLC.","SharpeTronics, LLC.\noDinZu WenKi",None,None,"License: GPL-3.0\nSecurity: IGSC, FSF",None)
</ui>
<ui_library>
(7,"gtk","4.6",None),

View File

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.14.0 -->
<!--License: GPL-3.0-->
<!--License: GPL-3.0
Security: IGSC, FSF-->
<interface domain="https://sharpetronics.com">
<!-- interface-description A secure Drogon dashboard for managing content from a Drogon web server.

View File

@ -1,6 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.14.0 -->
<!--License: GPL-3.0-->
<!--License: GPL-3.0
Security: IGSC, FSF-->
<interface>
<!-- interface-description A secure Drogon dashboard for managing content from a Drogon web server.