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 "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 endmenu # Domo
menu "Host tools" menu "Host tools"

View File

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

View File

@@ -1,7 +1,7 @@
config BR2_PACKAGE_SPRINKLERD config BR2_PACKAGE_SPRINKLERD
bool "sprinklerd" bool "sprinklerd"
select BR2_PACKAGE_LIBUBUS_CPP select BR2_PACKAGE_LIBUBUS_CPP
select BR2_PACKAGE_JSON_C select BR2_PACKAGE_JSONCPP
default n default n
help help
This program manage the sprinklers of the domo project. 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_SITE_METHOD = local
SPRINKLERD_INSTALL_STAGING = YES SPRINKLERD_INSTALL_STAGING = YES
SPRINKLERD_DEPENDENCIES = libubus-cpp json-c SPRINKLERD_DEPENDENCIES = libubus-cpp jsoncpp
SPRINKLERD_CONF = SRC_DIR=$(TOPDIR)/../.. SPRINKLERD_CONF = SRC_DIR=$(TOPDIR)/../..

View File

@@ -55,3 +55,5 @@ BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_PROCD=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) project (libubus-cpp)
include (libubox)
include (libubuscpp)
project (libubuscpp) set (CMAKE_MODULE_PATH "${MODULE_PATH}")
include (br)
include_directories ($ENV{SRC_DIR}/src/lib/libubus-cpp/include/)
file( file(
GLOB_RECURSE GLOB_RECURSE
source_files source_files
../../src/UBusCall.cpp
../../src/UBusObject.cpp $ENV{SRC_DIR}/src/lib/libubus-cpp/src/UBusCall.cpp
../../src/UBusTimer.cpp $ENV{SRC_DIR}/src/lib/libubus-cpp/src/UBusObject.cpp
$ENV{SRC_DIR}/src/lib/libubus-cpp/src/UBusTimer.cpp
) )
add_library( add_library(
ubuscpp ubus-cpp
SHARED SHARED
${source_files} ${source_files}
) )
target_link_libraries (ubuscpp target_link_libraries (ubus-cpp
LINK_PUBLIC LINK_PUBLIC
ubus 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 ----------------------------------*/ /*------------------------------- INCLUDES ----------------------------------*/
extern "C" { 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. * Copyright (c) 2015, NADAL Jean-Baptiste. All rights reserved.
* *
@@ -28,7 +28,7 @@
/*------------------------------- INCLUDES ----------------------------------*/ /*------------------------------- INCLUDES ----------------------------------*/
#include "ubuscpp/UBusCpp.h" #include "ubus-cpp/UBusCpp.h"
/*----------------------------- Dependencies --------------------------------*/ /*----------------------------- Dependencies --------------------------------*/

View File

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

View File

@@ -1,17 +1,32 @@
/*! /*!
* (C) Copyright 2003-2015 Awox SA. All rights reserved. * UbusCall.cpp
* This work contains confidential trade secrets of Awox. *
* Use, examination, copying, transfer and disclosure to others * Copyright (c) 2015, NADAL Jean-Baptiste. All rights reserved.
* are prohibited, except with the express written agreement of Awox. *
* 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 ----------------------------------*/ /*------------------------------- INCLUDES ----------------------------------*/
#include "ubuscpp/UBusObject.h" #include "ubus-cpp/UBusObject.h"
/*------------------------------- GLOBALS ----------------------------------*/ /*------------------------------- GLOBALS ----------------------------------*/

View File

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

View File

@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.0) cmake_minimum_required (VERSION 3.0)
project(chacond) project (chacond)
set (CMAKE_MODULE_PATH "${MODULE_PATH}") 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 <libubus.h>
} }
#include "UbusSprinklerModel.h" #include "ubus-sprinkler-model.h"
#include "sprinklers.h" #include "sprinklers.h"

View File

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

View File

@@ -30,7 +30,7 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <jsoncpp/json.h> #include <json/json.h>
extern "C" { extern "C" {
#include <libubox/blobmsg_json.h> #include <libubox/blobmsg_json.h>
@@ -38,7 +38,7 @@ extern "C" {
#include "sprinklers.h" #include "sprinklers.h"
#include "UbusSprinklerModel.h" #include "ubus-sprinkler-model.h"
namespace { namespace {
@@ -69,8 +69,7 @@ SprinkerModel::SprinkerModel (void) :
* @brief Destructor of the UBus Mixer Volume. * @brief Destructor of the UBus Mixer Volume.
*/ */
SprinkerModel::~SprinkerModel (void) SprinkerModel::~SprinkerModel (void)
{ {
} }

View File

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