From c3c22aa84c759a8308aee98e7790a5ffab58af9b Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Wed, 30 Jan 2019 10:37:24 -0800 Subject: [PATCH] EGL and Oculus depedency macros --- cmake/macros/TargetEGL.cmake | 4 ++++ cmake/macros/TargetOculusMobile.cmake | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 cmake/macros/TargetEGL.cmake create mode 100644 cmake/macros/TargetOculusMobile.cmake diff --git a/cmake/macros/TargetEGL.cmake b/cmake/macros/TargetEGL.cmake new file mode 100644 index 0000000000..1d8ce26d83 --- /dev/null +++ b/cmake/macros/TargetEGL.cmake @@ -0,0 +1,4 @@ +macro(target_egl) + find_library(EGL EGL) + target_link_libraries(${TARGET_NAME} ${EGL}) +endmacro() diff --git a/cmake/macros/TargetOculusMobile.cmake b/cmake/macros/TargetOculusMobile.cmake new file mode 100644 index 0000000000..3eaa008b14 --- /dev/null +++ b/cmake/macros/TargetOculusMobile.cmake @@ -0,0 +1,20 @@ + +macro(target_oculus_mobile) + set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/oculus/VrApi) + + # Mobile SDK + set(OVR_MOBILE_INCLUDE_DIRS ${INSTALL_DIR}/Include) + target_include_directories(${TARGET_NAME} PRIVATE ${OVR_MOBILE_INCLUDE_DIRS}) + set(OVR_MOBILE_LIBRARY_DIR ${INSTALL_DIR}/Libs/Android/arm64-v8a) + set(OVR_MOBILE_LIBRARY_RELEASE ${OVR_MOBILE_LIBRARY_DIR}/Release/libvrapi.so) + set(OVR_MOBILE_LIBRARY_DEBUG ${OVR_MOBILE_LIBRARY_DIR}/Debug/libvrapi.so) + select_library_configurations(OVR_MOBILE) + target_link_libraries(${TARGET_NAME} ${OVR_MOBILE_LIBRARIES}) + + # Platform SDK + set(INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/oculusPlatform) + set(OVR_PLATFORM_INCLUDE_DIRS ${INSTALL_DIR}/Include) + target_include_directories(${TARGET_NAME} PRIVATE ${OVR_PLATFORM_INCLUDE_DIRS}) + set(OVR_PLATFORM_LIBRARIES ${INSTALL_DIR}/Android/libs/arm64-v8a/libovrplatformloader.so) + target_link_libraries(${TARGET_NAME} ${OVR_PLATFORM_LIBRARIES}) +endmacro()