dev-cpp/simpleini: install cmake config files

Signed-off-by: Yuri Konotopov <ykonotopov@gnome.org>
Closes: https://github.com/gentoo/gentoo/pull/36344
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Yuri Konotopov
2024-04-21 21:23:25 +04:00
committed by Ionen Wolkens
parent 36c7d400cd
commit 48d2fe7cc6
3 changed files with 102 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
From f7862c3dd7ad35becc2741f268e3402e89a37666 Mon Sep 17 00:00:00 2001
From: Alexandre Bouvier <contact@amb.tf>
Date: Tue, 2 Jan 2024 10:54:44 +0100
Subject: [PATCH 2/2] cmake: really disable tests (#75)
---
CMakeLists.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7804947..4b360ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,5 +72,7 @@ target_include_directories(${PROJECT_NAME} INTERFACE
if(IS_TOPLEVEL_PROJECT)
include(CTest)
- add_subdirectory(tests)
+ if(BUILD_TESTING)
+ add_subdirectory(tests)
+ endif()
endif()
--
2.43.2

View File

@@ -0,0 +1,44 @@
From aeacf861a8ad8add5f4974792a88ffea393e41db Mon Sep 17 00:00:00 2001
From: Alexandre Bouvier <contact@amb.tf>
Date: Tue, 2 Jan 2024 08:42:03 +0100
Subject: [PATCH 1/2] cmake: fix namespace and include dir (#74)
---
CMakeLists.txt | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8f09295..7804947 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,7 +48,7 @@ configure_package_config_file(${PROJECT_NAME}Config.cmake.in
)
install(FILES SimpleIni.h
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(TARGETS ${PROJECT_NAME}
@@ -62,12 +62,15 @@ install(FILES
)
install(EXPORT ${PROJECT_NAME}Targets
DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}
- NAMESPACE EXPORT_NAMESPACE
+ NAMESPACE ${EXPORT_NAMESPACE}
)
-target_include_directories(${PROJECT_NAME} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
+target_include_directories(${PROJECT_NAME} INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+)
if(IS_TOPLEVEL_PROJECT)
- enable_testing()
+ include(CTest)
add_subdirectory(tests)
endif()
--
2.43.2

View File

@@ -0,0 +1,33 @@
# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="C++ library providing a simple API to read and write INI-style files"
HOMEPAGE="https://github.com/brofield/simpleini/"
SRC_URI="https://github.com/brofield/simpleini/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"
DEPEND="test? ( dev-cpp/gtest )"
BDEPEND="test? ( virtual/pkgconfig )"
PATCHES=(
"${FILESDIR}"/${PN}-4.20-pkgconfig-var.patch
"${FILESDIR}"/${P}-include-dir.patch
"${FILESDIR}"/${P}-disable-tests.patch
)
src_configure() {
local mycmakeargs=(
-DBUILD_TESTING=$(usex test)
-DSIMPLEINI_USE_SYSTEM_GTEST=ON
)
cmake_src_configure
}