Skip to content

Commit

Permalink
dokan_fuse: Add cmake-install target
Browse files Browse the repository at this point in the history
This adds an install target that installs the headers in the same
directory structure as libfuse. This makes it easy to support compiling
against either libfuse or libdokanfuse1 from the same codebase.
This fixes #250 for manual compilations under Cygwin or for MingW.
  • Loading branch information
Rondom committed Sep 20, 2016
1 parent 6d51499 commit 8c5578f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
39 changes: 28 additions & 11 deletions dokan_fuse/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
cmake_minimum_required(VERSION 2.8.4)

project (dokanfuse1)

set(CMAKE_LEGACY_CYGWIN_WIN32 0)
cmake_minimum_required(VERSION 2.8.5)
project(dokanfuse1)
include(GNUInstallDirs)

if(NOT CMAKE_BUILD_TYPE)
message("No CMAKE_BUILD_TYPE specified, defaulting to Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -mwin32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -mwin32 -Wall")
add_definitions(-D_FILE_OFFSET_BITS=64)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/../sys
)

file(GLOB source src/*.cpp src/*.c)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/../sys)
file(GLOB sources src/*.cpp src/*.c)
set(install_headers
include/fuse.h
include/fuse_common.h
include/fuse_opt.h
include/fuse_sem_fix.h
include/fuse_win.h
include/utils.h
)
set(compat_headers
include/old/fuse.h
)
add_library(dokanfuse1 SHARED ${sources})

add_library(dokanfuse1 SHARED ${source})
INSTALL(FILES ${install_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fuse/)
INSTALL(FILES ${compat_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
INSTALL(TARGETS dokanfuse1
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
9 changes: 9 additions & 0 deletions dokan_fuse/include/old/fuse.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
This header is for compatibility with older software using FUSE.
Please use 'pkg-config --cflags fuse' to set include path. The
correct usage is still '#include <fuse.h>', not '#include
<fuse/fuse.h>'.
*/

#include "fuse/fuse.h"

0 comments on commit 8c5578f

Please sign in to comment.