CMakeLists.txt 实例
来源:互联网 发布:串行通讯c程序员指南 编辑:程序博客网 时间:2024/05/07 02:39
project(tool_calibrate)cmake_minimum_required(VERSION 2.6)set(CMAKE_C_COMPILER gcc)set(CMAKE_CXX_COMPILER g++)set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")set(TARGET "tool_train")#set(LIBS ${LIBS} "${PROJECT_SOURCE_DIR}/opencv_linux/lib")#message(STATUS "**************** 1111111 ")#message(STATUS ${PROJECT_SOURCE_DIR})#// 头文件路径include_directories("${PROJECT_SOURCE_DIR}")include_directories("${PROJECT_SOURCE_DIR}/opencv_linux/include")include_directories("${PROJECT_SOURCE_DIR}/tbb/include")#// 库文件路径link_directories("${PROJECT_SOURCE_DIR}/opencv_linux/lib")link_directories("${PROJECT_SOURCE_DIR}/tbb/lib/intel64/gcc4.1")#// 自动搜“.cpp .c .cxx”文件# 多个文件夹下要注意 aux_source_directory()的结果不能合为一个变量,建议写成两个aux_source_directory(./src SRC_FILE)aux_source_directory(./src2 SRC_FILE_2)message(STATUS "source file" ${SRC_FILE})message(STATUS "source file 2" ${SRC_FILE_2})add_executable(${TARGET} ${SRC_FILE} ${SRC_FILE_2})#// 链接库target_link_libraries(${TARGET} "opencv_core")target_link_libraries(${TARGET} "opencv_highgui")target_link_libraries(${TARGET} "opencv_features2d")target_link_libraries(${TARGET} "opencv_imgproc")target_link_libraries(${TARGET} "opencv_legacy")target_link_libraries(${TARGET} "opencv_ml") set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
检查是否链接了指定的库:<重要>
ldd ./bin/tool_train
1 0
- CMakeLists.txt 实例
- CMakeLists.txt 实例
- CMakelists.txt
- CMakeLists.txt
- CMakeLists.txt
- CMakeLists.txt
- CMakeLists.txt
- 以一个实例说明 CMakeLists.txt 文件的编写
- 以一个实例说明 CMakeLists.txt 文件的编写
- CMakeLists.txt的写法
- CMakeLists.txt文件写法
- CMakeLists.txt的写法
- CMakeLists.txt 编写
- ROS中的CMakeLists.txt
- CMakeLists.txt的写法
- xespeak CmakeLists.txt
- CMake Intro - CMakeLists.txt
- ROS中的CMakeLists.txt
- 替换系统类的函数实现
- mediaserver内存泄露分析
- Red5 1.0.6 整合到Web (1.0.2 ~ 1.0.7M4 通用)
- 蓝桥杯 算法提高 扶老奶奶过街
- android中dialog中的EditText无法弹出输入法对话框
- CMakeLists.txt 实例
- 如何做优化,UITabelView才能更加顺滑
- python 内部执行原理
- Java异常的理解
- Java项目中读取properties文件,以及六种获取路径的方法
- Sqlite3查询指定行数数据
- oracle这个语句是什么意思?SET DEFINE OFF;
- Android Studio使用百度语音合成是TTS时报错: ****.so文件找不到的有关问题
- 解决Eclipse建立Maven项目后无src/main/java资源文件夹的办法