From 8b7c1fe9b73c6d30dec0859721cbcde89517ad3c Mon Sep 17 00:00:00 2001 From: Diogo Autilio Date: Sun, 8 Sep 2024 18:41:12 -0300 Subject: [PATCH] Adjust CMake installation paths to use PSPDIR from psp-config - 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. --- CMakeLists.txt | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 816906d..0374fc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) +