2
0

Findastc-encoder.cmake.template 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  3. #
  4. # SPDX-License-Identifier: Apache-2.0 OR MIT
  5. #
  6. # this file actually ingests the library and defines targets.
  7. set(LIB_NAME "astc-encoder")
  8. set(TARGET_WITH_NAMESPACE "3rdParty::$${LIB_NAME}")
  9. set($${LIB_NAME}_INCLUDE_DIR $${CMAKE_CURRENT_LIST_DIR}/$${LIB_NAME}/include)
  10. set($${LIB_NAME}_LIBRARY_DIR $${CMAKE_CURRENT_LIST_DIR}/$${LIB_NAME}/bin)
  11. if ($${PAL_PLATFORM_NAME} STREQUAL "Windows")
  12. set($${LIB_NAME}_LIBRARY_RELEASE $${$${LIB_NAME}_LIBRARY_DIR}/Release/astcenc-sse4.1-static.lib)
  13. set($${LIB_NAME}_LIBRARY_DEBUG $${$${LIB_NAME}_LIBRARY_DIR}/Debug/astcenc-sse4.1-static.lib)
  14. elseif ($${PAL_PLATFORM_NAME} STREQUAL "Linux")
  15. set($${LIB_NAME}_LIBRARY_RELEASE $${$${LIB_NAME}_LIBRARY_DIR}/libastcenc-sse4.1-static.a)
  16. set($${LIB_NAME}_LIBRARY_DEBUG $${$${LIB_NAME}_LIBRARY_RELEASE})
  17. else()
  18. set($${LIB_NAME}_LIBRARY_RELEASE $${$${LIB_NAME}_LIBRARY_DIR}/libastcenc-sse4.1-static.a)
  19. set($${LIB_NAME}_LIBRARY_DEBUG $${$${LIB_NAME}_LIBRARY_RELEASE})
  20. endif()
  21. # declare the target so that others can 'depend on it'
  22. add_library($${TARGET_WITH_NAMESPACE} STATIC IMPORTED GLOBAL)
  23. # add include directory
  24. ly_target_include_system_directories(TARGET $${TARGET_WITH_NAMESPACE} INTERFACE $${$${LIB_NAME}_INCLUDE_DIR})
  25. # add static library as "output" IMPORTED_LOCATION for the target
  26. set_target_properties($${TARGET_WITH_NAMESPACE}
  27. PROPERTIES
  28. IMPORTED_LOCATION_DEBUG $${$${LIB_NAME}_LIBRARY_DEBUG}
  29. IMPORTED_LOCATION $${$${LIB_NAME}_LIBRARY_RELEASE}
  30. )
  31. set($${LIB_NAME}_FOUND True)