From 45d9ab522c8e17b88cfaa7eb5b6a9d10a624a3aa Mon Sep 17 00:00:00 2001
From: Sylvester Joosten <sylvester.joosten@gmail.com>
Date: Tue, 5 Apr 2016 16:04:52 -0400
Subject: [PATCH] added program stub to cmake build

---
 program/CMakeLists.txt      | 54 +++++++++++++++++++++++++++++++++++++
 program/example-config.json |  5 ++++
 program/pythia6m.cc         | 16 +++++++++++
 3 files changed, 75 insertions(+)
 create mode 100644 program/CMakeLists.txt
 create mode 100644 program/example-config.json
 create mode 100644 program/pythia6m.cc

diff --git a/program/CMakeLists.txt b/program/CMakeLists.txt
new file mode 100644
index 0000000..14fb34e
--- /dev/null
+++ b/program/CMakeLists.txt
@@ -0,0 +1,54 @@
+################################################################################
+## CMAKE Settings
+################################################################################
+set (EXE "pythia6m")
+set (TARGETS ${TARGETS} ${EXE} PARENT_SCOPE)
+
+
+################################################################################
+## Sources and install headers
+################################################################################
+set (SOURCES "pythia6m.cc")
+
+################################################################################
+## Include directories
+################################################################################
+include_directories("${PROJECT_SOURCE_DIR}")
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
+
+################################################################################
+## External Libraries
+################################################################################
+## ROOT
+find_package(ROOT REQUIRED)
+include_directories(${ROOT_INCLUDE_DIR})
+## boost
+find_package(Boost COMPONENTS program_options filesystem system REQUIRED)
+include_directories(${Boost_INCLUDE_DIRS})
+## nanocernlib
+find_package(nanocernlib REQUIRED)
+
+################################################################################
+## Compile and Link
+################################################################################
+add_executable(${EXE} ${SOURCES})
+target_link_libraries(${EXE} 
+  pythia6m_fmotion
+  pythia6m_gmc
+  pythia6m_pythia
+  pythia6m_radgen
+  pythia6m_util
+  pythia6m_fmotion
+  pythia6m_gmc
+  pythia6m_pythia
+  pythia6m_radgen
+  pythia6m_util
+  ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${NANOCERNLIB_LIBRARIES})
+set_target_properties(${EXE} PROPERTIES VERSION ${PYTHIA6M_VERSION})
+
+################################################################################
+## Export and Install
+################################################################################
+install(TARGETS ${EXE}
+  EXPORT ${PROJECT_NAME}-targets
+  RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin)
diff --git a/program/example-config.json b/program/example-config.json
new file mode 100644
index 0000000..8ecd233
--- /dev/null
+++ b/program/example-config.json
@@ -0,0 +1,5 @@
+"target": {
+  "nucleon": "p",
+  "polarization": {
+    "value": 0,
+    "direction"k
diff --git a/program/pythia6m.cc b/program/pythia6m.cc
new file mode 100644
index 0000000..fabfcd0
--- /dev/null
+++ b/program/pythia6m.cc
@@ -0,0 +1,16 @@
+#include <pythia6m/util/configuration.hh>
+#include <pythia6m/util/framework.hh>
+
+using namespace pythia6m;
+
+int run_pythia(const ptree& settings, const std::string& output) {}
+
+int main(int argc, char* argv[]) {
+  try {
+    framework pythia6m{argc, argv, run_pythia};
+    pythia6m.run();
+    return 0;
+  } catch (...) {
+    return 1;
+  }
+}
-- 
GitLab