-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
37 lines (26 loc) · 1.1 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
project(berthad)
# XXX We really need 2.6?
cmake_minimum_required(VERSION 2.6)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(CheckFunctionExists)
include(CheckCCompilerFlag)
MACRO(ADD_C_COMPILER_FLAG_IF_AVAILABLE FLAG RESULT)
check_c_compiler_flag("${FLAG}" ${RESULT})
if(${RESULT})
add_definitions("${FLAG}")
endif(${RESULT})
ENDMACRO(ADD_C_COMPILER_FLAG_IF_AVAILABLE)
add_c_compiler_flag_if_available(-std=c99 HAVE_CFLAG_STDC99)
add_c_compiler_flag_if_available(-Wall HAVE_CFLAG_WALL)
add_c_compiler_flag_if_available(-pedantic HAVE_CFLAG_PEDANTIC)
check_function_exists(splice HAVE_SPLICE)
check_function_exists(sendfile HAVE_SENDFILE)
check_function_exists(fallocate HAVE_FALLOCATE)
check_function_exists(posix_fadvise HAVE_POSIX_FADVISE)
configure_file(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_SOURCE_DIR}/config.h)
find_package(Glib)
find_package(Gthread)
add_executable(berthad-vfs berthad-vfs.c)
include_directories(${Glib_INCLUDE_DIRS})
target_link_libraries(berthad-vfs ${Glib_LIBRARIES} ${Gthread_LIBRARIES})
install (TARGETS berthad-vfs DESTINATION bin)