Skip to content

Commit

Permalink
Adjust CMake installation paths to use PSPDIR from psp-config
Browse files Browse the repository at this point in the history
- Updated CMakeLists.txt to dynamically set PSPDIR using `psp-config --psp-prefix`.
- Modified the installation instructions to match the behavior of the old Makefile.
- Now installs libraries and headers into the appropriate PSP directory, ensuring compatibility with the previous Makefile setup.
  • Loading branch information
dogo committed Sep 8, 2024
1 parent 420c088 commit 8b7c1fe
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,30 @@ target_link_libraries(${TARGET_LIB}
-lpng -ljpeg -lz -lm
)

# Get the PSP prefix using psp-config
execute_process(
COMMAND psp-config --psp-prefix
OUTPUT_VARIABLE PSPDIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Installation instructions
install(TARGETS ${TARGET_LIB} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
install(DIRECTORY src/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/oslib FILES_MATCHING PATTERN "*.h")
install(TARGETS ${TARGET_LIB} DESTINATION ${PSPDIR}/lib)

# Include directories installation (headers)
install(FILES ${SOURCE_DIR}/intraFont/intraFont.h ${SOURCE_DIR}/intraFont/libccc.h
DESTINATION ${PSPDIR}/include/oslib/intraFont)

install(FILES ${SOURCE_DIR}/libpspmath/pspmath.h
DESTINATION ${PSPDIR}/include/oslib/libpspmath)

install(FILES ${SOURCE_DIR}/adhoc/pspadhoc.h
DESTINATION ${PSPDIR}/include/oslib/adhoc)

install(FILES ${SOURCE_DIR}/oslmath.h ${SOURCE_DIR}/net.h ${SOURCE_DIR}/browser.h ${SOURCE_DIR}/audio.h
${SOURCE_DIR}/bgm.h ${SOURCE_DIR}/dialog.h ${SOURCE_DIR}/drawing.h ${SOURCE_DIR}/keys.h
${SOURCE_DIR}/map.h ${SOURCE_DIR}/messagebox.h ${SOURCE_DIR}/osk.h ${SOURCE_DIR}/saveload.h
${SOURCE_DIR}/oslib.h ${SOURCE_DIR}/text.h ${SOURCE_DIR}/usb.h ${SOURCE_DIR}/vfpu_ops.h
${SOURCE_DIR}/VirtualFile.h ${SOURCE_DIR}/vram_mgr.h ${SOURCE_DIR}/ccc.h ${SOURCE_DIR}/sfont.h
DESTINATION ${PSPDIR}/include/oslib)

0 comments on commit 8b7c1fe

Please sign in to comment.