Available options were 'version' and 'help' only.
Checking package metadata (change-id) on platform image can be used instead.
Change-Id: I4861509f5983db6a8fcd3d3f0a615017129a7df8
+# Copyright (c) 2017 - 2020 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file CMakeLists.txt
+# @author Dariusz Michaluk <d.michaluk@samsung.com>
+# @author Jaroslaw Pelczar <j.pelczar@samsung.com>
+
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
##### Configure project version when using
message(FATAL_ERROR "systemd support required but systemd not found")
ENDIF()
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dcm_build_config.h.in
- ${CMAKE_CURRENT_BINARY_DIR}/dcm_build_config.h)
-
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(shared)
COMPONENTS
serialization
filesystem
- program_options
log
thread
system)
+++ /dev/null
-#define PROJECT_VERSION "@PROJECT_VERSION@"
+# Copyright (c) 2017 - 2020 Samsung Electronics Co., Ltd All Rights Reserved
#
-# DCM daemon build script
-# Jaroslaw Pelczar <j.pelczar@samsung.com>
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file dcm-daemon/CMakeLists.txt
+# @author Dariusz Michaluk <d.michaluk@samsung.com>
+# @author Jaroslaw Pelczar <j.pelczar@samsung.com>
###### Protobuf generator #######
${Boost_LOG_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
- ${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
device-certificate-manager
/******************************************************************
*
- * Copyright 2017 - 2018 Samsung Electronics All Rights Reserved.
+ * Copyright 2017 - 2020 Samsung Electronics All Rights Reserved.
*
* Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
*
*
******************************************************************/
-#include <boost/program_options.hpp>
#include <boost/asio.hpp>
#include <iostream>
#include <sys/stat.h>
#include <sys/signal.h>
-#include "dcm_build_config.h"
#include "dcmserver.h"
#include "logging.h"
#include "serviceadapter.h"
#include <cynara-client.h>
#endif
-namespace po = boost::program_options;
-
-struct OptionContext {
- bool fShowHelp = false;
- bool fShowVersion = false;
- std::string fSocketName = DCM_UNIX_SOCKET_PATH;
-
- void parse_options(int argc, char ** argv)
- {
- po::options_description desc("Allowed options");
- desc.add_options()
- ("help", "Print this help")
- ("version", "Print version")
- ;
-
- po::variables_map vm;
- po::store(po::parse_command_line(argc, argv, desc), vm);
- po::notify(vm);
-
- if(vm.count("help")) {
- std::cout << desc << std::endl;
- fShowHelp = true;
- return;
- }
-
- if(vm.count("version")) {
- fShowVersion = true;
- return;
- }
- }
-};
-
BOOST_LOG_ATTRIBUTE_KEYWORD(_scope, "Scope", boost::log::attributes::named_scope::value_type)
BOOST_LOG_ATTRIBUTE_KEYWORD(_timestamp, "TimeStamp", boost::posix_time::ptime)
BOOST_LOG_ATTRIBUTE_KEYWORD(_severity, "Severity", log_severity)
cynara * gGlobalCynaraInstance;
#endif
-int main(int argc, char ** argv)
+int main()
{
int error = 0;
BOOST_LOG_FUNCTION();
- OptionContext options;
-
- try {
- options.parse_options(argc, argv);
- } catch(std::exception& ex) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::error) << "Failed to parse options: " << ex.what();
- return EXIT_FAILURE;
- }
-
- if(options.fShowHelp) {
- return EXIT_SUCCESS;
- }
-
- if(options.fShowVersion) {
- BOOST_LOG_SEV(dcm_logger::get(), log_severity::normal) << "Device Certificate Manager version " PROJECT_VERSION;
- return EXIT_SUCCESS;
- }
-
- service_adapter serviceAdapter(options.fSocketName);
+ service_adapter serviceAdapter(DCM_UNIX_SOCKET_PATH);
#ifdef USE_CYNARA
cynara_configuration * cynara_conf = nullptr;