mirror of
https://git.planet-casio.com/Lephenixnoir/fxsdk.git
synced 2024-12-29 13:03:37 +01:00
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).
This commit is contained in:
parent
6383e1a30e
commit
30befdd2cf
2 changed files with 16 additions and 6 deletions
|
@ -27,11 +27,16 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
|
|
||||||
set(FXSDK_CMAKE_MODULE_PATH "${FXSDK_CMAKE_MODULE_PATH}")
|
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
|
# Determine compiler install path
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_C_COMPILER} --print-search-dirs
|
COMMAND ${CMAKE_C_COMPILER} --print-file-name=.
|
||||||
COMMAND head -n 1
|
|
||||||
COMMAND sed -E "s/^[^:]+: //"
|
|
||||||
OUTPUT_VARIABLE FXSDK_COMPILER_INSTALL
|
OUTPUT_VARIABLE FXSDK_COMPILER_INSTALL
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
|
|
|
@ -27,11 +27,16 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
|
|
||||||
set(FXSDK_CMAKE_MODULE_PATH "${FXSDK_CMAKE_MODULE_PATH}")
|
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
|
# Determine compiler install path
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_C_COMPILER} --print-search-dirs
|
COMMAND ${CMAKE_C_COMPILER} --print-file-name=.
|
||||||
COMMAND head -n 1
|
|
||||||
COMMAND sed -E "s/^[^:]+: //"
|
|
||||||
OUTPUT_VARIABLE FXSDK_COMPILER_INSTALL
|
OUTPUT_VARIABLE FXSDK_COMPILER_INSTALL
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue