Browse Source

cmake: automatically find libraries in FXSDK_PREFIX

This paves the way for out-of-compiler installs which might become a
relevant thing for packaging and dual gint/PrizmSDK users (if it ever
happens).
dev
Lephenixnoir 4 months ago
parent
commit
30befdd2cf
Signed by: Lephenixnoir GPG Key ID: 1BBA026E13FC0495
  1. 11
      fxsdk/cmake/FX9860G.cmake
  2. 11
      fxsdk/cmake/FXCG50.cmake

11
fxsdk/cmake/FX9860G.cmake

@ -27,11 +27,16 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(FXSDK_CMAKE_MODULE_PATH "${FXSDK_CMAKE_MODULE_PATH}")
# Add the fxSDK prefix path to the search
set(FXSDK_PREFIX "$ENV{FXSDK_PREFIX}")
foreach(DIR IN LISTS FXSDK_PREFIX)
include_directories("${DIR}/include")
link_directories("${DIR}/lib")
endforeach()
# Determine compiler install path
execute_process(
COMMAND ${CMAKE_C_COMPILER} --print-search-dirs
COMMAND head -n 1
COMMAND sed -E "s/^[^:]+: //"
COMMAND ${CMAKE_C_COMPILER} --print-file-name=.
OUTPUT_VARIABLE FXSDK_COMPILER_INSTALL
OUTPUT_STRIP_TRAILING_WHITESPACE
)

11
fxsdk/cmake/FXCG50.cmake

@ -27,11 +27,16 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(FXSDK_CMAKE_MODULE_PATH "${FXSDK_CMAKE_MODULE_PATH}")
# Add the fxSDK prefix path to the search
set(FXSDK_PREFIX "$ENV{FXSDK_PREFIX}")
foreach(DIR IN LISTS FXSDK_PREFIX)
include_directories("${DIR}/include")
link_directories("${DIR}/lib")
endforeach()
# Determine compiler install path
execute_process(
COMMAND ${CMAKE_C_COMPILER} --print-search-dirs
COMMAND head -n 1
COMMAND sed -E "s/^[^:]+: //"
COMMAND ${CMAKE_C_COMPILER} --print-file-name=.
OUTPUT_VARIABLE FXSDK_COMPILER_INSTALL
OUTPUT_STRIP_TRAILING_WHITESPACE
)
Loading…
Cancel
Save