]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cmake: link against gtest in a better way 23628/head
authorKefu Chai <kchai@redhat.com>
Tue, 14 Aug 2018 08:11:13 +0000 (16:11 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 17 Aug 2018 07:21:27 +0000 (15:21 +0800)
commit6f231ee8640a332b3a04808b7a5e9126369ebe57
tree549de412fbc31661604e110028e76b3b6db8eefa
parentf0800a49ed918b8751bf5e6566a44f313896f659
cmake: link against gtest in a better way

* add FindGMock.cmake which allows user to use the libgtest-dev
  shipped by distro
* add GMock::{GMock,Main}, GTest::{GTest,Main} targets to be
  compatible with FindGTest.cmake and FindGMock.cmake, which
  expose the built libraries with properties adhered to
  them. so the consumer of them can import them in a better way.
* update tests to drop the commands like
  set_target_properties(foo PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}),
  as they are already linked against gmock and gtest.

Signed-off-by: Kefu Chai <kchai@redhat.com>
29 files changed:
cmake/modules/AddCephTest.cmake
cmake/modules/FindGMock.cmake [new file with mode: 0644]
src/CMakeLists.txt
src/test/CMakeLists.txt
src/test/ObjectMap/CMakeLists.txt
src/test/cls_hello/CMakeLists.txt
src/test/cls_journal/CMakeLists.txt
src/test/cls_lock/CMakeLists.txt
src/test/cls_log/CMakeLists.txt
src/test/cls_lua/CMakeLists.txt
src/test/cls_numops/CMakeLists.txt
src/test/cls_rbd/CMakeLists.txt
src/test/cls_refcount/CMakeLists.txt
src/test/cls_rgw/CMakeLists.txt
src/test/cls_sdk/CMakeLists.txt
src/test/cls_statelog/CMakeLists.txt
src/test/cls_version/CMakeLists.txt
src/test/erasure-code/CMakeLists.txt
src/test/filestore/CMakeLists.txt
src/test/journal/CMakeLists.txt
src/test/libcephfs/CMakeLists.txt
src/test/librados/CMakeLists.txt
src/test/libradosstriper/CMakeLists.txt
src/test/librbd/CMakeLists.txt
src/test/mon/CMakeLists.txt
src/test/msgr/CMakeLists.txt
src/test/objectstore/CMakeLists.txt
src/test/rbd_mirror/CMakeLists.txt
src/test/rgw/CMakeLists.txt