Files
bsdports/devel/cmake/files/patch-Source_CPack_cmCPackFreeBSDGenerator.cxx
2019-12-26 07:26:06 +00:00

19 lines
698 B
C++

diff --git Source/CPack/cmCPackFreeBSDGenerator.cxx Source/CPack/cmCPackFreeBSDGenerator.cxx
index 91ae1a23f..a676302e7 100644
--- Source/CPack/cmCPackFreeBSDGenerator.cxx
+++ Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -339,6 +339,13 @@ int cmCPackFreeBSDGenerator::PackageFiles()
std::string output_dir =
cmSystemTools::CollapseCombinedPath(toplevel, "../");
+ if (!pkg_initialized() && pkg_init(NULL, NULL) != EPKG_OK)
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Can not initialize libpkg." << std::endl);
+ return 0;
+ }
+
pkg_create_from_manifest(output_dir.c_str(), ::TXZ, toplevel.c_str(),
manifestname.c_str(), NULL);