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 d578ca9
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,27 @@ 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 /Library/Frameworks/macFUSE.framework/macFUSE)
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 /Library/Frameworks/OSXFUSE.framework/OSXFUSE)
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)
else()
target_link_libraries(apfs-fuse apfs fuse)
target_compile_definitions(apfs-fuse PRIVATE USE_FUSE2)
endif()
if (USE_FUSE3)
target_link_libraries(apfs-fuse apfs fuse3)
else()
message(BAR)
target_link_libraries(apfs-fuse apfs fuse)
target_compile_definitions(apfs-fuse PRIVATE USE_FUSE2)
endif()
endif()

add_executable(apfsutil ApfsUtil/ApfsUtil.cpp)
Expand Down

0 comments on commit d578ca9

Please sign in to comment.