zoukankan      html  css  js  c++  java
  • Cmake 命令总结

    
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_CXX_FLAGS "-std=c++11")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}")
    set(CMAKE_BUILD_TYPE "Release")
    
    //找库
    find_package( OpenCV REQUIRED)
    include_directories( 
    ${OpenCV_INCLUDE_DIRS}
    )
    target_link_libraries(${PROJECT_NAME}
    ${OpenCV_LIBS}
    )
    
    //可执行文件
    add_executable(SuperPointPretrainC++ SuperPointPretrainC++.cpp)
    target_link_libraries(SuperPointPretrainC++ ${PROJECT_NAME})
    target_link_libraries(SuperPointPretrainC++ "${TORCH_LIBRARIES}")
    target_link_libraries(SuperPointPretrainC++ ${OpenCV_LIBS})
    //为可执行文件添加动态链接库
    FILE(GLOB_RECURSE shareObject /usr/local/lib/superpoint_share_lib/* )
    target_link_libraries(SuperPointPretrainC++ ${shareObject})
    //为可执行文件添加静态库
    target_link_libraries(SuperPointPretrainC++ "${CMAKE_CURRENT_SOURCE_DIR}/lib/libcaculateDistance.a")
    //输出信息
    MESSAGE( STATUS "this var key = ${shareObject}.")
    //打包静态库文件
    add_library(${PROJECT_NAME}
    src/SPextractor.cc
    src/SuperPoint.cc
    src/SuperPointMatch.cc
    )
    target_link_libraries(${PROJECT_NAME}
    ${TORCH_LIBRARIES}
    ${OpenCV_LIBS}
    ${EIGEN3_LIBS}
    )
    
    //解析src文件夹内容,添加到变量SRC_LIST中
    aux_source_directory(./src SRC_LIST)
    
  • 相关阅读:
    jsp页面a标签URL转码问题
    函数的真面目实例
    野指针和内存操作实例
    redhat安装VMware tools的方法
    线索化二叉树实例
    遍历二叉树实例
    创建二叉树实例
    树的存储结构实例
    树的定义实例
    HBase基础和伪分布式安装配置
  • 原文地址:https://www.cnblogs.com/jiajiewu/p/13692568.html
Copyright © 2011-2022 走看看