-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
54 lines (42 loc) · 1.43 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 3.7)
project(exfuse VERSION 0.0.1 LANGUAGES C)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(PkgConfig REQUIRED)
find_package(FUSE REQUIRED)
option(COVERAGE "Enable clang coverage flags" OFF)
option(TESTS "Enable tests" OFF)
option(SANITIZER "Enable compiler sanitizer" OFF)
add_definitions(${FUSE_COMPILE_DEFINITIONS})
add_compile_options(-Wall -Wextra)
add_compile_options(${FUSE_COMPILE_OPTIONS})
if (COVERAGE)
include(Coverage)
endif()
if (TESTS)
enable_testing()
endif()
if (SANITIZER)
include(Sanitizer)
endif()
add_subdirectory(src)
if (TESTS)
add_subdirectory(test)
endif()
add_custom_target(distclean
COMMAND find . -name "CMakeFiles" | xargs rm -rfv
COMMAND find . -name "Makefile" | xargs rm -rfv
COMMAND find . -name "cmake_install.cmake" | xargs rm -rfv
COMMAND find . -name "CMakeCache.txt" | xargs rm -rfv
COMMAND find . -name "CTestTestfile.cmake" | xargs rm -rfv
COMMAND find . -name "*.profdata" | xargs rm -rfv
COMMAND find . -name "*.profraw" | xargs rm -rfv
COMMAND find . -name "exdev" | xargs rm -rfv
COMMAND rm -vrf bin build lib
COMMAND rm -vrf compile_commands.json
COMMAND rm -vrf Testing
VERBATIM
)
add_custom_target(format
COMMAND find ${CMAKE_SOURCE_DIR} -iname '*.h' -o -iname '*.c' | xargs clang-format -i
)