Skip to content

Commit 16d599d

Browse files
Add keychain_common lib
Keychain common functional has been separated into keychain_common lib
1 parent 7510efa commit 16d599d

20 files changed

+48
-23
lines changed

CMakeLists.txt

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
project( KeychainApp )
1+
project( KeychainCmdApp )
2+
3+
add_subdirectory(./keychain_lib)
24

35
cmake_minimum_required( VERSION 3.0.2 )
46

57
set(CMAKE_CXX_FLAGS "-std=c++14")
6-
set(CMAKE_EXE_LINKER_FLAGS
7-
"-L/home/roman/blockchain/array-io-keychain/3rd-party-components/lib \
8-
-L/opt/openssllib/lib\
9-
-L/opt/boostlib/lib\
10-
-lpthread \
11-
-ldl")
8+
set(CMAKE_EXE_LINKER_FLAGS "-lpthread -ldl -v")
129

1310
SET(BOOST_COMPONENTS)
1411
LIST(APPEND BOOST_COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context locale iostreams)
@@ -24,18 +21,18 @@ FIND_PACKAGE(Boost 1.65 REQUIRED COMPONENTS coroutine)
2421
LIST(APPEND BOOST_COMPONENTS coroutine)
2522
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
2623

24+
include_directories("./keychain_lib/include" "/opt/openssllib/include" "./3rd-party-components/include" "/usr/include/libcxxabi" ${Boost_INCLUDE_DIR})
25+
26+
find_library(LIB_FC NAME fc HINTS "./3rd-party-components/lib")
27+
find_library(LIB_SECP256 NAME secp256k1 HINTS "./3rd-party-components/lib")
28+
find_library(LIB_GRAPHENE graphene_utilities HINTS "./3rd-party-components/lib")
2729

28-
include_directories("./include" "/opt/openssllib/include" "./3rd-party-components/include" "/usr/include/libcxxabi" ${Boost_INCLUDE_DIR})
30+
find_library(LIB_OPENSSL NAME crypto HINTS "/opt/openssllib/lib")
2931

30-
find_library(FCLIB name fc HINTS "~/blockchain/3rd-party-components/lib")
31-
find_library(FCLIB name secp256k1 HINTS "~/blockchain/3rd-party-components/lib")
32-
find_library(FCLIB name graphene_utilities HINTS "~/blockchain/3rd-party-components/lib")
33-
find_library(FCLIB name crypto HINTS "/opt/openssllib/lib")
34-
find_library(FCLIB name boost_program_options HINTS "/opt/boostlib/lib")
35-
file(GLOB KEYCHAIN_SOURCES "./src/*.cpp")
36-
file(GLOB KEYCHAIN_INCLUDE "./include/*.hpp")
32+
file(GLOB KEYCHAIN_SOURCES "./keychain_cmd_app/*.cpp")
33+
file(GLOB KEYCHAIN_INCLUDE "./keychain_cmd_app/*.hpp")
3734

38-
add_executable(keychain ${KEYCHAIN_SOURCES})
35+
add_executable(keychain ${KEYCHAIN_SOURCES} ${KEYCHAIN_INCLUDE})
3936

40-
target_link_libraries(keychain fc secp256k1 graphene_utilities crypto ${Boost_LIBRARIES})
37+
target_link_libraries(keychain keychain_common ${LIB_FC} ${LIB_SECP256} ${LIB_GRAPHENE} ${LIB_OPENSSL} ${Boost_LIBRARIES})
4138

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
#include <iostream>
66

7+
#include <keychain_lib/pipeline_parser.hpp>
8+
#include <keychain_lib/keychain_wrapper.hpp>
9+
#include <keychain_lib/secure_module_singletone.hpp>
10+
711
#include "cmd_parser.hpp"
8-
#include "pipe_line_parser.hpp"
9-
#include "keychain_wrapper.hpp"
10-
#include "secure_module_singletone.hpp"
1112
#include "secure_module_dummy.hpp"
1213

1314
using namespace keychain_app;
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#ifndef KEYCHAINAPP_SECURE_MODULE_DUMMY_HPP
66
#define KEYCHAINAPP_SECURE_MODULE_DUMMY_HPP
77

8-
#include <keychain_wrapper.hpp>
8+
#include <keychain_lib/keychain_wrapper.hpp>
99

1010
namespace keychain_app
1111
{

keychain_lib/CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
project( KeychainLib )
2+
3+
cmake_minimum_required( VERSION 3.0.2 )
4+
5+
set(CMAKE_CXX_FLAGS "-std=c++14")
6+
7+
SET(BOOST_COMPONENTS)
8+
LIST(APPEND BOOST_COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context locale iostreams)
9+
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
10+
11+
SET(BOOST_ROOT $ENV{BOOST_ROOT})
12+
set(Boost_USE_MULTITHREADED ON)
13+
set(BOOST_ALL_DYN_LINK OFF)
14+
15+
FIND_PACKAGE(Boost 1.65 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
16+
SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES})
17+
FIND_PACKAGE(Boost 1.65 REQUIRED COMPONENTS coroutine)
18+
LIST(APPEND BOOST_COMPONENTS coroutine)
19+
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
20+
21+
22+
include_directories("./include/keychain_lib" "/opt/openssllib/include" "../3rd-party-components/include" "/usr/include/libcxxabi" ${Boost_INCLUDE_DIR})
23+
24+
file(GLOB KEYCHAIN_LIB_SOURCES "./src/*.cpp")
25+
file(GLOB KEYCHAIN_LIB_INCLUDE "./include/*.hpp")
26+
27+
add_library(keychain_common STATIC ${KEYCHAIN_LIB_SOURCES})

include/key_encryptor.hpp renamed to keychain_lib/include/keychain_lib/key_encryptor.hpp

File renamed without changes.

include/key_file_parser.hpp renamed to keychain_lib/include/keychain_lib/key_file_parser.hpp

File renamed without changes.

include/keychain.hpp renamed to keychain_lib/include/keychain_lib/keychain.hpp

File renamed without changes.

0 commit comments

Comments
 (0)