-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathCMakeLists.txt
66 lines (50 loc) · 1.94 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
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
cmake_minimum_required(VERSION 2.6)
project(ttvfs)
option(TTVFS_BUILD_EXAMPLES "Build examples?" FALSE)
option(TTVFS_SUPPORT_ZIP "Build support for zip archives?" TRUE)
option(TTVFS_LARGEFILE_SUPPORT "Enable support for files > 4 GB? (experimental!)" TRUE)
option(TTVFS_IGNORE_CASE "Enable full case-insensitivity even on case-sensitive OSes like Linux and alike?" TRUE)
option(TTVFS_BUILD_CFILEAPI "Build C-style API wrapper" TRUE)
option(TTVFS_BUILD_TESTS "Build tests" FALSE)
# Be sure to copy this part to your root CMakeLists.txt if you prefer to use CMake for configuring
# instead of editing the config header directly!
# If you edit the header, this is not necessary.
if(TTVFS_LARGEFILE_SUPPORT)
add_definitions("-DVFS_LARGEFILE_SUPPORT")
endif()
if(TTVFS_IGNORE_CASE)
add_definitions("-DVFS_IGNORE_CASE")
endif()
if(TTVFS_SUPPORT_ZIP)
add_definitions("-DVFS_SUPPORT_ZIP")
endif()
# --snip--
# non-msvc needs build type - if no build type was provided, set a default one
if(NOT MSVC)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build (Debug, Release, RelWithDebInfo, MinSizeRel)" FORCE)
endif()
endif()
set(code_dirs "${CMAKE_CURRENT_SOURCE_DIR}/ttvfs")
if(TTVFS_SUPPORT_ZIP)
list(APPEND code_dirs "${CMAKE_CURRENT_SOURCE_DIR}/ttvfs_zip")
endif()
if(TTVFS_BUILD_CFILEAPI)
list(APPEND code_dirs "${CMAKE_CURRENT_SOURCE_DIR}/ttvfs_cfileapi")
endif()
message(STATUS "Files dir: ${code_dirs}")
set(TTVFS_INCLUDE_DIRS "${code_dirs}" CACHE STRING "ttvfs include directory - for external includers" FORCE)
set(TTVFS_SRC_DIR "${code_dirs}" CACHE STRING "ttvfs source directory - for external includers" FORCE)
add_subdirectory(ttvfs)
if(TTVFS_SUPPORT_ZIP)
add_subdirectory(ttvfs_zip)
endif()
if(TTVFS_BUILD_CFILEAPI)
add_subdirectory(ttvfs_cfileapi)
endif()
if(TTVFS_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(TTVFS_BUILD_TESTS)
add_subdirectory(test)
endif()