Skip to content

Commit

Permalink
deliver json cpp (#762)
Browse files Browse the repository at this point in the history
Deliver jsoncpp library with install.

Prevent library mismatch on clients
  • Loading branch information
JasonMarechal25 authored Feb 29, 2024
1 parent ca67653 commit bafa6d0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
25 changes: 25 additions & 0 deletions conception/Architecture_decision_records/Install_jsoncpp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Decision record template by Michael Nygard

This is the template
in [Documenting architecture decisions - Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions).
You can use [adr-tools](https://github.com/npryce/adr-tools) for managing the ADR files.

In each ADR file, write these sections:

# Install jsoncpp library with xpansion

## Status: Accepted [28 Feb. 2024]

## Context

In the context of migrating from centOS7 to oracle linux8 it was observed that managing jsoncpp library installation on
target environment
can be difficult.

## Decision

Deliver jsoncpp library with xpansion package

## Consequences

jsoncpp does not need to be installed on the target system. No version conflict
13 changes: 13 additions & 0 deletions conception/Using_jsoncpp_cmake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# How to use jsoncpp in cmake [Feb. 2024]

The jsoncpp library doesn't follow modern Cmake convention.

Following the library documentation https://github.com/open-source-parsers/jsoncpp/wiki/Building we need to do:

get_target_property(JSON_INC_PATH jsoncpp_lib INTERFACE_INCLUDE_DIRECTORIES)
include_directories(${JSON_INC_PATH})
target_link_libraries(${PROJECT_NAME} jsoncpp_lib)

We can at least use target_include_directories instead of include_directories but don't try to use find package or
namespaced targets.
Some issues are opened on jsoncpp repository but not worked on
5 changes: 5 additions & 0 deletions src/cpp/helpers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ target_link_libraries (helpers
Boost::boost Boost::program_options
MINIZIP::minizip-ng
)

install(FILES
$<TARGET_FILE:jsoncpp_lib>
DESTINATION bin
)

0 comments on commit bafa6d0

Please sign in to comment.