2019-03-03 14:14:32 +00:00
|
|
|
cmake_minimum_required (VERSION 3.10)
|
2019-04-27 10:34:45 +00:00
|
|
|
project(webfuse VERSION 0.2.0 DESCRIPTION "Websocket filesystem based on libfuse")
|
2019-01-27 02:45:03 +00:00
|
|
|
|
2020-02-10 15:58:04 +00:00
|
|
|
option(WITHOUT_TESTS "disable unit tests" OFF)
|
|
|
|
option(WITHOUT_ADAPTER "disable adapter library" OFF)
|
|
|
|
option(WITHOUT_PROVIDER "disable provider library" OFF)
|
2019-12-01 10:01:00 +00:00
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
|
|
include(coverage)
|
2019-01-30 20:53:57 +00:00
|
|
|
|
2019-01-27 02:45:03 +00:00
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(LWS REQUIRED libwebsockets)
|
|
|
|
pkg_check_modules(JANSSON REQUIRED jansson)
|
|
|
|
|
2019-03-23 14:13:07 +00:00
|
|
|
add_definitions(-D_FILE_OFFSET_BITS=64)
|
|
|
|
|
2019-02-10 08:22:58 +00:00
|
|
|
set(CMAKE_C_STANDARD 99)
|
2019-12-01 10:05:50 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
2019-02-10 08:38:31 +00:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2019-02-10 08:22:58 +00:00
|
|
|
set(C_WARNINGS -Wall -Wextra)
|
2019-02-25 20:28:31 +00:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
2019-01-27 02:45:03 +00:00
|
|
|
|
2019-04-27 07:49:43 +00:00
|
|
|
include_directories(
|
2019-02-10 13:19:15 +00:00
|
|
|
"include"
|
2019-01-27 02:45:03 +00:00
|
|
|
${LWS_INCLUDE_DIRS}
|
|
|
|
${JANSSON_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
2019-04-27 07:49:43 +00:00
|
|
|
add_compile_options(
|
2019-02-10 08:22:58 +00:00
|
|
|
${C_WARNINGS}
|
2019-01-27 02:45:03 +00:00
|
|
|
${LWS_CFLAGS_OTHER}
|
|
|
|
${JANSSON_CFLAGS_OTHER}
|
|
|
|
"-pthread"
|
|
|
|
)
|
|
|
|
|
2020-02-10 16:35:27 +00:00
|
|
|
include(webfuse_core)
|
|
|
|
include(webfuse_adapter)
|
|
|
|
include(webfuse_provider)
|
|
|
|
include(unit_tests)
|