vcpe/CMakeLists.txt

52 lines
1.2 KiB
CMake

CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)
PROJECT(vCPE_project)
OPTION(VCPE_AGENT "Enable vCPE agent test application" OFF)
OPTION(USED_LWIP "PPPoE for vCPE" OFF)
OPTION(USED_OPENDHCPD "DHCP server for vCPE" OFF)
SET(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig")
SET(URI_HOME "${CMAKE_SOURCE_DIR}/libs")
EXECUTE_PROCESS(COMMAND git describe --tags --always --dirty=-dev
OUTPUT_VARIABLE GIT_TAG)
if ("${GIT_TAG}" STREQUAL "")
STRING(TIMESTAMP COMPILE_TIME %Y-%m-%d_%H:%M:%S)
SET(GIT_VERSION ${COMPILE_TIME})
else ()
STRING(REGEX REPLACE "\n$" "" GIT_TAG ${GIT_TAG})
SET(GIT_VERSION ${GIT_TAG})
endif ()
MESSAGE("Version: " ${GIT_VERSION})
ADD_SUBDIRECTORY(srcs)
ADD_SUBDIRECTORY(srcs/libs)
if (VCPE_AGENT)
MESSAGE("Select Option VCPE_AGENT")
endif ()
if (USED_LWIP)
MESSAGE("Select Option USED_LWIP")
endif ()
if (USED_OPENDHCPD)
MESSAGE("Select Option USED_OPENDHCPD")
ADD_SUBDIRECTORY(srcs/open_dhcp)
endif ()
if (USED_OPENDHCPDDNS)
MESSAGE("Select Option USED_OPENDHCPDDNS")
ADD_SUBDIRECTORY(srcs/dual_server)
endif ()
if (USED_LWIP OR VCPE_AGENT)
ADD_SUBDIRECTORY(srcs/lwip)
endif ()
ADD_SUBDIRECTORY(srcs/httpserver)