Source: dlt-daemon
Version: 3.0.0-10
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs

dlt-daemon fails to cross build from source, because the upstream
CMakeLists.txt hard codes the build architecture pkg-config and
therefore fails to locate gtest. A side-quest of this is that running
tests is not feasible during cross compilation, but skipping the build
of tests actually changes the package contents, so doing so would break
reproducibility and is not an option. The reason it uses pkg-config is
to discover the version of gtest. While find_package cannot easily
report the version, one can pass a minimum required version. The
attached patch changes the logic to do that and thus avoids the breaking
pkg-config invocation. What do you think? Please propose this upstream
as it also helps other cross-building distributions such as PtxDist or
Yocto.

Helmut
--- dlt-daemon-3.0.0.orig/CMakeLists.txt
+++ dlt-daemon-3.0.0/CMakeLists.txt
@@ -450,17 +450,9 @@
 endif()
 
 if(WITH_DLT_UNIT_TESTS)
-    find_package(GTest)
-    if(GTEST_FOUND)
-        find_package(PkgConfig REQUIRED)
-        execute_process(COMMAND pkg-config --modversion gtest OUTPUT_VARIABLE GTEST_VERSION)
-        string(REPLACE "\n" "" GTEST_VERSION ${GTEST_VERSION})
-        if(${GTEST_VERSION} VERSION_LESS 1.7.0)
-            message(WARNING "Please use Gtest version greater or equal to 1.7.0,
-                    or use option 'WITH_GIT_SUBMODULE' for latest version")
-        endif()
-    else()
-        message(STATUS "No Gtest package found, preparing submodule ...")
+    find_package(GTest 1.7.0)
+    if(NOT GTEST_FOUND)
+        message(STATUS "No suitable Gtest package found, preparing submodule ...")
         set(WITH_GIT_SUBMODULE ON)
     endif()
 

Reply via email to