-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
99 lines (83 loc) · 3.39 KB
/
CMakeLists.txt
File metadata and controls
99 lines (83 loc) · 3.39 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# =====================================================================
# DMOD Driver File System Module
# =====================================================================
cmake_minimum_required(VERSION 3.18)
# ======================================================================
# For VS Code
# ======================================================================
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# ======================================================================
# DMOD DFS
# ======================================================================
# Allow version to be passed as a parameter, default to 0.1
if(NOT DEFINED DMOD_MODULE_VERSION)
set(DMOD_MODULE_VERSION "0.1" CACHE STRING "DMOD module version")
endif()
set(DMOD_MODE "DMOD_MODULE" CACHE STRING "DMOD build mode")
# ======================================================================
# Fetch DMOD repository
# ======================================================================
include(FetchContent)
FetchContent_Declare(
dmod
GIT_REPOSITORY https://github.com/choco-technologies/dmod.git
GIT_TAG develop
)
# ======================================================================
# DMOD Configuration
# ======================================================================
set(DMOD_MODE "DMOD_MODULE" CACHE STRING "DMOD build mode")
set(DMOD_BUILD_TESTS OFF CACHE BOOL "Build tests")
set(DMOD_BUILD_EXAMPLES OFF CACHE BOOL "Build examples")
set(DMOD_BUILD_TOOLS OFF CACHE BOOL "Build tools")
set(DMOD_BUILD_TEMPLATES OFF CACHE BOOL "Build templates")
FetchContent_MakeAvailable(dmod)
project(dmdevfs
VERSION ${DMOD_MODULE_VERSION}
DESCRIPTION "DMOD Driver File System"
LANGUAGES C CXX)
# ======================================================================
# Import dmod functions and macros
# ======================================================================
set(DMOD_DIR ${dmod_SOURCE_DIR} CACHE PATH "DMOD source directory")
include(${DMOD_DIR}/paths.cmake)
dmod_setup_external_module()
# ======================================================================
# DMDEVFS Module Configuration
# ======================================================================
# Name of the module
set(DMOD_MODULE_NAME dmdevfs)
# Version is already set above and used in project()
# No need to set it again here
# Author (should be string)
set(DMOD_AUTHOR_NAME Patryk Kubiak)
# Stack size for the module (should be integer)
set(DMOD_STACK_SIZE 1024)
#
# dmod_add_library - create a library module
# it has the same signature as add_library
# and can be used in the same way after the creation
# (for example, to link libraries)
#
dmod_add_library(${DMOD_MODULE_NAME} ${DMOD_MODULE_VERSION}
# List of source files - can include C and C++ files
src/dmdevfs.c
)
# Link to other DMOD modules (will be downloaded on build time)
dmod_link_modules(${DMOD_MODULE_NAME}
dmfsi
dmdrvi
dmini
dmlist
)
target_include_directories(${DMOD_MODULE_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
# ======================================================================
# Tests
# ======================================================================
option(DMDEVFS_BUILD_TESTS "Build tests" OFF)
if(DMDEVFS_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()