2018-05-21 08:18:34 +02:00
|
|
|
project (fspp-fuse)
|
|
|
|
|
|
|
|
set(SOURCES
|
|
|
|
../impl/FilesystemImpl.cpp
|
|
|
|
../impl/Profiler.cpp
|
|
|
|
../fuse/Fuse.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(${PROJECT_NAME} STATIC ${SOURCES})
|
|
|
|
|
|
|
|
target_compile_definitions(${PROJECT_NAME} PUBLIC _FILE_OFFSET_BITS=64)
|
2018-08-08 03:45:05 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC cpp-utils fspp-interface)
|
2018-05-21 08:18:34 +02:00
|
|
|
|
|
|
|
target_add_boost(${PROJECT_NAME} filesystem system thread chrono)
|
|
|
|
target_enable_style_warnings(${PROJECT_NAME})
|
|
|
|
target_activate_cpp14(${PROJECT_NAME})
|
|
|
|
|
2018-09-16 02:42:32 +02:00
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
2018-09-18 13:35:50 +02:00
|
|
|
get_target_architecture(TARGET_ARCH)
|
2018-09-19 07:45:20 +02:00
|
|
|
message(STATUS "Linking to Dokan ${TARGET_ARCH}")
|
2018-09-18 13:35:50 +02:00
|
|
|
if ("${TARGET_ARCH}" STREQUAL "x86_64")
|
2018-09-27 04:18:06 +02:00
|
|
|
set(DOKAN_LIB_PATH "${DOKAN_PATH}")
|
2018-09-18 13:35:50 +02:00
|
|
|
elseif("${TARGET_ARCH}" STREQUAL "i386")
|
2018-11-22 06:45:27 +01:00
|
|
|
set(DOKAN_LIB_PATH "${DOKAN_PATH}/x86")
|
2018-09-18 13:35:50 +02:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unsupported architecture: ${TARGET_ARCH}")
|
|
|
|
endif()
|
|
|
|
|
2018-11-22 06:45:27 +01:00
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC "${DOKAN_PATH}/include")
|
|
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC "${DOKAN_LIB_PATH}/lib/dokan1.lib")
|
|
|
|
#target_link_libraries(${PROJECT_NAME} PUBLIC "${DOKAN_LIB_PATH}/lib/dokannp1.lib")
|
|
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC "${DOKAN_LIB_PATH}/lib/dokanfuse1.lib")
|
2018-09-27 04:18:06 +02:00
|
|
|
|
2018-11-22 06:45:27 +01:00
|
|
|
install(FILES "${DOKAN_LIB_PATH}/dokan1.dll" "${DOKAN_LIB_PATH}/dokanfuse1.dll"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
2018-09-27 04:18:06 +02:00
|
|
|
)
|
2018-09-18 13:35:50 +02:00
|
|
|
|
2018-09-16 02:42:32 +02:00
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
2018-05-21 08:18:34 +02:00
|
|
|
set(CMAKE_FIND_FRAMEWORK LAST)
|
2018-09-16 02:42:32 +02:00
|
|
|
find_library_with_path(FUSE "osxfuse" FUSE_LIB_PATH)
|
|
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC ${FUSE})
|
|
|
|
else() # Linux
|
|
|
|
find_library_with_path(FUSE "fuse" FUSE_LIB_PATH)
|
|
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC ${FUSE})
|
|
|
|
endif()
|
2018-05-21 08:18:34 +02:00
|
|
|
|