diff --git a/.travis.yml b/.travis.yml index 7ba845a..9ee88f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ before_install: before_script: - mkdir .build - cd .build - - cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_EXAMPLE=ON -DWITH_TESTS=ON .. + - cmake -DCMAKE_BUILD_TYPE=Debug .. script: - make diff --git a/CMakeLists.txt b/CMakeLists.txt index fccff9a..ddc30b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required (VERSION 3.1) project(fuse-wsfs VERSION 0.1.0 DESCRIPTION "Websocket filesystem based on libfuse") -option(WITH_TESTS "enable unit tests" OFF) -option(WITH_EXAMPLE "enable example" OFF) +option(WITHOUT_TESTS "disable unit tests" OFF) +option(WITHOUT_EXAMPLE "disable example" OFF) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) @@ -98,7 +98,7 @@ install(FILES "${PROJECT_BINARY_DIR}/libfuse-wsfs.pc" DESTINATION lib${LIB_SUFFI # app -if(WITH_EXAMPLE) +if(NOT WITHOUT_EXAMPLE) add_executable(wsfs example/main.c @@ -108,11 +108,11 @@ target_link_libraries(wsfs PUBLIC fuse-wsfs ${EXTRA_LIBS}) target_include_directories(wsfs PUBLIC ${EXTRA_INCLUDE_DIRS}) target_compile_options(wsfs PUBLIC ${EXTRA_CFLAGS}) -endif(WITH_EXAMPLE) +endif(NOT WITHOUT_EXAMPLE) # tests -if(WITH_TESTS) +if(NOT WITHOUT_TESTS) pkg_check_modules(GTEST gtest_main) @@ -139,4 +139,4 @@ target_compile_options(alltests PUBLIC ${EXTRA_CFLAGS} ${GTEST_CFLAGS}) enable_testing() add_test(alltests alltests) -endif(WITH_TESTS) \ No newline at end of file +endif(NOT WITHOUT_TESTS) \ No newline at end of file diff --git a/README.md b/README.md index d99191d..902959e 100644 --- a/README.md +++ b/README.md @@ -275,12 +275,22 @@ Read from an open file. To install dependencies, see below. cd fuse-wsfs - mkdir ./build - cd ./build - cmake -DWITH_EXAMPLE=ON .. + mkdir .build + cd .build + cmake .. mkdir test ./wsfs -m test --document_root=../exmaple/www --port=4711 +### Build options + +By default, unit tests and example application are enabled. You can disable them using the following cmake options: + +- **WITHOUT_TESTS**: disable tests + `cmake -DWITHOUT_TESTS=ON ..` + +- **WITHOUT_EXAMPLE**: disable example + `cmake -DWITHOUD_EXAMPLE=ON ..` + ## Dependencies - [libfuse3](https://github.com/libfuse/libfuse/)