Skip to content

Instantly share code, notes, and snippets.

@joar
Created August 23, 2011 22:45
Show Gist options
  • Save joar/1166818 to your computer and use it in GitHub Desktop.
Save joar/1166818 to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 2.8)
project(TMFS CXX)
#SET(Boost_ADDITIONAL_VERSIONS "1.43" "1.43.0" "1.44" "1.44.0" "1.45" "1.45.0")
SET(BOOST_ROOT "$ENV{HOME}/Downloads/boost_1_47_0/build")
SET(Boost_INCLUDE_DIR "${BOOST_ROOT}/include")
SET(Boost_LIBRARY_DIRS "${BOOST_ROOT}/lib")
SET(Boost_LIBRARIES "${BOOST_ROOT}/lib/libboost_filesystem-mt.so;${BOOST_ROOT}/lib/libboost_regex-mt.so")
MESSAGE(STATUS "** Search Boost root: ${BOOST_ROOT}")
FIND_PACKAGE(Boost 1.47 COMPONENTS filesystem regex REQUIRED)
MESSAGE(STATUS "** Boost Include: ${Boost_INCLUDE_DIR}")
MESSAGE(STATUS "** Boost Libraries: ${Boost_LIBRARY_DIRS}")
MESSAGE(STATUS "** Boost Libraries: ${Boost_LIBRARIES}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED OFF)
set(Boost_USE_STATIC_RUNTIME OFF)
set(Boost_DEBUG OFF)
#find_package(Boost 1.47 COMPONENTS filesystem)
find_package(PkgConfig)
pkg_check_modules(FUSE REQUIRED fuse)
add_definitions(${FUSE_CFLAGS} -Wall)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(tmfs
src/main.cc
src/readdir.cc
src/read.cc
src/getattr.cc
src/get_real_path.cc
)
link_directories(${FUSE_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})
target_link_libraries(tmfs ${FUSE_LIBRARIES} ${Boost_LIBRARIES})
install(TARGETS tmfs RUNTIME DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment