author | Xeli |
Sat, 08 Oct 2011 14:55:13 +0200 | |
branch | hedgeroid |
changeset 6039 | d75329716a02 |
parent 5647 | 28ab6763da9d |
child 6230 | de1e43054017 |
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) |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
37 |
|
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
38 |
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
|
39 |
|
5448 | 40 |
set(ANDROID_SDK_API_LVL 8) |
41 |
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
|
42 |
|
5448 | 43 |
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
|
44 |
|
5448 | 45 |
configure_file(Templates/complete_build.sh .) |
46 |
configure_file(Templates/default.properties SDL-android-project/) |
|
47 |
configure_file(Templates/local.properties SDL-android-project/) |
|
48 |
configure_file(Templates/Makefile.android .) |
|
49 |
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
|
50 |
|
5448 | 51 |
if(SDL_DIR) |
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
52 |
|
5448 | 53 |
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
|
54 |
|
5448 | 55 |
set(DirsToCopy |
56 |
SDL |
|
57 |
SDL_image |
|
58 |
SDL_mixer |
|
59 |
SDL_ttf |
|
60 |
jpeg |
|
61 |
png |
|
62 |
mikmod |
|
63 |
) |
|
64 |
foreach(DIR ${DirsToCopy}) |
|
5647 | 65 |
exec_program( |
66 |
${CMAKE_COMMAND} |
|
67 |
ARGS -E copy_directory |
|
5448 | 68 |
${SDL_DIR}/jni/${DIR} |
69 |
${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/${DIR} |
|
70 |
) |
|
5647 | 71 |
MESSAGE("Moved ${DIR}") |
5448 | 72 |
endforeach(DIR) |
73 |
exec_program(${HGCOMMAND} |
|
74 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp |
|
75 |
) |
|
76 |
exec_program(${HGCOMMAND} |
|
77 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp |
|
78 |
) |
|
5647 | 79 |
exec_program(${HGCOMMAND} |
80 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/video/android/SDL_androidtouch.c |
|
81 |
) |
|
82 |
||
83 |
exec_program(${HGCOMMAND} |
|
84 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/video/android/SDL_androidtouch.h |
|
85 |
) |
|
86 |
||
87 |
||
5448 | 88 |
else(SDL_DIR) |
89 |
MESSAGE("Android port of SDL not moved..") |
|
90 |
endif(SDL_DIR) |
|
5446 | 91 |
|
5647 | 92 |
|
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
93 |
else(ANDROID_AND AND ANDROID_SDK AND FPC_DIR) |
5647 | 94 |
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
|
95 |
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
|
96 |
|
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
97 |