-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (29 loc) · 1.13 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
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(Share C)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH})
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall --pedantic -g -ggdb")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_C_STANDARD 99)
find_package(FUSE REQUIRED)
find_package(Threads REQUIRED)
include_directories("${CMAKE_SOURCE_DIR}/include")
file(GLOB GLOBAL_SOURCES "src/*.c")
if (APPLE)
file(GLOB SPECIFIC_SOURCES "src/Darwin/*.c")
elseif(UNIX)
file(GLOB SPECIFIC_SOURCES "src/Unix/*.c")
endif(APPLE)
set(SOURCES ${GLOBAL_SOURCES} ${SPECIFIC_SOURCES})
include_directories(${FUSE_INCLUDE_DIR})
add_executable(share ${SOURCES})
target_link_libraries(share ${FUSE_LIBRARIES})
if(THREADS_HAVE_PTHREAD_ARG)
target_compile_options(share PUBLIC "-pthread")
endif()
if(CMAKE_THREAD_LIBS_INIT)
target_link_libraries(share "${CMAKE_THREAD_LIBS_INIT}")
endif()