mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
CMake: Use find_program to detect host tools when cross-compiling
In the future, we should also try to do find_package(Panda3D) to use the host tools even if Panda3D isn't in a system path.
This commit is contained in:
parent
f377bdfb29
commit
4556059c90
@ -95,6 +95,26 @@ target_link_libraries(interrogate_module p3cppParser p3interrogatedb
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
add_executable(host_interrogate ALIAS interrogate)
|
||||
add_executable(host_interrogate_module ALIAS interrogate_module)
|
||||
|
||||
else()
|
||||
# When cross-compiling, we must find the host Interrogate.
|
||||
# TODO: We should also try to find_package(Panda3D ...) before falling back
|
||||
# to searching manually.
|
||||
find_program(HOST_PATH_INTERROGATE interrogate)
|
||||
find_program(HOST_PATH_INTERROGATE_MODULE interrogate_module)
|
||||
|
||||
add_executable(host_interrogate IMPORTED GLOBAL)
|
||||
if(HOST_PATH_INTERROGATE)
|
||||
set_target_properties(host_interrogate PROPERTIES
|
||||
IMPORTED_LOCATION "${HOST_PATH_INTERROGATE}")
|
||||
endif()
|
||||
|
||||
add_executable(host_interrogate_module IMPORTED GLOBAL)
|
||||
if(HOST_PATH_INTERROGATE_MODULE)
|
||||
set_target_properties(host_interrogate_module PROPERTIES
|
||||
IMPORTED_LOCATION "${HOST_PATH_INTERROGATE_MODULE}")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if(WANT_INTERROGATE)
|
||||
|
@ -22,6 +22,15 @@ if(HAVE_ZLIB)
|
||||
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
add_executable(host_pzip ALIAS pzip)
|
||||
else()
|
||||
find_program(HOST_PATH_PZIP pzip)
|
||||
|
||||
add_executable(host_pzip IMPORTED GLOBAL)
|
||||
if(HOST_PATH_PZIP)
|
||||
set_target_properties(host_pzip PROPERTIES
|
||||
IMPORTED_LOCATION "${HOST_PATH_PZIP}")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
add_executable(punzip punzip.cxx)
|
||||
|
Loading…
x
Reference in New Issue
Block a user