From 560d558e30bc9ed6187c04cf6075584328715ef3 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Tue, 15 Mar 2022 16:09:04 +0100 Subject: [PATCH 1/2] Use psp-pkg-config for FindPkgConfig in CMake This make it so that when using the following code: ``` include(FindPkgConfig) pkg_search_module(SDL2 REQUIRED sdl2) ``` The variables ``${SDL2_INCLUDE_DIRS}`` and ``${SDL2_LIBRARIES}`` are set to the expected values within CMake. --- src/base/pspdev.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/base/pspdev.cmake b/src/base/pspdev.cmake index 9daa3c98..b4985e55 100644 --- a/src/base/pspdev.cmake +++ b/src/base/pspdev.cmake @@ -22,6 +22,8 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +SET(PKG_CONFIG_EXECUTABLE "${PSPDEV}/bin/psp-pkg-config" CACHE PATH "psp-pkg-config executable") + ## Add Default PSPSDK Libraries according to build.mak and add stdc++ for C++ builds so this doesn't need to be done manually later include_directories(${PSPDEV}/psp/include ${PSPDEV}/psp/sdk/include) link_directories( ${PSPDEV}/lib ${PSPDEV}/psp/lib ${PSPDEV}/psp/sdk/lib) From a51d8066dabb31500812cb5a8d2ff09197810b16 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Tue, 15 Mar 2022 16:13:37 +0100 Subject: [PATCH 2/2] Clean up setting pkg-config executable I found out the cache part wasn't needed. --- src/base/pspdev.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/pspdev.cmake b/src/base/pspdev.cmake index b4985e55..e0520191 100644 --- a/src/base/pspdev.cmake +++ b/src/base/pspdev.cmake @@ -22,7 +22,7 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -SET(PKG_CONFIG_EXECUTABLE "${PSPDEV}/bin/psp-pkg-config" CACHE PATH "psp-pkg-config executable") +SET(PKG_CONFIG_EXECUTABLE "${PSPDEV}/bin/psp-pkg-config") ## Add Default PSPSDK Libraries according to build.mak and add stdc++ for C++ builds so this doesn't need to be done manually later include_directories(${PSPDEV}/psp/include ${PSPDEV}/psp/sdk/include)