Skip to content

Commit

Permalink
Merge pull request #633 from Dronecode/fix-versioning
Browse files Browse the repository at this point in the history
core/backend: back to version tags
  • Loading branch information
julianoes authored Jan 9, 2019
2 parents ff36534 + 93f973e commit 3672877
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ endif()
set(dronecode_sdk_install_include_dir "include/dronecode_sdk")
set(dronecode_sdk_install_lib_dir ${lib_path})

file (STRINGS "${PROJECT_SOURCE_DIR}/version" VERSION_STR)
message(STATUS "Read version: ${VERSION_STR}")
execute_process(
COMMAND git describe --abbrev=8 --dirty --always --tags
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE VERSION_STR
OUTPUT_STRIP_TRAILING_WHITESPACE
)

message(STATUS "Version: ${VERSION_STR}")
add_definitions(-DDRONECODE_SDK_VERSION="${VERSION_STR}")

add_custom_target(version
COMMAND :
DEPENDS ${PROJECT_SOURCE_DIR}/version)

add_subdirectory(core)
add_subdirectory(plugins)

Expand Down
2 changes: 0 additions & 2 deletions backend/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ else()
add_library(backend STATIC ${BACKEND_SOURCES})
endif()

add_dependencies(dronecode_sdk version)

target_link_libraries(backend
dronecode_sdk
dronecode_sdk_action
Expand Down
5 changes: 3 additions & 2 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ else()
set(LIBRARY_TYPE "SHARED")
endif()


configure_file(version.h.in version.h)

add_library(dronecode_sdk ${LIBRARY_TYPE}
call_every_handler.cpp
connection.cpp
Expand All @@ -36,8 +39,6 @@ add_library(dronecode_sdk ${LIBRARY_TYPE}
thread_pool.cpp
)

add_dependencies(dronecode_sdk version)

target_link_libraries(dronecode_sdk
${CMAKE_THREAD_LIBS_INIT}
${CURL_LIBRARY}
Expand Down
3 changes: 2 additions & 1 deletion core/dronecode_sdk_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "system_impl.h"
#include "serial_connection.h"
#include "cli_arg.h"
#include "version.h"

namespace dronecode_sdk {

Expand All @@ -21,7 +22,7 @@ DronecodeSDKImpl::DronecodeSDKImpl() :
_on_discover_callback(nullptr),
_on_timeout_callback(nullptr)
{
LogInfo() << "DronecodeSDK version: " << DRONECODE_SDK_VERSION;
LogInfo() << "DronecodeSDK version: " << dronecode_sdk_version;
}

DronecodeSDKImpl::~DronecodeSDKImpl()
Expand Down
1 change: 0 additions & 1 deletion version

This file was deleted.

0 comments on commit 3672877

Please sign in to comment.