1
0
mirror of https://github.com/rtbrick/bngblaster.git synced 2024-05-06 15:54:57 +00:00
rtbrick-bngblaster/CMakeLists.txt

53 lines
1.5 KiB
CMake
Raw Normal View History

2021-02-04 21:56:56 +01:00
# BNG Blaster
#
# For Debug Build Try below command
2021-02-04 21:56:56 +01:00
#cmake -DCMAKE_BUILD_TYPE=Debug .
2021-05-26 19:39:12 +02:00
cmake_minimum_required (VERSION 3.10)
2021-02-05 16:00:09 +01:00
project(bngblaster LANGUAGES C VERSION 0.0.0)
2022-03-09 14:25:59 +01:00
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
message(FATAL_ERROR "Host ${CMAKE_SYSTEM_NAME} is not supported!")
endif()
2022-03-09 15:50:43 +01:00
message("Compiler: ${CMAKE_C_COMPILER_ID} Version: ${CMAKE_C_COMPILER_VERSION}")
2021-02-05 16:00:09 +01:00
option(BNGBLASTER_TESTS "Build unit tests (requires cmocka)" OFF)
option(BNGBLASTER_NETMAP "Build with netmap support" OFF)
2021-02-04 21:56:56 +01:00
2021-05-26 19:39:12 +02:00
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
2021-02-04 21:56:56 +01:00
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("Debug Build")
set(CMAKE_BUILD_TYPE Debug)
add_definitions(-DBBL_DEBUG)
else()
message("Release Build")
set(CMAKE_BUILD_TYPE Release)
endif()
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE)
endif()
2021-02-04 21:56:56 +01:00
# libdict will be statically linked
2021-02-04 21:56:56 +01:00
find_library(libdict NAMES libdict.a REQUIRED)
if(BNGBLASTER_TESTS)
include(CTest)
endif()
add_subdirectory(code)
2021-02-04 21:56:56 +01:00
set(CPACK_GENERATOR "DEB")
2021-02-05 16:06:35 +01:00
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1, libncurses5, libjansson4")
2021-02-04 21:56:56 +01:00
set(CPACK_DEBIAN_LIB_PACKAGE_NAME "bngblaster")
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
2021-02-05 16:06:35 +01:00
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "RtBrick BNG Blaster")
2021-02-04 21:56:56 +01:00
set(CPACK_PACKAGE_CONTACT "RtBrick <bngblaster@rtbrick.com>")
2021-02-05 11:28:18 +01:00
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/rtbrick/bngblaster")
2021-02-05 16:00:09 +01:00
if (NOT DEFINED BNGBLASTER_VERSION)
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
else()
set(CPACK_PACKAGE_VERSION ${BNGBLASTER_VERSION})
endif()
include(CPack)