Skip to content

Commit

Permalink
Handle macFUSE and OSXFUSE
Browse files Browse the repository at this point in the history
With the change of project from OSXFUSE to macFUSE, the header and
library paths have changed, so update the CMake configuration to
handle both, and to properly error out if neither are found under
macOS
  • Loading branch information
msbit committed Jul 5, 2021
1 parent b2ea1e7 commit a5017f9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +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)
target_compile_definitions(apfs-fuse PRIVATE USE_FUSE2)
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

0 comments on commit a5017f9

Please sign in to comment.