use relative path
This commit is contained in:
parent
6c3e30421b
commit
18284b95a4
15
README.md
15
README.md
@ -1,12 +1,9 @@
|
|||||||
# joomer-ftxui-file-browser
|
# joomer-ftxui-file-browser
|
||||||
Terminal User Interface for file browsing using ftxui
|
Terminal User Interface for file browsing using ftxui
|
||||||
|
|
||||||
<img src="resources/joomer-bella-basic-renderer.png">
|
|
||||||
|
|
||||||
# Demonstrates
|
# Demonstrates
|
||||||
-
|
- use arrow keys or mouse to navigate directories
|
||||||
- supports arrow keys or mouse navigation
|
- jump in and out of directories
|
||||||
- jump in and out of directories,
|
|
||||||
- select a file and print it's size
|
- select a file and print it's size
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
@ -32,14 +29,18 @@ learndir/
|
|||||||
|
|
||||||
## Ubuntu Linux (kasm-ubuntu)
|
## Ubuntu Linux (kasm-ubuntu)
|
||||||
```
|
```
|
||||||
|
mkdir learndir
|
||||||
|
cd learndir
|
||||||
git clone https://github.com/ArthurSonzogni/FTXUI
|
git clone https://github.com/ArthurSonzogni/FTXUI
|
||||||
|
cd FTXUI
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
|
cmake ..
|
||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
cd ..
|
cd ..
|
||||||
git clone https://git.indoodle.com/jason/joomer-ftxui-file-browser.git
|
git clone https://git.indoodle.com/jason/joomer-ftxui-file-browser.git
|
||||||
cd joomer-ftxui-file-browser.git
|
cd joomer-ftxui-file-browser
|
||||||
make all -j4
|
make all
|
||||||
bin/Linux/release/joomer-ftxui-file-browser
|
bin/Linux/release/joomer-ftxui-file-browser
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -115,7 +115,7 @@ int main(int argc, char* argv[]) {
|
|||||||
// --- OUTPUT AFTER THE LOOP HAS CLEANLY EXITED ---
|
// --- OUTPUT AFTER THE LOOP HAS CLEANLY EXITED ---
|
||||||
// ----------------------------------------------------
|
// ----------------------------------------------------
|
||||||
cout<< "directory path: " << directory_path << endl;
|
cout<< "directory path: " << directory_path << endl;
|
||||||
cout << "test: " << test << endl;
|
//cout << "test: " << test << endl;
|
||||||
if (final_selected_index >= 0 && final_selected_index < entries.size()) {
|
if (final_selected_index >= 0 && final_selected_index < entries.size()) {
|
||||||
std::cout << "Selected Entry: " << entries[final_selected_index] << std::endl;
|
std::cout << "Selected Entry: " << entries[final_selected_index] << std::endl;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
37
makefile
37
makefile
@ -8,16 +8,9 @@ BUILD_TYPE ?= release# Default to release build if not specified
|
|||||||
LINUX_LIB_EXT = so
|
LINUX_LIB_EXT = so
|
||||||
|
|
||||||
# Version configuration (can be overridden)
|
# 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 = ../FTXUI
|
||||||
FTXUI_PATH = ../learndir/FTXUI
|
|
||||||
#BELLA_BUILD_DIR = $(BELLA_PATH)/build/library
|
|
||||||
LIB_PATHS = -L$(FTXUI_PATH)/build
|
LIB_PATHS = -L$(FTXUI_PATH)/build
|
||||||
INC_DIRS = -Iinclude -I$(FTXUI_PATH)/include
|
INC_DIRS = -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)
|
|
||||||
|
|
||||||
# Common paths
|
# Common paths
|
||||||
OBJ_DIR = obj/$(PLATFORM)/$(BUILD_TYPE)
|
OBJ_DIR = obj/$(PLATFORM)/$(BUILD_TYPE)
|
||||||
@ -25,33 +18,31 @@ BIN_DIR = bin/$(PLATFORM)/$(BUILD_TYPE)
|
|||||||
OUTPUT_FILE = $(BIN_DIR)/$(EXECUTABLE_NAME)
|
OUTPUT_FILE = $(BIN_DIR)/$(EXECUTABLE_NAME)
|
||||||
|
|
||||||
CXX = g++
|
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
|
# Build type specific flags
|
||||||
ifeq ($(BUILD_TYPE), debug)
|
ifeq ($(BUILD_TYPE), debug)
|
||||||
CPP_DEFINES = -D_DEBUG -DDL_USE_SHARED
|
CPP_DEFINES = -D_DEBUG
|
||||||
COMMON_FLAGS = $(ARCH_FLAGS) $(INCLUDE_PATHS)
|
COMMON_FLAGS = $(ARCH_FLAGS)
|
||||||
COMP_FLAGS = -g -O0 -std=c++17 -Wall
|
COMP_FLAGS = -g -O0 -std=c++17 -Wall
|
||||||
#LINK_FLAGS = -fvisibility=hidden
|
#LINK_FLAGS = -fvisibility=hidden
|
||||||
else
|
else
|
||||||
CPP_DEFINES = -DNDEBUG=1 -DDL_USE_SHARED
|
CPP_DEFINES = -DNDEBUG=1
|
||||||
COMMON_FLAGS = $(ARCH_FLAGS) $(INCLUDE_PATHS)
|
COMMON_FLAGS = $(ARCH_FLAGS)
|
||||||
COMP_FLAGS = -O3 -std=c++17 -Wall
|
COMP_FLAGS = -O3 -std=c++17 -Wall
|
||||||
#LINK_FLAGS = -fvisibility=hidden
|
#LINK_FLAGS = -fvisibility=hidden
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Language-specific flags
|
# Language-specific flags
|
||||||
#C_FLAGS = $(COMMON_FLAGS) -std=c17
|
|
||||||
#CXX_FLAGS = $(COMMON_FLAGS) -std=c++17 -Wall -g $(INC_DIRS)
|
|
||||||
CXX = g++
|
CXX = g++
|
||||||
CXX_FLAGS = $(COMMON_FLAGS) $(INC_DIRS)
|
CXX_FLAGS = $(COMMON_FLAGS)
|
||||||
LINK_FLAGS = $(LIB_PATHS) #-fvisibility=hidden
|
LINK_FLAGS = $(LIB_PATHS) #-fvisibility=hidden
|
||||||
FTXUI_LIB_FLAGS = -lftxui-component -lftxui-dom -lftxui-screen
|
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)
|
# 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)
|
# 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
|
# 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
|
# We've changed this back to use joomer-ftxui-file-browser.o as the source of the executable
|
||||||
@ -65,10 +56,7 @@ $(OBJ_DIR)/%.o: %.cpp
|
|||||||
# --- Main Target ---
|
# --- Main Target ---
|
||||||
# 'all' is the default target that builds your executable
|
# 'all' is the default target that builds your executable
|
||||||
all: $(OUTPUT_FILE)
|
all: $(OUTPUT_FILE)
|
||||||
@echo "FTXUI_PATH: $(FTXUI_PATH)"
|
@echo "Building executables complete."
|
||||||
@echo "Build complete."
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Rule to link the executable:
|
# Rule to link the executable:
|
||||||
# It depends on the object files and uses CXX to link them with specified libraries.
|
# It depends on the object files and uses CXX to link them with specified libraries.
|
||||||
@ -76,8 +64,7 @@ $(OUTPUT_FILE): $(OBJECTS)
|
|||||||
@echo "Linking $(OUTPUT_FILE)..."
|
@echo "Linking $(OUTPUT_FILE)..."
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(CXX) -o $@ $(OBJECTS) $(LINK_FLAGS) $(LDFLAGS)
|
$(CXX) -o $@ $(OBJECTS) $(LINK_FLAGS) $(LDFLAGS)
|
||||||
@echo "FTXUI_PATH: "$(FTXUI_PATH)
|
@echo "Building links complete."
|
||||||
@echo "Build complete."
|
|
||||||
|
|
||||||
|
|
||||||
# --- Clean Target ---
|
# --- Clean Target ---
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user