forked from nCine/nCine-android-libraries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (63 loc) · 2.1 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
cmake_minimum_required(VERSION 3.12)
project(nCine-android-libraries NONE)
option(BUILD_WEBP "Build the WebP library" ON)
option(BUILD_PNG "Build the PNG library" ON)
option(BUILD_OGG "Build the OGG library" ON)
option(BUILD_VORBIS "Build the Vorbis library" ON)
option(BUILD_OPENAL "Build the OpenAL-soft library" ON)
option(BUILD_LUA "Build the Lua library and interepreter" ON)
option(BUILD_BOX2D "Build the Box2D-soft library" ON)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
get_filename_component(PARENT_SOURCE_DIR ${CMAKE_SOURCE_DIR} DIRECTORY)
set(DESTINATION_PATH ${PARENT_SOURCE_DIR}/nCine-android-external CACHE STRING "Set the destination directory where files will be copied")
set(EP_BASE "${CMAKE_BINARY_DIR}/ExternalProjects")
set_property(DIRECTORY PROPERTY "EP_BASE" ${EP_BASE})
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
message(STATUS "CMAKE_BUILD_TYPE set by default to: " ${CMAKE_BUILD_TYPE})
else()
message(STATUS "CMAKE_BUILD_TYPE is: " ${CMAKE_BUILD_TYPE})
endif()
set(NDK_DIR $ENV{ANDROID_NDK_HOME} CACHE PATH "Set the path to the Android NDK")
message(STATUS "Android NDK directory: ${NDK_DIR}")
set(ARCH "arm64-v8a" CACHE STRING "Architecture")
set_property(CACHE ARCH PROPERTY STRINGS armeabi-v7a arm64-v8a x86_64)
message(STATUS "Available architectures are: armeabi-v7a, arm64-v8a, x86_64")
message(STATUS "ARCH is: " ${ARCH})
set(PLATFORM "21" CACHE STRING "Android platform level")
message(STATUS "PLATFORM is: " ${PLATFORM})
if(WIN32)
set(HOST_TAG "windows-x86_64")
elseif(APPLE)
set(HOST_TAG "darwin-x86_64")
else()
set(HOST_TAG "linux-x86_64")
endif()
set(STRIP_SHARED_ARGS "--strip-unneeded")
set(STRIP_STATIC_ARGS "--strip-debug")
include(arch_${ARCH})
include(crosscompile_args)
include(ExternalProject)
include(ProcessorCount)
ProcessorCount(CPUS)
if(BUILD_WEBP)
include(webp)
endif()
if(BUILD_PNG)
include(png)
endif()
if(BUILD_OGG)
include(ogg)
endif()
if(BUILD_OGG AND BUILD_VORBIS)
include(vorbis)
endif()
if(BUILD_OPENAL)
include(openal-soft)
endif()
if(BUILD_LUA)
include(lua)
endif()
if(BUILD_BOX2D)
include(box2d)
endif()