-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
93 lines (83 loc) · 3.96 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
83
84
85
86
87
88
89
90
91
92
93
cmake_minimum_required(VERSION 3.0.2)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(XSBEXTERN_BUILD_LIBPNG ON)
set(XSBEXTERN_BUILD_CURL ON)
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(XSBEXTERN_BUILD_CURL ON)
set(XSBEXTERN_BUILD_LIBPNG ON)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(XSBEXTERN_BUILD_ZLIB ON)
set(XSBEXTERN_BUILD_CURL ON)
set(XSBEXTERN_BUILD_LIBPNG ON)
set(XSBEXTERN_BUILD_OPENAL_SOFT ON)
else()
message(FATAL_ERROR "Unrecognised Platform. Aborting.")
endif()
if(XSBEXTERN_BUILD_ZLIB)
set(SKIP_INSTALL_ALL TRUE)
add_subdirectory(zlib-1.2.11 EXCLUDE_FROM_ALL)
set(ZLIB_FOUND TRUE)
set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib-1.2.11 ${CMAKE_CURRENT_BINARY_DIR}/zlib-1.2.11)
set(ZLIB_LIBRARY zlibstatic)
else()
find_library(ZLIB NAMES z zlib DOC "zlib compression library")
endif()
if (XSBEXTERN_BUILD_LIBPNG)
set(PNG_FRAMEWORK FALSE CACHE BOOL "Build libpng as Framework" FORCE)
set(PNG_DEBUG FALSE CACHE BOOL "Build libpng with debuggings" FORCE)
set(PNG_STATIC TRUE CACHE BOOL "Build libpng static" FORCE)
set(PNG_SHARED FALSE CACHE BOOL "Build libpng shared" FORCE)
set(PNG_TESTS FALSE CACHE BOOL "Build libpng tests" FORCE)
add_subdirectory(libpng-1.6.28 EXCLUDE_FROM_ALL)
set(PNG_FOUND TRUE CACHE BOOL "PNG Library Available" FORCE)
set(PNG_LIBRARY png_static CACHE STRING "PNG Library Path" FORCE)
else()
find_library(PNG NAMES png png16 DOC "libpng image library")
endif()
# PCRE
# we always build PCRE.
set(PCRE_BUILD_PCREGREP OFF CACHE BOOL "Build pcregrep")
set(PCRE_BUILD_TESTS OFF CACHE BOOL "Build pcre tests")
set(PCRE_SHOW_REPORT OFF CACHE BOOL "Show PCRE configuration report")
add_subdirectory(pcre-8.37 EXCLUDE_FROM_ALL)
# CURL
if(XSBEXTERN_BUILD_CURL)
set(BUILD_CURL_EXE OFF CACHE BOOL "Build CURL exe" FORCE)
set(CURL_STATICLIB ON CACHE BOOL "Build CURL Static Library" FORCE)
set(CURL_DISABLE_FTP ON CACHE BOOL "Disable FTP in Curl" FORCE)
set(CURL_DISABLE_LDAP ON CACHE BOOL "Disable LDAP in Curl" FORCE)
set(CURL_DISABLE_TELNET ON CACHE BOOL "Disable Telnet" FORCE)
set(CURL_DISABLE_DICT ON CACHE BOOL "Disable Dict" FORCE)
set(CURL_DISABLE_FILE ON CACHE BOOL "disables FILE" FORCE)
set(CURL_DISABLE_TFTP ON CACHE BOOL "disables TFTP" FORCE)
set(CURL_DISABLE_LDAPS ON CACHE BOOL "to disable LDAPS" FORCE)
set(CURL_DISABLE_RTSP ON CACHE BOOL "to disable RTSP" FORCE)
set(CURL_DISABLE_POP3 ON CACHE BOOL "to disable POP3" FORCE)
set(CURL_DISABLE_IMAP ON CACHE BOOL "to disable IMAP" FORCE)
set(CURL_DISABLE_SMTP ON CACHE BOOL "to disable SMTP" FORCE)
set(CURL_DISABLE_GOPHER ON CACHE BOOL "to disable Gopher" FORCE)
set(CURL_DISABLE_CRYPTO_AUTH ON CACHE BOOL "Disable Cryptographic Authentication" FORCE)
set(ENABLE_MANUAL OFF CACHE BOOL "Build the CURL Manual" FORCE)
set(BUILD_TESTING OFF CACHE BOOL "Build CURL Test Suite" FORCE)
set(CMAKE_USE_OPENSSL OFF CACHE BOOL "Make use of OpenSSL" FORCE)
add_subdirectory(curl-7.53.1 EXCLUDE_FROM_ALL)
endif()
if(XSBEXTERN_BUILD_OPENAL_SOFT)
set(ALSOFT_UTILS OFF CACHE BOOL "Build and install utility programs" FORCE)
set(ALSOFT_NO_CONFIG_UTIL ON CACHE BOOL "Disable building the alsoft-config utility" FORCE)
set(ALSOFT_EXAMPLES OFF CACHE BOOL "Build and install example programs" FORCE)
set(ALSOFT_TESTS OFF CACHE BOOL "Build and install test programs" FORCE)
set(ALSOFT_CONFIG OFF CACHE BOOL "Install alsoft.conf sample configuration file" FORCE)
set(ALSOFT_HRTF_DEFS OFF CACHE BOOL "Install HRTF definition files" FORCE)
set(ALSOFT_AMBDEC_PRESETS OFF CACHE BOOL "Install AmbDec preset files" FORCE)
set(ALSOFT_INSTALL ON CACHE BOOL "Install headers and libraries" FORCE)
add_subdirectory(openal-soft-1.19.1 EXCLUDE_FROM_ALL)
# OpenAL doesn't export its public headers with its target. Force this.
target_include_directories(OpenAL
INTERFACE
$<BUILD_INTERFACE:${OpenAL_SOURCE_DIR}/include>)
else()
find_library(OpenAL NAMES al openal OpenAL DOC "OpenAL Audio Library")
endif()
# JSON
add_subdirectory(json EXCLUDE_FROM_ALL)