Skip to content

Commit

Permalink
Merge pull request #4 from pspdev/move_examples
Browse files Browse the repository at this point in the history
Move examples to a different folder
  • Loading branch information
fjtrujy authored Nov 3, 2024
2 parents ca9ffba + 0258259 commit a5d98eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Add subdirectories for each component
add_subdirectory(src/lib) # Static library
add_subdirectory(src/module) # PRX module
add_subdirectory(src/example) # Example program
add_subdirectory(examples/basic) # Basic example program
20 changes: 10 additions & 10 deletions src/example/CMakeLists.txt → examples/basic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Example executable
project(fooME)
project(basicME)

# Collect source files for the example program
file(GLOB EXAMPLE_SOURCES *.c)

# Define the executable target
add_executable(fooME ${EXAMPLE_SOURCES})
add_executable(basicME ${EXAMPLE_SOURCES})

# Link against the static library
target_link_libraries(fooME pspme_static)
target_link_libraries(basicME pspme_static)

# TODO: Copy the generated PRX pspme_prx module to the bin directory
# add_custom_command(
# TARGET fooME POST_BUILD
# TARGET basicME POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pspme_prx> ${CMAKE_BINARY_DIR}/bin
# )

# Set output name to "fooME.elf"
set_target_properties(fooME PROPERTIES OUTPUT_NAME "fooME")
target_include_directories(fooME PRIVATE ${CMAKE_SOURCE_DIR}/include)
# Set output name to "basicME.elf"
set_target_properties(basicME PROPERTIES OUTPUT_NAME "basicME")
target_include_directories(basicME PRIVATE ${CMAKE_SOURCE_DIR}/include)

# Use create_pbp_file to generate a PBP file after building fooME.elf
# Use create_pbp_file to generate a PBP file after building basicME.elf
create_pbp_file(
TARGET fooME
TARGET basicME
ICON_PATH NULL
BACKGROUND_PATH NULL
PREVIEW_PATH NULL
TITLE "fooME"
TITLE "basicME"
)
2 changes: 1 addition & 1 deletion src/example/main.c → examples/basic/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#define VERS 1
#define REVS 0
PSP_MODULE_INFO("FooME", 0, VERS, REVS);
PSP_MODULE_INFO("BasicME", 0, VERS, REVS);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

static int exitRequest = 0;
Expand Down

0 comments on commit a5d98eb

Please sign in to comment.