zoukankan      html  css  js  c++  java
  • C++--------------------->>>>>>cmakelist的编写

    CMAKE_MINIMUM_REQUIRED(VERSION 2.6) #cmake 最低版本要求,低于2.6 构建过程会被终止。
    PROJECT(Algorithms) #定义工程名称
    MESSAGE(STATUS "Project: Algorithms") #打印相关消息消息
    MESSAGE(STATUS "Project Directory: ${PROJECT_SOURCE_DIR}")
    SET(CMAKE_BUILD_TYPE "Debug")
    SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
    SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
    add_definitions(-DCPU_ONLY)
    add_definitions(-DUSE_OPENCV)
    add_definitions(-DUSE_CAFFE)

    add_compile_options(-std=c++11)
    ADD_SUBDIRECTORY(src) #添加子目录
    INCLUDE_DIRECTORIES( #相关头文件的目录
    /usr/include
    ${PROJECT_SOURCE_DIR}/include
    ${PROJECT_SOURCE_DIR}/include/parameter
    ${PROJECT_SOURCE_DIR}/include/result
    ${PROJECT_SOURCE_DIR}/include/features
    ${PROJECT_SOURCE_DIR}/include/glog
    ${PROJECT_SOURCE_DIR}/include/json
    ${PROJECT_SOURCE_DIR}/include/OpenBLAS
    ${PROJECT_SOURCE_DIR}/include/utils
    )

    FIND_LIBRARY(RUNTIME_LIB caffe /usr/lib ${PROJECT_SOURCE_DIR}/lib /usr/local/lib NO_DEFAULT_PATH)
    MESSAGE(STATUS "find caffe ----reuslt --- : ${RUNTIME_LIB}")


    aux_source_directory(. SOURCE_FILES)

    ADD_EXECUTABLE(Algorithms ${SOURCE_FILES}) #shengchengwenjian

    LINK_DIRECTORIES( #相关库文件的目录
    ${PROJECT_SOURCE_DIR}/lib
    /usr/local/lib
    )
    TARGET_LINK_LIBRARIES(Algorithms
    protobuf
    algorithm
    gflags
    boost_filesystem
    m
    hdf5
    boost_system
    glog
    opencv_core
    opencv_highgui
    opencv_imgproc
    ${PROJECT_SOURCE_DIR}/lib/libcaffe.so
    pthread
    )

    SET_TARGET_PROPERTIES(Algorithms PROPERTIES #表示生成的执行文件所在路径
    RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

  • 相关阅读:
    一个人事工资模块
    Delete From 带 inner join
    打开SQL AnyWhere *.db数据库
    开启查询IO操作统计
    一个大数据量表访问优化联动下拉框查询优化
    一个简单的配置文件读取类
    MSSQL2005 双机热备说明
    数据库镜像
    GridView + ObjectDatasource 的一个范例代码
    往带自增长列的数据表中导数据
  • 原文地址:https://www.cnblogs.com/shuimuqingyang/p/14035387.html
Copyright © 2011-2022 走看看