Findcityhash.cmake 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #
  2. # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
  3. # its licensors.
  4. #
  5. # For complete copyright and license terms please see the LICENSE at the root of this
  6. # distribution (the "License"). All use of this software is governed by the License,
  7. # or, if provided, by the license below or the license accompanying this file. Do not
  8. # remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
  9. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. #
  11. # this file actually ingests the library and defines targets.
  12. set(TARGET_WITH_NAMESPACE "3rdParty::cityhash")
  13. if (TARGET ${TARGET_WITH_NAMESPACE})
  14. return()
  15. endif()
  16. set(MY_NAME "cityhash")
  17. set(${MY_NAME}_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/cityhash/src)
  18. set(${MY_NAME}_LIBS_DIR ${CMAKE_CURRENT_LIST_DIR}/cityhash/build)
  19. if (${PAL_PLATFORM_NAME} STREQUAL "Android")
  20. set(${MY_NAME}_ANDROID_BASE ${${MY_NAME}_LIBS_DIR}/win_x64/android_ndk_r12/android-21/arm64-v8a/clang-3.8)
  21. set(${MY_NAME}_LIBRARY_DEBUG ${${MY_NAME}_ANDROID_BASE}/debug/libcityhash.a)
  22. set(${MY_NAME}_LIBRARY_RELEASE ${${MY_NAME}_ANDROID_BASE}/release/libcityhash.a)
  23. elseif (${PAL_PLATFORM_NAME} STREQUAL "iOS")
  24. set(${MY_NAME}_LIBRARY_DEBUG ${${MY_NAME}_LIBS_DIR}/osx/ios-clang-703.0.31/debug/libcityhash.a)
  25. set(${MY_NAME}_LIBRARY_RELEASE ${${MY_NAME}_LIBS_DIR}/osx/ios-clang-703.0.31/release/libcityhash.a)
  26. elseif (${PAL_PLATFORM_NAME} STREQUAL "Linux")
  27. set(${MY_NAME}_LIBRARY_DEBUG ${${MY_NAME}_LIBS_DIR}/linux/clang-3.8/debug/libcityhash.a)
  28. set(${MY_NAME}_LIBRARY_RELEASE ${${MY_NAME}_LIBS_DIR}/linux/clang-3.8/release/libcityhash.a)
  29. elseif (${PAL_PLATFORM_NAME} STREQUAL "Mac")
  30. set(${MY_NAME}_LIBRARY_DEBUG ${${MY_NAME}_LIBS_DIR}/osx/darwin-clang-703.0.31/debug/libcityhash.a)
  31. set(${MY_NAME}_LIBRARY_RELEASE ${${MY_NAME}_LIBS_DIR}/osx/darwin-clang-703.0.31/release/libcityhash.a)
  32. elseif (${PAL_PLATFORM_NAME} STREQUAL "Windows")
  33. set(${MY_NAME}_LIBRARY_DEBUG ${${MY_NAME}_LIBS_DIR}/win_x64/vc140/debug/cityhash.lib)
  34. set(${MY_NAME}_LIBRARY_RELEASE ${${MY_NAME}_LIBS_DIR}/win_x64/vc140/release/cityhash.lib)
  35. endif()
  36. # we set it to a generator expression for multi-config situations:
  37. set(${MY_NAME}_LIBRARY
  38. "$<$<CONFIG:profile>:${${MY_NAME}_LIBRARY_RELEASE}>"
  39. "$<$<CONFIG:Release>:${${MY_NAME}_LIBRARY_RELEASE}>"
  40. "$<$<CONFIG:Debug>:${${MY_NAME}_LIBRARY_DEBUG}>")
  41. add_library(${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
  42. ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE ${${MY_NAME}_INCLUDE_DIR})
  43. target_link_libraries(${TARGET_WITH_NAMESPACE}
  44. INTERFACE ${${MY_NAME}_LIBRARY}
  45. )
  46. set(${MY_NAME}_FOUND True)