git-svn-id: svn://db.shs.com.ru/pip@4 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
5
utils/remote_console/CMakeLists.txt
Executable file
5
utils/remote_console/CMakeLists.txt
Executable file
@@ -0,0 +1,5 @@
|
||||
add_executable(pip_remote_console "main.cpp")
|
||||
target_link_libraries(pip_remote_console pip)
|
||||
if (DEFINED LIB)
|
||||
install(TARGETS pip_remote_console DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
endif ()
|
||||
209
utils/remote_console/Makefile
Normal file
209
utils/remote_console/Makefile
Normal file
@@ -0,0 +1,209 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 2.8
|
||||
|
||||
# Default target executed when no arguments are given to make.
|
||||
default_target: all
|
||||
.PHONY : default_target
|
||||
|
||||
#=============================================================================
|
||||
# Special targets provided by cmake.
|
||||
|
||||
# Disable implicit rules so canonical targets will work.
|
||||
.SUFFIXES:
|
||||
|
||||
# Remove some rules from gmake that .SUFFIXES does not remove.
|
||||
SUFFIXES =
|
||||
|
||||
.SUFFIXES: .hpux_make_needs_suffix_list
|
||||
|
||||
# Suppress display of executed commands.
|
||||
$(VERBOSE).SILENT:
|
||||
|
||||
# A target that is always out of date.
|
||||
cmake_force:
|
||||
.PHONY : cmake_force
|
||||
|
||||
#=============================================================================
|
||||
# Set environment variables for the build.
|
||||
|
||||
# The shell in which to execute make rules.
|
||||
SHELL = /bin/sh
|
||||
|
||||
# The CMake executable.
|
||||
CMAKE_COMMAND = /usr/bin/cmake
|
||||
|
||||
# The command to remove a file.
|
||||
RM = /usr/bin/cmake -E remove -f
|
||||
|
||||
# Escaping for special characters.
|
||||
EQUALS = =
|
||||
|
||||
# The top-level source directory on which CMake was run.
|
||||
CMAKE_SOURCE_DIR = /home/andrey/linux_build/libs
|
||||
|
||||
# The top-level build directory on which CMake was run.
|
||||
CMAKE_BINARY_DIR = /home/andrey/linux_build/libs
|
||||
|
||||
#=============================================================================
|
||||
# Targets provided globally by CMake.
|
||||
|
||||
# Special rule for the target edit_cache
|
||||
edit_cache:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
|
||||
/usr/bin/cmake -i .
|
||||
.PHONY : edit_cache
|
||||
|
||||
# Special rule for the target edit_cache
|
||||
edit_cache/fast: edit_cache
|
||||
.PHONY : edit_cache/fast
|
||||
|
||||
# Special rule for the target install
|
||||
install: preinstall
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
|
||||
/usr/bin/cmake -P cmake_install.cmake
|
||||
.PHONY : install
|
||||
|
||||
# Special rule for the target install
|
||||
install/fast: preinstall/fast
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
|
||||
/usr/bin/cmake -P cmake_install.cmake
|
||||
.PHONY : install/fast
|
||||
|
||||
# Special rule for the target install/local
|
||||
install/local: preinstall
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
|
||||
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
|
||||
.PHONY : install/local
|
||||
|
||||
# Special rule for the target install/local
|
||||
install/local/fast: install/local
|
||||
.PHONY : install/local/fast
|
||||
|
||||
# Special rule for the target install/strip
|
||||
install/strip: preinstall
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
|
||||
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
|
||||
.PHONY : install/strip
|
||||
|
||||
# Special rule for the target install/strip
|
||||
install/strip/fast: install/strip
|
||||
.PHONY : install/strip/fast
|
||||
|
||||
# Special rule for the target list_install_components
|
||||
list_install_components:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
|
||||
.PHONY : list_install_components
|
||||
|
||||
# Special rule for the target list_install_components
|
||||
list_install_components/fast: list_install_components
|
||||
.PHONY : list_install_components/fast
|
||||
|
||||
# Special rule for the target rebuild_cache
|
||||
rebuild_cache:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
|
||||
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
||||
.PHONY : rebuild_cache
|
||||
|
||||
# Special rule for the target rebuild_cache
|
||||
rebuild_cache/fast: rebuild_cache
|
||||
.PHONY : rebuild_cache/fast
|
||||
|
||||
# The main all target
|
||||
all: cmake_check_build_system
|
||||
cd /home/andrey/linux_build/libs && $(CMAKE_COMMAND) -E cmake_progress_start /home/andrey/linux_build/libs/CMakeFiles /home/andrey/linux_build/libs/pip/utils/remote_console/CMakeFiles/progress.marks
|
||||
cd /home/andrey/linux_build/libs && $(MAKE) -f CMakeFiles/Makefile2 pip/utils/remote_console/all
|
||||
$(CMAKE_COMMAND) -E cmake_progress_start /home/andrey/linux_build/libs/CMakeFiles 0
|
||||
.PHONY : all
|
||||
|
||||
# The main clean target
|
||||
clean:
|
||||
cd /home/andrey/linux_build/libs && $(MAKE) -f CMakeFiles/Makefile2 pip/utils/remote_console/clean
|
||||
.PHONY : clean
|
||||
|
||||
# The main clean target
|
||||
clean/fast: clean
|
||||
.PHONY : clean/fast
|
||||
|
||||
# Prepare targets for installation.
|
||||
preinstall: all
|
||||
cd /home/andrey/linux_build/libs && $(MAKE) -f CMakeFiles/Makefile2 pip/utils/remote_console/preinstall
|
||||
.PHONY : preinstall
|
||||
|
||||
# Prepare targets for installation.
|
||||
preinstall/fast:
|
||||
cd /home/andrey/linux_build/libs && $(MAKE) -f CMakeFiles/Makefile2 pip/utils/remote_console/preinstall
|
||||
.PHONY : preinstall/fast
|
||||
|
||||
# clear depends
|
||||
depend:
|
||||
cd /home/andrey/linux_build/libs && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
|
||||
.PHONY : depend
|
||||
|
||||
# Convenience name for target.
|
||||
pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/rule:
|
||||
cd /home/andrey/linux_build/libs && $(MAKE) -f CMakeFiles/Makefile2 pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/rule
|
||||
.PHONY : pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/rule
|
||||
|
||||
# Convenience name for target.
|
||||
pip_remote_console: pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/rule
|
||||
.PHONY : pip_remote_console
|
||||
|
||||
# fast build rule for target.
|
||||
pip_remote_console/fast:
|
||||
cd /home/andrey/linux_build/libs && $(MAKE) -f pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/build.make pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/build
|
||||
.PHONY : pip_remote_console/fast
|
||||
|
||||
main.o: main.cpp.o
|
||||
.PHONY : main.o
|
||||
|
||||
# target to build an object file
|
||||
main.cpp.o:
|
||||
cd /home/andrey/linux_build/libs && $(MAKE) -f pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/build.make pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/main.cpp.o
|
||||
.PHONY : main.cpp.o
|
||||
|
||||
main.i: main.cpp.i
|
||||
.PHONY : main.i
|
||||
|
||||
# target to preprocess a source file
|
||||
main.cpp.i:
|
||||
cd /home/andrey/linux_build/libs && $(MAKE) -f pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/build.make pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/main.cpp.i
|
||||
.PHONY : main.cpp.i
|
||||
|
||||
main.s: main.cpp.s
|
||||
.PHONY : main.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
main.cpp.s:
|
||||
cd /home/andrey/linux_build/libs && $(MAKE) -f pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/build.make pip/utils/remote_console/CMakeFiles/pip_remote_console.dir/main.cpp.s
|
||||
.PHONY : main.cpp.s
|
||||
|
||||
# Help Target
|
||||
help:
|
||||
@echo "The following are some of the valid targets for this Makefile:"
|
||||
@echo "... all (the default if no target is provided)"
|
||||
@echo "... clean"
|
||||
@echo "... depend"
|
||||
@echo "... edit_cache"
|
||||
@echo "... install"
|
||||
@echo "... install/local"
|
||||
@echo "... install/strip"
|
||||
@echo "... list_install_components"
|
||||
@echo "... pip_remote_console"
|
||||
@echo "... rebuild_cache"
|
||||
@echo "... main.o"
|
||||
@echo "... main.i"
|
||||
@echo "... main.s"
|
||||
.PHONY : help
|
||||
|
||||
|
||||
|
||||
#=============================================================================
|
||||
# Special targets to cleanup operation of make.
|
||||
|
||||
# Special rule to run CMake to check the build system integrity.
|
||||
# No rule that depends on this can have commands that come from listfiles
|
||||
# because they might be regenerated.
|
||||
cmake_check_build_system:
|
||||
cd /home/andrey/linux_build/libs && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
|
||||
.PHONY : cmake_check_build_system
|
||||
|
||||
60
utils/remote_console/cmake_install.cmake
Normal file
60
utils/remote_console/cmake_install.cmake
Normal file
@@ -0,0 +1,60 @@
|
||||
# Install script for directory: /home/andrey/linux_build/libs/pip/utils/remote_console
|
||||
|
||||
# Set the install prefix
|
||||
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr")
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Set the install configuration name.
|
||||
IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
||||
IF(BUILD_TYPE)
|
||||
STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
||||
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
||||
ELSE(BUILD_TYPE)
|
||||
SET(CMAKE_INSTALL_CONFIG_NAME "Release")
|
||||
ENDIF(BUILD_TYPE)
|
||||
MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
||||
|
||||
# Set the component getting installed.
|
||||
IF(NOT CMAKE_INSTALL_COMPONENT)
|
||||
IF(COMPONENT)
|
||||
MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
|
||||
SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
||||
ELSE(COMPONENT)
|
||||
SET(CMAKE_INSTALL_COMPONENT)
|
||||
ENDIF(COMPONENT)
|
||||
ENDIF(NOT CMAKE_INSTALL_COMPONENT)
|
||||
|
||||
# Install shared libraries without execute permission?
|
||||
IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
||||
SET(CMAKE_INSTALL_SO_NO_EXE "1")
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
||||
|
||||
IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
|
||||
IF(EXISTS "$ENV{DESTDIR}/usr/bin/pip_remote_console" AND
|
||||
NOT IS_SYMLINK "$ENV{DESTDIR}/usr/bin/pip_remote_console")
|
||||
FILE(RPATH_CHECK
|
||||
FILE "$ENV{DESTDIR}/usr/bin/pip_remote_console"
|
||||
RPATH "")
|
||||
ENDIF()
|
||||
list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
|
||||
"/usr/bin/pip_remote_console")
|
||||
IF (CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
|
||||
message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
|
||||
ENDIF (CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
|
||||
IF (CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
|
||||
message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
|
||||
ENDIF (CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
|
||||
FILE(INSTALL DESTINATION "/usr/bin" TYPE EXECUTABLE FILES "/home/andrey/linux_build/libs/pip/utils/remote_console/pip_remote_console")
|
||||
IF(EXISTS "$ENV{DESTDIR}/usr/bin/pip_remote_console" AND
|
||||
NOT IS_SYMLINK "$ENV{DESTDIR}/usr/bin/pip_remote_console")
|
||||
FILE(RPATH_REMOVE
|
||||
FILE "$ENV{DESTDIR}/usr/bin/pip_remote_console")
|
||||
IF(CMAKE_INSTALL_DO_STRIP)
|
||||
EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}/usr/bin/pip_remote_console")
|
||||
ENDIF(CMAKE_INSTALL_DO_STRIP)
|
||||
ENDIF()
|
||||
ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
|
||||
|
||||
64
utils/remote_console/main.cpp
Executable file
64
utils/remote_console/main.cpp
Executable file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Remote console viewer
|
||||
Copyright (C) 2014 Ivan Pelipenko peri4ko@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "pip.h"
|
||||
|
||||
void key_event(char key, void * );
|
||||
|
||||
PIConsole console(false, key_event);
|
||||
PIStringList as;
|
||||
bool selected = false;
|
||||
|
||||
void key_event(char key, void * ) {
|
||||
if (key < '1' || key > '9') return;
|
||||
int ind = key - '1';
|
||||
if (ind < 0 || ind >= as.size_s()) return;
|
||||
selected = true;
|
||||
console.connectToServer(as[ind]);
|
||||
}
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
console.enableExitCapture();
|
||||
console.listenServers();
|
||||
while (!PIKbdListener::exiting) {
|
||||
msleep(200);
|
||||
if (selected) break;
|
||||
console.clearScreen();
|
||||
as = console.availableServers();
|
||||
if (as.isEmpty()) {
|
||||
piCout << "No servers are available!";
|
||||
} else {
|
||||
piCout << "Select one with numeric key:";
|
||||
for (int i = 0; i < as.size_s(); ++i)
|
||||
piCout << (i + 1) << as[i];
|
||||
}
|
||||
}
|
||||
if (!selected) return 0;
|
||||
//console.clearScreen();
|
||||
piCout << "Connecting to" << console.selectedServer() << "...";
|
||||
while (!PIKbdListener::exiting) {
|
||||
msleep(20);
|
||||
if (console.isConnected())
|
||||
break;
|
||||
}
|
||||
if (PIKbdListener::exiting)
|
||||
return 0;
|
||||
console.start();
|
||||
console.waitForFinish();
|
||||
};
|
||||
BIN
utils/remote_console/pip_remote_console
Executable file
BIN
utils/remote_console/pip_remote_console
Executable file
Binary file not shown.
BIN
utils/remote_console/pip_remote_console.exe
Normal file
BIN
utils/remote_console/pip_remote_console.exe
Normal file
Binary file not shown.
Reference in New Issue
Block a user