cmake_minimum_required(VERSION 3.13)
project(glRN)
set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_VERBOSE_MAKEFILE on)
set(rnoh_glRN_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
add_definitions(-DOHOS_PLATFORM)
file(GLOB rnoh_glRN_SRC CONFIGURE_DEPENDS *.cpp)
file(GLOB_RECURSE rnoh_glRN_generated_SRC "${rnoh_glRN_generated_dir}/**/*.cpp")
include_directories(
    ${NATIVERENDER_ROOT_PATH}
    ${NATIVERENDER_ROOT_PATH}/include
)
add_library(rnoh_glRN SHARED
                                      napi_init.cpp
                                      GLCanvas/GLCanvas.cpp
                                      GLCanvasManager/GLCanvasManager.cpp
                                      GLFBO/GLFBO.cpp
                                      GLImage/GLImage.cpp
                                      GLShader/GLShader.cpp
                                      GLTexture/GLTexture.cpp
                                      RNGLContext/RNGLContext.cpp
                                 napi_init.cpp ${rnoh_glRN_SRC} ${rnoh_glRN_generated_SRC})
 find_library(
     # Sets the name of the path variable.
     EGL-lib
     # Specifies the name of the NDK library that
     # you want CMake to locate.
     EGL
 )

 find_library(
     # Sets the name of the path variable.
     GLES-lib
     # Specifies the name of the NDK library that
     # you want CMake to locate.
     GLESv3
 )

 find_library(
     # Sets the name of the path variable.
     hilog-lib
     # Specifies the name of the NDK library that
     # you want CMake to locate.
     hilog_ndk.z
 )

 find_library(
     # Sets the name of the path variable.
     libace-lib
     # Specifies the name of the NDK library that
     # you want CMake to locate.
     ace_ndk.z
 )

 find_library(
     # Sets the name of the path variable.
     libnapi-lib
     # Specifies the name of the NDK library that
     # you want CMake to locate.
     ace_napi.z
 )

 find_library(
     # Sets the name of the path variable.
     libuv-lib
     # Specifies the name of the NDK library that
     # you want CMake to locate.
     uv
 )
target_include_directories(rnoh_glRN PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${rnoh_glRN_generated_dir}
    ${CMAKE_CURRENT_SOURCE_DIR}/generated/react/render/components/gl_react_native
)

target_link_libraries(rnoh_glRN PUBLIC rnoh  ${EGL-lib} ${GLES-lib} ${hilog-lib} ${libace-lib} ${libnapi-lib} ${libuv-lib} libnative_window.so)