diff options
Diffstat (limited to 'meta-oe/recipes-support/avro/avro-c++/0002-Add-package-configuration-files.patch')
-rw-r--r-- | meta-oe/recipes-support/avro/avro-c++/0002-Add-package-configuration-files.patch | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/avro/avro-c++/0002-Add-package-configuration-files.patch b/meta-oe/recipes-support/avro/avro-c++/0002-Add-package-configuration-files.patch new file mode 100644 index 000000000..ecb125186 --- /dev/null +++ b/meta-oe/recipes-support/avro/avro-c++/0002-Add-package-configuration-files.patch | |||
@@ -0,0 +1,79 @@ | |||
1 | From 56feaa90d070a5011f380d3ae47c01643b9fafe0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rui Costa <rui.ms.costa@ctw.bmwgroup.com> | ||
3 | Date: Fri, 22 Mar 2024 13:27:38 +0000 | ||
4 | Subject: [PATCH 2/2] Add package configuration files | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | --- | ||
8 | lang/c++/CMakeLists.txt | 35 +++++++++++++++++++++++++++--- | ||
9 | lang/c++/cmake/AvroCppConfig.cmake | 5 +++++ | ||
10 | 2 files changed, 37 insertions(+), 3 deletions(-) | ||
11 | create mode 100644 lang/c++/cmake/AvroCppConfig.cmake | ||
12 | |||
13 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
14 | index d94ba42d3..2e5a394cb 100644 | ||
15 | --- a/CMakeLists.txt | ||
16 | +++ b/CMakeLists.txt | ||
17 | @@ -140,12 +140,16 @@ set (CPACK_PACKAGE_FILE_NAME "avrocpp-${AVRO_VERSION_MAJOR}") | ||
18 | |||
19 | include (CPack) | ||
20 | |||
21 | -install (TARGETS avrocpp avrocpp_s | ||
22 | +install (TARGETS avrocpp | ||
23 | + EXPORT AvroCppTargets | ||
24 | LIBRARY DESTINATION lib | ||
25 | ARCHIVE DESTINATION lib | ||
26 | - RUNTIME DESTINATION lib) | ||
27 | + RUNTIME DESTINATION lib | ||
28 | + INCLUDES DESTINATION include) | ||
29 | |||
30 | -install (TARGETS avrogencpp RUNTIME DESTINATION bin) | ||
31 | +install (TARGETS avrogencpp | ||
32 | + EXPORT AvroCppTargets | ||
33 | + RUNTIME DESTINATION bin) | ||
34 | |||
35 | install (DIRECTORY api/ DESTINATION include/avro | ||
36 | FILES_MATCHING PATTERN *.hh) | ||
37 | @@ -155,3 +159,28 @@ if (NOT CMAKE_BUILD_TYPE) | ||
38 | "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." | ||
39 | FORCE) | ||
40 | endif (NOT CMAKE_BUILD_TYPE) | ||
41 | + | ||
42 | +# Create cmake config files | ||
43 | +include(CMakePackageConfigHelpers) | ||
44 | +write_basic_package_version_file( | ||
45 | + "${CMAKE_CURRENT_BINARY_DIR}/AvroCppConfigVersion.cmake" | ||
46 | + VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR}.${AVRO_VERSION_PATCH} | ||
47 | + COMPATIBILITY AnyNewerVersion | ||
48 | +) | ||
49 | + | ||
50 | +configure_file(cmake/AvroCppConfig.cmake | ||
51 | + "${CMAKE_CURRENT_BINARY_DIR}/AvroCppConfig.cmake" | ||
52 | + COPYONLY | ||
53 | +) | ||
54 | + | ||
55 | +set(ConfigPackageLocation lib/cmake/avrocpp) | ||
56 | +install(EXPORT AvroCppTargets | ||
57 | + FILE AvroCppTargets.cmake | ||
58 | + NAMESPACE AvroCpp:: | ||
59 | + DESTINATION ${ConfigPackageLocation} | ||
60 | +) | ||
61 | +install(FILES | ||
62 | + "cmake/AvroCppConfig.cmake" | ||
63 | + "${CMAKE_CURRENT_BINARY_DIR}/AvroCppConfigVersion.cmake" | ||
64 | + DESTINATION ${ConfigPackageLocation} | ||
65 | + COMPONENT Devel) | ||
66 | diff --git a/cmake/AvroCppConfig.cmake b/cmake/AvroCppConfig.cmake | ||
67 | new file mode 100644 | ||
68 | index 000000000..deb8aaa31 | ||
69 | --- /dev/null | ||
70 | +++ b/cmake/AvroCppConfig.cmake | ||
71 | @@ -0,0 +1,5 @@ | ||
72 | +include(CMakeFindDependencyMacro) | ||
73 | +find_dependency(Boost 1.38 REQUIRED | ||
74 | + COMPONENTS filesystem iostreams program_options regex system) | ||
75 | + | ||
76 | +include("${CMAKE_CURRENT_LIST_DIR}/AvroCppTargets.cmake") | ||
77 | -- | ||
78 | 2.44.0 | ||
79 | |||