cmake_minimum_required(VERSION 2.8)
project(run_get_output)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")

if (NOT DEPS_ROOT)
    set(DEPS_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../deps/x86)
endif ()
message(STATUS "DEPS_ROOT: ${DEPS_ROOT}")

if (NOT RELEASE_ROOT)
    set(RELEASE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../script_x86/)
endif ()
message(STATUS "RELEASE_ROOT: ${RELEASE_ROOT}")

set(RELEASE_LIB_DIR ${RELEASE_ROOT}/x86/lib/)
set(RELEASE_BIN_DIR ${RELEASE_ROOT}/x86/bin/)

include_directories(
        ${HOST_PACKAGE_DIR}/dnn_x86/include
        ${DEPS_ROOT}/glog/include
        ${DEPS_ROOT}/gflags/include
        ${DEPS_ROOT}/opencv/include)

link_directories(
        ${HOST_PACKAGE_DIR}/dnn_x86/lib
        ${DEPS_ROOT}/glog/lib
        ${DEPS_ROOT}/gflags/lib
        ${DEPS_ROOT}/opencv/lib
        )

SET(LINK_libs dnn hbdk_sim_x86 gflags glog opencv_world zlib dl rt pthread)

add_executable(run_get_output src/run_get_output.cc)
target_link_libraries(run_get_output ${LINK_libs})

install(TARGETS run_get_output DESTINATION ${RELEASE_BIN_DIR})

file(COPY ${HOST_PACKAGE_DIR}/dnn_x86/lib/libdnn.so DESTINATION ${RELEASE_LIB_DIR})
file(COPY ${DEPS_ROOT}/opencv/lib/libopencv_world.so.3.4 DESTINATION ${RELEASE_LIB_DIR})
file(COPY ${HOST_PACKAGE_DIR}/dnn_x86/lib/libhbdk_sim_x86.so DESTINATION ${RELEASE_LIB_DIR})
