Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS detect FUSE package #152

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,19 @@ add_executable(apfs-fuse
apfsfuse/ApfsFuse.cpp)
target_compile_definitions(apfs-fuse PRIVATE _FILE_OFFSET_BITS=64 _DARWIN_USE_64_BIT_INODE)
if (APPLE)
target_include_directories(apfs-fuse PRIVATE /usr/local/include/osxfuse/)
# link_directories(/usr/local/lib/)
target_link_libraries(apfs-fuse apfs /usr/local/lib/libosxfuse.dylib)
if(EXISTS /usr/local/include/fuse/fuse.h AND EXISTS /usr/local/lib/libfuse.dylib)
message(STATUS "Using macFUSE package")
target_compile_definitions(apfs-fuse PRIVATE USE_FUSE2)
target_include_directories(apfs-fuse PRIVATE /usr/local/include/)
target_link_libraries(apfs-fuse apfs /usr/local/lib/libfuse.dylib)
elseif(EXISTS /usr/local/include/osxfuse/fuse/fuse.h AND EXISTS /usr/local/lib/libosxfuse.dylib)
message(STATUS "Using OSXFUSE package")
target_compile_definitions(apfs-fuse PRIVATE USE_FUSE2)
target_include_directories(apfs-fuse PRIVATE /usr/local/include/osxfuse/)
target_link_libraries(apfs-fuse apfs /usr/local/lib/libosxfuse.dylib)
else()
message(FATAL_ERROR "Unable to find FUSE package")
endif()
else()
if (USE_FUSE3)
target_link_libraries(apfs-fuse apfs fuse3)
Expand Down