diff mbox series

[meta-oe,PATCHv2] libtinyxml2: use cmake buildsystem

Message ID 20251103075055.300411-1-f_l_k@t-online.de
State Under Review
Headers show
Series [meta-oe,PATCHv2] libtinyxml2: use cmake buildsystem | expand

Commit Message

Markus Volk Nov. 3, 2025, 7:50 a.m. UTC
Currently tinyxml2 is built with meson, which doesn't generate files in /usr/lib/cmake
Use cmake instead. This will generate files in both /usr/lib/cmake and /usr/lib/pkgconfig
and allow cmake projects to find libtinyxml2.

Avoids errors such as:

| CMake Error at CMakeLists.txt:11 (find_package):
|   By not providing "FindTinyXML2.cmake" in CMAKE_MODULE_PATH this project has
|   asked CMake to find a package configuration file provided by "TinyXML2",
|   but CMake did not find one.
|
|   Could not find a package configuration file provided by "TinyXML2" with any
|   of the following names:
|
|     TinyXML2Config.cmake
|     tinyxml2-config.cmake
|
|   Add the installation prefix of "TinyXML2" to CMAKE_PREFIX_PATH or set
|   "TinyXML2_DIR" to a directory containing one of the above files.  If
|   "TinyXML2" provides a separate development package or SDK, be sure it has
|   been installed.
|
|
| -- Configuring incomplete, errors occurred!
---
 .../recipes-support/libtinyxml2/libtinyxml2_11.0.0.bb | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/libtinyxml2/libtinyxml2_11.0.0.bb b/meta-oe/recipes-support/libtinyxml2/libtinyxml2_11.0.0.bb
index 89e6eca99b..d295b99f3d 100644
--- a/meta-oe/recipes-support/libtinyxml2/libtinyxml2_11.0.0.bb
+++ b/meta-oe/recipes-support/libtinyxml2/libtinyxml2_11.0.0.bb
@@ -9,14 +9,13 @@  SRCREV = "9148bdf719e997d1f474be6bcc7943881046dba1"
 SRC_URI = "git://github.com/leethomason/tinyxml2.git;branch=master;protocol=https \
            file://run-ptest"
 
+inherit cmake ptest
 
-inherit meson ptest
-
-EXTRA_OEMESON += " \
-    ${@bb.utils.contains('PTEST_ENABLED', '1', '-Dtests=true', '', d)} \
-    -Ddefault_library=both \
-"
+EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-Dtinyxml2_BUILD_TESTING=ON', '', d)}"
 
+PACKAGECONFIG ?= "shared-libs"
+PACKAGECONFIG[shared-libs] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF" 
+ 
 CXXFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE"
 
 do_install_ptest() {