Commit 1f80a9e8 authored by Matthieu Dorier's avatar Matthieu Dorier

made CMake install the right files

parent 9854b9a1
add_executable(hepnos-daemon hepnos-daemon.cpp)
target_link_libraries(hepnos-daemon hepnos-service yaml-cpp margo bake-server sdskv-server)
install(TARGETS hepnos-daemon DESTINATION bin)
......@@ -32,6 +32,14 @@ class DataStore {
public:
/**
* @brief Constructor. Initializes the DataStore by taking
* the name of the configuration file from the environment
* variable HEPNOS_CONFIG_FILE.
*/
DataStore();
/**
* @brief Constructor. Initializes the DataStore using a YAML
* configuration file (this file is generated by the HEPnOS
......
......@@ -80,3 +80,7 @@ install (DIRECTORY ../include/hepnos
install (DIRECTORY ../include/hepnos
DESTINATION include
FILES_MATCHING PATTERN "*.h")
install (FILES ../include/hepnos.h
DESTINATION include)
install (FILES ../include/hepnos-service.h
DESTINATION include)
......@@ -21,6 +21,15 @@ namespace hepnos {
// DataStore implementation
////////////////////////////////////////////////////////////////////////////////////////////
DataStore::DataStore()
: m_impl(std::make_unique<DataStore::Impl>(this)) {
char* file = getenv("HEPNOS_CONFIG_FILE");
if(file == nullptr)
throw Exception("HEPNOS_CONFIG_FILE environment variable not set");
std::string configFile(file);
m_impl->init(configFile);
}
DataStore::DataStore(const std::string& configFile)
: m_impl(std::make_unique<DataStore::Impl>(this)) {
m_impl->init(configFile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment