vcpe/CMakeLists.txt

71 lines
1.8 KiB
CMake
Raw Normal View History

CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)
2022-05-10 02:59:51 +00:00
PROJECT(vCPE_project)
OPTION(VCPE_AGENT "Enable vCPE agent test application" OFF)
OPTION(USED_LWIP "PPPoE of LWIP support for vCPE" OFF)
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-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)
OPTION(USED_SQLITE "Add sqlite3 database support for vCPE" OFF)
2022-11-28 09:57:57 +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)
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})
SET(GIT_VERSION ${GIT_TAG})
2022-12-02 02:51:51 +00:00
ENDIF ()
MESSAGE("Version: " ${GIT_VERSION})
2022-05-10 02:59:51 +00:00
2022-12-02 02:51:51 +00:00
IF (USED_LWIP)
LIST(APPEND COMMON_DEFINE "-DLWIP_ON")
2022-12-02 02:51:51 +00:00
ENDIF ()
2022-12-02 02:51:51 +00:00
IF (USED_OPENDHCPD)
LIST(APPEND COMMON_DEFINE "-DOPENDHCPD_ON")
2022-12-02 02:51:51 +00:00
ENDIF ()
2022-12-02 02:51:51 +00:00
IF (USED_OPENDHCPDDNS)
LIST(APPEND COMMON_DEFINE "-DOPENDHCPDDNS_ON")
2022-12-02 02:51:51 +00:00
ENDIF ()
2022-12-02 02:51:51 +00:00
IF (VCPE_AGENT)
MESSAGE("Select Option VCPE_AGENT")
2022-12-02 02:51:51 +00:00
ENDIF ()
2022-12-02 02:51:51 +00:00
IF (USED_LWIP)
MESSAGE("Select Option USED_LWIP")
2022-12-02 02:51:51 +00:00
ENDIF ()
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)
MESSAGE("Select Option USED_OPENDHCPD")
ADD_SUBDIRECTORY(srcs/open_dhcp)
2022-12-02 02:51:51 +00:00
ENDIF ()
2022-12-02 02:51:51 +00:00
IF (USED_OPENDHCPDDNS)
MESSAGE("Select Option USED_OPENDHCPDDNS")
ADD_SUBDIRECTORY(srcs/dual_server)
2022-12-02 02:51:51 +00:00
ENDIF ()
2022-12-02 02:51:51 +00:00
IF (USED_LWIP OR VCPE_AGENT)
ADD_SUBDIRECTORY(srcs/lwip)
2022-12-02 02:51:51 +00:00
ENDIF ()
2022-11-28 09:57:57 +00:00
ADD_SUBDIRECTORY(srcs)
ADD_SUBDIRECTORY(srcs/libs)
ADD_SUBDIRECTORY(srcs/httpserver)