CMakeLists.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. cmake_minimum_required(VERSION 2.8.7)
  2. if(POLICY CMP0046)
  3. cmake_policy(SET CMP0046 NEW)
  4. endif()
  5. if(POLICY CMP0054)
  6. cmake_policy(SET CMP0054 NEW)
  7. endif()
  8. # compile flags
  9. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O2")
  10. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -g")
  11. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_REENTRANT -fPIC -Wno-deprecated-declarations -Wall -Werror")
  12. set(CNSTREAM_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
  13. set(CNSTREAM_TOOLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../)
  14. set(EXECUTABLE_OUTPUT_PATH ${CNSTREAM_TOOLS_DIR}/bin)
  15. # ---[ Google-gflags
  16. include(${CNSTREAM_ROOT_DIR}/cmake/FindGFlags.cmake)
  17. include_directories(${GFLAGS_INCLUDE_DIRS})
  18. set(CMAKE_MODULE_PATH ${CNSTREAM_ROOT_DIR}/cmake)
  19. # ---[ neuware
  20. find_package(Neuware)
  21. include_directories(${NEUWARE_INCLUDE_DIR})
  22. # ---[ easydk
  23. include(${CNSTREAM_ROOT_DIR}/cmake/have_cnstream_target.cmake)
  24. have_easydk_target(${CNSTREAM_ROOT_DIR})
  25. set(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed")
  26. add_executable(get_model_io get_model_io.cpp)
  27. if(HAVE_EASYDK_TARGET)
  28. add_dependencies(get_model_io easydk)
  29. endif()
  30. target_link_libraries(get_model_io easydk ${CNCODEC_LIBS} ${CNRT_LIBS} ${GFLAGS_LIBRARIES} pthread dl)