1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-17 03:50:03 +02:00

move src dir to cli and add it's own cmake file.

This commit is contained in:
Henrik Hautakoski 2020-04-07 22:37:05 +02:00
parent 526b87670b
commit ba0efa2dd7
15 changed files with 48 additions and 43 deletions

View file

@ -8,9 +8,6 @@ project(eosio-keygen
set( PROJECT_MAINTAINER "Henrik Hautakoski <henrik@eossweden.org>")
# Options
option(FORCE_ANSI "Force ANSI console colors even on windows" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
# Use installpath from GNUInstallDirs as default.
@ -37,59 +34,25 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_definitions( "-D_CRT_SECURE_NO_WARNINGS=1" )
endif()
# --------------------------------
# Common code
# --------------------------------
add_subdirectory( common )
# --------------------------------
# Program
# --------------------------------
set (PROGRAM_EXE ${CMAKE_PROJECT_NAME})
set (PROGRAM_SOURCE
src/isatty.cpp
src/cli_key_search_result.cpp
src/console.cpp
src/benchmark.cpp
src/main.cpp
)
if (WIN32 AND NOT FORCE_ANSI)
set (PROGRAM_SOURCE ${PROGRAM_SOURCE} src/console_win32.cpp)
else()
# *nix should have ansi support.
set (PROGRAM_SOURCE ${PROGRAM_SOURCE} src/console_ansi.cpp)
endif()
# Project config file
configure_file(src/config.h.in "${PROJECT_BINARY_DIR}/config.h" @ONLY)
configure_file(config.h.in "${PROJECT_BINARY_DIR}/config.h" @ONLY)
include_directories(${PROJECT_BINARY_DIR})
add_executable( ${PROGRAM_EXE} ${PROGRAM_SOURCE} )
# --------------------------------
# Subdirectories
# --------------------------------
target_link_libraries( ${PROGRAM_EXE} PUBLIC common )
add_subdirectory( common )
add_subdirectory( cli )
# --------------------------------
# Install
# --------------------------------
install(TARGETS ${PROGRAM_EXE} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# Readme and license
install(FILES README.md LICENSE
DESTINATION ${CMAKE_INSTALL_SHAREDIR})
# Documentation
if (UNIX)
configure_file( docs/eosio-keygen.1.in ${PROJECT_BINARY_DIR}/man1/eosio-keygen.1 )
install(DIRECTORY ${PROJECT_BINARY_DIR}/man1
DESTINATION ${CMAKE_INSTALL_MANDIR})
endif (UNIX)
# --------------------------------
# Package
# --------------------------------

42
cli/CMakeLists.txt Normal file
View file

@ -0,0 +1,42 @@
# Options
option(FORCE_ANSI "Force ANSI console colors even on windows" OFF)
# --------------------------------
# Program
# --------------------------------
set (PROGRAM_EXE ${CMAKE_PROJECT_NAME})
set (PROGRAM_SOURCE
isatty.cpp
cli_key_search_result.cpp
console.cpp
benchmark.cpp
main.cpp
)
if (WIN32 AND NOT FORCE_ANSI)
set (PROGRAM_SOURCE ${PROGRAM_SOURCE} console_win32.cpp)
else()
# *nix should have ansi support.
set (PROGRAM_SOURCE ${PROGRAM_SOURCE} console_ansi.cpp)
endif()
add_executable( ${PROGRAM_EXE} ${PROGRAM_SOURCE} )
target_link_libraries( ${PROGRAM_EXE} PUBLIC common )
# --------------------------------
# Install
# --------------------------------
install(TARGETS ${PROGRAM_EXE} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# Documentation
if (UNIX)
configure_file( docs/eosio-keygen.1.in ${PROJECT_BINARY_DIR}/man1/eosio-keygen.1 )
install(DIRECTORY ${PROJECT_BINARY_DIR}/man1
DESTINATION ${CMAKE_INSTALL_MANDIR})
endif (UNIX)