Commit 0cd5f563 authored by Marc Vef's avatar Marc Vef
Browse files

fs with bbfs example converted to cmake

parent 0378c694
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -65,3 +65,11 @@
# .idea
*.idea/

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
+34 −0
Original line number Diff line number Diff line
# Find the FUSE includes and library
#
#  FUSE_INCLUDE_DIR - where to find fuse.h, etc.
#  FUSE_LIBRARIES   - List of libraries when using FUSE.
#  FUSE_FOUND       - True if FUSE lib is found.

# check if already in cache, be silent
IF (FUSE_INCLUDE_DIR)
    SET (FUSE_FIND_QUIETLY TRUE)
ENDIF (FUSE_INCLUDE_DIR)

# find includes
FIND_PATH (FUSE_INCLUDE_DIR fuse.h
        /usr/local/include/osxfuse
        /usr/local/include
        /usr/include
        )

# find lib
if (APPLE)
    SET(FUSE_NAMES libosxfuse.dylib fuse)
else (APPLE)
    SET(FUSE_NAMES fuse)
endif (APPLE)
FIND_LIBRARY(FUSE_LIBRARIES
        NAMES ${FUSE_NAMES}
        PATHS /lib64 /lib /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /usr/lib/x86_64-linux-gnu
        )

include ("FindPackageHandleStandardArgs")
find_package_handle_standard_args ("FUSE" DEFAULT_MSG
        FUSE_INCLUDE_DIR FUSE_LIBRARIES)

mark_as_advanced (FUSE_INCLUDE_DIR FUSE_LIBRARIES)
 No newline at end of file
+17 −5
Original line number Diff line number Diff line
cmake_minimum_required(VERSION 3.6)
project(fs)
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
project(fs VERSION 0.0.1 LANGUAGES C)

set(CMAKE_CXX_STANDARD 11)
#set(CMAKE_CXX_STANDARD 11)
# XXX recheck what this stuff is
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall --pedantic -g")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
# from fuse example. dont know what it does yet
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
#set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
find_package(FUSE REQUIRED)

set(SOURCE_FILES main.cpp)
add_executable(fs ${SOURCE_FILES})
 No newline at end of file
include_directories(${FUSE_INCLUDE_DIR})
set(SOURCE_FILES src/bbfs.c src/log.c src/log.h src/bbfs.h)
add_executable(adafs ${SOURCE_FILES} src/bbfs.c)
target_link_libraries(adafs ${FUSE_LIBRARIES})
 No newline at end of file

fs/main.cpp

deleted100644 → 0
+0 −6
Original line number Diff line number Diff line
#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}
 No newline at end of file

fs/playground/bbfs.log

0 → 100644
+3500 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading