diff --git a/CMakeLists.txt b/CMakeLists.txt index 29afb6373b3..0733befb253 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" ) diff --git a/programs/cleos/CMakeLists.txt b/programs/cleos/CMakeLists.txt index 938032d1f19..2581a15bd4f 100644 --- a/programs/cleos/CMakeLists.txt +++ b/programs/cleos/CMakeLists.txt @@ -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() @@ -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} diff --git a/programs/cleos/config.hpp.in b/programs/cleos/config.hpp.in index 37081daf3f4..18673e9c8c2 100644 --- a/programs/cleos/config.hpp.in +++ b/programs/cleos/config.hpp.in @@ -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}"; }}} diff --git a/programs/cleos/main.cpp b/programs/cleos/main.cpp index 946e223f389..fd061507202 100644 --- a/programs/cleos/main.cpp +++ b/programs/cleos/main.cpp @@ -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(); diff --git a/programs/keosd/CMakeLists.txt b/programs/keosd/CMakeLists.txt index de6b09d98bc..ac434e92c71 100644 --- a/programs/keosd/CMakeLists.txt +++ b/programs/keosd/CMakeLists.txt @@ -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} diff --git a/programs/nodeos/CMakeLists.txt b/programs/nodeos/CMakeLists.txt index 62819604a27..532749284ba 100644 --- a/programs/nodeos/CMakeLists.txt +++ b/programs/nodeos/CMakeLists.txt @@ -1,13 +1,12 @@ +add_executable( ${NODE_EXECUTABLE_NAME} main.cpp ) - -add_executable( nodeos 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() @@ -30,7 +29,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) @@ -45,7 +44,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} @@ -62,13 +61,13 @@ target_link_libraries( nodeos PRIVATE eosio_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) 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() include(additionalPlugins) install( TARGETS - nodeos + ${NODE_EXECUTABLE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} @@ -95,4 +94,4 @@ install(DIRECTORY DESTINATION ${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/eosio WORLD_EXECUTE ) -mas_sign(nodeos) +mas_sign(${NODE_EXECUTABLE_NAME})