Browse Source

修改cmakelist、dockerfile

master
Your Name 3 years ago
parent
commit
0d9ddf5339
  1. 43
      CMakeLists.txt
  2. 5
      docker/Dockerfile.satellite
  3. BIN
      lib/libmodels.so
  4. 19
      modules/CMakeLists.txt

43
CMakeLists.txt

@ -2,7 +2,6 @@ if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "Please create a separate directory for build files.") message(FATAL_ERROR "Please create a separate directory for build files.")
endif() endif()
cmake_minimum_required(VERSION 3.6) cmake_minimum_required(VERSION 3.6)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@ -20,47 +19,6 @@ endif()
set(ENABLE_MYSQL ON CACHE BOOL "enable mysql") set(ENABLE_MYSQL ON CACHE BOOL "enable mysql")
##OpenCV
if(WITH_OPENCV)
if(CMAKE_TOOLCHAIN_FILE)
if(EXISTS ${PROJECT_SOURCE_DIR}/include/opencv)
set(OpenCV_LIBS opencv_core opencv_imgproc opencv_highgui opencv_features2d opencv_flann)
if(EXISTS ${PROJECT_SOURCE_DIR}/include/opencv2/imgcodecs)
list(APPEND OpenCV_LIBS opencv_imgcodecs)
endif()
if(EXISTS ${PROJECT_SOURCE_DIR}/include/opencv2/videoio)
list(APPEND OpenCV_LIBS opencv_videoio)
endif()
message(STATUS "HAVE_OPENCV enabled")
message(STATUS "opencv libraries: ${OpenCV_LIBS}")
set(HAVE_OPENCV true)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_OPENCV")
else()
set (HAVE_OPENCV false)
endif()
else()
set(OpenCV_FIND_QUIETLY true)
#find_package(OpenCV REQUIRED) //this will include opencv_ts which result in crash on centos
find_package(OpenCV OPTIONAL_COMPONENTS imgcodecs)
find_package(OpenCV OPTIONAL_COMPONENTS videoio)
set(optional_opencv_libs ${OpenCV_LIBS})
find_package(OpenCV REQUIRED core imgproc highgui features2d)
if(OpenCV_FOUND)
if(imgcodecs_FOUND)
list(APPEND OpenCV_LIBS optional_opencv_libs)
endif()
message(STATUS "HAVE_OPENCV enabled")
message(STATUS "opencv libraries: ${OpenCV_LIBS}")
set(HAVE_OPENCV true)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_OPENCV")
else()
set (HAVE_OPENCV false)
endif()
endif()
else()
set (HAVE_OPENCV false)
endif()
#mysql #mysql
find_package(MYSQL QUIET) find_package(MYSQL QUIET)
if(MYSQL_FOUND AND ENABLE_MYSQL) if(MYSQL_FOUND AND ENABLE_MYSQL)
@ -78,7 +36,6 @@ include_directories(${PROJECT_SOURCE_DIR}/modules/dataType/include/)
include_directories(${PROJECT_SOURCE_DIR}/modules/Disposition/include/) include_directories(${PROJECT_SOURCE_DIR}/modules/Disposition/include/)
include_directories(${PROJECT_SOURCE_DIR}/modules/TcpProxySession/include/) include_directories(${PROJECT_SOURCE_DIR}/modules/TcpProxySession/include/)
# #
aux_source_directory(./source/src DIR_SRCS) aux_source_directory(./source/src DIR_SRCS)

5
docker/Dockerfile.satellite

@ -2,7 +2,6 @@ FROM ubuntu:16.04
MAINTAINER <lishengyin, 1348640163@qq.com> MAINTAINER <lishengyin, 1348640163@qq.com>
ARG with_satellite_code=yes ARG with_satellite_code=yes
RUN apt-get update && \ RUN apt-get update && \
@ -17,15 +16,13 @@ RUN apt-get update && \
# 拷贝文件 # 拷贝文件
COPY ./3rdparty/ZLToolKit.tar.gz /root COPY ./3rdparty/ZLToolKit.tar.gz /root
COPY ./3rdparty/opencv.tar.gz /root
COPY ./3rdparty/kafka.tar.gz /root
# install zltoolkit # install zltoolkit
RUN cd /root/ && tar -zxvf ZLToolKit.tar.gz RUN cd /root/ && tar -zxvf ZLToolKit.tar.gz
RUN cp -rf /root/ZLToolKit/lib/* /usr/lib/ RUN cp -rf /root/ZLToolKit/lib/* /usr/lib/
RUN cp -rf /root/ZLToolKit/include/* /usr/include/ RUN cp -rf /root/ZLToolKit/include/* /usr/include/
RUN if [ "$with_cnstream_code" = "yes" ]; then \ RUN if [ "$with_satellite_code" = "yes" ]; then \
cd /root && git clone http://120.79.157.137:80/lishengyin/Satellite.git Satellite && \ cd /root && git clone http://120.79.157.137:80/lishengyin/Satellite.git Satellite && \
cd /root/Satellite && mkdir build && cd build &&\ cd /root/Satellite && mkdir build && cd build &&\
cmake ..&& make -j; \ cmake ..&& make -j; \

BIN
lib/libmodels.so

Binary file not shown.

19
modules/CMakeLists.txt

@ -34,25 +34,6 @@ set(DEPENDENCIES "")
set(CMAKE_MODULE_PATH ${CNSTREAM_ROOT_DIR}/cmake) set(CMAKE_MODULE_PATH ${CNSTREAM_ROOT_DIR}/cmake)
# ---[ opencv
set(OpenCV_FIND_QUIETLY true)
#find_package(OpenCV REQUIRED) //this will include opencv_ts which result in crash on centos
find_package(OpenCV OPTIONAL_COMPONENTS imgcodecs)
find_package(OpenCV OPTIONAL_COMPONENTS videoio)
set(optional_opencv_libs ${OpenCV_LIBS})
find_package(OpenCV REQUIRED core imgproc highgui features2d)
if(OpenCV_FOUND)
if(imgcodecs_FOUND)
list(APPEND OpenCV_LIBS optional_opencv_libs)
endif()
include_directories(${OpenCV_INCLUDE_DIRS})
list(APPEND 3RDPARTY_LIBS ${OpenCV_LIBS})
message(STATUS "opencv include: ${OpenCV_INCLUDE_DIRS}")
message(STATUS "opencv libraries: ${OpenCV_LIBS}")
else()
message(FATAL_ERROR "opencv not found!")
endif()
find_package(MYSQL QUIET) find_package(MYSQL QUIET)
if(MYSQL_FOUND AND ENABLE_MYSQL) if(MYSQL_FOUND AND ENABLE_MYSQL)
message(STATUS "找到mysqlclient库:\"${MYSQL_INCLUDE_DIR}\",ENABLE_MYSQL宏已打开") message(STATUS "找到mysqlclient库:\"${MYSQL_INCLUDE_DIR}\",ENABLE_MYSQL宏已打开")

Loading…
Cancel
Save