From 5ccd6747954fde40646505fd786a2e5c0c04ba34 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Sat, 20 Aug 2022 11:48:42 +0200 Subject: [PATCH] meta: build system for fxSDK 2.9 with sysroot --- CMakeLists.txt | 15 ++++----------- FindAzur.cmake | 5 +++-- README.md | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4652086..60506ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,17 +74,10 @@ if(AZUR_PLATFORM STREQUAL gint) find_package(LibProf 2.4 REQUIRED) link_libraries(LibProf::LibProf Gint::Gint) - # Default to the fxSDK install path - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${FXSDK_COMPILER_INSTALL}" CACHE PATH "..." FORCE) - endif() - - # The fxSDK install path has a slightly different structure - if(CMAKE_INSTALL_PREFIX STREQUAL "${FXSDK_COMPILER_INSTALL}") - set(LIBDIR ".") - set(INCDIR "include") - set(MODPATH "${FXSDK_CMAKE_MODULE_PATH}") - endif() + # Install in the fxSDK sysroot + set(LIBDIR "${FXSDK_LIB}") + set(INCDIR "${FXSDK_INCLUDE}") + set(MODPATH "${FXSDK_CMAKE_MODULE_PATH}") endif() if(AZUR_PLATFORM STREQUAL linux) diff --git a/FindAzur.cmake b/FindAzur.cmake index 7bc92d0..196e54f 100644 --- a/FindAzur.cmake +++ b/FindAzur.cmake @@ -4,9 +4,9 @@ set(AZUR_PATH "$ENV{AZUR_PATH_${AZUR_PLATFORM}}") if(NOT "${FXSDK_PLATFORM_LONG}" STREQUAL "") set(AZUR_PLATFORM gint) - set(AZUR_PATH "${FXSDK_COMPILER_INSTALL}") + set(AZUR_PATH "${FXSDK_LIB}") set(AZUR_LIB "${AZUR_PATH}/libazur_${AZUR_PLATFORM}.a") - set(AZUR_INCLUDE "${AZUR_PATH}/include") + set(AZUR_INCLUDE "${FXSDK_INCLUDE}") message("(Azur) Using the fxSDK compiler path: ${AZUR_LIB}") message("(Azur) Will take includes from: ${AZUR_INCLUDE}") @@ -52,6 +52,7 @@ execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE) message("(Azur) Library version found in header: ${AZUR_VERSION}") +# TODO: ${AZUR_PATH}/lib will not work with the fxSDK sysroot set(AZUR_3RDPARTY "") set(AZUR_LIB_GL3W "${AZUR_PATH}/lib/libazur_${AZUR_PLATFORM}_gl3w.a") set(AZUR_LIB_IMGUI "${AZUR_PATH}/lib/libazur_${AZUR_PLATFORM}_imgui.a") diff --git a/README.md b/README.md index f55c96b..ee54482 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ You *must* install into a different folder for each platform, as the headers wou **Building for fx-CG** -Use the [fxSDK toolchain](https://gitea.planet-casio.com/Lephenixnoir/fxsdk). When building with the fxSDK, `AZUR_PLATFORM=gint` is assumed and the compiler's data folder is used to install the library. +Use the [fxSDK toolchain](https://gitea.planet-casio.com/Lephenixnoir/fxsdk). When building with the fxSDK, `AZUR_PLATFORM=gint` is assumed and the fxSDK sysroot is used to install the library. ``` % fxsdk build-cg install