author | Xeli |
Fri, 26 Aug 2011 21:03:23 +0200 | |
branch | hedgeroid |
changeset 5663 | b13d1897d06f |
parent 5647 | 28ab6763da9d |
child 6039 | d75329716a02 |
permissions | -rw-r--r-- |
5621 | 1 |
################################################################################### |
2 |
# Hedgewars, a free turn based strategy game |
|
3 |
# Copyright (c) 2011 Richard Deurwaarder <xeli@xelification.com> |
|
4 |
# |
|
5 |
# This program is free software; you can redistribute it and/or modify |
|
6 |
# it under the terms of the GNU General Public License as published by |
|
7 |
# the Free Software Foundation; version 2 of the License |
|
8 |
# |
|
9 |
# This program is distributed in the hope that it will be useful, |
|
10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
# GNU General Public License for more details. |
|
13 |
# |
|
14 |
# You should have received a copy of the GNU General Public License |
|
15 |
# along with this program; if not, write to the Free Software |
|
16 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
################################################################################### |
|
18 |
||
19 |
||
20 |
||
21 |
||
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
22 |
################################################################################### |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
23 |
# Uncomment (remove the leading '#') and change the paths accordingly to your own |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
24 |
# build environment, please do specify an absolute path (/home/richard/SoftDev |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
25 |
# rather than ~/SoftDev). |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
26 |
# You only need to change the three lines below, after that you can run 'cmake .' |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
27 |
# from the hedgewars root directory |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
28 |
# |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
29 |
# optionally you can specify SDL_DIR this will move the required SDL libraries to |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
30 |
# the correct place |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
31 |
################################################################################## |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
32 |
|
5381
8f95038f3f75
Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff
changeset
|
33 |
set(ANDROID_NDK /home/richard/SoftDev/android/android-ndk-r5b) |
8f95038f3f75
Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff
changeset
|
34 |
set(ANDROID_SDK /home/richard/SoftDev/android/android-sdk-linux_86) |
8f95038f3f75
Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff
changeset
|
35 |
set(FPC_DIR /home/richard/SoftDev/fpc-2.4.4) |
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
36 |
set(SDL_DIR /home/richard/Downloads/android-project) |
5647 | 37 |
set(LUA_DIR /home/richard/Downloads/lua-5.1.4) |
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
38 |
|
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
39 |
if(ANDROID_NDK AND ANDROID_SDK AND FPC_DIR) |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
40 |
|
5448 | 41 |
set(ANDROID_SDK_API_LVL 8) |
42 |
set(ANDROID_NDK_API_LVL 5) |
|
5381
8f95038f3f75
Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff
changeset
|
43 |
|
5448 | 44 |
MESSAGE("Creating android scripts and configuration files") |
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
45 |
|
5448 | 46 |
configure_file(Templates/complete_build.sh .) |
47 |
configure_file(Templates/default.properties SDL-android-project/) |
|
48 |
configure_file(Templates/local.properties SDL-android-project/) |
|
49 |
configure_file(Templates/Makefile.android .) |
|
50 |
configure_file(Templates/pushToDevice.sh .) |
|
5381
8f95038f3f75
Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff
changeset
|
51 |
|
5448 | 52 |
if(SDL_DIR) |
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
53 |
|
5448 | 54 |
MESSAGE("Moving Android port of SDL to the proper directories") |
5381
8f95038f3f75
Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff
changeset
|
55 |
|
5448 | 56 |
set(DirsToCopy |
57 |
SDL |
|
58 |
SDL_image |
|
59 |
SDL_mixer |
|
60 |
SDL_ttf |
|
61 |
jpeg |
|
62 |
png |
|
63 |
mikmod |
|
64 |
tremor |
|
65 |
freetype |
|
66 |
) |
|
67 |
foreach(DIR ${DirsToCopy}) |
|
5647 | 68 |
exec_program( |
69 |
${CMAKE_COMMAND} |
|
70 |
ARGS -E copy_directory |
|
5448 | 71 |
${SDL_DIR}/jni/${DIR} |
72 |
${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/${DIR} |
|
73 |
) |
|
5647 | 74 |
MESSAGE("Moved ${DIR}") |
5448 | 75 |
endforeach(DIR) |
76 |
exec_program(${HGCOMMAND} |
|
77 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp |
|
78 |
) |
|
79 |
exec_program(${HGCOMMAND} |
|
80 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp |
|
81 |
) |
|
5647 | 82 |
exec_program(${HGCOMMAND} |
83 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/video/android/SDL_androidtouch.c |
|
84 |
) |
|
85 |
||
86 |
exec_program(${HGCOMMAND} |
|
87 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/video/android/SDL_androidtouch.h |
|
88 |
) |
|
89 |
||
90 |
||
5448 | 91 |
else(SDL_DIR) |
92 |
MESSAGE("Android port of SDL not moved..") |
|
93 |
endif(SDL_DIR) |
|
5446 | 94 |
|
5647 | 95 |
|
5448 | 96 |
if(LUA_DIR) |
5647 | 97 |
MESSAGE("Moving Lua dir..") |
98 |
||
99 |
exec_program( |
|
100 |
${CMAKE_COMMAND} |
|
101 |
ARGS -E copy_directory |
|
102 |
${LUA_DIR}/src |
|
103 |
${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/lua-5.1.4 |
|
104 |
) |
|
105 |
MESSAGE("Lua has been moved.") |
|
106 |
||
5448 | 107 |
exec_program(${HGCOMMAND} |
108 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/lua-5.1.4/Android.mk |
|
109 |
) |
|
110 |
exec_program(${HGCOMMAND} |
|
111 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/lua-5.1.4/llex.c |
|
112 |
) |
|
113 |
else(LUA_DIR) |
|
114 |
MESSAGE("Lua hasn't been moved..") |
|
115 |
endif(LUA_DIR) |
|
5381
8f95038f3f75
Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff
changeset
|
116 |
|
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
117 |
else(ANDROID_AND AND ANDROID_SDK AND FPC_DIR) |
5647 | 118 |
MESSAGE("Android port files not created, edit top of ${CMAKE_CURRENT_SOURCE_DIR}/CMakeList.txt to create android specific files") |
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
119 |
endif(ANDROID_NDK AND ANDROID_SDK AND FPC_DIR) |
5381
8f95038f3f75
Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff
changeset
|
120 |
|
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
121 |