forked from Mirrors/openclonk
CMake: use FIND_PROGRAM
While cross-compiling, it is easier to find a binary from the patch using FIND_PROGRAM instead of using a cmake file. Try to find c4group native tool with FIND_PROGRAM and fallback to the cmake file if c4group is not found. Signed-off-by: Romain Naour <romain.naour@gmail.com>stable-8
parent
923d355c91
commit
54d2ce7e07
|
@ -1481,9 +1481,15 @@ ENDIF()
|
|||
|
||||
# When cross-compiling, import c4group from a native build
|
||||
IF(CMAKE_CROSSCOMPILING)
|
||||
SET(IMPORT_NATIVE_TOOLS "IMPORT_NATIVE_TOOLS-NOTFOUND" CACHE FILEPATH "Export file from a native build")
|
||||
INCLUDE(${IMPORT_NATIVE_TOOLS})
|
||||
SET(native_c4group native-c4group)
|
||||
FIND_PROGRAM(C4GROUP_PATH NAMES c4group PATHS)
|
||||
|
||||
IF (NOT C4GROUP_PATH)
|
||||
SET(IMPORT_NATIVE_TOOLS "IMPORT_NATIVE_TOOLS-NOTFOUND" CACHE FILEPATH "Export file from a native build")
|
||||
INCLUDE(${IMPORT_NATIVE_TOOLS})
|
||||
SET(native_c4group native-c4group)
|
||||
ELSE()
|
||||
SET(native_c4group ${C4GROUP_PATH})
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(native_c4group c4group)
|
||||
ENDIF()
|
||||
|
|
Loading…
Reference in New Issue