aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-06-01 11:21:43 -0700
committerChris Robinson <[email protected]>2019-06-01 11:21:43 -0700
commit8c4a9a5a32e0294e2b2a3ac01df501f78f8d2160 (patch)
tree9b4f8ca266b051ff1f7032a9b269d5e734a24767
parent20ce461096c88e1bafa209a43541a599ff0ad610 (diff)
Properly search for prebuilt native-tools
-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}")