From 4fe3d9e041d88f81c0a8336d2f6d1b2a59f6ac49 Mon Sep 17 00:00:00 2001 From: Edmunt Pienkowsky Date: Wed, 8 May 2024 07:41:48 +0200 Subject: [PATCH] ctest: Honor BUILD_TESTING option --- CMakeLists.txt | 1 + CMakePresets.json | 4 ++++ get-build-flags.sh | 12 ++++++++++++ src/CMakeLists.txt | 2 +- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80d250a2..617f748a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -248,6 +248,7 @@ IF(BUILD_CHAN_QUECTEL_BINARY) IF(IS_GIT_REPO) INCLUDE(CTest) ENDIF() + IF(NOT DEFINED ASTERISK_VERSION_NUM) FIND_PACKAGE(PkgConfig) IF(${PKG_CONFIG_FOUND}) diff --git a/CMakePresets.json b/CMakePresets.json index 667bfe6e..bd4da4e2 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -83,6 +83,10 @@ "type": "BOOL", "value": true }, + "BUILD_TESTING": { + "type": "BOOL", + "value": false + }, "BUILD_CHAN_QUECTEL_BINARY": { "type": "BOOL", "value": true diff --git a/get-build-flags.sh b/get-build-flags.sh index 70f52aa7..a6557b15 100755 --- a/get-build-flags.sh +++ b/get-build-flags.sh @@ -11,6 +11,10 @@ readonly JQ_DEB_SCRIPT=' name: "deb-internal", hidden: true, cacheVariables: { + "BUILD_TESTING": { + type: "BOOL", + value: true + }, "CHECK_SOURCE_DATE_EPOCH": { "type": "BOOL", "value": true @@ -58,6 +62,10 @@ readonly JQ_RPI_SCRIPT=' name: "rpi-internal", hidden: true, cacheVariables: { + "BUILD_TESTING": { + type: "BOOL", + value: true + }, "CHECK_SOURCE_DATE_EPOCH": { "type": "BOOL", "value": true @@ -118,6 +126,10 @@ readonly JQ_RPM_SCRIPT=' name: "rpm-internal", hidden: true, cacheVariables: { + "BUILD_TESTING": { + type: "BOOL", + value: true + }, "CHECK_SOURCE_DATE_EPOCH": { "type": "BOOL", "value": true diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c1ca2b25..81698a79 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,7 +48,7 @@ INSTALL( COMPONENT chan-quectel ) -IF(IS_GIT_REPO) +IF(IS_GIT_REPO AND BUILD_TESTING) IF(DEFINED CMAKE_READELF) ADD_TEST(NAME "Load library" COMMAND ${CMAKE_COMMAND} -DCMAKE_READELF=${CMAKE_READELF}