# Copyright (C) 2017 Ortega Froysa, Nicolás # Author: Ortega Froysa, Nicolás # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation, either # version 3 of the License, or (at your option) any later version. # # 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program. If not, see # . cmake_minimum_required(VERSION 2.8) project(NeoComm) set(TARGET_NAME "neocomm") set(TARGET_VERSION_MAJOR 0) set(TARGET_VERSION_MINOR 1) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "release") endif() string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE) message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}") option(BUILD_SHARED_LIBS "Whether to build a shared object instead of a static." OFF) include_directories( "include/") set(SRCS src/connection.c src/error.c src/neocomm.c src/nodes.c) set(CMAKE_C_FLAGS "-std=c99 -Wall -Wextra -Werror -Wfatal-errors -Wmissing-declarations -pedantic-errors") set(CMAKE_C_FLAGS_DEBUG "-g -O0") set(CMAKE_C_FLAGS_RELEASE "-O3") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O3") set(CMAKE_C_FLAGS_MINSEZEREL "-Os") if(NOT CMAKE_BUILD_TYPE MATCHES "debug" AND NOT CMAKE_BUILD_TYPE MATCHES "relwithdebinfo") add_definitions("-DNDEBUG") else() add_definitions("-DDEBUG") endif() add_library(${TARGET_NAME} ${SRCS})