-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (26 loc) · 918 Bytes
/
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
# CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(snapzap C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE_SOURCE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE64_SOURCE")
# Uncomment the line below to enable debug
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEBUG")
# Find required libraries
find_library(LIBZFS NAMES zfs)
find_library(LIBNVPAIR NAMES nvpair)
find_library(LIBUUTIL NAMES uutil)
# Include directories
include_directories(/usr/include/libzfs /usr/include/libspl)
# Source files
set(SOURCE_FILES
src/snapzap.c
)
# Executable
add_executable(snapzap ${SOURCE_FILES})
# Link required libraries
target_link_libraries(snapzap ${LIBZFS} ${LIBNVPAIR} ${LIBUUTIL})
# Specify installation targets
install(TARGETS snapzap DESTINATION bin)