harfang3d/tools/assetc/CMakeLists.txt

40 lines
1.3 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()
if(UNIX)
target_link_libraries(assetc pthread)
endif()
# assetc installation
install(TARGETS assetc libluadll RUNTIME DESTINATION assetc LIBRARY DESTINATION assetc COMPONENT assetc)
install(FILES $<TARGET_FILE:glfw> DESTINATION assetc COMPONENT assetc)
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()