Findpybind11.cmake 815 B

123456789101112131415161718192021222324
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. # this file actually ingests the library and defines targets.
  8. set(TARGET_WITH_NAMESPACE "3rdParty::pybind11")
  9. if (TARGET ${TARGET_WITH_NAMESPACE})
  10. return()
  11. endif()
  12. set(LIB_NAME "pybind11")
  13. set(${LIB_NAME}_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/pybind11/include)
  14. add_library(${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
  15. ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE ${${LIB_NAME}_INCLUDE_DIR})
  16. if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
  17. target_compile_options(3rdParty::pybind11 INTERFACE -fsized-deallocation)
  18. endif()
  19. set(${LIB_NAME}_FOUND True)