aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-07 16:46:48 +0200
committerAdrian Kummerländer2014-05-07 16:46:48 +0200
commit168537848c7317f81ba44d0986e6cd7da2afb976 (patch)
tree23c8f041329297faa265a223065467702ccb2a00
parente17ba6dde7588f717bc5e79b3cb64cddd73d6173 (diff)
downloadInputXSLT-168537848c7317f81ba44d0986e6cd7da2afb976.tar
InputXSLT-168537848c7317f81ba44d0986e6cd7da2afb976.tar.gz
InputXSLT-168537848c7317f81ba44d0986e6cd7da2afb976.tar.bz2
InputXSLT-168537848c7317f81ba44d0986e6cd7da2afb976.tar.lz
InputXSLT-168537848c7317f81ba44d0986e6cd7da2afb976.tar.xz
InputXSLT-168537848c7317f81ba44d0986e6cd7da2afb976.tar.zst
InputXSLT-168537848c7317f81ba44d0986e6cd7da2afb976.zip
Extracted core functionality into static libary
* this was needed to share object files between the newly separated test-case and example target executables * allows for easy development of multiple "frontends" to the same core functionality
-rw-r--r--CMakeLists.txt31
-rw-r--r--example.cc11
-rw-r--r--test.cc7
3 files changed, 38 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3333c26..53fa29c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,9 +10,9 @@ include_directories(
src/
)
-add_executable(
- test
- test.cc
+add_library(
+ InputXSLT
+ STATIC
src/plattform_guard.cc
src/transformation_facade.cc
src/function/read_file.cc
@@ -21,14 +21,35 @@ add_executable(
src/support/filesystem_context.cc
src/support/dom/document_cache.cc
src/support/dom/document_cache_item.cc
- tests/function_read_file.cc
)
-target_link_libraries(
+add_executable(
+ example
+ example.cc
+)
+
+add_executable(
test
+ test.cc
+ tests/function_read_file.cc
+)
+
+set(
+ Libraries
+ InputXSLT
xalan-c
xerces-c
boost_system
boost_filesystem
+)
+
+target_link_libraries(
+ example
+ ${Libraries}
+)
+
+target_link_libraries(
+ test
gtest
+ ${Libraries}
)
diff --git a/example.cc b/example.cc
new file mode 100644
index 0000000..a0c122d
--- /dev/null
+++ b/example.cc
@@ -0,0 +1,11 @@
+#include "plattform_guard.h"
+#include "transformation_facade.h"
+
+int main(int, char**) {
+ InputXSLT::PlattformGuard plattform;
+ InputXSLT::TransformationFacade transformation("../dummy/transform.xsl");
+
+ return transformation.generate("out.xml", {
+ {"test", "42"}
+ });
+}
diff --git a/test.cc b/test.cc
index c024048..b3bf40e 100644
--- a/test.cc
+++ b/test.cc
@@ -3,13 +3,8 @@
#include "gtest/gtest.h"
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
InputXSLT::PlattformGuard plattform;
- InputXSLT::TransformationFacade transformation("../dummy/transform.xsl");
-
- transformation.generate("out.xml", {
- {"test", "42"}
- });
testing::InitGoogleTest(&argc, argv);