Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Makefile
DartConfiguration.tcl
compile_commands.json
_deps/
.deps/

# Qt meta-object / resource / uic output
*_autogen/
Expand Down Expand Up @@ -51,6 +52,7 @@ packaging/.tools/
# Editor / tooling
.claude/
.worktrees/
__pycache__/

# CTest output
Testing/
Expand Down
93 changes: 90 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,20 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

if(APPLE)
enable_language(OBJCXX)
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0" CACHE STRING
"Minimum macOS version supported by FileCommander")
endif()

include(cmake/FileCommanderOptions.cmake)

if(FILECOMMANDER_DEPS_ROOT)
get_filename_component(_fc_deps_root
"${FILECOMMANDER_DEPS_ROOT}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}")
list(PREPEND CMAKE_PREFIX_PATH "${_fc_deps_root}")
endif()

# Tests and benchmarks default ON (the normal development build is unchanged),
# but a packaging build turns them off: they roughly triple build time, and
# tests/ hard-requires /usr/src/googletest, which a clean package builder has no
Expand All @@ -33,6 +45,9 @@ add_compile_definitions(
FILECOMMANDER_MEDIA_BACKEND_MPV=${FILECOMMANDER_MEDIA_BACKEND_MPV}
FILECOMMANDER_MEDIA_BACKEND_WINDOWSMF=${FILECOMMANDER_MEDIA_BACKEND_WINDOWSMF}
)
if(FILECOMMANDER_USE_VCPKG)
add_compile_definitions(FILECOMMANDER_USE_VCPKG=1)
endif()
if(MSVC)
add_compile_options(/utf-8)
endif()
Expand All @@ -51,6 +66,31 @@ endif()
if(FILECOMMANDER_ENABLE_NETWORK)
find_package(Qt5 REQUIRED COMPONENTS WebSockets)
endif()

if(APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64" AND
CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
get_target_property(_fc_qt_core_location Qt5::Core IMPORTED_LOCATION_RELEASE)
if(NOT _fc_qt_core_location)
get_target_property(_fc_qt_core_location Qt5::Core IMPORTED_LOCATION)
endif()
if(_fc_qt_core_location AND EXISTS "${_fc_qt_core_location}")
execute_process(
COMMAND /usr/bin/lipo -info "${_fc_qt_core_location}"
OUTPUT_VARIABLE _fc_qt_architectures
ERROR_VARIABLE _fc_qt_architecture_error
RESULT_VARIABLE _fc_qt_lipo_result
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT _fc_qt_lipo_result EQUAL 0 OR
NOT _fc_qt_architectures MATCHES "x86_64" OR
NOT _fc_qt_architectures MATCHES "arm64")
message(FATAL_ERROR
"Universal2 macOS builds require a universal Qt5::Core framework. "
"The selected Qt installation is not universal: "
"${_fc_qt_core_location}")
endif()
endif()
endif()
find_package(LibArchive)

# Official announcement-only update manifest. Tests inject a local URL through
Expand Down Expand Up @@ -87,16 +127,36 @@ add_subdirectory(src/ui)
add_subdirectory(src/viewer)
add_subdirectory(src/archive)
add_subdirectory(src/search)
if(FILECOMMANDER_ENABLE_LINUX_INTEGRATION AND FILECOMMANDER_ENABLE_NETWORK)
if(FILECOMMANDER_ENABLE_NETWORK AND
(FILECOMMANDER_ENABLE_LINUX_INTEGRATION OR APPLE))
add_subdirectory(src/smbhelper)
endif()

add_executable(FileCommander
set(FILECOMMANDER_APP_SOURCES
src/main.cpp
resources/resources.qrc
)
if(APPLE)
set(FILECOMMANDER_MACOS_ICON
"${CMAKE_SOURCE_DIR}/resources/macos/FileCommander.icns")
set_source_files_properties("${FILECOMMANDER_MACOS_ICON}"
PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
list(APPEND FILECOMMANDER_APP_SOURCES "${FILECOMMANDER_MACOS_ICON}")
endif()

add_executable(FileCommander ${FILECOMMANDER_APP_SOURCES})
if(WIN32)
set_target_properties(FileCommander PROPERTIES WIN32_EXECUTABLE TRUE)
elseif(APPLE)
set_target_properties(FileCommander PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_GUI_IDENTIFIER "com.aigutta.FileCommander"
MACOSX_BUNDLE_BUNDLE_NAME "FileCommander"
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}"
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}"
MACOSX_BUNDLE_ICON_FILE "FileCommander.icns"
)
endif()

target_link_libraries(FileCommander PRIVATE
Expand All @@ -113,6 +173,27 @@ target_compile_definitions(FileCommander PRIVATE
FILECOMMANDER_MEDIA_BACKEND_WINDOWSMF=${FILECOMMANDER_MEDIA_BACKEND_WINDOWSMF}
)

if(APPLE)
# Keep the bundle self-contained during development. The helper is copied
# into the conventional LaunchServices location by the helper target below.
add_executable(FileCommanderPrivilegedHelper
src/platform/macos/FileCommanderPrivilegedHelper.cpp
)
set_target_properties(FileCommanderPrivilegedHelper PROPERTIES
OUTPUT_NAME "com.aigutta.FileCommander.privileged-helper"
RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/FileCommander.app/Contents/Library/LaunchServices"
)
target_link_libraries(FileCommanderPrivilegedHelper PRIVATE
platform
Qt5::Core
)
add_dependencies(FileCommander FileCommanderPrivilegedHelper)
endif()
if(TARGET FileCommander-smb-helper)
add_dependencies(FileCommander FileCommander-smb-helper)
endif()

if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
get_filename_component(_qt_bin "${Qt5_DIR}/../../../bin" ABSOLUTE)
set(_windeployqt "${_qt_bin}/windeployqt.exe")
Expand Down Expand Up @@ -165,7 +246,13 @@ endif()
# which is how the window manager ties running windows back to the launcher entry.
include(GNUInstallDirs)

install(TARGETS FileCommander RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if(APPLE)
install(TARGETS FileCommander BUNDLE DESTINATION .)
install(TARGETS FileCommanderPrivilegedHelper
RUNTIME DESTINATION FileCommander.app/Contents/Library/LaunchServices)
else()
install(TARGETS FileCommander RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if(UNIX AND NOT APPLE)
install(FILES packaging/FileCommander.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
Expand Down
103 changes: 102 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,86 @@
"TTC_BUILD_TESTS": "OFF",
"TTC_BUILD_BENCH": "OFF"
}
},
{
"name": "macos-universal2-debug",
"displayName": "macOS Universal2 Debug",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/macos-universal2-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_OSX_ARCHITECTURES": "x86_64;arm64",
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0",
"CMAKE_PREFIX_PATH": "$env{FILECOMMANDER_QT_ROOT}",
"TTC_BUILD_TESTS": "ON",
"TTC_BUILD_BENCH": "OFF",
"FILECOMMANDER_ENABLE_NETWORK": "ON",
"FILECOMMANDER_ENABLE_LINUX_INTEGRATION": "OFF",
"FILECOMMANDER_PREVIEW_PDF": "OFF",
"FILECOMMANDER_PREVIEW_MEDIA": "OFF",
"FILECOMMANDER_PREVIEW_OFFICE": "ON"
}
},
{
"name": "macos-x86_64-release",
"displayName": "macOS Intel Release",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/macos-x86_64-release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_OSX_ARCHITECTURES": "x86_64",
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/.deps/macos/vcpkg/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "filecommander-x64-osx-release",
"VCPKG_HOST_TRIPLET": "filecommander-x64-osx-release",
"VCPKG_INSTALLED_DIR": "${sourceDir}/.deps/macos/vcpkg/installed",
"FILECOMMANDER_DEPS_ROOT": "${sourceDir}/.deps/macos/vcpkg/installed/filecommander-x64-osx-release",
"FILECOMMANDER_POPPLER_QT5_ROOT": "${sourceDir}/.deps/macos/poppler-qt5-x64",
"FILECOMMANDER_USE_VCPKG": "ON",
"TTC_BUILD_TESTS": "OFF",
"TTC_BUILD_BENCH": "OFF",
"FILECOMMANDER_ENABLE_NETWORK": "ON",
"FILECOMMANDER_ENABLE_LINUX_INTEGRATION": "OFF",
"FILECOMMANDER_PREVIEW_PDF": "ON",
"FILECOMMANDER_PREVIEW_MEDIA": "ON",
"FILECOMMANDER_MEDIA_BACKEND": "mpv",
"FILECOMMANDER_PREVIEW_OFFICE": "ON"
}
},
{
"name": "macos-arm64-release",
"displayName": "macOS Apple Silicon Release",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/macos-arm64-release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_OSX_ARCHITECTURES": "arm64",
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/.deps/macos/vcpkg/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "filecommander-arm64-osx-release",
"VCPKG_HOST_TRIPLET": "filecommander-x64-osx-release",
"VCPKG_INSTALLED_DIR": "${sourceDir}/.deps/macos/vcpkg/installed",
"FILECOMMANDER_DEPS_ROOT": "${sourceDir}/.deps/macos/vcpkg/installed/filecommander-arm64-osx-release",
"FILECOMMANDER_USE_VCPKG": "ON",
"TTC_BUILD_TESTS": "OFF",
"TTC_BUILD_BENCH": "OFF",
"FILECOMMANDER_ENABLE_NETWORK": "ON",
"FILECOMMANDER_ENABLE_LINUX_INTEGRATION": "OFF",
"FILECOMMANDER_PREVIEW_PDF": "OFF",
"FILECOMMANDER_PREVIEW_MEDIA": "OFF",
"FILECOMMANDER_PREVIEW_OFFICE": "ON"
}
},
{
"name": "macos-universal2-release",
"inherits": "macos-universal2-debug",
"displayName": "macOS Universal2 Release",
"binaryDir": "${sourceDir}/build/macos-universal2-release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TTC_BUILD_TESTS": "OFF",
"TTC_BUILD_BENCH": "OFF"
}
}
],
"buildPresets": [
Expand All @@ -77,7 +157,23 @@
{ "name": "windows-msvc-x86-debug", "configurePreset": "windows-msvc-x86-debug" },
{ "name": "windows-msvc-arm64-debug", "configurePreset": "windows-msvc-arm64-debug" },
{ "name": "linux-debug", "configurePreset": "linux-debug" },
{ "name": "linux-release", "configurePreset": "linux-release" }
{ "name": "linux-release", "configurePreset": "linux-release" },
{
"name": "macos-universal2-debug",
"configurePreset": "macos-universal2-debug"
},
{
"name": "macos-universal2-release",
"configurePreset": "macos-universal2-release"
},
{
"name": "macos-x86_64-release",
"configurePreset": "macos-x86_64-release"
},
{
"name": "macos-arm64-release",
"configurePreset": "macos-arm64-release"
}
],
"testPresets": [
{
Expand All @@ -89,6 +185,11 @@
"name": "linux-debug",
"configurePreset": "linux-debug",
"output": { "outputOnFailure": true }
},
{
"name": "macos-universal2-debug",
"configurePreset": "macos-universal2-debug",
"output": { "outputOnFailure": true }
}
]
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# FileCommander · 文件指挥官

面向 Windows 和 Linux 的双栏文件管理器:熟悉的高效操作,连接不同设备。
面向 Windows、Linux 和 macOS 的双栏文件管理器:熟悉的高效操作,连接不同设备。

[下载](https://github.com/liuwenhuan/FileCommander/releases) · [English](#english)

Expand All @@ -16,13 +16,13 @@
- **跨设备文件发送和剪贴板同步。** 登录账号后,可向另一台设备发送文件:网络可达时设备间直连,否则通过中继传输。还可主动发送文字或图片到其他设备。支持官方服务器和自定义服务器;普通文件管理无需登录。
- **本地、网络与压缩包统一浏览。** 在同一工作区管理本地磁盘、SFTP、FTP、WebDAV、SMB,以及 7z、ZIP、TAR 等压缩包。
- **列表旁即时预览与编辑。** `Ctrl+Q` 在另一栏预览图片、文本、PDF、视频等文件;`Ctrl+E` 打开内嵌编辑,切换文件时不必反复开关窗口。Office 预览需另装 `office-oxide`。
- **Windows 与 Linux 双平台。** 提供可重绑定快捷键、多语言界面,以及浅色、深色和 Green CRT 主题。
- **Windows、Linux 与 macOS。** 提供可重绑定快捷键、多语言界面,以及浅色、深色和 Green CRT 主题。

## 获取与构建

可用安装包以 [GitHub Releases](https://github.com/liuwenhuan/FileCommander/releases) 的实际附件为准。仓库提供 Windows 安装/便携包及 Linux DEB、AppImage、RPM 的[打包脚本](packaging/);Windows 下不要单独复制 `FileCommander.exe`,它还需要随包提供的运行库。

Linux 开发环境需安装 Qt 5、libarchive、libssh2、libcurl、Poppler Qt5 等依赖;网络和媒体等功能的开关见 [`cmake/FileCommanderOptions.cmake`](cmake/FileCommanderOptions.cmake)。常规构建与测试:
Linux 开发环境需安装 Qt 5、libarchive、libssh2、libcurl、Poppler Qt5 等依赖;网络和媒体等功能的开关见 [`cmake/FileCommanderOptions.cmake`](cmake/FileCommanderOptions.cmake)。macOS 当前提供 Intel `x86_64` 打包流程,会使用 vcpkg、Homebrew 的 mpv/Samba 依赖,并自动编译 Qt5 Poppler 与打包 Office/SMB helper,步骤见 [`packaging/macos/README.md`](packaging/macos/README.md)。常规构建与测试:

```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
Expand All @@ -42,18 +42,18 @@ Windows 使用 Qt 5/MSVC 及项目所需 SDK;发布包脚本见 [`packaging/bu

## English

FileCommander is a dual-pane file manager for Windows and Linux. It pairs a familiar, keyboard-friendly workflow with file transfers and clipboard sharing across devices.
FileCommander is a dual-pane file manager for Windows, Linux, and macOS. It pairs a familiar, keyboard-friendly workflow with file transfers and clipboard sharing across devices.

### Why FileCommander

- **Efficient dual-pane file management.** A workflow familiar to Total Commander users, with keyboard shortcuts, independent tabs and history in each pane, copy and move, and directory comparison and synchronization.
- **Cross-device file transfers and clipboard sharing.** Sign in to send files directly between devices when reachable, with relay fallback, or explicitly send text and images through Cloud Clipboard. Use the official or a custom server; local file management needs no account.
- **Local, network, and archive browsing in one workspace.** Work with local drives, SFTP, FTP, WebDAV, SMB, and archives including 7z, ZIP, and TAR.
- **Preview and edit alongside the file list.** Use `Ctrl+Q` for embedded previews of images, text, PDFs, videos, and more, or `Ctrl+E` for embedded editing while navigating files. Office previews require a separate `office-oxide` installation.
- **Windows and Linux support.** Rebind shortcuts, choose from multiple languages, and switch between light, dark, and Green CRT themes.
- **Windows, Linux, and macOS support.** Rebind shortcuts, choose from multiple languages, and switch between light, dark, and Green CRT themes.

### Download and build

See [GitHub Releases](https://github.com/liuwenhuan/FileCommander/releases) for available packages. Windows packages must include the bundled runtime libraries; the EXE alone is not a complete distribution. Packaging scripts are in [`packaging/`](packaging/), and build options are in [`cmake/FileCommanderOptions.cmake`](cmake/FileCommanderOptions.cmake). The project uses Qt 5 and C++17; build and test with CMake and CTest as shown above.
See [GitHub Releases](https://github.com/liuwenhuan/FileCommander/releases) for available packages. Windows packages must include the bundled runtime libraries; the EXE alone is not a complete distribution. Packaging scripts are in [`packaging/`](packaging/), including the Intel macOS workflow in [`packaging/macos/`](packaging/macos/). Build options are in [`cmake/FileCommanderOptions.cmake`](cmake/FileCommanderOptions.cmake). The project uses Qt 5 and C++17; build and test with CMake and CTest as shown above.

Read the [development record](docs/development-history.md) for design decisions and known limitations. FileCommander is licensed under [GPL-3.0-or-later](LICENSE).
6 changes: 5 additions & 1 deletion cmake/FileCommanderOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ option(FILECOMMANDER_ENABLE_NETWORK "Build network providers" ON)
option(FILECOMMANDER_PREVIEW_PDF "Build Poppler PDF preview" ON)
option(FILECOMMANDER_PREVIEW_MEDIA "Build media preview" ON)
option(FILECOMMANDER_PREVIEW_OFFICE "Build office-oxide integration" ON)
option(FILECOMMANDER_USE_VCPKG
"Resolve third-party libraries through vcpkg CMake package configs" OFF)
set(FILECOMMANDER_DEPS_ROOT "" CACHE PATH
"Prefix containing the third-party dependencies used by this build")
set(FILECOMMANDER_MEDIA_BACKEND "auto" CACHE STRING
"Media backend: auto, mpv, windowsmf, or none")
set_property(CACHE FILECOMMANDER_MEDIA_BACKEND PROPERTY STRINGS auto mpv windowsmf none)

if(WIN32)
if(WIN32 OR APPLE)
option(FILECOMMANDER_ENABLE_LINUX_INTEGRATION
"Build Linux-only DBus, GVFS, X11, libsecret and libsmbclient integration" OFF)
else()
Expand Down
Loading