-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
73 lines (56 loc) · 2.11 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
# -------------------------------------------------------------------------
# Copyright (C) 2019 BMW Car IT GmbH
# All rights reserved.
# -------------------------------------------------------------------------
# This document contains proprietary information belonging to BMW Car IT.
# Passing on and copying of this document, use and communication of its
# contents is not permitted without prior written authorization.
# -------------------------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 3.3)
project (ZombiePiratesGame)
set (ZombiePiratesGame_VERSION_MAJOR 0)
set (ZombiePiratesGame_VERSION_MINOR 1)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
add_subdirectory(external)
# TODO after first version is done, refactor project structure
file(GLOB source_files
PirateGame/src/*.cpp
PirateGame/include/*.h
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(RND_PLATFORM platform-windows-wgl-4-2-core)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(RND_PLATFORM platform-x11-egl-es-3-0)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
set(RND_PLATFORM platform-android-egl-es-3-0)
endif()
set(ramses_dependencies
ramses-framework-api
ramses-framework
ramses-client-api
ramses-client
ramses-renderer-api
ramses-renderer-lib
${RND_PLATFORM}
)
IF (${CMAKE_SYSTEM_NAME} MATCHES "Android")
add_library(ZombiePiratesGame STATIC
${source_files})
ELSE()
add_executable(ZombiePiratesGame ${source_files})
ENDIF()
target_link_libraries(ZombiePiratesGame ${ramses_dependencies} )
target_include_directories(ZombiePiratesGame PUBLIC PirateGame/include)
# TODO check if this is the right place
add_definitions(-DRAMSES_LINK_STATIC)
# Collect PTX files
file(GLOB_RECURSE ASSETS
LIST_DIRECTORIES FALSE
CONFIGURE_DEPENDS
${PROJECT_SOURCE_DIR}/PirateGame/res/*
)
foreach(asset ${ASSETS})
file(RELATIVE_PATH relativePath ${PROJECT_SOURCE_DIR}/PirateGame ${asset})
configure_file(PirateGame/${relativePath} ${CMAKE_CURRENT_BINARY_DIR}/${relativePath} COPYONLY)
endforeach()