pystring, bump version (#10608)

This commit is contained in:
Schrijvers Luc
2024-06-18 17:08:43 +02:00
committed by GitHub
parent 90e44ad9f6
commit f8951b7064
3 changed files with 47 additions and 94 deletions

View File

@@ -1,81 +0,0 @@
From 754fcd9ebc523d3d4de39b9d0e443841a717e1c0 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Wed, 14 Jul 2021 19:21:21 +0000
Subject: Import open PR from https://github.com/imageworks/pystring/pull/29
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..0081a83
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,56 @@
+cmake_minimum_required(VERSION 3.2)
+
+option(BUILD_SHARED_LIBS "Create shared libraries if ON" OFF)
+
+project(pystring LANGUAGES CXX)
+
+# pystring library ======
+
+add_library(pystring
+ pystring.cpp
+ pystring.h
+)
+set_target_properties(pystring
+ PROPERTIES
+ PUBLIC_HEADER pystring.h
+ SOVERSION 0.0)
+
+set(EXPORT_NAME "${PROJECT_NAME}Targets")
+set(NAMESPACE "${PROJECT_NAME}::")
+
+# test ======
+
+include(CTest)
+
+if(BUILD_TESTING)
+ add_executable(pystring_test
+ test.cpp
+ unittest.h
+ )
+
+ target_link_libraries(pystring_test pystring)
+
+ add_test(NAME pystring_test COMMAND pystring_test)
+endif()
+
+# install and cmake configs ======
+
+include(GNUInstallDirs)
+install(TARGETS pystring
+ EXPORT "${EXPORT_NAME}"
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pystring)
+
+include(CMakePackageConfigHelpers)
+configure_package_config_file(cmake/pystringConfig.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/pystringConfig.cmake
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pystring)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pystringConfig.cmake
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pystring)
+
+install(EXPORT "${EXPORT_NAME}"
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pystring
+ NAMESPACE "${NAMESPACE}")
diff --git a/cmake/pystringConfig.cmake.in b/cmake/pystringConfig.cmake.in
new file mode 100644
index 0000000..82e3995
--- /dev/null
+++ b/cmake/pystringConfig.cmake.in
@@ -0,0 +1,4 @@
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/@EXPORT_NAME@.cmake")
+check_required_components("@PROJECT_NAME@")
--
2.30.2

View File

@@ -0,0 +1,39 @@
From ded9c50841ff5383ab61ccbf15a49ebf4575ea7b Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Tue, 18 Jun 2024 16:37:59 +0200
Subject: applying patch cmake-project-version.patch
https://src.fedoraproject.org/rpms/pystring/blob/rawhide/f/cmake-project-version.patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fed418f..e877cd6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.2)
-project(pystring CXX)
+project(pystring VERSION 1.1.4 LANGUAGES CXX)
set(BUILD_SHARED_LIBS YES)
@@ -7,6 +7,10 @@ add_library(pystring
pystring.cpp
pystring.h
)
+set_target_properties(pystring PROPERTIES
+ PUBLIC_HEADER "pystring.h"
+ VERSION ${PROJECT_VERSION}
+)
add_executable (pystring_test test.cpp)
TARGET_LINK_LIBRARIES (pystring_test pystring)
@@ -18,5 +22,6 @@ include(GNUInstallDirs)
install(TARGETS pystring
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
--
2.45.1