Fix compilation of sprinklerd

This commit is contained in:
2017-04-21 23:56:05 +02:00
parent 298cde361d
commit 936487e3d9
22 changed files with 110 additions and 72 deletions

View File

@@ -28,6 +28,22 @@ endmenu # Third parties
menu "Domo"
menu "Libraries"
source "$BR2_EXTERNAL_DOMO_PATH/package/libubus-cpp/Config.in"
endmenu # Libraries
menu "Programmes"
# CHACOND
source "$BR2_EXTERNAL_DOMO_PATH/package/chacond/Config.in"
# SPRINKLERD
source "$BR2_EXTERNAL_DOMO_PATH/package/sprinklerd/Config.in"
endmenu # Programmes
endmenu # Domo
menu "Host tools"

View File

@@ -1,5 +0,0 @@
menu "Domo"
endmenu # Domo

View File

@@ -1,7 +1,7 @@
config BR2_PACKAGE_SPRINKLERD
bool "sprinklerd"
select BR2_PACKAGE_LIBUBUS_CPP
select BR2_PACKAGE_JSON_C
select BR2_PACKAGE_JSONCPP
default n
help
This program manage the sprinklers of the domo project.

View File

@@ -10,7 +10,7 @@ SPRINKLERD_SITE = $(TOPDIR)/../../src/prog/sprinklerd/builders/cmake
SPRINKLERD_SITE_METHOD = local
SPRINKLERD_INSTALL_STAGING = YES
SPRINKLERD_DEPENDENCIES = libubus-cpp json-c
SPRINKLERD_DEPENDENCIES = libubus-cpp jsoncpp
SPRINKLERD_CONF = SRC_DIR=$(TOPDIR)/../..

View File

@@ -55,3 +55,5 @@ BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_PROCD=y
BR2_PACKAGE_CHACOND=y
BR2_PACKAGE_SPRINKLERD=y

View File

@@ -1,28 +1,36 @@
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.0)
include (libubus)
include (libubox)
include (libubuscpp)
project (libubus-cpp)
project (libubuscpp)
set (CMAKE_MODULE_PATH "${MODULE_PATH}")
include (br)
include_directories ($ENV{SRC_DIR}/src/lib/libubus-cpp/include/)
file(
GLOB_RECURSE
source_files
../../src/UBusCall.cpp
../../src/UBusObject.cpp
../../src/UBusTimer.cpp
$ENV{SRC_DIR}/src/lib/libubus-cpp/src/UBusCall.cpp
$ENV{SRC_DIR}/src/lib/libubus-cpp/src/UBusObject.cpp
$ENV{SRC_DIR}/src/lib/libubus-cpp/src/UBusTimer.cpp
)
add_library(
ubuscpp
ubus-cpp
SHARED
${source_files}
)
target_link_libraries (ubuscpp
target_link_libraries (ubus-cpp
LINK_PUBLIC
ubus
)
)
target_include_directories (ubuscpp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories (ubus-cpp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
install (TARGETS ubus-cpp LIBRARY DESTINATION local/lib)
file (GLOB headers $ENV{SRC_DIR}/src/lib/libubus-cpp/include/ubus-cpp/*)
install (FILES ${headers} DESTINATION include/ubus-cpp)

View File

@@ -29,7 +29,7 @@
/*------------------------------- INCLUDES ----------------------------------*/
extern "C" {
#include <ubus/libubus.h>
#include <libubus.h>
}

View File

@@ -1,5 +1,5 @@
/*!
* UbusCall.h
* UbusObject.h
*
* Copyright (c) 2015, NADAL Jean-Baptiste. All rights reserved.
*
@@ -28,7 +28,7 @@
/*------------------------------- INCLUDES ----------------------------------*/
#include "ubuscpp/UBusCpp.h"
#include "ubus-cpp/UBusCpp.h"
/*----------------------------- Dependencies --------------------------------*/

View File

@@ -32,7 +32,7 @@ extern "C" {
#include "common.h"
#include "ubuscpp/UBusCall.h"
#include "ubus-cpp/UBusCall.h"
#define kDefaultTimeoutInSecond 5

View File

@@ -1,17 +1,32 @@
/*!
* (C) Copyright 2003-2015 Awox SA. All rights reserved.
* This work contains confidential trade secrets of Awox.
* Use, examination, copying, transfer and disclosure to others
* are prohibited, except with the express written agreement of Awox.
* UbusCall.cpp
*
* Copyright (c) 2015, NADAL Jean-Baptiste. All rights reserved.
*
* This library 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 2.1 of the License, or (at your option) any later version.
*
* This library 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 library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*
* @Author: NADAL Jean-Baptiste
* @Date: 21/03/2015
*
* @Author: Awox
* @Date: 06/10/2014
*/
/*------------------------------- INCLUDES ----------------------------------*/
#include "ubuscpp/UBusObject.h"
#include "ubus-cpp/UBusObject.h"
/*------------------------------- GLOBALS ----------------------------------*/

View File

@@ -27,7 +27,7 @@
#include <cstdio>
#include "ubuscpp/UBusTimer.h"
#include "ubus-cpp/UBusTimer.h"
/*! ----------------------------------------------------------------------------

View File

@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.0)
project(chacond)
project (chacond)
set (CMAKE_MODULE_PATH "${MODULE_PATH}")

View File

@@ -0,0 +1,35 @@
cmake_minimum_required (VERSION 3.0)
project (sprinklerd)
set (CMAKE_MODULE_PATH "${MODULE_PATH}")
set (CMAKE_CXX_STANDARD 11)
include (br)
include_directories ($ENV{SRC_DIR}/src/prog/sprinklerd)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Werror=strict-aliasing")
file(
GLOB_RECURSE
source_files
$ENV{SRC_DIR}/src/prog/sprinklerd/src/main.cpp
$ENV{SRC_DIR}/src/prog/sprinklerd/src/ubus-sprinkler-model.cpp
$ENV{SRC_DIR}/src/prog/sprinklerd/src/sprinklers.cpp
)
add_executable (sprinklerd ${source_files})
target_link_libraries (sprinklerd
LINK_PUBLIC
ubus-cpp
jsoncpp
ubox
ubus
blobmsg_json
rt
)
install (TARGETS sprinklerd DESTINATION local/bin)

View File

@@ -32,7 +32,7 @@ extern "C" {
#include <libubus.h>
}
#include "UbusSprinklerModel.h"
#include "ubus-sprinkler-model.h"
#include "sprinklers.h"

View File

@@ -29,10 +29,10 @@
#include <stdlib.h>
#include <unistd.h>
#include <jsoncpp/json.h>
#include <json/json.h>
#include <string>
#include <ubuscpp/UBusCall.h>
#include <ubus-cpp/UBusCall.h>
#include "sprinklers.h"

View File

@@ -30,7 +30,7 @@
#include <string>
#include <sstream>
#include <jsoncpp/json.h>
#include <json/json.h>
extern "C" {
#include <libubox/blobmsg_json.h>
@@ -38,7 +38,7 @@ extern "C" {
#include "sprinklers.h"
#include "UbusSprinklerModel.h"
#include "ubus-sprinkler-model.h"
namespace {
@@ -70,7 +70,6 @@ SprinkerModel::SprinkerModel (void) :
*/
SprinkerModel::~SprinkerModel (void)
{
}

View File

@@ -30,7 +30,7 @@
#include <stdint.h>
#include <ubuscpp/UBusObject.h>
#include <ubus-cpp/UBusObject.h>
/*--------------------------------- Define ----------------------------------*/

View File

@@ -1,32 +0,0 @@
cmake_minimum_required(VERSION 2.8.11)
project(sprinklersd)
include (libubus)
include (libubox)
include (libubuscpp)
include (libjsoncpp)
include_directories(../../src)
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -pedantic -Werror=strict-aliasing")
file(
GLOB_RECURSE
source_files
../../src/main.cpp
../../src/UbusSprinklerModel.cpp
../../src/sprinklers.cpp
)
add_executable (
sprinklersd
${source_files}
)
target_link_libraries (sprinklersd
LINK_PUBLIC
jsoncpp
ubuscpp
rt
)