Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
DG-23: Process Grove Version based on the value set in VERSION file u…
Browse files Browse the repository at this point in the history
…sing CMake

Signed-off-by: br <bindu@iotechsys.com>
  • Loading branch information
BinduRao2018 committed Nov 29, 2019
1 parent c5454a9 commit d6c10d8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
1.2.0

2 changes: 1 addition & 1 deletion scripts/Dockerfile.alpine-3.9
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ RUN apk add --update --no-cache build-base git gcc cmake make linux-headers yaml

COPY scripts /device-grove/scripts
COPY src /device-grove/src/
COPY VERSION /device-grove
RUN mkdir -p /device-grove/build

WORKDIR /device-grove
Expand All @@ -23,7 +24,6 @@ COPY --from=builder /usr/local/include/mraa.h /usr/local/include/
COPY --from=builder /usr/local/lib/libmraa.so* /usr/local/lib/
COPY --from=builder /usr/local/lib64/libcbor.so* /usr/local/lib64/

COPY VERSION /.
COPY LICENSE /.
COPY Attribution.txt /.
COPY res /res
Expand Down
6 changes: 5 additions & 1 deletion src/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ project(device_grove LANGUAGES C)
# Package support
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

# Versioning
file (STRINGS ${CMAKE_SOURCE_DIR}/../../VERSION GROVE_DOT_VERSION)

find_package (LibMRAA REQUIRED)
if (NOT LIBMRAA_FOUND)
message (WARNING "mraa library or header not found")
Expand Down Expand Up @@ -32,6 +35,7 @@ file (GLOB C_FILES *.c)
find_library(EDGEX_CSDK_RELEASE_LIB NAMES csdk)
find_library(LIBMRAA_LIB NAMES mraa)
add_executable(device-grove ${C_FILES})
target_compile_definitions(device-grove PRIVATE GROVE_VERSION="${GROVE_DOT_VERSION}")
target_include_directories (device-grove PRIVATE .)
target_link_libraries (device-grove PUBLIC m PRIVATE ${LIBMRAA_LIB} ${EDGEX_CSDK_RELEASE_LIB})
install(TARGETS device-grove DESTINATION bin)
install(TARGETS device-grove DESTINATION bin)
1 change: 0 additions & 1 deletion src/c/device_grove.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ extern "C" {
#define GROVE_ADC_REF 5

#define GROVE_SVC "Device-Grove"
#define GROVE_VERSION "1.1.0"

typedef enum
{
Expand Down
2 changes: 1 addition & 1 deletion src/c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ static void grove_stop (void *impl, bool force)

int main (int argc, char *argv[])
{
edgex_device_svcparams params = { GROVE_SVC, "", NULL, "" };
edgex_device_svcparams params = { GROVE_SVC, NULL, NULL, NULL };

grove_pidriver_t *implObject = malloc (sizeof (grove_pidriver_t));
memset (implObject, 0, sizeof (grove_pidriver_t));
Expand Down

0 comments on commit d6c10d8

Please sign in to comment.