Fix Compilation of restd.

This commit is contained in:
jbnadal
2017-06-07 16:55:05 +02:00
parent 5d7856ea1f
commit f4bf901f9a
5 changed files with 29 additions and 31 deletions

View File

@@ -1,46 +1,44 @@
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.0)
project(restd)
include (libcivetweb)
include (libjsoncpp)
include (libubus)
include (libubox)
include (libubuscpp)
set (CMAKE_MODULE_PATH "${MODULE_PATH}")
set (CMAKE_CXX_STANDARD 11)
include_directories(../../src)
include (br)
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -pedantic -Werror=strict-aliasing")
include_directories ($ENV{SRC_DIR}/src/prog/restd/src/)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Werror=strict-aliasing")
file (
GLOB_RECURSE
source_files
../../src/main.cpp
../../src/authorize.cpp
../../src/session.cpp
../../src/message.cpp
../../src/routes/ExitHandler.cpp
../../src/routes/UbusHandler.cpp
$ENV{SRC_DIR}/src/prog/restd/src/main.cpp
$ENV{SRC_DIR}/src/prog/restd/src/authorize.cpp
$ENV{SRC_DIR}/src/prog/restd/src/session.cpp
$ENV{SRC_DIR}/src/prog/restd/src/message.cpp
$ENV{SRC_DIR}/src/prog/restd/src/routes/ExitHandler.cpp
$ENV{SRC_DIR}/src/prog/restd/src/routes/UbusHandler.cpp
)
add_executable (
restd
${source_files}
)
add_executable (restd ${source_files})
target_link_libraries (restd
LINK_PUBLIC
civetweb
ubus
ubuscpp
pthread
dl
crypt
jsoncpp
ubus
ubus-cpp
json-cpp
civetweb-cpp
)
install (TARGETS restd DESTINATION local/bin)
add_custom_command(
TARGET restd
POST_BUILD
COMMAND cp ${CMAKE_SOURCE_DIR}/certificate/ssl_cert.pem ${CMAKE_SOURCE_DIR}/build/
)
#add_custom_command(
# TARGET restd
# POST_BUILD
# COMMAND cp ${CMAKE_SOURCE_DIR}/certificate/ssl_cert.pem ${CMAKE_SOURCE_DIR}/build/
# )

View File

@@ -30,7 +30,7 @@
#include <pthread.h>
#include <CivetServer.h>
#include <civetweb/CivetServer.h>
/*--------------------------------- Define ----------------------------------*/

View File

@@ -28,7 +28,7 @@
/*-------------------------------- INCLUDES ---------------------------------*/
#include <CivetServer.h>
#include <civetweb/CivetServer.h>
/*---------------------------------- CLASS ----------------------------------*/

View File

@@ -29,7 +29,7 @@
#include <jsoncpp/reader.h>
#include <ubuscpp/UBusCall.h>
#include <ubus-cpp/UBusCall.h>
#include "UbusHandler.h"

View File

@@ -31,7 +31,7 @@
#include <string.h>
#include <jsoncpp/json.h>
#include <CivetServer.h>
#include <civetweb/CivetServer.h>
/*---------------------------------- CLASS ----------------------------------*/