--- /dev/null
+--- jsoncpp-1.9.5/jsoncpp-namespaced-targets.cmake.orig 2021-11-03 18:53:28.000000000 +0100
++++ jsoncpp-1.9.5/jsoncpp-namespaced-targets.cmake 2023-05-10 16:21:39.573256446 +0200
+@@ -1,7 +1,7 @@
+-if (TARGET jsoncpp_static)
+- add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
+- set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
+-elseif (TARGET jsoncpp_lib)
++if (TARGET jsoncpp_lib)
+ add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
+ set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
+-endif ()
+\ No newline at end of file
++elseif (TARGET jsoncpp_static)
++ add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
++ set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
++endif ()
#
# Conditional build:
-%bcond_without apidocs # doxygen apidocs build
-%bcond_without tests # tests during build
+%bcond_without apidocs # doxygen apidocs build
+%bcond_without static_libs # static library
+%bcond_without tests # tests during build
Summary: API for manipulating JSON
Summary(pl.UTF-8): API do operacji na strukturach JSON
Name: jsoncpp
Version: 1.9.5
-Release: 2
+Release: 3
License: MIT or Public Domain
Group: Libraries
#Source0Download: https://github.com/open-source-parsers/jsoncpp/releases
Source0: https://github.com/open-source-parsers/jsoncpp/archive/%{version}/%{name}-%{version}.tar.gz
# Source0-md5: d6c8c609f2162eff373db62b90a051c7
+Patch0: %{name}-cmake-prefer-shared.patch
URL: https://github.com/open-source-parsers/jsoncpp/
BuildRequires: cmake >= 3.8.0
BuildRequires: libstdc++-devel >= 6:4.8.1
JSONCPP provides a simple API to manipulate JSON values, and handle
serialization and unserialization to strings.
-%description
+%description -l pl.UTF-8
JSONCPP udostępnia proste API do operacji na wartościach JSON oraz
obsługi serializacji oraz deserializacji z łańcuchów znaków.
%prep
%setup -q
+%patch0 -p1
%build
install -d build
cd build
%cmake .. \
+ -DBUILD_OBJECT_LIBS=OFF \
+ %{!?with_static_libs:-DBUILD_STATIC_LIBS=OFF} \
-DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_includedir}/%{name} \
-DJSONCPP_WITH_CMAKE_PACKAGE=ON \
%{!?with_tests:-DJSONCPP_WITH_TESTS=OFF} \
%{_pkgconfigdir}/jsoncpp.pc
%{_libdir}/cmake/jsoncpp
+%if %{with static_libs}
%files static
%defattr(644,root,root,755)
%{_libdir}/libjsoncpp.a
+%endif
%if %{with apidocs}
%files apidocs