From cc70088a83037a9cd7a990d01a5f619949d81382 Mon Sep 17 00:00:00 2001 From: aiekick Date: Sat, 25 Nov 2023 14:17:33 +0100 Subject: [PATCH] [UPD] : update doc about file system interface --- ImGuiFileDialog | 2 +- README.md | 23 ++++++++++++++++++-- cmake/boost.cmake | 54 ++++++++++++++--------------------------------- 3 files changed, 38 insertions(+), 41 deletions(-) diff --git a/ImGuiFileDialog b/ImGuiFileDialog index 075f525..841e96c 160000 --- a/ImGuiFileDialog +++ b/ImGuiFileDialog @@ -1 +1 @@ -Subproject commit 075f5258fd146ac72c221f06bbcbdfda63e1911b +Subproject commit 841e96c11a0d98c9ee9d5a1c89225e5c4e8f59be diff --git a/README.md b/README.md index d4e6caf..2a90ff4 100644 --- a/README.md +++ b/README.md @@ -938,9 +938,28 @@ to note : -

Api's C/C++ :

+

Custom FileSystem

-### the C Api +you can use your custom file system interface. + +by default IGFD come with the File System Interfaces for Dirent or std::filesystem +but you have now a FileSystem interface called IFileSystem who can be overrided with your needs +by ex for android, emscripten, or boost + +2 steps : + +1) create a include file who must contain : + - your override of IGFD::IFileSystem + - a define of your class name in FILE_SYSTEM_OVERRIDE (ex : #define FILE_SYSTEM_OVERRIDE FileSystemBoost) + +2) define your file system include file path in the preprocessor var "CUSTOM_FILESYSTEM_INCLUDE" + ex : #define CUSTOM_FILESYSTEM_INCLUDE "src/FileSystemBoost.hpp" + +you can check the DemoApp who is using an override for the Boost::filesystem + +
+ +

C Api :

this api was sucessfully tested with CImGui diff --git a/cmake/boost.cmake b/cmake/boost.cmake index 46b36cb..6ee0833 100644 --- a/cmake/boost.cmake +++ b/cmake/boost.cmake @@ -30,41 +30,19 @@ set(BOOST_FILESYSTEM_LIBRARIES boost_type_traits ) -set_target_properties(boost_assert PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_atomic PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_chrono PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_container PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_context PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_contract PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_core PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_coroutine PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_date_time PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_exception PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_fiber PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_fiber_numa PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_filesystem PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_graph PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_iostreams PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_json PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_locale PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_log PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_log_setup PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_nowide PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_prg_exec_monitor PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_program_options PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_random PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_serialization PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_stacktrace_basic PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_stacktrace_noop PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_stacktrace_windbg PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_stacktrace_windbg_cached PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_system PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_test_exec_monitor PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_thread PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_timer PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_type_erasure PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_unit_test_framework PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_url PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_variant2 PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_wave PROPERTIES FOLDER 3rdparty/boost) -set_target_properties(boost_wserialization PROPERTIES FOLDER 3rdparty/boost) \ No newline at end of file +## will serarhc for target with a particular prefix and will set destination folder +function(set_target_dir _PREFIX DIR TARGET_DIR) + get_property(TGTS DIRECTORY "${DIR}" PROPERTY BUILDSYSTEM_TARGETS) + string (REGEX MATCHALL "(^|;)${_PREFIX}[A-Za-z0-9_]*" _matchedVars "${TGTS}") + foreach (_var IN LISTS _matchedVars) + if (TARGET ${_var}) + set_target_properties(${_var} PROPERTIES FOLDER ${TARGET_DIR}) + endif() + endforeach() + get_property(SUBDIRS DIRECTORY "${DIR}" PROPERTY SUBDIRECTORIES) + foreach(SUBDIR IN LISTS SUBDIRS) + set_target_dir("${_PREFIX}" "${SUBDIR}" "${TARGET_DIR}") + endforeach() +endfunction() + +set_target_dir(boost . 3rdparty/boost)