From ceea7dca2f4ff356e136b9a72611b9b66d402eaa Mon Sep 17 00:00:00 2001
From: Přemysl Eric Janouch
Date: Wed, 12 Aug 2020 07:29:57 +0200
Subject: C++: split out a library with a trivial interface
Closes #2.
---
meson.build | 9 +-
pdf-simple-sign.cpp | 895 +--------------------------------------------------
pdf-simple-sign.h | 28 ++
pdf.cpp | 906 ++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 950 insertions(+), 888 deletions(-)
create mode 100644 pdf-simple-sign.h
create mode 100644 pdf.cpp
diff --git a/meson.build b/meson.build
index 0446cc3..6544cdb 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,12 @@
project('pdf-simple-sign', 'cpp', default_options : ['cpp_std=c++11'])
cryptodep = dependency('libcrypto')
-executable('pdf-simple-sign', 'pdf-simple-sign.cpp',
+
+executable('pdf-simple-sign', 'pdf-simple-sign.cpp', 'pdf.cpp',
+ install : true,
+ dependencies : cryptodep)
+
+install_headers('pdf-simple-sign.h')
+library('pdf-simple-sign', 'pdf.cpp',
+ soversion : 0,
install : true,
dependencies : cryptodep)
diff --git a/pdf-simple-sign.cpp b/pdf-simple-sign.cpp
index 818270e..8f3fe3f 100644
--- a/pdf-simple-sign.cpp
+++ b/pdf-simple-sign.cpp
@@ -2,7 +2,7 @@
//
// pdf-simple-sign: simple PDF signer
//
-// Copyright (c) 2017, Přemysl Eric Janouch
+// Copyright (c) 2017 - 2020, Přemysl Eric Janouch
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted.
@@ -17,899 +17,22 @@
//
#include
-#include
-#undef NDEBUG
-#include
-
-#include
-#include