harfang3d/tools/assetc/CMakeLists.txt

49 lines
1.5 KiB
CMake
Raw Normal View History

2021-10-13 12:40:31 +00:00
add_executable(assetc assetc.cpp)
add_dependencies(assetc texturec shaderc luac cmft)
set_target_properties(assetc PROPERTIES FOLDER "harfang/tools")
target_link_libraries(assetc engine tiny-process-library)
if(HG_ENABLE_RECAST_DETOUR_API)
add_subdirectory(recastc)
endif()
2022-12-07 08:51:01 +00:00
if(HG_ENABLE_BULLET3_SCENE_PHYSICS)
add_subdirectory(bulletc)
endif()
2021-10-13 12:40:31 +00:00
if(UNIX)
target_link_libraries(assetc pthread)
endif()
# assetc installation
2022-05-02 15:25:11 +00:00
install(TARGETS assetc RUNTIME DESTINATION assetc LIBRARY DESTINATION assetc COMPONENT assetc)
2021-10-13 12:40:31 +00:00
2022-05-02 15:25:11 +00:00
install_cppsdk_dependencies(assetc)
2021-10-13 12:40:31 +00:00
if(NOT ASSETC_TARGET_PREFIX)
set(ASSETC_TARGET_PREFIX ${HG_TARGET_PREFIX})
endif()
# toolchain installation
# [EJ22032021] BEWARE! The host for assetc is NOT the host for CMake!
# cmake_host (HG_HOST_PREFIX) builds the executables for cmake_target (HG_TARGET_PREFIX)
# assetc_host runs the executables (so HG_TARGET_PREFIX) and outputs assets for assetc_target (ASSETC_TARGET_PREFIX)
set(TOOLCHAIN_PATH assetc/toolchains/host-${HG_TARGET_PREFIX}-target-${ASSETC_TARGET_PREFIX})
install(TARGETS texturec shaderc luac cmft RUNTIME DESTINATION ${TOOLCHAIN_PATH} COMPONENT assetc)
if(WIN32)
install(PROGRAMS bin/win/texconv.exe DESTINATION ${TOOLCHAIN_PATH} COMPONENT assetc)
endif()
if(HG_ENABLE_RECAST_DETOUR_API)
install(TARGETS recastc RUNTIME DESTINATION ${TOOLCHAIN_PATH} COMPONENT assetc)
endif()
2022-12-07 08:51:01 +00:00
if(HG_ENABLE_BULLET3_SCENE_PHYSICS)
install(TARGETS bulletc RUNTIME DESTINATION ${TOOLCHAIN_PATH} COMPONENT assetc)
endif()