[Fawkes Git] branch/thofmann/gtest-check-libs-exist: created (0.5.0-3368-g5d0e249)

Till Hofmann hofmann at kbsg.rwth-aachen.de
Thu Nov 3 10:54:33 CET 2016


Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, thofmann/gtest-check-libs-exist has been created
        at  5d0e24992b2db43b70dcfe932207e4fe443bd003 (commit)

http://git.fawkesrobotics.org/fawkes.git/thofmann/gtest-check-libs-exist

- *Log* ---------------------------------------------------------------
commit 5d0e24992b2db43b70dcfe932207e4fe443bd003
Author:     Till Hofmann <hofmann at kbsg.rwth-aachen.de>
AuthorDate: Thu Nov 3 10:52:59 2016 +0100
Commit:     Till Hofmann <hofmann at kbsg.rwth-aachen.de>
CommitDate: Thu Nov 3 10:52:59 2016 +0100

    buildsys: also check the existence of gtest libs, not only its headers
    
    Some distributions (e.g. Debian) ship the gtest sources but don't ship
    compiled libraries. Thus, only checking for the header is insufficient,
    as linking against the lib will fail. Thus, also check if gtest's
    libraries exist. If not, don't build any tests.

http://git.fawkesrobotics.org/fawkes.git/commit/5d0e249
http://trac.fawkesrobotics.org/changeset/5d0e249

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------


- *Diffs* -------------------------------------------------------------

- *commit* 5d0e24992b2db43b70dcfe932207e4fe443bd003 - - - - - - - - - -
Author:  Till Hofmann <hofmann at kbsg.rwth-aachen.de>
Date:    Thu Nov 3 10:52:59 2016 +0100
Subject: buildsys: also check the existence of gtest libs, not only its headers

 etc/buildsys/gtest.mk |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

_Diff for modified files_:
diff --git a/etc/buildsys/gtest.mk b/etc/buildsys/gtest.mk
index 1859ca6..427908d 100644
--- a/etc/buildsys/gtest.mk
+++ b/etc/buildsys/gtest.mk
@@ -2,7 +2,7 @@
 #                Makefile Build System for Fawkes: gtest unit tests
 #                            -------------------
 #   Created on Mon Jan 05 15:44:42 2015
-#   Copyright (C) 2015 by Till Hofmann
+#   Copyright (C) 2015-2016 by Till Hofmann
 #
 #*****************************************************************************
 #
@@ -31,10 +31,16 @@ ifneq ($(GTESTCONFIG),)
   LDFLAGS_GTEST = $(shell $(GTESTCONFIG) --ldflags --libs)
 else
   # gtest-config not available, but maybe we can still find gtest
-  HAVE_GTEST = $(if $(wildcard $(addsuffix /gtest/gtest.h,$(__GTEST_INCLUDE_PATHS))),1)
-  ifeq ($(HAVE_GTEST),1)
-    # gtest-config not available, we must set the flags manually
-    LDFLAGS_GTEST += -pthread -lgtest
+  HAVE_GTEST_HDR = $(if $(wildcard $(addsuffix /gtest/gtest.h,$(__GTEST_INCLUDE_PATHS))),1)
+  ifeq ($(HAVE_GTEST_HDR),1)
+    # check if library is available
+    HAVE_GTEST_LIB = $(if $(shell ldconfig -p | grep libgtest\\.$(SOEXT)),1,)
+    HAVE_GTEST_MAIN = $(if $(shell ldconfig -p | grep libgtest_main\\.$(SOEXT)),1,)
+    ifeq ($(HAVE_GTEST_LIB)$(HAVE_GTEST_MAIN),11)
+      HAVE_GTEST = 1
+      # gtest-config not available, we must set the flags manually
+      LDFLAGS_GTEST += -pthread -lgtest
+    endif
   endif
 endif
 




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list