# Copyright © 2013 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Authored by: Thomas Voss cmake_minimum_required(VERSION 3.10) project(net-cpp VERSION 3.2.0) set(NET_CPP_SOVERSION 2 CACHE STRING "The version number from libnet-cpp's SONAME") option(ENABLE_WERROR "Treat all build warnings as errors" OFF) find_package(Threads) include(GNUInstallDirs) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wextra -fvisibility=hidden") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -Wextra") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY) if(ENABLE_WERROR) add_compile_options("-Werror") endif() include(CTest) include_directories( include/ ) file(GLOB_RECURSE NET_CPP_INTERFACE_HEADERS include/*.h) add_subdirectory(doc) add_subdirectory(data) add_subdirectory(include) add_subdirectory(src) if(BUILD_TESTING) add_subdirectory(tests) endif()