added my Recipes
This commit is contained in:
@@ -0,0 +1,145 @@
|
||||
From d8986cb065e770017ee1622fb7324387ead60203 Mon Sep 17 00:00:00 2001
|
||||
From: Ming Liu <peter.x.liu@external.atlascopco.com>
|
||||
Date: Tue, 7 Mar 2017 11:46:52 +0100
|
||||
Subject: [PATCH] Adjust the cmake files
|
||||
|
||||
- Remove json_test which can not build with boost 1.61.0.
|
||||
- Build shared library as well with the original static library.
|
||||
- Add FindLibJsonSpirit.cmake to be able to be found by the dependers.
|
||||
|
||||
Upstream-Status: Inappropriate [configuration]
|
||||
|
||||
Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
|
||||
---
|
||||
CMakeLists.txt | 8 +++---
|
||||
FindLibJsonSpirit.cmake | 64 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
json_spirit/CMakeLists.txt | 16 +++++++++++-
|
||||
3 files changed, 83 insertions(+), 5 deletions(-)
|
||||
create mode 100644 FindLibJsonSpirit.cmake
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 4637a6c..b292f0f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,7 +1,7 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
|
||||
PROJECT(json_spirit)
|
||||
-SUBDIRS(json_spirit json_demo json_headers_only_demo json_map_demo json_test)
|
||||
+SUBDIRS(json_spirit json_demo json_headers_only_demo json_map_demo)
|
||||
INCLUDE_DIRECTORIES(json_spirit)
|
||||
|
||||
INSTALL(
|
||||
@@ -16,11 +16,11 @@ INSTALL(
|
||||
${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer.h
|
||||
${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer_template.h
|
||||
${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer_options.h
|
||||
- DESTINATION include)
|
||||
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
- ${CMAKE_BINARY_DIR}/json_spirit/libjson_spirit.a
|
||||
- DESTINATION lib)
|
||||
+ ${CMAKE_SOURCE_DIR}/FindLibJsonSpirit.cmake
|
||||
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules)
|
||||
|
||||
INCLUDE(CPack)
|
||||
diff --git a/FindLibJsonSpirit.cmake b/FindLibJsonSpirit.cmake
|
||||
new file mode 100644
|
||||
index 0000000..7ee7687
|
||||
--- /dev/null
|
||||
+++ b/FindLibJsonSpirit.cmake
|
||||
@@ -0,0 +1,64 @@
|
||||
+# FindLibJsonSpirit - Find libjson_spirit headers and libraries.
|
||||
+#
|
||||
+# Sample:
|
||||
+#
|
||||
+# SET( LibJsonSpirit_USE_STATIC_LIBS OFF )
|
||||
+# FIND_PACKAGE( LibJsonSpirit REQUIRED )
|
||||
+# IF( LibJsonSpirit_FOUND )
|
||||
+# INCLUDE_DIRECTORIES( ${LibJsonSpirit_INCLUDE_DIRS} )
|
||||
+# TARGET_LINK_LIBRARIES( ... ${LibJsonSpirit_LIBRARIES} )
|
||||
+# ENDIF()
|
||||
+#
|
||||
+# Variables used by this module need to be set before calling find_package
|
||||
+#
|
||||
+# LibJsonSpirit_USE_STATIC_LIBS Can be set to ON to force the use of the static
|
||||
+# libjson_spirit libraries. Defaults to OFF.
|
||||
+#
|
||||
+# Variables provided by this module:
|
||||
+#
|
||||
+# LibJsonSpirit_FOUND Include dir, libjson_spirit libraries.
|
||||
+#
|
||||
+# LibJsonSpirit_LIBRARIES Link to these to use all the libraries you specified.
|
||||
+#
|
||||
+# LibJsonSpirit_INCLUDE_DIRS Include directories.
|
||||
+#
|
||||
+# For each component you specify in find_package(), the following (UPPER-CASE)
|
||||
+# variables are set to pick and choose components instead of just using
|
||||
+# LibJsonSpirit_LIBRARIES:
|
||||
+#
|
||||
+# LIBJSONSPIRIT_FOUND TRUE if libjson_spirit was found
|
||||
+# LIBJSONSPIRIT_LIBRARY libjson_spirit library
|
||||
+#
|
||||
+
|
||||
+# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
|
||||
+IF(LibJsonSpirit_USE_STATIC_LIBS)
|
||||
+ SET( _ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES .a )
|
||||
+ENDIF()
|
||||
+
|
||||
+# Look for the header files
|
||||
+UNSET(LibJsonSpirit_INCLUDE_DIRS CACHE)
|
||||
+FIND_PATH(LibJsonSpirit_INCLUDE_DIRS NAMES json_spirit.h)
|
||||
+
|
||||
+# Look for the core library
|
||||
+UNSET(LIBJSONSPIRIT_LIBRARY CACHE)
|
||||
+FIND_LIBRARY(LIBJSONSPIRIT_LIBRARY NAMES json_spirit)
|
||||
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibJsonSpirit DEFAULT_MSG LIBJSONSPIRIT_LIBRARY LibJsonSpirit_INCLUDE_DIRS)
|
||||
+MARK_AS_ADVANCED(
|
||||
+ LIBJSONSPIRIT_FOUND
|
||||
+ LIBJSONSPIRIT_LIBRARY
|
||||
+)
|
||||
+
|
||||
+# Prepare return values and collectiong more components
|
||||
+SET(LibJsonSpirit_FOUND ${LIBJSONSPIRIT_FOUND})
|
||||
+SET(LibJsonSpirit_LIBRARIES ${LIBJSONSPIRIT_LIBRARY})
|
||||
+MARK_AS_ADVANCED(
|
||||
+ LibJsonSpirit_FOUND
|
||||
+ LibJsonSpirit_LIBRARIES
|
||||
+ LibJsonSpirit_INCLUDE_DIRS
|
||||
+)
|
||||
+
|
||||
+# Restore CMAKE_FIND_LIBRARY_SUFFIXES
|
||||
+IF(LibJsonSpirit_USE_STATIC_LIBS)
|
||||
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES} )
|
||||
+ENDIF()
|
||||
diff --git a/json_spirit/CMakeLists.txt b/json_spirit/CMakeLists.txt
|
||||
index fb52818..c1613b2 100644
|
||||
--- a/json_spirit/CMakeLists.txt
|
||||
+++ b/json_spirit/CMakeLists.txt
|
||||
@@ -13,5 +13,19 @@ json_spirit_writer_template.h )
|
||||
FIND_PACKAGE(Boost 1.34 REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
|
||||
|
||||
-ADD_LIBRARY(json_spirit STATIC ${JSON_SPIRIT_SRCS})
|
||||
+SET(JSONSPIRIT_SOVERSION_MAJOR "4")
|
||||
+SET(JSONSPIRIT_SOVERSION_MINOR "0")
|
||||
+SET(JSONSPIRIT_SOVERSION_PATCH "8")
|
||||
|
||||
+ADD_LIBRARY(json_spirit SHARED ${JSON_SPIRIT_SRCS})
|
||||
+SET_TARGET_PROPERTIES(json_spirit PROPERTIES PROJECT_LABEL "Json Spirit Library")
|
||||
+SET_TARGET_PROPERTIES(json_spirit PROPERTIES COMPILE_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
||||
+SET_TARGET_PROPERTIES(json_spirit PROPERTIES VERSION ${JSONSPIRIT_SOVERSION_MAJOR}.${JSONSPIRIT_SOVERSION_MINOR}.${JSONSPIRIT_SOVERSION_PATCH})
|
||||
+SET_TARGET_PROPERTIES(json_spirit PROPERTIES SOVERSION ${JSONSPIRIT_SOVERSION_MAJOR})
|
||||
+INSTALL(TARGETS json_spirit DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
+
|
||||
+ADD_LIBRARY(json_spirit_static STATIC ${JSON_SPIRIT_SRCS})
|
||||
+SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES PROJECT_LABEL "Json Spirit Static Library")
|
||||
+SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES OUTPUT_NAME "json_spirit")
|
||||
+SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES SOVERSION ${JSONSPIRIT_SOVERSION_MAJOR})
|
||||
+INSTALL(TARGETS json_spirit_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
--
|
||||
1.9.1
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
From bbac9ac3e391253bc1f90cf0f70a2ce1aac9511f Mon Sep 17 00:00:00 2001
|
||||
From: Ming Liu <liu.ming50@gmail.com>
|
||||
Date: Wed, 30 Aug 2017 16:50:56 +0200
|
||||
Subject: [PATCH] Link to libatomic
|
||||
|
||||
This is needed for clang compiler.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
|
||||
---
|
||||
json_demo/CMakeLists.txt | 2 +-
|
||||
json_headers_only_demo/CMakeLists.txt | 2 +-
|
||||
json_map_demo/CMakeLists.txt | 2 +-
|
||||
json_test/CMakeLists.txt | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/json_demo/CMakeLists.txt b/json_demo/CMakeLists.txt
|
||||
index b1d3c6a..0dfd308 100644
|
||||
--- a/json_demo/CMakeLists.txt
|
||||
+++ b/json_demo/CMakeLists.txt
|
||||
@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
|
||||
|
||||
ADD_EXECUTABLE(json_demo ${JSON_DEMO_SRCS})
|
||||
-TARGET_LINK_LIBRARIES(json_demo json_spirit)
|
||||
+TARGET_LINK_LIBRARIES(json_demo json_spirit -latomic)
|
||||
|
||||
diff --git a/json_headers_only_demo/CMakeLists.txt b/json_headers_only_demo/CMakeLists.txt
|
||||
index a3c787a..6eae11e 100644
|
||||
--- a/json_headers_only_demo/CMakeLists.txt
|
||||
+++ b/json_headers_only_demo/CMakeLists.txt
|
||||
@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
|
||||
|
||||
ADD_EXECUTABLE(json_headers_only_demo ${JSON_HEADERS_ONLY_DEMO_SRCS})
|
||||
-TARGET_LINK_LIBRARIES(json_headers_only_demo json_spirit)
|
||||
+TARGET_LINK_LIBRARIES(json_headers_only_demo json_spirit -latomic)
|
||||
|
||||
diff --git a/json_map_demo/CMakeLists.txt b/json_map_demo/CMakeLists.txt
|
||||
index 599006a..e3e45e8 100644
|
||||
--- a/json_map_demo/CMakeLists.txt
|
||||
+++ b/json_map_demo/CMakeLists.txt
|
||||
@@ -5,5 +5,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
|
||||
|
||||
ADD_EXECUTABLE(json_map_demo ${JSON_MAP_DEMO_SRCS})
|
||||
-TARGET_LINK_LIBRARIES(json_map_demo json_spirit)
|
||||
+TARGET_LINK_LIBRARIES(json_map_demo json_spirit -latomic)
|
||||
|
||||
diff --git a/json_test/CMakeLists.txt b/json_test/CMakeLists.txt
|
||||
index 38ffa7f..1ec1365 100644
|
||||
--- a/json_test/CMakeLists.txt
|
||||
+++ b/json_test/CMakeLists.txt
|
||||
@@ -11,5 +11,5 @@ FIND_PACKAGE(Boost 1.34 REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
|
||||
|
||||
ADD_EXECUTABLE(json_test ${JSON_TEST_SRCS})
|
||||
-TARGET_LINK_LIBRARIES(json_test json_spirit)
|
||||
+TARGET_LINK_LIBRARIES(json_test json_spirit -latomic)
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
SUMMARY = "A C++ JSON Parser/Generator Implemented with Boost Spirit."
|
||||
DESCRIPTION = "JSON Spirit, a C++ library that reads and writes JSON files or streams. \
|
||||
It is written using the Boost Spirit parser generator. If you are \
|
||||
already using Boost, you can use JSON Spirit without any additional \
|
||||
dependencies."
|
||||
HOMEPAGE = "https://www.codeproject.com/kb/recipes/json_spirit.aspx"
|
||||
SECTION = "libs"
|
||||
PRIORITY = "optional"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=278ef6183dec4aae1524fccc4b0113c9"
|
||||
|
||||
DEPENDS = "boost"
|
||||
|
||||
SRC_URI = "file://json_spirit_v${PV}.zip \
|
||||
file://0001-Adjust-the-cmake-files.patch \
|
||||
file://0001-Link-to-libatomic.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/json_spirit_v${PV}"
|
||||
|
||||
inherit cmake
|
||||
|
||||
BBCLASSEXTEND = "nativesdk"
|
||||
Reference in New Issue
Block a user