forked from gburca/rofs-filtered
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (29 loc) · 1.15 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
cmake_minimum_required(VERSION 3.0)
project(rofs-filtered VERSION 1.7)
include(GNUInstallDirs)
include(CheckIncludeFile)
# let cmake find our custom FindFUSE script
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/InstallIf.cmake)
add_definitions(-D_GNU_SOURCE)
set(CMAKE_C_FLAGS "-Wall -std=c11")
# find fuse library
find_package (fuse3 REQUIRED)
include_directories (${FUSE3_INCLUDE_DIR})
add_definitions(-D_FILE_OFFSET_BITS=64)
# generate config file
check_include_file(dirent.h HAVE_DIRENT_H)
configure_file(config.h.in config.h)
add_definitions(-DHAVE_CONFIG_H)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# create and configure targets
add_executable(rofs-filtered rofs-filtered.c)
target_link_libraries(rofs-filtered ${FUSE3_LIBRARY})
# configure installation
install(TARGETS rofs-filtered DESTINATION ${CMAKE_INSTALL_BINDIR})
install_if_not_exists(${CMAKE_CURRENT_SOURCE_DIR}/rofs-filtered.rc ${CMAKE_INSTALL_SYSCONFDIR})
install_if_not_exists(${CMAKE_CURRENT_SOURCE_DIR}/rofs-filtered-invert.rc ${CMAKE_INSTALL_SYSCONFDIR})
# unit testing
enable_testing()
add_subdirectory(test)