[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| Re: [mosquitto-dev] 2.1 testing binaries (called 2.0.99) available | 
(I've sent a number of minor things and test results to Roger
privately.)
I'm building on NetBSD 10 amd64, with most prereqs in /usr/pkg.
If I leave tests enabled (they are default on, but I want to run them),
then I get a build failure not finding gmock/gmock.h.  But it's qin
/usr/pkg/include, and there is cmake code to find it:
  if(WITH_TESTS)
          find_package(GTest REQUIRED)
          include(GoogleTest)
          enable_testing()
          add_subdirectory(test)
  endif()
I tried setting CMAKE_PREFIX_PATH and that didn't help.  But I find
cmake's approach confusing; it doesn't seem as simple as autoconf's just
pass CPPFLAGS in the environment or the normal --with-foo setup.
Perhaps I am just underclued about cmake, but perhaps the mechanism for
finding and using the include path for GTest is not quite right.  Maybe
GTEST_INCLUDEDIR or similar set in find and then used in the target
declaration?
Obviously this is the wrong fix, but with it I can build and run tests:
  diff --git a/test/mock/CMakeLists.txt b/test/mock/CMakeLists.txt
  index e34e509e..28dee7c9 100644
  --- a/test/mock/CMakeLists.txt
  +++ b/test/mock/CMakeLists.txt
  @@ -14,4 +14,5 @@ add_library(pthread_mock OBJECT pthread_mock.cpp)
   target_include_directories(pthread_mock
       PUBLIC
           ${mosquitto_SOURCE_DIR}/test/mock
  +       /usr/pkg/include
   )