-
Notifications
You must be signed in to change notification settings - Fork 0
/
qpm_defines.cmake
57 lines (51 loc) · 1.93 KB
/
qpm_defines.cmake
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
# YOU SHOULD NOT MANUALLY EDIT THIS FILE, QPM WILL VOID ALL CHANGES
# Version defines, pretty useful
set(MOD_VERSION "5.3.3")
# take the mod name and just remove spaces, that will be MOD_ID, if you don't like it change it after the include of this file
set(MOD_ID "assimp")
# derived from override .so name or just id_version
set(COMPILE_ID "assimp")
# derived from whichever codegen package is installed, will default to just codegen
set(CODEGEN_ID "codegen")
# given from qpm, automatically updated from qpm.json
set(EXTERN_DIR_NAME "extern")
set(SHARED_DIR_NAME "shared")
# if no target given, use Debug
if (NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
# defines used in ninja / cmake ndk builds
if (NOT DEFINED CMAKE_ANDROID_NDK)
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/ndkpath.txt")
file (STRINGS "ndkpath.txt" CMAKE_ANDROID_NDK)
else()
if(EXISTS $ENV{ANDROID_NDK_HOME})
set(CMAKE_ANDROID_NDK $ENV{ANDROID_NDK_HOME})
elseif(EXISTS $ENV{ANDROID_NDK_LATEST_HOME})
set(CMAKE_ANDROID_NDK $ENV{ANDROID_NDK_LATEST_HOME})
endif()
endif()
endif()
if (NOT DEFINED CMAKE_ANDROID_NDK)
message(Big time error buddy, no NDK)
endif()
message(Using NDK ${CMAKE_ANDROID_NDK})
string(REPLACE "\\" "/" CMAKE_ANDROID_NDK ${CMAKE_ANDROID_NDK})
set(ANDROID_PLATFORM 24)
set(ANDROID_ABI arm64-v8a)
set(ANDROID_STL c++_static)
set(ANDROID_USE_LEGACY_TOOLCHAIN_FILE OFF)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake)
# define used for external data, mostly just the qpm dependencies
set(EXTERN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${EXTERN_DIR_NAME})
set(SHARED_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${SHARED_DIR_NAME})
# get files by filter recursively
MACRO(RECURSE_FILES return_list filter)
FILE(GLOB_RECURSE new_list ${filter})
SET(file_list "")
FOREACH(file_path ${new_list})
SET(file_list ${file_list} ${file_path})
ENDFOREACH()
LIST(REMOVE_DUPLICATES file_list)
SET(${return_list} ${file_list})
ENDMACRO()