diff --git a/CMakeLists.txt b/CMakeLists.txt
index e32c1c49e..c5cbc9b51 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -130,7 +130,7 @@ set(PROJECT_SOVERSION 1)
execute_process(
COMMAND git describe --tags --abbrev=0 --match "v*"
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_VERSION_STR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
@@ -149,14 +149,14 @@ if(DEFINED ENV{CI})
else()
execute_process(
COMMAND git rev-parse --short=7 HEAD
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_REV
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
@@ -173,11 +173,6 @@ endif()
set(BUILDID "v${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}-${GIT_REV}-${VARIANT}")
-include_directories(
- ${CMAKE_SOURCE_DIR}/include
- ${CMAKE_BINARY_DIR}/include
-)
-
add_subdirectory(etc)
add_subdirectory(lib)
add_subdirectory(src)
@@ -205,8 +200,8 @@ if(WITH_TESTS)
endif()
configure_file(
- ${CMAKE_SOURCE_DIR}/include/villas/config.h.in
- ${CMAKE_BINARY_DIR}/include/villas/config.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/villas/config.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/include/villas/config.h
)
# Show feature summary
diff --git a/cmake/VILLASnodePackaging.cmake b/cmake/VILLASnodePackaging.cmake
index 39e07c942..9e8a1fc80 100644
--- a/cmake/VILLASnodePackaging.cmake
+++ b/cmake/VILLASnodePackaging.cmake
@@ -61,8 +61,8 @@ set(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
set(CPACK_RPM_PACKAGE_URL "http://www.fein-aachen.org/projects/villas-node/")
set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.md")
-set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
+set(CPACK_RESOURCE_FILE_LICENSE "${VILLASnode_SOURCE_DIR}/COPYING.md")
+set(CPACK_RESOURCE_FILE_README "${VILLASnode_SOURCE_DIR}/README.md")
set(CPACK_SOURCE_IGNORE_FILES "build/;\\\\.gitmodules;\\\\.git/;\\\\.vscode;\\\\.editorconfig;\\\\.gitlab-ci.yml;\\\\.(docker|git)ignore;\\\\.DS_Store")
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index aa3f57c67..687123271 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -53,7 +53,7 @@ if(DOXYGEN_FOUND)
doxygen_add_docs(doc
README.md CONTRIBUTING.md COPYING.md src/ lib/ tests/ include/ doc/
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${PROJECT_DIR}
)
install(
diff --git a/include/villas/nodes/comedi.h b/include/villas/nodes/comedi.h
index 3aa01f5b3..f7d938682 100644
--- a/include/villas/nodes/comedi.h
+++ b/include/villas/nodes/comedi.h
@@ -97,10 +97,10 @@ int comedi_start(struct node *n);
int comedi_stop(struct node *n);
/** @see node_type::read */
-int comedi_read(struct node *n, struct sample *smps[], unsigned cnt);
+int comedi_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release);
/** @see node_type::write */
-int comedi_write(struct node *n, struct sample *smps[], unsigned cnt);
+int comedi_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release);
/** @} */
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 4245b3189..dd8753a5a 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -22,10 +22,12 @@
add_compile_options(-fPIC)
-set(INCLUDE_DIRS
+list(APPEND INCLUDE_DIRS
${JANSSON_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
${CURL_INCLUDE_DIRS}
+ ${VILLASnode_BINARY_DIR}/include
+ ${VILLASnode_SOURCE_DIR}/include
)
set(LIBRARIES
diff --git a/lib/api/CMakeLists.txt b/lib/api/CMakeLists.txt
index 453cd2dca..34ece0463 100644
--- a/lib/api/CMakeLists.txt
+++ b/lib/api/CMakeLists.txt
@@ -21,14 +21,6 @@
# along with this program. If not, see .
###################################################################################
-set(INCLUDE_DIRS
- ${OPENSSL_INCLUDE_DIR}
-)
-
-set(LIBRARIES
- ${OPENSSL_LIBRARIES}
-)
-
set(API_SRC
session.c
actions/capabiltities.c
diff --git a/lib/formats/CMakeLists.txt b/lib/formats/CMakeLists.txt
index 3b5090166..169d661ab 100644
--- a/lib/formats/CMakeLists.txt
+++ b/lib/formats/CMakeLists.txt
@@ -20,7 +20,7 @@
# along with this program. If not, see .
###################################################################################
-set(FORMAT_SRC
+list(APPEND FORMAT_SRC
json.c
json_reserve.c
villas_binary.c
@@ -30,14 +30,6 @@ set(FORMAT_SRC
msg.c
)
-set(INCLUDE_DIRS
- ${OPENSSL_INCLUDE_DIR}
-)
-
-set(LIBRARIES
- ${OPENSSL_LIBRARIES}
-)
-
# Enable Google Protobuf format
if(PROTOBUFC_FOUND)
list(APPEND FORMAT_SRC
diff --git a/lib/hooks/CMakeLists.txt b/lib/hooks/CMakeLists.txt
index 137381e61..636405ba0 100644
--- a/lib/hooks/CMakeLists.txt
+++ b/lib/hooks/CMakeLists.txt
@@ -20,14 +20,6 @@
# along with this program. If not, see .
###################################################################################
-set(INCLUDE_DIRS
- ${JANSSON_INCLUDE_DIRS}
-)
-
-set(LIBRARIES
- PkgConfig::JANSSON
-)
-
set(HOOK_SRC
convert.c
decimate.c
diff --git a/lib/kernel/Makefile.inc b/lib/kernel/Makefile.inc
deleted file mode 100644
index 87e905d7d..000000000
--- a/lib/kernel/Makefile.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-# Makefile.
-#
-# @author Steffen Vogel
-# @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
-# @license GNU General Public License (version 3)
-#
-# VILLASnode
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-###################################################################################
-
-LIB_SRCS += $(addprefix lib/kernel/, kernel.c rt.c)
diff --git a/lib/nodes/CMakeLists.txt b/lib/nodes/CMakeLists.txt
index c12a96dab..5feea97db 100644
--- a/lib/nodes/CMakeLists.txt
+++ b/lib/nodes/CMakeLists.txt
@@ -20,14 +20,6 @@
# along with this program. If not, see .
###################################################################################
-set(INCLUDE_DIRS
- ${JANSSON_INCLUDE_DIRS}
-)
-
-set(LIBRARIES
- PkgConfig::JANSSON
-)
-
set(NODE_SRC
influxdb.c
stats.c
diff --git a/lib/nodes/comedi.c b/lib/nodes/comedi.c
index 44b1bb6ca..38faf9113 100644
--- a/lib/nodes/comedi.c
+++ b/lib/nodes/comedi.c
@@ -523,7 +523,7 @@ int comedi_stop(struct node *n)
#if COMEDI_USE_READ
-int comedi_read(struct node *n, struct sample *smps[], unsigned cnt)
+int comedi_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release)
{
int ret;
struct comedi *c = (struct comedi *) n->_vd;
@@ -646,7 +646,7 @@ int comedi_read(struct node *n, struct sample *smps[], unsigned cnt)
#else
-int comedi_read(struct node *n, struct sample *smps[], unsigned cnt)
+int comedi_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release)
{
int ret;
struct comedi *c = (struct comedi *) n->_vd;
@@ -831,7 +831,7 @@ int comedi_read(struct node *n, struct sample *smps[], unsigned cnt)
#endif
-int comedi_write(struct node *n, struct sample *smps[], unsigned cnt)
+int comedi_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release)
{
int ret;
struct comedi *c = (struct comedi *) n->_vd;
diff --git a/lib/nodes/mqtt.c b/lib/nodes/mqtt.c
index a17d31f0c..115ee2035 100644
--- a/lib/nodes/mqtt.c
+++ b/lib/nodes/mqtt.c
@@ -391,16 +391,16 @@ int mqtt_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re
if (ret < 0)
return ret;
- if(m->publish) {
- ret = mosquitto_publish(m->client, NULL /* mid */, m->publish, wbytes, data, m->qos,
+ if (m->publish) {
+ ret = mosquitto_publish(m->client, NULL /* mid */, m->publish, wbytes, data, m->qos,
m->retain);
- if (ret != MOSQ_ERR_SUCCESS) {
- warn("MQTT: publish failed for node %s: %s", node_name(n), mosquitto_strerror(ret));
- return -abs(ret);
- }
- }
- else{
- warn("MQTT: no publish for node %s possible because no publish topic is given", node_name(n));
+ if (ret != MOSQ_ERR_SUCCESS) {
+ warn("MQTT: publish failed for node %s: %s", node_name(n), mosquitto_strerror(ret));
+ return -abs(ret);
+ }
+ }
+ else {
+ warn("MQTT: no publish for node %s possible because no publish topic is given", node_name(n));
}
return cnt;
diff --git a/packaging/docker/CMakeLists.txt b/packaging/docker/CMakeLists.txt
index 832df0d2c..c9a11f488 100644
--- a/packaging/docker/CMakeLists.txt
+++ b/packaging/docker/CMakeLists.txt
@@ -33,7 +33,7 @@ set(DOCKER_RUN_OPTS
--publish 2345:2345
--privileged
--security-opt seccomp:unconfined
- --volume \"${CMAKE_SOURCE_DIR}:/villas\"
+ --volume \"${VILLASnode_SOURCE_DIR}:/villas\"
)
foreach(SUFFIX app dev dev-centos dev-ubuntu)
@@ -59,7 +59,7 @@ foreach(SUFFIX app dev dev-centos dev-ubuntu)
--build-arg GIT_REV=${GIT_REV}
--build-arg VERSION=${PROJECT_VERSION}
--build-arg VARIANT=${VARIANT}
- ${DOCKER_BUILD_OPTS} ${CMAKE_SOURCE_DIR}
+ ${DOCKER_BUILD_OPTS} ${VILLASnode_SOURCE_DIR}
COMMENT "Build Docker image: ${DOCKER_IMAGE}-${SUFFIX}:${DOCKER_TAG}"
)
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index a2e195c35..d83a3d0a0 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -22,7 +22,6 @@
# Plugins
link_libraries(villas)
-include_directories("${CMAKE_SOURCE_DIR}/include")
add_definitions("-DVILLAS")
add_library(simple_circuit MODULE models/simple_circuit.c)