if (RCAR_UT STREQUAL "ENABLE")
    set(app_name "opengl_cluster_sample_app_test")
else()
    set(app_name "opengl_cluster_sample_app")
endif()

set(app_version "0.1.3")

cmake_minimum_required(VERSION 3.16.3)
project(${app_name})

if(NOT RCAR_UT) # This guard allows to set RCAR_UT externally, e.g. via CMake Commandline during configuration
    set(RCAR_UT
        ENABLE DISABLE
    )
endif()

#check the architecture
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
    set(ARCH "x86_64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
    set(ARCH "aarch64")
else()
    message(FATAL_ERROR "unsupported architecture")
endif()

if(ARCH STREQUAL "x86_64" AND NOT(RCAR_SOC STREQUAL "x5h"))
    set(APP_INC "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/")
    set(RESOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/application/res")
    set(CONF_DIR "${CMAKE_CURRENT_SOURCE_DIR}/application/conf")

    if(ARCH STREQUAL "x86_64")
        message("--x86_64")
        add_compile_definitions(X86=1)
        add_compile_definitions(WAYLAND=0)
    else()
        add_compile_definitions(X86=0)
    endif()

    if(ARCH STREQUAL "x86_64")
        # Set the path to your OPENGL_X86 libraries and includes
        set(LINUX_X86_INC "/usr/include/")
        set(FREE_TYPE_INC "/usr/include/freetype2;/usr/include/libpng16")
        set(GL_LIBRARY "/usr/lib/x86_64-linux-gnu/libGL.so")
        set(GLFW_LIBRARY "/usr/lib/x86_64-linux-gnu/libglfw.so")
        set(GLEW_LIBRARY "/usr/lib/x86_64-linux-gnu/libGLEW.so")
        set(GLU_LIBRARY "/usr/lib/x86_64-linux-gnu/libGLU.so")
        set(LINUX_X86_LOCAL_LIB "/usr/local/lib/")
        file(COPY ${RESOURCE_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
        file(COPY ${CONF_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
    endif()

    # Add the include directories
    include_directories(
    if(ARCH STREQUAL "x86_64")
        ${LINUX_X86_INC}
        ${FREE_TYPE_INC}
    endif()
    ${APP_INC} 
    )

    # Add the source files to the project
    set(SOURCES
    "${CMAKE_CURRENT_SOURCE_DIR}/application/src/main.cpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/application/src/cpuload.cpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/application/src/sysConfigure.cpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/application/src/sysCpuLoad.cpp"
    # Add other source files if any
    )

    # Create an executable
    add_executable(opengl_cluster_sample_app ${SOURCES})

    if(ARCH STREQUAL "x86_64")
    # Link the required libraries
        set(link_lib 
            m
            EGL
            GLESv2
            freetype
            pthread
            ${GL_LIBRARY}
            ${GLFW_LIBRARY}
            ${GLEW_LIBRARY}
            ${GLU_LIBRARY}
            ${LINUX_X86_LOCAL_LIB}
            )

        find_library(WL_LIB wayland-client)
        if (WL_LIB)
            message("wayland_lib")
            list(APPEND link_lib
                wayland-egl
                wayland-client
                )
        endif()

        target_link_libraries(opengl_cluster_sample_app ${link_lib})   
    endif()

    target_compile_options(opengl_cluster_sample_app PRIVATE -w -fpermissive -g)
    # Set C++ version
    set_property(TARGET opengl_cluster_sample_app PROPERTY CXX_STANDARD 11)
endif()

if(RCAR_SOC STREQUAL "v4h2" OR RCAR_SOC STREQUAL "x5h")
    #----------------------------------------------------------------------------------------------------------------------
    # R-Car xOS SoC/Board selection
    #----------------------------------------------------------------------------------------------------------------------
    if(NOT RCAR_SOC) # This guard allows to set RCAR_SOC externally, e.g. via CMake Commandline during configuration
        set(RCAR_SOC
            V3H2 V3U # Allowed values are at the moment V3H1, V3M2. Availability depends on the package you have.
        )
    endif()

    #----------------------------------------------------------------------------------------------------------------------
    # Find R-Car xOS platform with your requested configuration
    # - In case you need a specific version, usage: find_package(rcar-xos v0.3.0 EXACT REQUIRED)
    # - In case you need at least version, usage: find_package(rcar-xos v0.3.0 REQUIRED)
    #
    # If the command fails to find the package:
    #   Make sure rcar-xos config files can be found via standard variables set in your system:
    #   PATH environment variable or rcar-xos_DIR (environment or CMake variable set via commandline)
    #
    # See R-Car xOS documentation for more help or https://cmake.org/cmake/help/latest/command/find_package.html
    #----------------------------------------------------------------------------------------------------------------------
    find_package(rcar-xos REQUIRED)

    #----------------------------------------------------------------------------------------------------------------------
    # Configurations
    #----------------------------------------------------------------------------------------------------------------------

    # Set to TRUE if you want to support the BCL format.
    set(SUPPORT_BCL_FORMAT FALSE)

    # Set to TRUE if you want to use IMP Driver instead of IMP Framework.
    set(USE_IMPDRV TRUE)

    find_package(rcar-xos REQUIRED)
    if(${rcar-xos_FOUND})
    message("Found xOS ${rcar-xos_VERSION}")
    endif()

    cmake_policy(SET CMP0075 NEW)

    include(CheckSymbolExists)
    include(CMakePushCheckState)
    include(CheckIncludeFile)

    set(CMAKE_CXX_STANDARD 17)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)

    add_definitions("-DXOS_VERSION_${rcar-xos_VERSION_MAJOR}_${rcar-xos_VERSION_MINOR}_${rcar-xos_VERSION_PATCH}")

    STRING(TOUPPER "${RCAR_SOC}" RCAR_SOC_LOCAL)
    add_definitions("-DRCAR_SOC_${RCAR_SOC_LOCAL}")
    add_definitions("-DRCAR_SOC=${RCAR_SOC_LOCAL}")
    STRING(TOUPPER "${RCAR_XIL}" RCAR_XIL_LOCAL)
    add_definitions("-DRCAR_XIL_${RCAR_XIL_LOCAL}")
    add_definitions("-DRCAR_XIL=${RCAR_XIL_LOCAL}")
    STRING(TOUPPER "${RCAR_UT}" RCAR_UT_LOCAL)
    add_definitions("-DRCAR_UT_${RCAR_UT_LOCAL}")
    add_definitions("-DRCAR_UT=${RCAR_UT_LOCAL}")

    add_definitions("-DRCAR_SOC_${RCAR_SOC_CLASS}${RCAR_SOC_GEN}${RCAR_SOC_LEVEL}${RCAR_SOC_VERSION_MAJOR}${RCAR_SOC_VERSION_MINOR}")
    add_definitions("-DRCAR_SOC_${RCAR_SOC_CLASS}${RCAR_SOC_GEN}${RCAR_SOC_LEVEL}${RCAR_SOC_VERSION_MAJOR}")

    set(CLUSTER_OPEN_SOURCE_ROOT_DIR ${RCAR_TOOL_DIR}/ref_app_oss)
    message("CLUSTER_OPEN_SOURCE_ROOT_DIR: ${CLUSTER_OPEN_SOURCE_ROOT_DIR}")

    if((RCAR_XIL STREQUAL "hil") OR (RCAR_XIL STREQUAL spils))
    set(cluster_lib_format aarch64)
    else()
        set(cluster_lib_format x86_64)
    endif()

    set(RESOURCE_DIR 
        "${CMAKE_CURRENT_SOURCE_DIR}/application/res"
    )

    if(RCAR_SOC STREQUAL "v4h2")
        file(COPY ${RESOURCE_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
        add_compile_definitions(X86=0)
        add_compile_definitions(WAYLAND=0)
    elseif(RCAR_SOC STREQUAL "x5h")
        add_compile_definitions(X86=1)
        add_compile_definitions(WAYLAND=0)
    endif()

    # OpenCV required
    #find_package(OpenCV REQUIRED)
    find_package(Freetype)
    find_package(OpenGL)
    #include_directories(${OpenCV_INCLUDE_DIRS} )
    include_directories( ${OpenGL_INCLUDE_DIRS} )
    include_directories( ${OPENGL_EGL_INCLUDE_DIRS} )
    include_directories( ${FREETYPE_INCLUDE_DIRS} )

    #set(GTEST_ENABLED 1)

    #----------------------------------------------------------------------------------------------------------------------
    # Source files
    #----------------------------------------------------------------------------------------------------------------------
    if(RCAR_UT STREQUAL "ENABLE")
        set(source
        "${CMAKE_CURRENT_SOURCE_DIR}/test/test_main.cpp"
        "${CMAKE_CURRENT_SOURCE_DIR}/test/sysConfigureFnTest.cpp"
        "${CMAKE_CURRENT_SOURCE_DIR}/test/mockEnv/cluster_mock.cpp"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/sysConfigure.cpp"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/sysCpuLoad.cpp"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/cpuload.cpp"
        )
    else()
        set(source
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/main.cpp"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/sysConfigure.cpp"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/sysCpuLoad.cpp"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/cpuload.cpp"
        )
    endif()   

    #----------------------------------------------------------------------------------------------------------------------
    # Header files of the application
    #----------------------------------------------------------------------------------------------------------------------
    if(RCAR_UT STREQUAL "ENABLE")
        set(header
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/stb_image.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/sysConfigure.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/sysCpuLoad.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/cpuload.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/appInfo.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/common.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/test/include/sysConfigureFnTest.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/test/mockEnv/include/cluster_mock.h"
        )
    else()
        set(header
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/stb_image.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/sysConfigure.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/sysCpuLoad.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/cpuload.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/appInfo.h"
        "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/common.h"
        )
    endif()

    if(RCAR_UT STREQUAL "ENABLE")
        add_compile_definitions(TEST_ENABLED=1)
        # Set compiler flags for coverage analysis
        set(CMAKE_CXX_FLAGS “–coverage”)
        set(CMAKE_EXE_LINKER_FLAGS “–coverage”)
    endif() 

    if(RCAR_SOC STREQUAL "x5h")
        set(LINUX_X86_INC "/usr/include/")
        set(FREE_TYPE_INC "${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/freetype2;\
                ${CMAKE_CURRENT_SOURCE_DIR}/application/src/include/libpng16")
        set(GL_LIBRARY "/usr/lib/x86_64-linux-gnu/libGL.so")
        set(GLFW_LIBRARY "/usr/lib/x86_64-linux-gnu/libglfw.so")
        set(GLEW_LIBRARY "/usr/lib/x86_64-linux-gnu/libGLEW.so")
        set(GLU_LIBRARY "/usr/lib/x86_64-linux-gnu/libGLU.so")
        set(LINUX_X86_LOCAL_LIB "/usr/local/lib/")
    endif()

    #----------------------------------------------------------------------------------------------------------------------
    # Include directories used by the application
    #----------------------------------------------------------------------------------------------------------------------
    if(NOT GTEST_ENABLED)

        set(include_dir
        ${CMAKE_CURRENT_BINARY_DIR}
        ${CMAKE_HEADER_OUTPUT_DIRECTORY}
        ${app_nameINCLUDE_DIRS}
        ${SDKROOT}/sysroots/aarch64-poky-linux/usr/include/libdrm
        ${SDKROOT}/sysroots/aarch64-poky-linux/usr/include/drm
        ${SDKROOT}/sysroots/aarch64-poky-linux/usr/include/freetype2
        ${SDKROOT}/sysroots/aarch64-poky-linux/usr/src/debug/libdrm/2.4.101-r0/libdrm-2.4.101
        if(RCAR_SOC STREQUAL "x5h")
       		${FREE_TYPE_INC}
    		${LINUX_X86_INC}/EGL/
    	endif()
        )
    else()
        list(APPEND include_dir
            ${CMAKE_CURRENT_SOURCE_DIR}/test/mockEnv/include/
            ${CMAKE_CURRENT_SOURCE_DIR}/test/include/
        )
    endif()

    if(SUPPORT_BCL_FORMAT)
        add_compile_definitions(SUPPORT_BCL_FORMAT)
    endif()
    if(USE_IMPDRV)
        add_compile_definitions(USE_IMPDRV)
    endif()

    if(RCAR_SOC STREQUAL "v3u")
        add_compile_definitions(DRV_ARCH_RCAR_V3U)
        add_compile_definitions(DRV_ARCH_RCAR_V3U1)
    elseif(RCAR_SOC STREQUAL "v3h2")
        add_compile_definitions(DRV_ARCH_RCAR_V3H2)
    elseif(RCAR_SOC STREQUAL "v4h2")
        add_compile_definitions(DRV_ARCH_RCAR_V4H)
    endif()

    if(RCAR_SOC STREQUAL "v3h2")
        STRING(TOUPPER "${RCAR_SOC}" RCAR_SOC_LOCAL)

        add_compile_definitions("DRV_ARCH_RCAR_${RCAR_SOC_LOCAL}")
        add_definitions("-DRCAR_${RCAR_SOC_LOCAL}")

        # for CNN toolchain
        add_definitions("-DRCAR_SOC_${RCAR_SOC_LOCAL}")
        add_definitions("-DRCAR_SOC=${RCAR_SOC_LOCAL}")

        # MAX_MODULE definiton for IMR related logic
        add_compile_definitions(MAX_MODULE=5)
    elseif(RCAR_SOC STREQUAL "v3u")
        add_definitions(-DRCAR_V3U)
        add_compile_definitions(MAX_MODULE=6)
    elseif(RCAR_SOC STREQUAL "v3h1")
        add_definitions(-DRCAR_V3H1)
        add_compile_definitions(MAX_MODULE=6)
    elseif(RCAR_SOC STREQUAL "v3m2")
        add_definitions(-DRCAR_V3M2)
        add_compile_definitions(MAX_MODULE=4)
    elseif(RCAR_SOC STREQUAL "v4h")
        add_definitions(-DRCAR_V4H)
        add_compile_definitions(MAX_MODULE=5)
    elseif(RCAR_SOC STREQUAL "v4h2")
        add_definitions(-DRCAR_V4H2)
        add_compile_definitions(MAX_MODULE=5)
    endif()

    if(RCAR_TARGET_OS STREQUAL "linux")
        if (CMAKE_C_COMPILER MATCHES "armclang")
            add_compile_definitions(__linux__=1)
        endif()
    endif()

    if(RCAR_TARGET_OS STREQUAL "windows")
        set(triplet x86_64-w64-mingw32)
        add_compile_definitions(RCAR_ENV_TARGET_SIL)
    elseif(RCAR_TARGET_OS STREQUAL "linux" AND
        CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
        set(triplet x86_64-linux-gnu)
        add_compile_definitions(_POSIX_C_SOURCE=199309L)
        add_compile_definitions(RCAR_ENV_TARGET_SIL)
    else()
        set(triplet ${TRIPLE})
    endif()
    #----------------------------------------------------------------------------------------------------------------------
    # Link libraries and Link directories used by the application
    #----------------------------------------------------------------------------------------------------------------------
    if(RCAR_SOC STREQUAL "v4h2")
        set(link_lib
            #atmlib
            # This sample does not need any other sw compoents
            # Examples could be: osal, osal_wrapper
            EGL
            GLESv2
            osal
            #rvx_target
            drm
            util
            imr
            imrdlg
            m
            ${OPENGL_LIBRARIES}
            ${OPENGL_egl_LIBRARIES}
            ${OpenCV_LIBS}
            dl
            freetype
            #adas_ref_fwk
        )
    elseif(RCAR_SOC STREQUAL "x5h")
        set(link_lib
            EGL
            GLESv2
            ${OPENGL_LIBRARIES}
            ${OPENGL_egl_LIBRARIES}
            ${OpenCV_LIBS}
            ${OpenCV_LIBS}
            ${GL_LIBRARY}
            ${GLFW_LIBRARY}
            ${GLEW_LIBRARY}
            ${GLU_LIBRARY}
            ${LINUX_X86_LOCAL_LIB}
            freetype
            gtest_main
            gmock_main
        )
        if (RCAR_XIL STREQUAL "spils" OR RCAR_XIL STREQUAL "spils2")
            list(APPEND link_lib
            vipdrv
            dof_conf
        )
        endif()
    endif()

    find_library(WL_LIB wayland-client)
    if (WL_LIB)
        message("wayland_lib")
        list(APPEND link_lib
            wayland-egl
            wayland-client
            )
    endif()

    if((RCAR_SOC STREQUAL "v3u") OR (RCAR_SOC STREQUAL "v4h") OR (RCAR_SOC STREQUAL "v4h2"))
        list(APPEND link_lib
            vspx
        )
    endif()
    # [optional] for 3rd Party libraries

    set(link_dir
    # Additional Link Directories for 3rd party libraries
    ${CLUSTER_OPEN_SOURCE_ROOT_DIR}/bin/${cluster_lib_format}/freetype/usr/lib/

)

#------------------------------------------------------ GTEST Frame Work ------------------------------------------#
include(FetchContent)
FetchContent_Declare(
    googletest
    GIT_CONFIG "http.sslVerify=false"
    GIT_REPOSITORY https://github.com/google/googletest.git
    GIT_TAG        release-1.10.0
)
set(googletest_BUILD_GMOCK TRUE)
set(BUILD_GMOCK TRUE)
set(googletest_gtest_force_shared_crt ON)
set(gtest_force_shared_crt ON)

FetchContent_MakeAvailable(googletest)

FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
    FetchContent_Populate(googletest)
    add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
endif()

if(RCAR_SOC STREQUAL "x5h")
    # on x5h the googletest requires the extensions to be enabled to compile. Enable them only for the targets
    set_target_properties(gtest gmock gtest_main gmock_main PROPERTIES CXX_EXTENSIONS ON)
    set(CMAKE_CXX_EXTENSIONS ON)
endif()
#---------------------------------------------------------------------------------------------------------------------#

    #----------------------------------------------------------------------------------------------------------------------
    # Set document file list
    # If not set, it will search for document in ${CMAKE_CURRENT_SOURCE_DIR}/doc by default
    #----------------------------------------------------------------------------------------------------------------------


    #----------------------------------------------------------------------------------------------------------------------
    # [Optional] Any specifics that an application may require, like OS specifics, SoC specifics
    #----------------------------------------------------------------------------------------------------------------------

    # Example for enabling OSAL for certain environments
    if(RCAR_TARGET_OS STREQUAL "baremetal" )
        list(APPEND link_lib
            startup         # In baremetal environments the application requires at least startup code defined for xOS
        )
    else() # Any other Target OS
        list(APPEND link_lib
            osal            # This application makes use of the OSAL API
            osal_wrapper    # The application also needs the implementation of the OSAL API to link.
        )
    endif()

    if(RCAR_XIL STREQUAL "hil")
            list(APPEND link_lib
                osal_configuration
            )
    endif()

    # Linker dependencies for baremetal/freertos environments
    if (CMAKE_LINKER MATCHES "armlink")
        set(linker_script "${CMAKE_CURRENT_SOURCE_DIR}/application/lscript.scat")
    endif()

    #----------------------------------------------------------------------------------------------------------------------
    # Doxygen document setting
    #----------------------------------------------------------------------------------------------------------------------
    set(api_doc "NO")

    # API doc JSON file location (if not set, use default location ${source_dir}/doc/doxygen/doc_properties.json)
    set(api_doc_json "")

    # Set to ON to add SoC suffix to document file name
    set(api_doc_soc_depend OFF)

    # List of module to combine API document, input headers are their public headers
    set(doxygen_combine_module
    )

    # Decide to enable or disable doxygen for private_header, source code (default FALSE)
    set(doxygen_enable_for_source "FALSE")

    # List of patterns which you don't want to document in official release
    set(doxygen_exclude_pattern
    )

    # Set the image folder location on Artifactory to insert to document
    set(doxygen_image_remote_path
        "path/to/image/remote/folder"
    )

    # Enable release note automation generation (default NO)
    set(release_note "YES")

    # Release note PDF file name (if not set, use default file name ${module}_ReleaseNote)
    set(release_note_file_name "R-CarV4H2_SurroundView_ref_app_ReleaseNote")

    # Release note JSON file location (if not set, use default location ${source_dir}/doc/release_note/release_note.json)
    set(release_note_json "")

    #----------------------------------------------------------------------------------------------------------------------
    # Test settings, e.g. which and how to run the tests for this application
    #----------------------------------------------------------------------------------------------------------------------
    set(test_run_time_test_config_file
        # Set this test variable if you want to select the device/os dependent runtime test data config file
        # If not set. The default config (run_time_test_data.json) will be used
        ${CMAKE_CURRENT_SOURCE_DIR}/run_time_test_data_${RCAR_SOC}.json
    )
    set(test_args_config_file
        # Set this test variable if you want to select the device dependent test args config file
        # If not set. The default config (test_args.json) will be used for application test.
        ${CMAKE_CURRENT_SOURCE_DIR}/test_args_${RCAR_SOC}.json
    )

    #----------------------------------------------------------------------------------------------------------------------
    # Test settings, e.g. which and how to run the tests for this application
    #----------------------------------------------------------------------------------------------------------------------
    set(test_arg
        "--help"
    )

    # set(test_pretest_cmd
    #     "export PATH=$PATH:/sbin"
    #     "rmmod cmemdrv &> /dev/null"
    #     "modprobe cmemdrv bsize=0x1d000000"
    # )

    #======================================================================================================================
    # Set runtime test data
    #======================================================================================================================
    #set(test_run_time_test_config_file ${CMAKE_CURRENT_SOURCE_DIR}/run_time_test_data_${RCAR_SOC}_${RCAR_TARGET_OS}.json)

    #======================================================================================================================
    # Set test output file
    #======================================================================================================================
    set(test_output
        #/ci_test/Output_Buffer.tar.xz
        #final_s_memory_5.csv
        #final_s_memory_1.csv
    )
    #======================================================================================================================
    # Set test_use_shared_library
    #======================================================================================================================
    # Set this variable for using shared library when executing the test

    set(test_end_pattern
    # Only for X5H
    # Set this variable to help Zephyr OS test knows when the application is completed
    # When the log matches this pattern, R-Car Env test script will stop and turn off the board
    # E.g:
    # set(test_end_pattern "<APP_END>")
    # set(test_end_pattern "<Finish running app>")
    "================== opengl_cluster_sample_app finish =================="
)
    set(test_use_shared_library YES)
    #======================================================================================================================
    # DO NOT CHANGE ANYTHING BELOW THIS LINE, except you know what to do ;)
    #======================================================================================================================
    rcar_configure_application()

    # This app include public header from protobuf which produce error, we disable warning for this app

    target_compile_options(${app_name} PRIVATE -w -fpermissive -g)
    #endif()

endif()