-
Notifications
You must be signed in to change notification settings - Fork 25
/
CMakeLists.txt
79 lines (58 loc) · 2.15 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
cmake_minimum_required(VERSION 3.9)
project(ZenLib)
include(FetchContent)
include(cmake/clang-format.cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(ZENLIB_BUILD_EXAMPLES ON CACHE BOOL "Whether to build the examples")
set(ZENLIB_BUILD_TESTS OFF CACHE BOOL "Whether to build tests")
set(CMAKE_CXX_STANDARD 14)
# -----------------------------------------------------------------------------
# External: libsquish
#------------------------------------------------------------------------------
FetchContent_Declare(
libsquish
URL https://downloads.sourceforge.net/project/libsquish/libsquish-1.15.tgz
URL_HASH SHA1=51844b9a8bc815a27e2cc0ffbede5fee3ef75110
)
if(NOT libsquish_POPULATED)
message(STATUS "ZenLib: Populating libsquish...")
FetchContent_Populate(libsquish)
SET(BUILD_SQUISH_WITH_OPENMP OFF CACHE BOOL "" FORCE)
add_subdirectory(${libsquish_SOURCE_DIR} ${libsquish_BINARY_DIR})
message(STATUS "ZenLib: Done populating libsquish!")
endif()
# -----------------------------------------------------------------------------
# External: physfs
#------------------------------------------------------------------------------
FetchContent_Declare(
physfs
URL https://icculus.org/physfs/downloads/physfs-3.0.2.tar.bz2
URL_HASH SHA1=6a15c458898d0570101d8f173201cde9ced78df7
)
if(NOT physfs_POPULATED)
message(STATUS "ZenLib: Populating physfs...")
FetchContent_Populate(physfs)
set(PHYSFS_BUILD_SHARED OFF)
set(PHYSFS_BUILD_TEST OFF)
add_subdirectory(${physfs_SOURCE_DIR} ${physfs_BINARY_DIR})
message(STATUS "ZenLib: Done populating physfs!")
endif()
# -----------------------------------------------------------------------------
# Mute annoying MSVC-Warnings
if(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
add_definitions(-DNOMINMAX)
endif()
include_directories(.)
# Internal libraries
add_subdirectory(utils)
add_subdirectory(vdfs)
add_subdirectory(zenload)
add_subdirectory(daedalus)
# Tests
if(ZENLIB_BUILD_TESTS)
add_subdirectory(tests)
endif()
if(ZENLIB_BUILD_EXAMPLES)
add_subdirectory(samples)
endif()