author | Xeli |
Mon, 18 Jul 2011 14:40:19 +0200 | |
branch | hedgeroid |
changeset 5448 | 787cf66a7c39 |
parent 5446 | 68f261c94a86 |
child 5621 | ea796c83ea47 |
permissions | -rw-r--r-- |
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
1 |
################################################################################### |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
2 |
# 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
|
3 |
# 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
|
4 |
# rather than ~/SoftDev). |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
5 |
# 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
|
6 |
# from the hedgewars root directory |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
7 |
# |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
8 |
# 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
|
9 |
# the correct place |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
10 |
################################################################################## |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
11 |
|
5381
8f95038f3f75
Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff
changeset
|
12 |
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
|
13 |
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
|
14 |
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
|
15 |
set(SDL_DIR /home/richard/Downloads/android-project) |
5448 | 16 |
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
|
17 |
|
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
18 |
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
|
19 |
|
5448 | 20 |
set(ANDROID_SDK_API_LVL 8) |
21 |
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
|
22 |
|
5448 | 23 |
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
|
24 |
|
5448 | 25 |
configure_file(Templates/complete_build.sh .) |
26 |
configure_file(Templates/default.properties SDL-android-project/) |
|
27 |
configure_file(Templates/local.properties SDL-android-project/) |
|
28 |
configure_file(Templates/Makefile.android .) |
|
29 |
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
|
30 |
|
5448 | 31 |
if(SDL_DIR) |
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
32 |
|
5448 | 33 |
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
|
34 |
|
5448 | 35 |
set(DirsToCopy |
36 |
SDL |
|
37 |
SDL_image |
|
38 |
SDL_mixer |
|
39 |
SDL_ttf |
|
40 |
jpeg |
|
41 |
png |
|
42 |
mikmod |
|
43 |
tremor |
|
44 |
freetype |
|
45 |
) |
|
46 |
foreach(DIR ${DirsToCopy}) |
|
47 |
EXECUTE_PROCESS( |
|
48 |
COMMAND ${CMAKE_COMMAND} |
|
49 |
-E copy_directory |
|
50 |
${SDL_DIR}/jni/${DIR} |
|
51 |
${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/${DIR} |
|
52 |
) |
|
53 |
endforeach(DIR) |
|
54 |
exec_program(${HGCOMMAND} |
|
55 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp |
|
56 |
) |
|
57 |
exec_program(${HGCOMMAND} |
|
58 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp |
|
59 |
) |
|
60 |
else(SDL_DIR) |
|
61 |
MESSAGE("Android port of SDL not moved..") |
|
62 |
endif(SDL_DIR) |
|
5446 | 63 |
|
5448 | 64 |
if(LUA_DIR) |
65 |
EXECUTE_PROCESS( |
|
66 |
${CMAKE_COMMAND} |
|
67 |
-E copy_directory |
|
68 |
${LUA_DIR}/src |
|
69 |
${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/lua-5.1.4 |
|
70 |
) |
|
71 |
exec_program(${HGCOMMAND} |
|
72 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/lua-5.1.4/Android.mk |
|
73 |
) |
|
74 |
exec_program(${HGCOMMAND} |
|
75 |
ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/lua-5.1.4/llex.c |
|
76 |
) |
|
77 |
MESSAGE("Lua has been moved.") |
|
78 |
else(LUA_DIR) |
|
79 |
MESSAGE("Lua hasn't been moved..") |
|
80 |
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
|
81 |
|
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
82 |
else(ANDROID_AND AND ANDROID_SDK AND FPC_DIR) |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
83 |
MESSAGE("Android port files not created, edit top of ${CMAKE_CURRENT_SOURCE_DIR}/CMakeList.txt to created android specific files") |
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
84 |
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
|
85 |
|
5442
7c1e5a5f7f34
Greatly simplifies the buildenvironment plus makes cmake a bit more vocal
Xeli
parents:
5408
diff
changeset
|
86 |