Permalink
Browse files

Added cmake files (resolves #17)

  • Loading branch information...
1 parent 2d82e85 commit 8f69082c8e5b56aaf5b9c0ad66d7b455782bb442 @yifanlu yifanlu committed Dec 9, 2016
View
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
+ if(DEFINED ENV{VITASDK})
+ set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
+ else()
+ message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
+ endif()
+endif()
+
+project(sample)
+add_subdirectory(audio)
+add_subdirectory(camera)
+add_subdirectory(ctrl)
+add_subdirectory(debug_print)
+add_subdirectory(hello_cpp_world)
+add_subdirectory(hello_world)
+add_subdirectory(ime)
+add_subdirectory(motion)
+add_subdirectory(net_http)
+add_subdirectory(power)
+add_subdirectory(pretty_livearea)
+add_subdirectory(rtc)
+add_subdirectory(touch)
View
@@ -0,0 +1,40 @@
+cmake_minimum_required(VERSION 2.8)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
+ if(DEFINED ENV{VITASDK})
+ set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
+ else()
+ message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
+ endif()
+endif()
+
+set(SHORT_NAME audio_sample)
+project(${SHORT_NAME})
+include("${VITASDK}/share/vita.cmake" REQUIRED)
+
+set(VITA_APP_NAME "Audio example")
+set(VITA_TITLEID "VSDK00001")
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+
+include_directories(
+ ../common
+)
+
+add_executable(${SHORT_NAME}
+ src/main.c
+)
+
+target_link_libraries(${SHORT_NAME}
+ m
+ SceDisplay_stub
+ SceCtrl_stub
+ SceAudio_stub
+)
+
+vita_create_self(${SHORT_NAME}.self ${SHORT_NAME})
+vita_create_vpk(${SHORT_NAME}.vpk ${VITA_TITLEID} ${SHORT_NAME}.self
+ VERSION ${VITA_VERSION}
+ NAME ${VITA_APP_NAME}
+)
View
@@ -0,0 +1,39 @@
+cmake_minimum_required(VERSION 2.8)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
+ if(DEFINED ENV{VITASDK})
+ set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
+ else()
+ message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
+ endif()
+endif()
+
+set(SHORT_NAME camera_sample)
+project(${SHORT_NAME})
+include("${VITASDK}/share/vita.cmake" REQUIRED)
+
+set(VITA_APP_NAME "Camera example")
+set(VITA_TITLEID "VSDK00002")
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+
+include_directories(
+ ../common
+)
+
+add_executable(${SHORT_NAME}
+ src/main.c
+)
+
+target_link_libraries(${SHORT_NAME}
+ SceDisplay_stub
+ SceCtrl_stub
+ SceCamera_stub
+)
+
+vita_create_self(${SHORT_NAME}.self ${SHORT_NAME})
+vita_create_vpk(${SHORT_NAME}.vpk ${VITA_TITLEID} ${SHORT_NAME}.self
+ VERSION ${VITA_VERSION}
+ NAME ${VITA_APP_NAME}
+)
View
@@ -0,0 +1,38 @@
+cmake_minimum_required(VERSION 2.8)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
+ if(DEFINED ENV{VITASDK})
+ set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
+ else()
+ message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
+ endif()
+endif()
+
+set(SHORT_NAME ctrl_sample)
+project(${SHORT_NAME})
+include("${VITASDK}/share/vita.cmake" REQUIRED)
+
+set(VITA_APP_NAME "Control example")
+set(VITA_TITLEID "VSDK00003")
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+
+include_directories(
+ ../common
+)
+
+add_executable(${SHORT_NAME}
+ src/main.c
+)
+
+target_link_libraries(${SHORT_NAME}
+ SceDisplay_stub
+ SceCtrl_stub
+)
+
+vita_create_self(${SHORT_NAME}.self ${SHORT_NAME})
+vita_create_vpk(${SHORT_NAME}.vpk ${VITA_TITLEID} ${SHORT_NAME}.self
+ VERSION ${VITA_VERSION}
+ NAME ${VITA_APP_NAME}
+)
@@ -0,0 +1,37 @@
+cmake_minimum_required(VERSION 2.8)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
+ if(DEFINED ENV{VITASDK})
+ set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
+ else()
+ message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
+ endif()
+endif()
+
+set(SHORT_NAME debug_print)
+project(${SHORT_NAME})
+include("${VITASDK}/share/vita.cmake" REQUIRED)
+
+set(VITA_APP_NAME "Print example")
+set(VITA_TITLEID "VSDK00004")
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+
+include_directories(
+ ../common
+)
+
+add_executable(${SHORT_NAME}
+ src/main.c
+)
+
+target_link_libraries(${SHORT_NAME}
+ SceDisplay_stub
+)
+
+vita_create_self(${SHORT_NAME}.self ${SHORT_NAME})
+vita_create_vpk(${SHORT_NAME}.vpk ${VITA_TITLEID} ${SHORT_NAME}.self
+ VERSION ${VITA_VERSION}
+ NAME ${VITA_APP_NAME}
+)
@@ -0,0 +1,72 @@
+## This file is a quick tutorial on writing CMakeLists for targeting the Vita
+cmake_minimum_required(VERSION 2.8)
+
+## This includes the Vita toolchain, must go before project definition
+# It is a convenience so you do not have to type
+# -DCMAKE_TOOLCHAIN_FILE=$VITASDK/share/vita.toolchain.cmake for cmake. It is
+# highly recommended that you include this block for all projects.
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
+ if(DEFINED ENV{VITASDK})
+ set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
+ else()
+ message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
+ endif()
+endif()
+
+## Define project parameters here
+# Name of the project
+project(hello_cpp_world)
+# This line adds Vita helper macros, must go after project definition in order
+# to build Vita specific artifacts (self/vpk).
+include("${VITASDK}/share/vita.cmake" REQUIRED)
+
+## Configuration options for this app
+# Display name (under bubble in LiveArea)
+set(VITA_APP_NAME "Hello World")
+# Unique ID must be exactly 9 characters. Recommended: XXXXYYYYY where X =
+# unique string of developer and Y = a unique number for this app
+set(VITA_TITLEID "VSDK00005")
+# Optional version string to show in LiveArea's more info screen
+set(VITA_VERSION "01.00")
+
+## Flags and includes for building
+# Note that we make sure not to overwrite previous flags
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+# Optional. You can specify more param.sfo flags this way.
+set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")
+
+# Add any additional include paths here
+include_directories(
+)
+
+# Add any additional library paths here
+# ${CMAKE_CURRENT_BINARY_DIR} lets you use any library currently being built
+link_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+## Build and link
+# Add all the files needed to compile here
+add_executable(hello_cpp_world
+ src/main.cpp
+)
+
+# Library to link to (drop the -l prefix). This will mostly be stubs.
+target_link_libraries(hello_cpp_world
+ SceLibKernel_stub # this line is only for demonstration. It's not needed as
+ # the most common stubs are automatically included.
+)
+
+## Create Vita files
+vita_create_self(hello_cpp_world.self hello_cpp_world)
+# The FILE directive lets you add additional files to the VPK, the syntax is
+# FILE src_path dst_path_in_vpk. In this case, we add the LiveArea paths.
+vita_create_vpk(hello_cpp_world.vpk ${VITA_TITLEID} hello_cpp_world.self
+ VERSION ${VITA_VERSION}
+ NAME ${VITA_APP_NAME}
+ FILE sce_sys/icon0.png sce_sys/icon0.png
+ FILE sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png
+ FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
+ FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
+)
@@ -0,0 +1,72 @@
+## This file is a quick tutorial on writing CMakeLists for targeting the Vita
+cmake_minimum_required(VERSION 2.8)
+
+## This includes the Vita toolchain, must go before project definition
+# It is a convenience so you do not have to type
+# -DCMAKE_TOOLCHAIN_FILE=$VITASDK/share/vita.toolchain.cmake for cmake. It is
+# highly recommended that you include this block for all projects.
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
+ if(DEFINED ENV{VITASDK})
+ set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
+ else()
+ message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
+ endif()
+endif()
+
+## Define project parameters here
+# Name of the project
+project(hello_world)
+# This line adds Vita helper macros, must go after project definition in order
+# to build Vita specific artifacts (self/vpk).
+include("${VITASDK}/share/vita.cmake" REQUIRED)
+
+## Configuration options for this app
+# Display name (under bubble in LiveArea)
+set(VITA_APP_NAME "Hello World")
+# Unique ID must be exactly 9 characters. Recommended: XXXXYYYYY where X =
+# unique string of developer and Y = a unique number for this app
+set(VITA_TITLEID "VSDK00006")
+# Optional version string to show in LiveArea's more info screen
+set(VITA_VERSION "01.00")
+
+## Flags and includes for building
+# Note that we make sure not to overwrite previous flags
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+# Optional. You can specify more param.sfo flags this way.
+set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")
+
+# Add any additional include paths here
+include_directories(
+)
+
+# Add any additional library paths here
+# ${CMAKE_CURRENT_BINARY_DIR} lets you use any library currently being built
+link_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+## Build and link
+# Add all the files needed to compile here
+add_executable(hello_world
+ src/main.c
+)
+
+# Library to link to (drop the -l prefix). This will mostly be stubs.
+target_link_libraries(hello_world
+ SceLibKernel_stub # this line is only for demonstration. It's not needed as
+ # the most common stubs are automatically included.
+)
+
+## Create Vita files
+vita_create_self(hello_world.self hello_world)
+# The FILE directive lets you add additional files to the VPK, the syntax is
+# FILE src_path dst_path_in_vpk. In this case, we add the LiveArea paths.
+vita_create_vpk(hello_world.vpk ${VITA_TITLEID} hello_world.self
+ VERSION ${VITA_VERSION}
+ NAME ${VITA_APP_NAME}
+ FILE sce_sys/icon0.png sce_sys/icon0.png
+ FILE sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png
+ FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
+ FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
+)
View
@@ -0,0 +1,41 @@
+cmake_minimum_required(VERSION 2.8)
+
+if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
+ if(DEFINED ENV{VITASDK})
+ set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
+ else()
+ message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
+ endif()
+endif()
+
+set(SHORT_NAME ime_sample)
+project(${SHORT_NAME})
+include("${VITASDK}/share/vita.cmake" REQUIRED)
+
+set(VITA_APP_NAME "IME example")
+set(VITA_TITLEID "VSDK00007")
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+
+include_directories(
+ ../common
+)
+
+add_executable(${SHORT_NAME}
+ src/main.c
+)
+
+target_link_libraries(${SHORT_NAME}
+ SceDisplay_stub
+ SceGxm_stub
+ SceAppUtil_stub
+ SceCommonDialog_stub
+ SceSysmodule_stub
+)
+
+vita_create_self(${SHORT_NAME}.self ${SHORT_NAME})
+vita_create_vpk(${SHORT_NAME}.vpk ${VITA_TITLEID} ${SHORT_NAME}.self
+ VERSION ${VITA_VERSION}
+ NAME ${VITA_APP_NAME}
+)
Oops, something went wrong.

0 comments on commit 8f69082

Please sign in to comment.