Fix compilation of sprinklerd
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
/*------------------------------- INCLUDES ----------------------------------*/
|
||||
|
||||
extern "C" {
|
||||
#include <ubus/libubus.h>
|
||||
#include <libubus.h>
|
||||
}
|
||||
|
||||
|
||||
@@ -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 --------------------------------*/
|
||||
|
||||
@@ -32,7 +32,7 @@ extern "C" {
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include "ubuscpp/UBusCall.h"
|
||||
#include "ubus-cpp/UBusCall.h"
|
||||
|
||||
#define kDefaultTimeoutInSecond 5
|
||||
|
||||
|
||||
@@ -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 ----------------------------------*/
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "ubuscpp/UBusTimer.h"
|
||||
#include "ubus-cpp/UBusTimer.h"
|
||||
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
|
||||
project(chacond)
|
||||
project (chacond)
|
||||
|
||||
set (CMAKE_MODULE_PATH "${MODULE_PATH}")
|
||||
|
||||
|
||||
35
src/prog/sprinklerd/builders/cmake/CMakeLists.txt
Normal file
35
src/prog/sprinklerd/builders/cmake/CMakeLists.txt
Normal 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)
|
||||
@@ -32,7 +32,7 @@ extern "C" {
|
||||
#include <libubus.h>
|
||||
}
|
||||
|
||||
#include "UbusSprinklerModel.h"
|
||||
#include "ubus-sprinkler-model.h"
|
||||
|
||||
#include "sprinklers.h"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -69,8 +69,7 @@ SprinkerModel::SprinkerModel (void) :
|
||||
* @brief Destructor of the UBus Mixer Volume.
|
||||
*/
|
||||
SprinkerModel::~SprinkerModel (void)
|
||||
{
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <ubuscpp/UBusObject.h>
|
||||
#include <ubus-cpp/UBusObject.h>
|
||||
|
||||
/*--------------------------------- Define ----------------------------------*/
|
||||
|
||||
@@ -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
|
||||
)
|
||||
Reference in New Issue
Block a user