[PATCH v2 4/7] cmake: consolidate CMAKE_USE_SYSTEM_LIBRARIES

Ross Burton
2026-02-16T13:48:52Z

Move CMAKE_USE_SYSTEM_LIBRARIES=1 to cmake.inc so that all builds use
system libraries unless told otherwise.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
meta/recipes-devtools/cmake/cmake-native_4.2.3.bb | 1 -
meta/recipes-devtools/cmake/cmake.inc | 2 ++
meta/recipes-devtools/cmake/cmake_4.2.3.bb | 1 -
3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/cmake/cmake-native_4.2.3.bb b/meta/recipes-devtools/cmake/cmake-native_4.2.3.bb
index 299cb4d1ea6..0845be49e57 100644
--- a/meta/recipes-devtools/cmake/cmake-native_4.2.3.bb
+++ b/meta/recipes-devtools/cmake/cmake-native_4.2.3.bb
@@ -25,7 +25,6 @@ do_configure[cleandirs] = "${B}"
EXTRA_OECMAKE += "\
-DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
-DBUILD_CursesDialog=1 \
- -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
-DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
-DCMAKE_USE_SYSTEM_LIBRARY_CPPDAP=0 \
-DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
diff --git a/meta/recipes-devtools/cmake/cmake.inc b/meta/recipes-devtools/cmake/cmake.inc
index 5b8c1922b18..1b84c785d03 100644
--- a/meta/recipes-devtools/cmake/cmake.inc
+++ b/meta/recipes-devtools/cmake/cmake.inc
@@ -24,3 +24,5 @@ SRC_URI[sha256sum] = "7efaccde8c5a6b2968bad6ce0fe60e19b6e10701a12fce948c2bf79bac
UPSTREAM_CHECK_REGEX = "cmake-(?P<pver>\d+(\.\d+)+)\.tar"

CVE_STATUS[CVE-2016-10642] = "cpe-incorrect: This is specific to the npm package that installs cmake, so isn't relevant to OpenEmbedded"
+
+EXTRA_OECMAKE += "-DCMAKE_USE_SYSTEM_LIBRARIES=1"
\ No newline at end of file
diff --git a/meta/recipes-devtools/cmake/cmake_4.2.3.bb b/meta/recipes-devtools/cmake/cmake_4.2.3.bb
index 233ceeae153..cf559d764a0 100644
--- a/meta/recipes-devtools/cmake/cmake_4.2.3.bb
+++ b/meta/recipes-devtools/cmake/cmake_4.2.3.bb
@@ -35,7 +35,6 @@ python () {

EXTRA_OECMAKE += " \
-DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \
- -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
-DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
-DCMAKE_USE_SYSTEM_LIBRARY_CPPDAP=0 \
-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
--
2.43.0