Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Make customization point for executable names #5101

Merged
merged 4 commits into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ set(VERSION_MINOR 1)
set(VERSION_PATCH 4)

set( CLI_CLIENT_EXECUTABLE_NAME cleos )
set( NODE_EXECUTABLE_NAME nodeos )
set( KEY_STORE_EXECUTABLE_NAME keosd )
set( GUI_CLIENT_EXECUTABLE_NAME eosio )
set( CUSTOM_URL_SCHEME "gcs" )
set( INSTALLER_APP_ID "68ad7005-8eee-49c9-95ce-9eed97e5b347" )
Expand Down
10 changes: 5 additions & 5 deletions programs/cleos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_executable( cleos main.cpp httpc.cpp help_text.cpp localize.hpp config.hpp CLI11.hpp)
add_executable( ${CLI_CLIENT_EXECUTABLE_NAME} main.cpp httpc.cpp help_text.cpp localize.hpp config.hpp CLI11.hpp)
if( UNIX AND NOT APPLE )
set(rt_library rt )
endif()
Expand Down Expand Up @@ -29,16 +29,16 @@ endif()
find_package(Intl REQUIRED)

set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
set(LOCALEDOMAIN cleos)
set(LOCALEDOMAIN ${CLI_CLIENT_EXECUTABLE_NAME})
configure_file(config.hpp.in config.hpp ESCAPE_QUOTES)

target_include_directories(cleos PUBLIC ${Intl_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(${CLI_CLIENT_EXECUTABLE_NAME} PUBLIC ${Intl_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})

target_link_libraries( cleos
target_link_libraries( ${CLI_CLIENT_EXECUTABLE_NAME}
PRIVATE appbase chain_api_plugin producer_plugin chain_plugin http_plugin eosio_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ${Intl_LIBRARIES} )

install( TARGETS
cleos
${CLI_CLIENT_EXECUTABLE_NAME}

RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
Expand Down
1 change: 1 addition & 0 deletions programs/cleos/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ namespace eosio { namespace client { namespace config {
constexpr char version_str[] = "${cleos_BUILD_VERSION}";
constexpr char locale_path[] = "${LOCALEDIR}";
constexpr char locale_domain[] = "${LOCALEDOMAIN}";
constexpr char key_store_executable_name[] = "${KEY_STORE_EXECUTABLE_NAME}";
}}}
4 changes: 2 additions & 2 deletions programs/cleos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,9 @@ void ensure_keosd_running(CLI::App* app) {
// This extra check is necessary when running cleos like this: ./cleos ...
if (binPath.filename_is_dot())
binPath.remove_filename();
binPath.append("keosd"); // if cleos and keosd are in the same installation directory
binPath.append(key_store_executable_name); // if cleos and keosd are in the same installation directory
if (!boost::filesystem::exists(binPath)) {
binPath.remove_filename().remove_filename().append("keosd").append("keosd");
binPath.remove_filename().remove_filename().append("keosd").append(key_store_executable_name);
}

const auto& lo_address = resolved_url.resolved_addresses.front();
Expand Down
10 changes: 5 additions & 5 deletions programs/keosd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
add_executable( keosd main.cpp )
add_executable( ${KEY_STORE_EXECUTABLE_NAME} main.cpp )
if( UNIX AND NOT APPLE )
set(rt_library rt )
endif()

find_package( Gperftools QUIET )
if( GPERFTOOLS_FOUND )
message( STATUS "Found gperftools; compiling keosd with TCMalloc")
message( STATUS "Found gperftools; compiling ${KEY_STORE_EXECUTABLE_NAME} with TCMalloc")
list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
endif()

target_link_libraries( keosd
target_link_libraries( ${KEY_STORE_EXECUTABLE_NAME}
PRIVATE appbase
PRIVATE wallet_api_plugin wallet_plugin
PRIVATE http_plugin
PRIVATE eosio_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )

mas_sign(keosd)
mas_sign(${KEY_STORE_EXECUTABLE_NAME})

install( TARGETS
keosd
${KEY_STORE_EXECUTABLE_NAME}

RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
Expand Down
16 changes: 8 additions & 8 deletions programs/nodeos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
add_executable( nodeos main.cpp )
add_executable( ${NODE_EXECUTABLE_NAME} main.cpp )
if( UNIX AND NOT APPLE )
set(rt_library rt )
endif()

find_package( Gperftools QUIET )
if( GPERFTOOLS_FOUND )
message( STATUS "Found gperftools; compiling nodeos with TCMalloc")
message( STATUS "Found gperftools; compiling ${NODE_EXECUTABLE_NAME} with TCMalloc")
list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
endif()

Expand All @@ -28,7 +28,7 @@ endif()

configure_file(config.hpp.in config.hpp ESCAPE_QUOTES)

target_include_directories(nodeos PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(${NODE_EXECUTABLE_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})

if(UNIX)
if(APPLE)
Expand All @@ -43,7 +43,7 @@ else()
set(no_whole_archive_flag "--no-whole-archive")
endif()

target_link_libraries( nodeos
target_link_libraries( ${NODE_EXECUTABLE_NAME}
PRIVATE appbase
PRIVATE -Wl,${whole_archive_flag} login_plugin -Wl,${no_whole_archive_flag}
PRIVATE -Wl,${whole_archive_flag} history_plugin -Wl,${no_whole_archive_flag}
Expand All @@ -60,15 +60,15 @@ target_link_libraries( nodeos
PRIVATE eosio_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )

if(TARGET sql_db_plugin)
target_link_libraries( nodeos PRIVATE -Wl,${whole_archive_flag} sql_db_plugin -Wl,${no_whole_archive_flag} )
target_link_libraries( ${NODE_EXECUTABLE_NAME} PRIVATE -Wl,${whole_archive_flag} sql_db_plugin -Wl,${no_whole_archive_flag} )
endif()

if(BUILD_MONGO_DB_PLUGIN)
target_link_libraries( nodeos PRIVATE -Wl,${whole_archive_flag} mongo_db_plugin -Wl,${no_whole_archive_flag} )
target_link_libraries( ${NODE_EXECUTABLE_NAME} PRIVATE -Wl,${whole_archive_flag} mongo_db_plugin -Wl,${no_whole_archive_flag} )
endif()

install( TARGETS
nodeos
${NODE_EXECUTABLE_NAME}

RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
Expand All @@ -95,4 +95,4 @@ install(DIRECTORY DESTINATION ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/eosio
WORLD_EXECUTE
)

mas_sign(nodeos)
mas_sign(${NODE_EXECUTABLE_NAME})