aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt15
1 files changed, 13 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53c3ff80..d6448a25 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1161,8 +1161,19 @@ SET(NATIVE_SRC_DIR "${OpenAL_SOURCE_DIR}/native-tools")
SET(ALSOFT_NATIVE_TOOLS_PATH "" CACHE STRING "Path to prebuilt native tools (leave blank to auto-build)")
IF(ALSOFT_NATIVE_TOOLS_PATH)
- SET(BIN2H_COMMAND "${ALSOFT_NATIVE_TOOLS_PATH}/bin2h")
- SET(BSINCGEN_COMMAND "${ALSOFT_NATIVE_TOOLS_PATH}/bsincgen")
+ find_program(BIN2H_NATIVE_COMMAND NAMES bin2h
+ PATHS "${ALSOFT_NATIVE_TOOLS_PATH}"
+ NO_DEFAULT_PATH)
+ find_program(BSINCGEN_NATIVE_COMMAND NAMES bsincgen
+ PATHS "${ALSOFT_NATIVE_TOOLS_PATH}"
+ NO_DEFAULT_PATH)
+ if(NOT BIN2H_NATIVE_COMMAND OR NOT BSINCGEN_NATIVE_COMMAND)
+ message(FATAL_ERROR "Failed to find native tools in ${ALSOFT_NATIVE_TOOLS_PATH}.
+bin2h: ${BIN2H_NATIVE_COMMAND}
+bsincgen: ${BSINCGEN_NATIVE_COMMAND}")
+ endif()
+ SET(BIN2H_COMMAND ${BIN2H_NATIVE_COMMAND})
+ SET(BSINCGEN_COMMAND ${BSINCGEN_NATIVE_COMMAND})
ELSE()
SET(NATIVE_BIN_DIR "${OpenAL_BINARY_DIR}/native-tools")
FILE(MAKE_DIRECTORY "${NATIVE_BIN_DIR}")