forked from d3m3vilurr/vita-savemgr
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
83 lines (70 loc) · 2.18 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
74
75
76
77
78
79
80
81
82
83
cmake_minimum_required(VERSION 2.8)
set(CMAKE_SYSTEM_NAME "Generic")
set(CMAKE_C_COMPILER "arm-vita-eabi-gcc")
project(savemgr)
set(TITLE_ID "SAVEMGR00")
set(TITLE "Save Manager")
set(VERSION "0.8.0")
execute_process(COMMAND
python -c "print '%02d.%02d' % tuple(map(lambda x: int(x), '${VERSION}'.split('.')[:2]))"
OUTPUT_VARIABLE APP_VER
)
string(REPLACE "\n" "" APP_VER "${APP_VER}")
if (NOT EXISTS "$ENV{RELEASE}")
execute_process(COMMAND
git describe --abbrev=7 --dirty --always
OUTPUT_VARIABLE GIT_HASH
)
string(REPLACE "\n" "" GIT_HASH "${GIT_HASH}")
set(VERSION "${VERSION}-${GIT_HASH}")
endif(NOT EXISTS "$ENV{RELEASE}")
add_definitions(-DSQLITE_OS_OTHER=1)
add_definitions(-DSQLITE_TEMP_STORE=3)
add_definitions(-DSQLITE_THREADSAFE=0)
add_definitions(-DVERSION=\"${VERSION}\")
set(CMAKE_C_FLAGS "-Wl,-q -Wall -O3 -std=c99")
include_directories(
sqlite3
extern/inih
)
add_executable(${PROJECT_NAME}.elf
src/console.c
src/appdb.c
src/file.c
src/font.c
src/button.c
src/config.c
src/main.c
src/vita_sqlite.c
sqlite3/sqlite3.c
extern/inih/ini.c
)
target_link_libraries(${PROJECT_NAME}.elf
-lvita2d
-lfreetype
-lz
-lm
-lSceIofilemgr_stub
-lSceKernelThreadMgr_stub
-lSceCommonDialog_stub
-lSceDisplay_stub
-lSceGxm_stub
-lSceAppMgr_stub
-lSceAppUtil_stub
-lSceSysmodule_stub
-lSceCtrl_stub
-lScePgf_stub
-lSceShellSvc_stub
)
add_custom_target(${PROJECT_NAME}.vpk ALL
COMMAND vita-elf-create ${PROJECT_NAME}.elf ${PROJECT_NAME}.velf
COMMAND vita-make-fself ${PROJECT_NAME}.velf eboot.bin
COMMAND vita-mksfoex -s TITLE_ID=${TITLE_ID} -s APP_VER=${APP_VER} "${TITLE}" param.sfo
COMMAND vita-pack-vpk -s param.sfo -b eboot.bin
--add ../sce_sys/icon0.png=sce_sys/icon0.png
--add ../sce_sys/livearea/contents/bg.png=sce_sys/livearea/contents/bg.png
--add ../sce_sys/livearea/contents/startup.png=sce_sys/livearea/contents/startup.png
--add ../sce_sys/livearea/contents/template.xml=sce_sys/livearea/contents/template.xml
${PROJECT_NAME}.vpk
)
add_dependencies(${PROJECT_NAME}.vpk ${PROJECT_NAME}.elf)