123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- cmake_minimum_required(VERSION 3.5)
- set(CMAKE_CXX_STANDARD 11)
- project(MIVA C CXX)
- set(CMAKE_BUILD_TYPE Debug)
- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
- set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/source/bin/)
- option(build_inference "build module inference" ON)
- option(build_inifile "build module inifile" ON)
- option(build_HttpClient "build module HttpClient" ON)
- option(build_md5 "build module md5" ON)
- option(build_userApp "build module userApp" ON)
- option(build_TCPClient "build module TCPClient" ON)
- option(build_recorder "build module recorder" ON)
- option(build_Cleaner "build modele Cleaner" ON)
- option(build_monitor "build modele monitor" ON)
- option(build_deviceState "build modele deviceState" ON)
- option(build_Manager "build modele Manager" ON)
- option(build_Shell "build modele Shell" ON)
- option(WITH_FFMPEG "with ffmpeg" OFF)
- option(WITH_OPENCV "with opencv" ON)
- set(ENABLE_MYSQL ON CACHE BOOL "enable mysql")
- find_package(MYSQL QUIET)
- if(MYSQL_FOUND AND ENABLE_MYSQL)
- message(STATUS "找到mysqlclient库:\"${MYSQL_INCLUDE_DIR}\",ENABLE_MYSQL宏已打开")
- include_directories(${MYSQL_INCLUDE_DIR})
- include_directories(${MYSQL_INCLUDE_DIR}/mysql)
- add_definitions(-DENABLE_MYSQL)
- list(APPEND 3RDPARTY_LIBS ${MYSQL_LIBRARIES})
- endif()
- add_subdirectory(framework)
- if(CMAKE_TOOLCHAIN_FILE)
- set(GFLAGS_LIBRARIES gflags)
- else()
- include("${PROJECT_SOURCE_DIR}/cmake/FindGFlags.cmake")
- endif()
- list(APPEND 3RDPARTY_INCLUDE_DIRS ${GFLAGS_INCLUDE_DIRS})
- list(APPEND 3RDPARTY_LIBS ${GFLAGS_LIBRARIES})
- if(CMAKE_TOOLCHAIN_FILE)
- set(GLOG_LIBRARIES glog)
- else()
- include("${PROJECT_SOURCE_DIR}/cmake/FindGlog.cmake")
- endif()
- list(APPEND 3RDPARTY_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS})
- list(APPEND 3RDPARTY_LIBS ${GLOG_LIBRARIES})
- set(ENV{OpenCV_DIR} "/usr/local")
- find_package(OpenCV REQUIRED)
- include_directories(include ${OpenCV_INCLUDE_DIRS})
- include_directories(${PROJECT_SOURCE_DIR}/3rdparty/rapidjson/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/inference/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/decoder/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/userApp/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/md5/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/inifile/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/TCPClient/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/dataType/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/HttpClient/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/recorder/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/Cleaner/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/monitor/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/deviceState/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/Manager/include/)
- include_directories(${PROJECT_SOURCE_DIR}/modules/Shell/include/)
- include_directories(${PROJECT_SOURCE_DIR}/framework/request/include/)
- include_directories(/usr/include/gstreamer-1.0)
- include_directories(/usr/include/glib-2.0/)
- include_directories(/usr/lib/aarch64-linux-gnu/glib-2.0/include)
- include_directories(/opt/nvidia/deepstream/deepstream/sources/includes/)
- include_directories(/usr/local/cuda-10.2/include/)
- aux_source_directory(./source/src DIR_SRCS)
- add_compile_options(-Wall -std=c++11 -O2 -g -DPLATFORM_TEGRA)
- link_directories(${PROJECT_SOURCE_DIR}/lib)
- link_directories(/opt/nvidia/deepstream/deepstream/lib/)
- list(APPEND Source_LINKER_LIBS ZLToolKit dl ${3RDPARTY_LIBS} ${OpenCV_LIBS} ${FFMPEG_LIBRARIES} pthread miva_core)
- list(APPEND ALL_LINKER_LIBS gstreamer-1.0 gobject-2.0 glib-2.0 nvdsgst_meta nvds_meta nvdsgst_helper nvbufsurface m ${Source_LINKER_LIBS})
- add_subdirectory(${PROJECT_SOURCE_DIR}/modules)
- add_executable(main ${DIR_SRCS})
- target_link_libraries(main ${ALL_LINKER_LIBS} modules)
|