From 9605918951a39a7703bd3156da7db1dc8ead8cc5 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Tue, 29 Dec 2020 19:26:26 +0200 Subject: [PATCH] dev-cpp/properties-cpp: re-enable tests Package-Manager: Portage-3.0.9, Repoman-3.0.2 --- dev-cpp/properties-cpp/files/FindGtest.cmake | 17 +++++++++++++++++ .../properties-cpp-0_pre20180409.ebuild | 13 +++++++++---- .../properties-cpp/properties-cpp-9999.ebuild | 10 ++++++---- 3 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 dev-cpp/properties-cpp/files/FindGtest.cmake diff --git a/dev-cpp/properties-cpp/files/FindGtest.cmake b/dev-cpp/properties-cpp/files/FindGtest.cmake new file mode 100644 index 0000000..6d090c8 --- /dev/null +++ b/dev-cpp/properties-cpp/files/FindGtest.cmake @@ -0,0 +1,17 @@ +include(FindPackageHandleStandardArgs) + +find_path(GTEST_INCLUDE_DIR gtest/gtest.h) +find_path(GMOCK_INCLUDE_DIR gmock/gmock.h) + +find_library(GMOCK_LIBRARY libgmock.so) +find_library(GMOCK_MAIN_LIBRARY libgmock_main.so) +find_library(GTEST_LIBRARY libgtest.so) +find_library(GTEST_MAIN_LIBRARY libgtest_main.so) + +set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARY} ${GMOCK_MAIN_LIBRARY}) +set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY}) +set(GTEST_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES}) + +find_package_handle_standard_args(Gtest DEFAULT_MSG + GMOCK_INCLUDE_DIR + GTEST_INCLUDE_DIR) diff --git a/dev-cpp/properties-cpp/properties-cpp-0_pre20180409.ebuild b/dev-cpp/properties-cpp/properties-cpp-0_pre20180409.ebuild index 684a54b..8ec333d 100644 --- a/dev-cpp/properties-cpp/properties-cpp-0_pre20180409.ebuild +++ b/dev-cpp/properties-cpp/properties-cpp-0_pre20180409.ebuild @@ -20,20 +20,25 @@ fi LICENSE="LGPL-3" SLOT="0" -IUSE="doc" +IUSE="doc test" DEPEND=" doc? ( app-doc/doxygen ) + test? ( dev-cpp/gtest ) " -# test? ( dev-cpp/gtest ) -#" PATCHES=( "${FILESDIR}/optional_tests.patch" ) +src_prepare() { + # Provided FindGtest tries (and fails) to build its own version of gtest rather than actually search for it on the system + cp "${FILESDIR}"/FindGtest.cmake cmake/FindGtest.cmake || die + cmake_src_prepare +} + src_configure() { local mycmakeargs=( -DPROPERTIES_CPP_ENABLE_DOC_GENERATION=$(usex doc) - -DPROPERTIES_CPP_BUILD_TESTS=OFF + -DPROPERTIES_CPP_BUILD_TESTS=$(usex test) ) cmake_src_configure } diff --git a/dev-cpp/properties-cpp/properties-cpp-9999.ebuild b/dev-cpp/properties-cpp/properties-cpp-9999.ebuild index 684a54b..8f0ce59 100644 --- a/dev-cpp/properties-cpp/properties-cpp-9999.ebuild +++ b/dev-cpp/properties-cpp/properties-cpp-9999.ebuild @@ -24,16 +24,18 @@ IUSE="doc" DEPEND=" doc? ( app-doc/doxygen ) + dev-cpp/gtest " -# test? ( dev-cpp/gtest ) -#" -PATCHES=( "${FILESDIR}/optional_tests.patch" ) +src_prepare() { + # Provided FindGtest tries (and fails) to build its own version of gtest rather than actually search for it on the system + cp "${FILESDIR}"/FindGtest.cmake cmake/FindGtest.cmake || die + cmake_src_prepare +} src_configure() { local mycmakeargs=( -DPROPERTIES_CPP_ENABLE_DOC_GENERATION=$(usex doc) - -DPROPERTIES_CPP_BUILD_TESTS=OFF ) cmake_src_configure }