-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (28 loc) · 1.47 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.0)
project(libfs VERSION 0.1.0)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_executable(service service/service.c service/req_buffer.c service/operations.c service/inode.c)
target_include_directories(service PUBLIC .)
target_link_libraries(service pthread)
add_library(libfs SHARED lib/libfs.c)
target_include_directories(libfs PUBLIC .)
# target_link_libraries(libfs)
add_executable(libfs-tests lib/libfs_tests.c)
target_include_directories(libfs-tests PUBLIC .)
target_link_libraries(libfs-tests libfs)
add_executable(libfs-presentation lib/presentation.c)
target_include_directories(libfs-presentation PUBLIC .)
target_link_libraries(libfs-presentation libfs)
add_executable(libfs-presentation-from-backup lib/presentation_from_backup.c)
target_include_directories(libfs-presentation-from-backup PUBLIC .)
target_link_libraries(libfs-presentation-from-backup libfs)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
enable_testing()
file(GLOB_RECURSE SOURCE_FILES ${PROJECT_SOURCE_DIR}/lib/libfs.c ${PROJECT_SOURCE_DIR}/common.h)
file(GLOB TEST_SOURCES ${PROJECT_SOURCE_DIR}/test/test-*.c)
add_executable(runUnitTests ${TEST_SOURCES} ${SOURCE_FILES} ${PROJECT_SOURCE_DIR}/test/ctest.h service/req_buffer.c service/operations.c service/inode.c)
target_link_libraries(runUnitTests pthread)
target_include_directories(runUnitTests PUBLIC .)
add_test(NAME runUnitTests COMMAND runUnitTests)