diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-03-19 22:51:09 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-03-21 08:25:11 -0700 |
commit | ea01f3fd80710fa675a0fb97ae7c03fb3ff63af3 (patch) | |
tree | add186ded4a5cc1bb8b31647afa4582adde0102e | |
parent | 5723c738c0cee50d5a2ef2dae0cbaec633098afc (diff) | |
download | meta-openembedded-ea01f3fd80710fa675a0fb97ae7c03fb3ff63af3.tar.gz |
json-schema-validator: Use GNUInstallDirs in cmake
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 files changed, 49 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/json-schema-validator/json-schema-validator/0001-cmake-Use-GNUInstallDirs.patch b/meta-oe/recipes-devtools/json-schema-validator/json-schema-validator/0001-cmake-Use-GNUInstallDirs.patch new file mode 100644 index 0000000000..4b1184a394 --- /dev/null +++ b/meta-oe/recipes-devtools/json-schema-validator/json-schema-validator/0001-cmake-Use-GNUInstallDirs.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From e0b1ad02c678513412aba95a1b2fb4005c3c0452 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 19 Mar 2022 22:40:49 -0700 | ||
4 | Subject: [PATCH] cmake: Use GNUInstallDirs | ||
5 | |||
6 | This helps it make it platform independent, some platforms e.g. | ||
7 | ppc64/linux use /usr/lib64 for system libraries | ||
8 | |||
9 | Upstream-Status: Submitted [https://github.com/pboettch/json-schema-validator/pull/197] | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | CMakeLists.txt | 8 +++++--- | ||
13 | 1 file changed, 5 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
16 | index c4cc218..594dc5f 100644 | ||
17 | --- a/CMakeLists.txt | ||
18 | +++ b/CMakeLists.txt | ||
19 | @@ -122,11 +122,13 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
20 | endif() | ||
21 | endif() | ||
22 | |||
23 | +include(GNUInstallDirs) | ||
24 | + | ||
25 | if(JSON_VALIDATOR_INSTALL) | ||
26 | install(TARGETS nlohmann_json_schema_validator | ||
27 | EXPORT ${PROJECT_NAME}Targets | ||
28 | - LIBRARY DESTINATION lib | ||
29 | - ARCHIVE DESTINATION lib | ||
30 | + LIBRARY DESTINATION ${LIBDIR} | ||
31 | + ARCHIVE DESTINATION ${LIBDIR} | ||
32 | RUNTIME DESTINATION bin) | ||
33 | |||
34 | install(FILES src/nlohmann/json-schema.hpp | ||
35 | @@ -155,7 +157,7 @@ if(JSON_VALIDATOR_INSTALL) | ||
36 | # Set Up the Project Targets and Config Files for CMake | ||
37 | |||
38 | # Set the install path to the cmake config files | ||
39 | - set(INSTALL_CMAKE_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}) | ||
40 | + set(INSTALL_CMAKE_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) | ||
41 | |||
42 | # Create the ConfigVersion file | ||
43 | include(CMakePackageConfigHelpers) # write_basic_package_version_file | ||
44 | -- | ||
45 | 2.35.1 | ||
46 | |||
diff --git a/meta-oe/recipes-devtools/json-schema-validator/json-schema-validator_2.1.0.bb b/meta-oe/recipes-devtools/json-schema-validator/json-schema-validator_2.1.0.bb index 4a8de5f3b0..00d26d7b34 100644 --- a/meta-oe/recipes-devtools/json-schema-validator/json-schema-validator_2.1.0.bb +++ b/meta-oe/recipes-devtools/json-schema-validator/json-schema-validator_2.1.0.bb | |||
@@ -2,7 +2,9 @@ SUMMARY = "JSON schema validator for JSON for Modern C++" | |||
2 | LICENSE = "MIT" | 2 | LICENSE = "MIT" |
3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c441d022da1b1663c70181a32225d006" | 3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c441d022da1b1663c70181a32225d006" |
4 | 4 | ||
5 | SRC_URI = "git://github.com/pboettch/json-schema-validator;branch=master;protocol=https" | 5 | SRC_URI = "git://github.com/pboettch/json-schema-validator;branch=master;protocol=https \ |
6 | file://0001-cmake-Use-GNUInstallDirs.patch \ | ||
7 | " | ||
6 | SRCREV = "27fc1d094503623dfe39365ba82581507524545c" | 8 | SRCREV = "27fc1d094503623dfe39365ba82581507524545c" |
7 | 9 | ||
8 | S = "${WORKDIR}/git" | 10 | S = "${WORKDIR}/git" |