当前位置: 首页 > news >正文

cmakelists例子

cmake例子

项目特定的逻辑。

cmake_minimum_required (VERSION 3.8)

project (“c_Plus_Plus”)

----------------------------------add opencv lib----------------------------------

find_package(OpenCV)

If the package has been found, several variables will

be set, you can find the full list with descriptions

in the OpenCVConfig.cmake file.

Print some message showing some of them

message(STATUS “OpenCV library status:”)
message(STATUS " version: ${OpenCV_VERSION}“)
message(STATUS " libraries: ${OpenCV_LIBS}”)
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")

Add OpenCV headers location to your include paths

include_directories(${OpenCV_INCLUDE_DIRS})

----------------------------------add opencv lib----------------------------------

set(BUILD_LIBS 0) # 是否编译出库文件
set(LINUX 1)
add_definitions(-DLINUX)

add_compile_options(-pg)

MESSAGE(STATUS “work in linux”)

include_directories(
KaTeX parse error: Expected 'EOF', got '#' at position 38: …DIR}/include" #̲"{CMAKE_CURRENT_SOURCE_DIR}/bin/linux/include”
“${OpenCV_INCLUDE_DIRS}”

)

link_directories(
KaTeX parse error: Expected 'EOF', got '#' at position 37: …_DIR}/libs/" ) #̲MESSAGE(STATUS …{CMAKE_CURRENT_SOURCE_DIR}”)

aux_source_directory(“${CMAKE_CURRENT_SOURCE_DIR}/src/” DIR_SRCS)

MESSAGE(STATUS “src:${DIR_SRCS}”)

将源代码添加到此项目的可执行文件。

add_executable (${PROJECT_NAME} ${DIR_SRCS})

target_link_libraries( P R O J E C T N A M E p t h r e a d ) t a r g e t l i n k l i b r a r i e s ( {PROJECT_NAME} pthread) target_link_libraries( PROJECTNAMEpthread)targetlinklibraries({PROJECT_NAME} ${OpenCV_LIBS} ${CMAKE_CURRENT_SOURCE_DIR}/bin/lib/*.a)

if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET fc_Plus_Plus PROPERTY CXX_STANDARD 20)
endif()

SET(CMAKE_INSTALL_PREFIX “${CMAKE_CURRENT_SOURCE_DIR}/bin/linux/”)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX})

#/bin/linux/${CMAKE_SYSTEM_PROCESSOR})

相关文章:

  • 手机上的网站是怎么做的/广州优化网站排名
  • 男女直接做那个的视频网站/怎么进行推广
  • 票务网站做酒店推荐的目的/万网域名查询
  • 网站建设价格标准报价/免费域名申请网站大全
  • 网站建设项目经理/我想做地推怎么找渠道
  • 个人建设网站制作/三亚网络推广
  • ES6学习笔记之箭头函数
  • d的更好C关闭ctfe的dup
  • 当青训营遇上码上掘金之主题四-攒青豆
  • javaEE 初阶 — 文件内容的读写
  • Linux chattr命令
  • #9文献学习--基于元强化学习的边缘计算快速自适应任务卸载
  • 一篇文章带你学完JavaScript基础知识,超全的JavaScript知识点总结
  • react受控组件和非受控组件区别
  • 拐点检测常用算法总结
  • YonBuilder 应用构建教程之移动端扩展
  • 文本处理工具
  • Virtualbox设置固定IP