diff --git a/CMakeLists.txt b/CMakeLists.txt index f2fb8e4..f5de044 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,6 @@ project(hello-world-cpp) # Название проекта add_library(process_launcher STATIC process_launcher.cpp) # Создание статической библиотеки с именем process_launcher -add_executable(main test.cpp) # Создает исполняемый файл с именем main +add_executable(main main.cpp) # Создает исполняемый файл с именем main target_link_libraries(main process_launcher) # Линковка программы с библиотекой \ No newline at end of file diff --git a/README.md b/README.md index 41ecfb8..2758fa0 100644 Binary files a/README.md and b/README.md differ diff --git a/test.cpp b/test.cpp deleted file mode 100644 index 4f529b2..0000000 --- a/test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "process_launcher.h" -#include -#include - -int main() { - std::string command; - - // В зависимости от ОС, выберем команду для запуска -#ifdef _WIN32 - command = "cmd /C echo Hello, World!"; -#else - command = "echo Hello, World!"; -#endif - - // Запускаем процесс - int pid = ProcessLauncher::launch(command); - if (pid == -1) { - std::cerr << "Не удалось запустить процесс." << std::endl; - return -1; - } - - std::cout << "Процесс с PID: " << pid << " запущен." << std::endl; - - // Ожидаем завершения процесса - int exitCode = ProcessLauncher::waitForProcess(pid); - std::cout << "Процесс завершился с кодом: " << exitCode << std::endl; - - return 0; -} \ No newline at end of file