dev-cpp/properties-cpp: re-enable tests

Package-Manager: Portage-3.0.9, Repoman-3.0.2
This commit is contained in:
Alfred Wingate 2020-12-29 19:26:26 +02:00
parent 8e81ddd815
commit 9605918951
No known key found for this signature in database
GPG Key ID: A12750536B5E7010
3 changed files with 32 additions and 8 deletions

View File

@ -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)

View File

@ -20,20 +20,25 @@ fi
LICENSE="LGPL-3" LICENSE="LGPL-3"
SLOT="0" SLOT="0"
IUSE="doc" IUSE="doc test"
DEPEND=" DEPEND="
doc? ( app-doc/doxygen ) doc? ( app-doc/doxygen )
test? ( dev-cpp/gtest )
" "
# test? ( dev-cpp/gtest )
#"
PATCHES=( "${FILESDIR}/optional_tests.patch" ) 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() { src_configure() {
local mycmakeargs=( local mycmakeargs=(
-DPROPERTIES_CPP_ENABLE_DOC_GENERATION=$(usex doc) -DPROPERTIES_CPP_ENABLE_DOC_GENERATION=$(usex doc)
-DPROPERTIES_CPP_BUILD_TESTS=OFF -DPROPERTIES_CPP_BUILD_TESTS=$(usex test)
) )
cmake_src_configure cmake_src_configure
} }

View File

@ -24,16 +24,18 @@ IUSE="doc"
DEPEND=" DEPEND="
doc? ( app-doc/doxygen ) 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() { src_configure() {
local mycmakeargs=( local mycmakeargs=(
-DPROPERTIES_CPP_ENABLE_DOC_GENERATION=$(usex doc) -DPROPERTIES_CPP_ENABLE_DOC_GENERATION=$(usex doc)
-DPROPERTIES_CPP_BUILD_TESTS=OFF
) )
cmake_src_configure cmake_src_configure
} }