2022-09-21 07:55:05 +00:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)
|
2022-05-10 02:59:51 +00:00
|
|
|
|
2022-12-14 02:16:10 +00:00
|
|
|
PROJECT(vCPE VERSION "1.0.0")
|
|
|
|
|
|
|
|
CONFIGURE_FILE(prj_config.h.in prj_config.h)
|
2022-05-10 02:59:51 +00:00
|
|
|
|
2022-09-19 01:53:11 +00:00
|
|
|
OPTION(VCPE_AGENT "Enable vCPE agent test application" OFF)
|
2022-11-29 06:32:13 +00:00
|
|
|
OPTION(USED_LWIP "PPPoE of LWIP support for vCPE" OFF)
|
2022-11-29 08:30:29 +00:00
|
|
|
OPTION(USED_OPENDHCPD "DHCP server for vCPE" OFF)
|
2022-11-28 09:57:57 +00:00
|
|
|
OPTION(USED_OPENDHCPDDNS "DHCP And DNS server for vCPE" OFF)
|
|
|
|
|
2022-11-29 06:32:13 +00:00
|
|
|
# 数据库开关
|
2022-11-28 09:57:57 +00:00
|
|
|
OPTION(USED_REDIS "Add redis database support for vCPE" OFF)
|
|
|
|
OPTION(USED_MYSQL "Add mysql database support for vCPE" OFF)
|
2022-11-29 08:30:29 +00:00
|
|
|
OPTION(USED_SQLITE "Add sqlite3 database support for vCPE" OFF)
|
2022-11-28 09:57:57 +00:00
|
|
|
|
2022-09-19 01:53:11 +00:00
|
|
|
SET(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig")
|
2022-05-10 02:59:51 +00:00
|
|
|
SET(URI_HOME "${CMAKE_SOURCE_DIR}/libs")
|
|
|
|
|
|
|
|
EXECUTE_PROCESS(COMMAND git describe --tags --always --dirty=-dev
|
2022-12-02 02:51:51 +00:00
|
|
|
OUTPUT_VARIABLE GIT_TAG)
|
2022-05-10 02:59:51 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF ("${GIT_TAG}" STREQUAL "")
|
2022-05-10 02:59:51 +00:00
|
|
|
STRING(TIMESTAMP COMPILE_TIME %Y-%m-%d_%H:%M:%S)
|
2022-06-28 09:45:56 +00:00
|
|
|
SET(GIT_VERSION ${COMPILE_TIME})
|
2022-12-02 02:51:51 +00:00
|
|
|
ELSE ()
|
2022-05-10 02:59:51 +00:00
|
|
|
STRING(REGEX REPLACE "\n$" "" GIT_TAG ${GIT_TAG})
|
2022-06-28 09:47:36 +00:00
|
|
|
SET(GIT_VERSION ${GIT_TAG})
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-06-10 09:03:27 +00:00
|
|
|
|
2022-06-28 09:45:56 +00:00
|
|
|
MESSAGE("Version: " ${GIT_VERSION})
|
2022-05-10 02:59:51 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_LWIP)
|
2022-11-16 02:36:28 +00:00
|
|
|
LIST(APPEND COMMON_DEFINE "-DLWIP_ON")
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-11-16 02:36:28 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_OPENDHCPD)
|
2022-11-16 02:36:28 +00:00
|
|
|
LIST(APPEND COMMON_DEFINE "-DOPENDHCPD_ON")
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-11-16 02:36:28 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_OPENDHCPDDNS)
|
2022-11-16 02:36:28 +00:00
|
|
|
LIST(APPEND COMMON_DEFINE "-DOPENDHCPDDNS_ON")
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-11-16 02:36:28 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (VCPE_AGENT)
|
2022-09-19 01:53:11 +00:00
|
|
|
MESSAGE("Select Option VCPE_AGENT")
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-09-19 01:53:11 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_LWIP)
|
2022-09-19 01:53:11 +00:00
|
|
|
MESSAGE("Select Option USED_LWIP")
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-09-19 01:53:11 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_SQLITE)
|
2022-11-28 09:57:57 +00:00
|
|
|
MESSAGE("Select Option USED_SQLITE")
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-11-28 09:57:57 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_OPENDHCPD)
|
2022-09-19 01:53:11 +00:00
|
|
|
MESSAGE("Select Option USED_OPENDHCPD")
|
|
|
|
ADD_SUBDIRECTORY(srcs/open_dhcp)
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-09-27 09:43:16 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_OPENDHCPDDNS)
|
2022-10-28 07:37:01 +00:00
|
|
|
MESSAGE("Select Option USED_OPENDHCPDDNS")
|
|
|
|
ADD_SUBDIRECTORY(srcs/dual_server)
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-10-28 07:37:01 +00:00
|
|
|
|
2022-12-02 02:51:51 +00:00
|
|
|
IF (USED_LWIP OR VCPE_AGENT)
|
2022-09-27 09:43:16 +00:00
|
|
|
ADD_SUBDIRECTORY(srcs/lwip)
|
2022-12-02 02:51:51 +00:00
|
|
|
ENDIF ()
|
2022-11-07 06:21:24 +00:00
|
|
|
|
2022-11-28 09:57:57 +00:00
|
|
|
ADD_SUBDIRECTORY(srcs)
|
|
|
|
ADD_SUBDIRECTORY(srcs/libs)
|
|
|
|
ADD_SUBDIRECTORY(srcs/httpserver)
|