forked from fgenesis/ttvfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (63 loc) · 2.59 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
cmake_minimum_required(VERSION 2.6)
project(ttvfs)
option(TTVFS_BUILD_EXAMPLES "Build examples?" FALSE)
option(TTVFS_BUILD_GENERATOR "Build the embedded zip archive generator tool." TRUE)
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)
if(TTVFS_BUILD_GENERATOR AND NOT TTVFS_SUPPORT_ZIP)
message(FATAL_ERROR "You must enable TTVFS_SUPPORT_ZIP to use TTVFS_BUILD_GENERATOR")
endif()
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# 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_GENERATOR AND TTVFS_SUPPORT_ZIP)
add_subdirectory(ttvfs_gen)
endif()
if(TTVFS_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(TTVFS_BUILD_TESTS)
add_subdirectory(test)
endif()