[med-svn] [Git][med-team/libzeep][upstream] New upstream version 5.1.4

Maarten L. Hekkelman (@mhekkel-guest) gitlab at salsa.debian.org
Wed Sep 29 15:24:05 BST 2021



Maarten L. Hekkelman pushed to branch upstream at Debian Med / libzeep


Commits:
c3143cac by Maarten L. Hekkelman at 2021-09-29T15:48:32+02:00
New upstream version 5.1.4
- - - - -


6 changed files:

- CMakeLists.txt
- Config.cmake.in
- changelog
- + cmake/FindFilesystem.cmake
- include/zeep/xml/node.hpp
- lib-xml/src/node.cpp


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -1,12 +1,13 @@
 cmake_minimum_required(VERSION 3.16)
 
-project(libzeep VERSION 5.1.2 LANGUAGES CXX)
+project(libzeep VERSION 5.1.4 LANGUAGES CXX)
 
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
 
 include(GNUInstallDirs)
 include(CheckFunctionExists)
 include(CheckIncludeFiles)
+include(FindFilesystem)
 include(CheckLibraryExists)
 include(CMakePackageConfigHelpers)
 include(Dart)
@@ -20,10 +21,11 @@ set(CXX_EXTENSIONS OFF)
 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-if(CMAKE_COMPILER_IS_GNUCC)
-    set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter")
-endif()
-if(MSVC)
+find_package(Filesystem REQUIRED)
+
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
+elseif(MSVC)
     set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} /W4")
 endif()
 
@@ -52,8 +54,8 @@ if(MSVC)
 
 	# On Windows, do not install in the system location by default
 	if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-		message("The library and auxiliary files will be installed in $ENV{LOCALAPPDATA}/${PROJECT_NAME}")
-		set(CMAKE_INSTALL_PREFIX "$ENV{LOCALAPPDATA}/${PROJECT_NAME}" CACHE PATH "..." FORCE)
+		message("The library and auxiliary files will be installed in $ENV{LOCALAPPDATA}/zeep")
+		set(CMAKE_INSTALL_PREFIX "$ENV{LOCALAPPDATA}/zeep" CACHE PATH "..." FORCE)
 	endif()
 
 	# Find out the processor type for the target
@@ -95,13 +97,10 @@ set(THREADS_PREFER_PTHREAD_FLAG)
 find_package(Threads REQUIRED)
 
 set(Boost_DETAILED_FAILURE_MSG ON)
-find_package(Boost 1.70.0 REQUIRED COMPONENTS program_options system date_time)
-
-find_package(ZLIB)
-find_package(BZip2)
-
-include_directories(${Boost_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/include)
-link_libraries(${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+if(NOT BUILD_SHARED_LIBS)
+	set(Boost_USE_STATIC_LIBS ON)
+endif()
+find_package(Boost 1.70.0 REQUIRED COMPONENTS program_options system date_time regex)
 
 set(ZEEP_HEADERS
 	${CMAKE_SOURCE_DIR}/include/zeep/crypto.hpp
@@ -191,8 +190,12 @@ target_include_directories(zeep
 	PUBLIC
 	"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
 	"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
+	${Boost_INCLUDE_DIR}
 )
 
+target_include_directories(zeep PRIVATE ${CMAKE_SOURCE_DIR}/include)
+target_link_libraries(zeep PUBLIC ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} std::filesystem)
+
 if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
     target_link_options(zeep PRIVATE -undefined dynamic_lookup)
 endif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
@@ -340,6 +343,12 @@ if(ZEEP_BUILD_TESTS)
 	# data files for the parser test
 
 	add_library(client_test OBJECT ${CMAKE_SOURCE_DIR}/lib-http/test/client-test-code.cpp)
+	target_include_directories(client_test PRIVATE
+		${CMAKE_CURRENT_SOURCE_DIR}/include
+		${CMAKE_CURRENT_BINARY_DIR}  # for config.h
+		${CMAKE_SOURCE_DIR}/include
+		${Boost_INCLUDE_DIR}
+	)
 
 	# data files for the parser test
 	set(XML_CONF_TAR ${CMAKE_SOURCE_DIR}/lib-xml/test/XML-Test-Suite.tbz)
@@ -412,9 +421,10 @@ if(ZEEP_BUILD_TESTS)
 		target_include_directories(${ZEEP_TEST} PRIVATE
 			${CMAKE_CURRENT_SOURCE_DIR}/include
 			${CMAKE_CURRENT_BINARY_DIR}  # for config.h
+			${CMAKE_SOURCE_DIR}/include
 		)
 
-		target_link_libraries(${ZEEP_TEST} zeep)
+		target_link_libraries(${ZEEP_TEST} PRIVATE zeep std::filesystem)
 
 		if(MSVC)
 			# Specify unwind semantics so that MSVC knowns how to handle exceptions


=====================================
Config.cmake.in
=====================================
@@ -1,5 +1,8 @@
 @PACKAGE_INIT@
 
+include(CMakeFindDependencyMacro)
+find_dependency(Boost 1.70.0 REQUIRED COMPONENTS program_options system date_time)
+
 INCLUDE("${CMAKE_CURRENT_LIST_DIR}/zeepTargets.cmake")
 
 set_and_check(ZEEP_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")


=====================================
changelog
=====================================
@@ -1,3 +1,6 @@
+Version 5.1.4
+- Update cmakefile to work more reliably
+
 Version 5.1.3
 - Update SONAME to 5.1
 - Create reproducible builds of documentation (and thus whole package)


=====================================
cmake/FindFilesystem.cmake
=====================================
@@ -0,0 +1,74 @@
+# Simplistic reimplementation of https://github.com/vector-of-bool/CMakeCM/blob/master/modules/FindFilesystem.cmake
+
+if(TARGET std::filesystem)
+	return()
+endif()
+
+cmake_minimum_required(VERSION 3.10)
+
+include(CMakePushCheckState)
+include(CheckIncludeFileCXX)
+include(CheckCXXSourceCompiles)
+
+cmake_push_check_state()
+
+set(CMAKE_CXX_STANDARD 17)
+
+check_include_file_cxx("filesystem" _CXX_FILESYSTEM_HAVE_HEADER)
+mark_as_advanced(_CXX_FILESYSTEM_HAVE_HEADER)
+
+set(code [[
+#include <cstdlib>
+#include <filesystem>
+
+int main() {
+	auto cwd = std::filesystem::current_path();
+	return EXIT_SUCCESS;
+}
+]])
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 8.4.0)
+	# >> https://stackoverflow.com/questions/63902528/program-crashes-when-filesystempath-is-destroyed
+	set(CXX_FILESYSTEM_NO_LINK_NEEDED 0)
+else()
+	# Check a simple filesystem program without any linker flags
+	check_cxx_source_compiles("${code}" CXX_FILESYSTEM_NO_LINK_NEEDED)
+endif()
+
+if(CXX_FILESYSTEM_NO_LINK_NEEDED)
+	set(_found 1)
+else()
+	set(prev_libraries ${CMAKE_REQUIRED_LIBRARIES})
+	# Add the libstdc++ flag
+	set(CMAKE_REQUIRED_LIBRARIES ${prev_libraries} -lstdc++fs)
+	check_cxx_source_compiles("${code}" CXX_FILESYSTEM_STDCPPFS_NEEDED)
+	set(_found ${CXX_FILESYSTEM_STDCPPFS_NEEDED})
+	if(NOT CXX_FILESYSTEM_STDCPPFS_NEEDED)
+		# Try the libc++ flag
+		set(CMAKE_REQUIRED_LIBRARIES ${prev_libraries} -lc++fs)
+		check_cxx_source_compiles("${code}" CXX_FILESYSTEM_CPPFS_NEEDED)
+		set(_found ${CXX_FILESYSTEM_CPPFS_NEEDED})
+	endif()
+endif()
+
+if(_found)
+	add_library(std::filesystem INTERFACE IMPORTED)
+	set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17)
+
+	if(CXX_FILESYSTEM_NO_LINK_NEEDED)
+		# Nothing to add...
+	elseif(CXX_FILESYSTEM_STDCPPFS_NEEDED)
+		set_target_properties(std::filesystem PROPERTIES IMPORTED_LIBNAME stdc++fs)
+	elseif(CXX_FILESYSTEM_CPPFS_NEEDED)
+		set_target_properties(std::filesystem PROPERTIES IMPORTED_LIBNAME c++fs)
+	endif()
+endif()
+
+cmake_pop_check_state()
+
+set(Filesystem_FOUND ${_found} CACHE BOOL "TRUE if we can run a program using std::filesystem" FORCE)
+
+if(Filesystem_FIND_REQUIRED AND NOT Filesystem_FOUND)
+    message(FATAL_ERROR "Cannot run simple program using std::filesystem")
+endif()
+


=====================================
include/zeep/xml/node.hpp
=====================================
@@ -341,10 +341,10 @@ class attribute : public node
 	using parent_type = element;
 
 	attribute(const attribute& attr)
-		: m_qname(attr.m_qname), m_value(attr.m_value), m_id(attr.m_id) {}
+		: node(), m_qname(attr.m_qname), m_value(attr.m_value), m_id(attr.m_id) {}
 
 	attribute(attribute&& attr) noexcept
-		: m_qname(std::move(attr.m_qname)), m_value(std::move(attr.m_value)), m_id(attr.m_id) {}
+		: node(), m_qname(std::move(attr.m_qname)), m_value(std::move(attr.m_value)), m_id(attr.m_id) {}
 
 	attribute(const std::string& qname, const std::string& value, bool id = false)
 		: m_qname(qname), m_value(value), m_id(id) {}


=====================================
lib-xml/src/node.cpp
=====================================
@@ -515,7 +515,8 @@ element::element(const std::string& qname, std::initializer_list<zeep::xml::attr
 
 // copy constructor. Copy data and children, but not parent and sibling
 element::element(const element& e)
-	: m_qname(e.m_qname)
+	: node()
+	, m_qname(e.m_qname)
 	, m_nodes(*this, e.m_nodes)
 	, m_attributes(*this, e.m_attributes)
 {



View it on GitLab: https://salsa.debian.org/med-team/libzeep/-/commit/c3143cac517f9e9ed81d69b6f1aff202b6d41514

-- 
View it on GitLab: https://salsa.debian.org/med-team/libzeep/-/commit/c3143cac517f9e9ed81d69b6f1aff202b6d41514
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210929/9e9e1241/attachment-0001.htm>


More information about the debian-med-commit mailing list