OCT 1. 增加工程版本信息

This commit is contained in:
huangxin 2022-12-14 10:16:10 +08:00
parent a6bc3c38e9
commit 346d9ec245
8 changed files with 55 additions and 8 deletions

View File

@ -1,6 +1,8 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)
PROJECT(vCPE_project)
PROJECT(vCPE VERSION "1.0.0")
CONFIGURE_FILE(prj_config.h.in prj_config.h)
OPTION(VCPE_AGENT "Enable vCPE agent test application" OFF)
OPTION(USED_LWIP "PPPoE of LWIP support for vCPE" OFF)

14
prj_config.h.in Normal file
View File

@ -0,0 +1,14 @@
//
// Created by xajhuang on 2022/12/14.
//
#ifndef VCPE_PRG_CONFIG_H_IN
#define VCPE_PRG_CONFIG_H_IN
#define VCPE_PROJECT_NAME "@PROJECT_NAME@"
#define VCPE_PROJECT_VER "@PROJECT_VERSION@"
#define VCPE_PROJECT_VER_MAJOR "@PROJECT_VERSION_MAJOR@"
#define VCPE_PROJECT_VER_MINOR "@PROJECT_VERSION_MINOR@"
#define VCPE_PTOJECT_VER_PATCH "@PROJECT_VERSION_PATCH@"
#endif //VCPE_PRG_CONFIG_H_IN

View File

@ -57,6 +57,7 @@ ENDIF ()
TARGET_LINK_LIBRARIES(${PROJECT_TARGET} common)
TARGET_LINK_LIBRARIES(${PROJECT_TARGET} ${COMMON_LIBS})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_TARGET} PUBLIC ${PROJECT_BINARY_DIR}/../)
IF (VCPE_AGENT)
TARGET_LINK_LIBRARIES(${PROJECT_TARGET_AGENT} common ${COMMON_LIBS})

View File

@ -1,11 +1,14 @@
SET(LIB_PROJECT_TARGET common)
PROJECT(${LIB_PROJECT_TARGET})
PROJECT(${LIB_PROJECT_TARGET} VERSION 1.1.0)
CONFIGURE_FILE(lib_config.h.in lib_config.h)
INCLUDE_DIRECTORIES(include
./ ./include ../lwip/src/include ../lwip/src/arch_linux/include ../include
../httpserver/include ../httpserver/src/haywire ../httpserver/src/haywire/configuration)
FILE(GLOB C_HEADS include/*.h include/uthash/*.h include/s2j/*.h vector/*.h)
../httpserver/include ../httpserver/src/haywire ../httpserver/src/haywire/configuration
${PROJECT_BINARY_DIR}/srcs/libs)
FILE(GLOB C_HEADS include/*.h include/uthash/*.h include/s2j/*.h vector/*.h ${PROJECT_BINARY_DIR}/srcs/libs/*.h)
AUX_SOURCE_DIRECTORY(json C_SRC)
@ -54,4 +57,9 @@ LINK_LIBRARIES(${COMMON_LIBS})
ADD_LIBRARY(${LIB_PROJECT_TARGET} ${C_SRC} ${C_HEADS})
TARGET_LINK_LIBRARIES(${LIB_PROJECT_TARGET} haywire)
TARGET_LINK_LIBRARIES(${LIB_PROJECT_TARGET} opendhcpd)
TARGET_LINK_LIBRARIES(${LIB_PROJECT_TARGET} opendhcpd)
#TARGET_INCLUDE_DIRECTORIES(${LIB_PROJECT_TARGET} PUBLIC "${PROJECT_BINARY_DIR}/srcs/libs")
TARGET_INCLUDE_DIRECTORIES(${LIB_PROJECT_TARGET} PUBLIC ${PROJECT_BINARY_DIR}/)
MESSAGE(+++++++++++++++++++${PROJECT_BINARY_DIR})

View File

@ -13210,7 +13210,7 @@ struct fts5_api {
** autoconf-based build
*/
#if defined(_HAVE_SQLITE_CONFIG_H) && !defined(SQLITECONFIG_H)
#include "config.h"
#include "./config.h"
#define SQLITECONFIG_H 1
#endif
@ -21062,7 +21062,7 @@ SQLITE_API extern int sqlite3_open_file_count;
** autoconf-based build
*/
#if defined(_HAVE_SQLITE_CONFIG_H) && !defined(SQLITECONFIG_H)
/* #include "config.h" */
/* #include "./config.h" */
#define SQLITECONFIG_H 1
#endif

View File

@ -18,6 +18,7 @@
#include "msg_queue.h"
#include "http_svr.h"
#include "haywire.h"
#include "lib_config.h"
#define DEFAULT_CONFIG_FILE ("vcpe.cfg")
#define DEFAULT_CONFIG_DIR ("config")
@ -93,7 +94,9 @@ int user_init(const char *pAppCfgFile, const char *pCfgDirectory, const char *pK
return -ERR_CONFIG_INIT;
}
dzlog_info("Application information: %s (Build: %s %s GCC Ver:%s) With %lu(bits) OS\n",
dzlog_info("%s library version %s information: %s (Build: %s %s GCC Ver:%s) With %lu(bits) OS\n",
VCPE_LIB_NAME,
VCPE_LIB_VER,
BUILD_VERSION,
__DATE__,
__TIME__,

14
srcs/libs/lib_config.h.in Normal file
View File

@ -0,0 +1,14 @@
//
// Created by xajhuang on 2022/12/14.
//
#ifndef VCPE_LIB_CONFIG_H_IN
#define VCPE_LIB_CONFIG_H_IN
#define VCPE_LIB_NAME "@PROJECT_NAME@"
#define VCPE_LIB_VER "@PROJECT_VERSION@"
#define VCPE_LIB_VER_MAJOR "@PROJECT_VERSION_MAJOR@"
#define VCPE_LIB_VER_MINOR "@PROJECT_VERSION_MINOR@"
#define VCPE_LIB_VER_PATCH "@PROJECT_VERSION_PATCH@"
#endif //VCPE_LIB_CONFIG_H_IN

View File

@ -8,6 +8,9 @@
#include "cmdline.h"
#include "task_manager.h"
#include "init.h"
#include "prj_config.h"
#if LWIP_ON
#include "user_info.h"
#include "lwip/tcpip.h"
@ -63,6 +66,8 @@ int main(int argc, char **argv) {
#else
uv_setup_args(argc, argv);
printf("Application %s version %s\n", VCPE_PROJECT_NAME, VCPE_PROJECT_VER);
setvbuf(stdout, NULL, _IONBF, 0);
ret = menu_run(argc, argv);