From 18284b95a446385deaf826f729732328845ed3a1 Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 28 Nov 2025 23:10:27 +0000 Subject: [PATCH] use relative path --- README.md | 15 +++++++------- joomer-ftxui-file-browser.cpp | 2 +- makefile | 39 ++++++++++++----------------------- 3 files changed, 22 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 1676ffd..e294258 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,9 @@ # joomer-ftxui-file-browser Terminal User Interface for file browsing using ftxui - - # Demonstrates -- -- supports arrow keys or mouse navigation -- jump in and out of directories, +- use arrow keys or mouse to navigate directories +- jump in and out of directories - select a file and print it's size # Usage @@ -32,14 +29,18 @@ learndir/ ## Ubuntu Linux (kasm-ubuntu) ``` +mkdir learndir +cd learndir git clone https://github.com/ArthurSonzogni/FTXUI +cd FTXUI mkdir build cd build +cmake .. cmake --build . --config Release cd .. git clone https://git.indoodle.com/jason/joomer-ftxui-file-browser.git -cd joomer-ftxui-file-browser.git -make all -j4 +cd joomer-ftxui-file-browser +make all bin/Linux/release/joomer-ftxui-file-browser ``` diff --git a/joomer-ftxui-file-browser.cpp b/joomer-ftxui-file-browser.cpp index c8cb3e9..1a9f4ed 100644 --- a/joomer-ftxui-file-browser.cpp +++ b/joomer-ftxui-file-browser.cpp @@ -115,7 +115,7 @@ int main(int argc, char* argv[]) { // --- OUTPUT AFTER THE LOOP HAS CLEANLY EXITED --- // ---------------------------------------------------- cout<< "directory path: " << directory_path << endl; - cout << "test: " << test << endl; + //cout << "test: " << test << endl; if (final_selected_index >= 0 && final_selected_index < entries.size()) { std::cout << "Selected Entry: " << entries[final_selected_index] << std::endl; } else { diff --git a/makefile b/makefile index 3b37fb5..635e34d 100644 --- a/makefile +++ b/makefile @@ -8,16 +8,9 @@ BUILD_TYPE ?= release# Default to release build if not specified LINUX_LIB_EXT = so # Version configuration (can be overridden) -#DPP_VERSION ?= $(shell find ../DPP/build/library -name "libdpp.so.*.*.*" -type f | head -1 | sed 's/.*libdpp\.so\.//') -FTXUI_PATH = ../learndir/FTXUI -#BELLA_BUILD_DIR = $(BELLA_PATH)/build/library +FTXUI_PATH = ../FTXUI LIB_PATHS = -L$(FTXUI_PATH)/build -INC_DIRS = -Iinclude -I$(FTXUI_PATH)/include -#endif - -#DPP_VERSION := $(or $(DPP_VERSION),10.1.4)# Fallback version if auto-detection fails -#DPP_LINUX_LIB_VERSION_FILE = libdpp.$(LINUX_LIB_EXT).$(DPP_VERSION) -#BELLA_LIB_NAME = libdpp.$(LINUX_LIB_EXT) +INC_DIRS = -I$(FTXUI_PATH)/include # Common paths OBJ_DIR = obj/$(PLATFORM)/$(BUILD_TYPE) @@ -25,33 +18,31 @@ BIN_DIR = bin/$(PLATFORM)/$(BUILD_TYPE) OUTPUT_FILE = $(BIN_DIR)/$(EXECUTABLE_NAME) CXX = g++ -CXX_FLAGS = $(COMMON_FLAGS) -std=c++17 -Wall -g $(INC_DIRS) +CXX_FLAGS = $(COMMON_FLAGS) -std=c++17 -Wall -g # Build type specific flags ifeq ($(BUILD_TYPE), debug) - CPP_DEFINES = -D_DEBUG -DDL_USE_SHARED - COMMON_FLAGS = $(ARCH_FLAGS) $(INCLUDE_PATHS) + CPP_DEFINES = -D_DEBUG + COMMON_FLAGS = $(ARCH_FLAGS) COMP_FLAGS = -g -O0 -std=c++17 -Wall #LINK_FLAGS = -fvisibility=hidden else - CPP_DEFINES = -DNDEBUG=1 -DDL_USE_SHARED - COMMON_FLAGS = $(ARCH_FLAGS) $(INCLUDE_PATHS) + CPP_DEFINES = -DNDEBUG=1 + COMMON_FLAGS = $(ARCH_FLAGS) COMP_FLAGS = -O3 -std=c++17 -Wall #LINK_FLAGS = -fvisibility=hidden endif # Language-specific flags -#C_FLAGS = $(COMMON_FLAGS) -std=c17 -#CXX_FLAGS = $(COMMON_FLAGS) -std=c++17 -Wall -g $(INC_DIRS) CXX = g++ -CXX_FLAGS = $(COMMON_FLAGS) $(INC_DIRS) +CXX_FLAGS = $(COMMON_FLAGS) LINK_FLAGS = $(LIB_PATHS) #-fvisibility=hidden FTXUI_LIB_FLAGS = -lftxui-component -lftxui-dom -lftxui-screen -#BELLA_LIB_FLAGS = -L$(LIB_PATHS) -Wl,-rpath,$(LIB_PATHS) -lbella_engine_sdk # Linker directive flags (L for library search path, l for library) # Need to link against the D++ library and pthread (common for C++ applications with threading) -LDFLAGS = $(FTXUI_LIB_FLAGS) #$(BELLA_LIB_FLAGS) #-L$(LIB_PATHS) -ldpp -lpthread -Wl,-rpath='$$ORIGIN' # search for lib in the same place as the executable file +LDFLAGS = -Wl,--start-group $(FTXUI_LIB_FLAGS) -Wl,--end-group +//LDFLAGS = $(FTXUI_LIB_FLAGS) #$(BELLA_LIB_FLAGS) #-L$(LIB_PATHS) -ldpp -lpthread -Wl,-rpath='$$ORIGIN' # search for lib in the same place as the executable file # List of object files for your executable # We've changed this back to use joomer-ftxui-file-browser.o as the source of the executable @@ -65,19 +56,15 @@ $(OBJ_DIR)/%.o: %.cpp # --- Main Target --- # 'all' is the default target that builds your executable all: $(OUTPUT_FILE) - @echo "FTXUI_PATH: $(FTXUI_PATH)" - @echo "Build complete." - - + @echo "Building executables complete." # Rule to link the executable: # It depends on the object files and uses CXX to link them with specified libraries. $(OUTPUT_FILE): $(OBJECTS) @echo "Linking $(OUTPUT_FILE)..." @mkdir -p $(@D) - $(CXX) -o $@ $(OBJECTS) $(LINK_FLAGS) $(LDFLAGS) - @echo "FTXUI_PATH: "$(FTXUI_PATH) - @echo "Build complete." + $(CXX) -o $@ $(OBJECTS) $(LINK_FLAGS) $(LDFLAGS) + @echo "Building links complete." # --- Clean Target ---