diff --git a/CMakeLists.txt b/CMakeLists.txt index c7b9adf7..b23141a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,10 @@ option(BUILD_TESTING "build test cases" OFF) option(CRYFS_UPDATE_CHECKS "let cryfs check for updates and security vulnerabilities" ON) option(DISABLE_OPENMP "allow building without OpenMP libraries. This will cause performance degradations." OFF) +if (MSVC) + option(DOKAN_LIB_PATH "Location of the Dokan library, e.g. C:\\Program Files\\Dokan\\DokanLibrary-1.1.0" "") +endif() + # Default value is to build in release mode if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release CACHE INTERNAL "CMAKE_BUILD_TYPE") diff --git a/README.md b/README.md index 4ae4f69e..1aa20cb4 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,16 @@ You can pass the following variables to the *cmake* command (using *-Dvariablena - **-DBUILD_TESTING**=[on|off]: Whether to build the test cases (can take a long time). Default: off - **-DCRYFS_UPDATE_CHECKS**=off: Build a CryFS that doesn't check online for updates and security vulnerabilities. +Building on Windows (experimental) +--------------- + +Build with Visual Studio 2017 and pass in the following flags to CMake: + + -DDOKAN_LIB_PATH=[dokan library location, e.g. "C:\Program Files\Dokan\DokanLibrary-1.1.0"] + -DCURL_LIBRARY=[path to libcurl.dll.a, e.g. "C:\ProgramData\chocolatey\lib\curl\tools\curl-7.61.1-win64-mingw\lib\libcurl.dll.a"] + -DCURL_INCLUDE_DIR=[path to libcurl include files, e.g. "C:\ProgramData\chocolatey\lib\curl\tools\curl-7.61.1-win64-mingw\include"] + -DBOOST_ROOT=[path to root of boost installation] + Troubleshooting --------------- diff --git a/src/fspp/fuse/CMakeLists.txt b/src/fspp/fuse/CMakeLists.txt index a7b31caf..114d7132 100644 --- a/src/fspp/fuse/CMakeLists.txt +++ b/src/fspp/fuse/CMakeLists.txt @@ -15,12 +15,17 @@ target_add_boost(${PROJECT_NAME} filesystem system thread chrono) target_enable_style_warnings(${PROJECT_NAME}) target_activate_cpp14(${PROJECT_NAME}) -if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + target_include_directories(${PROJECT_NAME} PUBLIC "${DOKAN_LIB_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") +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_FIND_FRAMEWORK LAST) - set(FUSE_LIB_NAME "osxfuse") -else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(FUSE_LIB_NAME "fuse") -endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + 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() -find_library_with_path(FUSE ${FUSE_LIB_NAME} FUSE_LIB_PATH) -target_link_libraries(${PROJECT_NAME} PUBLIC ${FUSE})