drogonCMS-cmake #20

Merged
sharpetronics merged 3 commits from drogonCMS-cmake into master 2024-01-23 01:37:01 -05:00
19 changed files with 16 additions and 14 deletions

6
.gitignore vendored
View File

@ -68,9 +68,9 @@ m4/lt~obsolete.m4
/drogon_dashboard
/DrogonCMS
vendors/local-api-server/local-drogon-api-server
vendors/local-api-server/test/local-server_test
vendors/simple-reverse-proxy/simple_reverse_proxy
vendors/api-server/DrogonCMS_API_Server
vendors/api-server/test/local-server_test
vendors/simple-reverse-proxy/DrogonCMS_Reverse_Proxy
# Generated Makefile
# (meta build system like autotools,

View File

@ -90,6 +90,7 @@ endif()
# Find packages go here.
find_package(PkgConfig REQUIRED)
find_package(PostgreSQL REQUIRED)
pkg_check_modules(GTK4 REQUIRED gtk4>=4.0)
message("GTK4 include dir: ${GTK4_INCLUDE_DIRS}")
@ -108,15 +109,16 @@ message("ADW Other CFlags: ${ADW_CFLAGS_OTHER}")
# 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})
include_directories(${GTK4_INCLUDE_DIRS} ${ADW_INCLUDE_DIRS} ${PostgreSQL_INCLUDE_DIRS} ${PostgreSQL_SERVER_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/local-api-server/)
add_subdirectory(vendors/api-server/)
add_subdirectory(vendors/simple-reverse-proxy/)
# This is a "default" library, and will match the *** variable setting.
@ -129,7 +131,7 @@ 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} drogon)
target_link_libraries(${PROJECT_NAME} PRIVATE ${GTK4_LIBRARIES} ${ADW_LIBRARIES} PostgreSQL::PostgreSQL)
# Target Compile Options
target_compile_options(${PROJECT_NAME} PRIVATE ${WARNING_LEVELS_GCC} $<$<CONFIG:DEBUG>:${WARNING_LEVELS_GCC_DEBUG}>)

View File

@ -122,7 +122,7 @@ An optional recommendation is Geany IDE.
| Configure | cmake -D CMAKE_BUILD_TYPE=Release | /home/username/Desktop/Local-Development/cplusplus/DrogonCMS/ |
| Build | cmake --build . | /home/username/Desktop/Local-Development/cplusplus/DrogonCMS |
| Run GUI | ./DrogonCMS | /home/username/Desktop/Local-Development/cplusplus/DrogonCMS/ |
| Run API | ./local-drogon-server-api | /home/username/Desktop/Local-Development/cplusplus/DrogonCMS/vendors/drogon/local-api-server/ |
| Run API | ./DrogonCMS-API-Server | /home/username/Desktop/Local-Development/cplusplus/DrogonCMS/vendors/api-server/ |
| Install | cmake --install | /home/username/Desktop/Local-Development/cplusplus/DrogonCMS/ |
## Authors

View File

@ -1,7 +1,7 @@
# Note: drogon_ctl was implemented to create the local template architecture
cmake_minimum_required(VERSION 3.5)
project(local-drogon-api-server CXX)
project(DrogonCMS_API_Server CXX)
include(CheckIncludeFileCXX)

BIN
vendors/api-server/test/local-server_test vendored Executable file

Binary file not shown.

View File

@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.5)
project(simple_reverse_proxy CXX)
project(DrogonCMS_Reverse_Proxy CXX)
include(CheckIncludeFileCXX)
@ -14,7 +14,7 @@ endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_executable(simple_reverse_proxy main.cc)
add_executable(DrogonCMS_Reverse_Proxy main.cc)
##########
# If you include the drogon source code locally in your project, use this method to add drogon
@ -23,13 +23,13 @@ add_executable(simple_reverse_proxy main.cc)
##########
find_package(Drogon CONFIG REQUIRED)
target_link_libraries(simple_reverse_proxy PRIVATE Drogon::Drogon)
target_link_libraries(DrogonCMS_Reverse_Proxy PRIVATE Drogon::Drogon)
if(CMAKE_CXX_STANDARD LESS 17)
#With C++14, use boost to support any and string_view
message(STATUS "use c++14")
find_package(Boost 1.61.0 REQUIRED)
target_include_directories(simple_reverse_proxy PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(DrogonCMS_Reverse_Proxy PRIVATE ${Boost_INCLUDE_DIRS})
else()
message(STATUS "use c++17")
endif()
@ -52,5 +52,5 @@ foreach(cspFile ${SCP_LIST})
set(VIEWSRC ${VIEWSRC} ${classname}.cc)
endforeach()
target_include_directories(simple_reverse_proxy PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/models)
target_sources(simple_reverse_proxy PRIVATE ${SRC_DIR} ${CTL_SRC} ${FILTER_SRC} ${VIEWSRC} ${PLUGIN_SRC} ${MODEL_SRC})
target_include_directories(DrogonCMS_Reverse_Proxy PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/models)
target_sources(DrogonCMS_Reverse_Proxy PRIVATE ${SRC_DIR} ${CTL_SRC} ${FILTER_SRC} ${VIEWSRC} ${PLUGIN_SRC} ${MODEL_SRC})