c++-CMakeLists编译出错,如何使用?

问题描述

CMakeLists编译出错,如何使用?

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

project(kinect_capture)

set(FREENECT_DIR "c:/code/libfreenect")
set(FREENECT_BUILD_DIR "c:/code/libfreenect_build")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${FREENECT_DIR}/cmake_modules/")

#Boost
set(BOOST_ROOT "c:/code/boost_1_47_0")
set(BOOST_LIBRARYDIR "C:/code/boost_1_47_0/stage/lib")
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost COMPONENTS date_time)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${BOOST_LIBRARYDIR})

#VTK
#find_package(VTK)
#if(VTK_FOUND)

INCLUDE(${VTK_USE_FILE})

#endif() f

#PCL
#find_package(PCL 1.1 COMPONENTS common visualization)
#include_directories(${PCL_INCLUDE_DIRS})
#link_directories(${PCL_LIBRARY_DIRS})
#add_definitions(${PCL_DEFINITIONS})

#OpenCV
set(OpenCV_DIR "C:/code/OpenCV2.2/build")
find_package(OpenCV COMPONENTS filesystem)
include_directories(${OpenCV_INCLUDE_DIRS})
link_directories(${OpenCV_LIB_DIR})

#OpenGL
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${USB_INCLUDE_DIRS})
#include_directories("C:/code/glew-1.7.0/include")
#include_directories("C:/code/glew-1.7.0/lib")

#Glui
include_directories("C:/code/glui-2.35/src/include")
link_directories("c:/code/glui-2.35/src/msvc/lib")

#PTHREAD
set(THREADS_PTHREADS_INCLUDE_DIR "c:/code/pthreads-2-8-0/include")
set(THREADS_PTHREADS_WIN32_LIBRARY "c:/code/pthreads-2-8-0/lib/pthreadVC2.lib")
set(THREADS_USE_PTHREADS_WIN32 true)
find_package(Threads REQUIRED)
include_directories(${THREADS_PTHREADS_INCLUDE_DIR})

#USB
set(LIBUSB_1_INCLUDE_DIR "C:/code/libusb-1.2.5.0/include")
set(LIBUSB_1_LIBRARY "C:/code/libusb-1.2.5.0/lib/msvc/libusb.lib")
find_package(libusb-1.0 REQUIRED)
include_directories(${LIBUSB_1_INCLUDE_DIRS})
include_directories("${FREENECT_DIR}/platform/windows")
include_directories("${FREENECT_DIR}/platform/windows/libusb10emu")

#Freenect
include_directories("${FREENECT_DIR}/include")
#set(FREENECT_LIBRARY_DIR optimized "${FREENECT_BUILD_DIR}/lib/Release/" debug "${FREENECT_BUILD_DIR}/lib/Debug/")
set(FREENECT_LIBRARY_DIR "${FREENECT_BUILD_DIR}/lib/")
link_directories(${FREENECT_LIBRARY_DIR})
set(FREENECT_LIBRARIES "freenect.lib")

#Files
file(GLOB_RECURSE INCS "*.h")
set(SRCS
kinect_capture.cpp
kinect_capture_app.cpp
kinect_calibration.cpp
freenect_module.cpp
)

#Build
add_executable (kinect_capture ${SRCS} ${INCS})
target_link_libraries (kinect_capture ${FREENECT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${LIBUSB_1_LIBRARIES} ${OpenCV_LIBS} ${Boost_LIBRARIES})
#${PCL_LIBRARIES} ${VTK_LIBRARIES}

这是cmakelist的全部内容,#Boost,#VTK,#PCL,#OpenCV,#OpenGL,#Glui,#PTHREAD,#Freenect这些在电脑里都要有吗??

解决方案

这些都是定义的符号,在你的build文件定义

时间: 2024-11-16 00:55:47

c++-CMakeLists编译出错,如何使用?的相关文章

xcode-学习objective-c 基础教程遇到问题 例题03.06 word-length-3 编译出错

问题描述 学习objective-c 基础教程遇到问题 例题03.06 word-length-3 编译出错 #import int main(int argc, const char * argv[]) { FILE *wordFile = fopen ("/tmp/words.txt", "r"); char word[100]; while (fgets(*word,99,wordFile)) \这一行编译出现"Thread 1:EXC_BAD_AC

chromium nacl编译出错

问题描述 chromium nacl编译出错 FAILED: Command '........outDebuggensdkwin_x86pnacl_newlibbinpnacl-ar @c:usersadmini~1.??appdatalocaltemptmpz8nl6n' returned non-zero exit stat us 1 [4/14478] ACTION nacl_lib_newlib: buil... plib_3ee1b6ebff4793d51aee0961182f8cb

JAVA代码编译出错:找不到符号,求解答

问题描述 JAVA代码编译出错:找不到符号,求解答 源代码: package com.tarena.shoot; import java.util.Random; //Airplane----敌机既是飞行物, public class Airplane extends FlyingObject implements Enemy{ private int speed = 2;//敌机走步的步数 public Airplane(){ image = ShootGame.airplane; width

java特殊符号的输入后编译出错

问题描述 java特殊符号的输入后编译出错 java编写代码每次到特殊符号如|都编译不出来 求大神教教我 解决方案 已自行解决 Java 双竖线按住shift加""""就行了 || 解决方案二: 在java中,||为或符号,为一种特殊字符,所以在字符串中需要在前面加上转义字符"".

如果子类的构造方法中既没有显示调用基类构造方法,而基类中又没有无参数的构造方法,则编译出错。

问题描述 如果子类的构造方法中既没有显示调用基类构造方法,而基类中又没有无参数的构造方法,则编译出错. class Person { private String name; private int age; public void setName(String name) { this.name = name; } public void setAge(int age) { this.age = age; } public String getName(){ return name; } pu

openssl编译出错,真心快崩溃了。。。求解答

问题描述 openssl编译出错,真心快崩溃了...求解答 如题,小弟今天编译的openssl-0.9.8zg,在执行nmake -f msntdll.mak后,总是出现以下错误 -c .cryptoecec_asn1.c ec_asn1.c .cryptoecec_asn1.c(264) : error C2370: "ECPKPARAMETERS_it": 重定义:不同的 存储类 .cryptoecec_asn1.c(262) : 参见"ECPKPARAMETERS_it

mod tile-mod_tile编译出错 -std=c++11 or -std=gnu++11

问题描述 mod_tile编译出错 -std=c++11 or -std=gnu++11 make[1]: 正在进入目录 /home/wml/src/mod_tile-master' depbase=echo src/gen_tile.o | sed 's|[^/]*$|.deps/&|;s|.o$||'`; g++ -DHAVE_CONFIG_H -I. -I./includes -I/usr/include/freetype2 -pthread -I/usr/local/include -I

commit message带引号,clang 编译出错

问题描述 commit message带引号,clang 编译出错 使用git commit becf7bfd4d8b3d8858d0b94f779d1b690248c11a Author: tug tug@skyth-tek.com Date: Sat May 21 13:28:10 2016 +0800 "a test" 提交如上,提交名为 "a test " 编译时候就会报错: target thumb C++: libsurfaceflinger <=

c++ primer-C++ primer第五版例子编译出错

问题描述 C++ primer第五版例子编译出错 请教,中文第五版p190页的例子编译出错,不知道错哪里了,求大神指正,感激不尽. 错误提示:expected unqualified-id before ')' token 代码如下: include include using namespace std; string::size_type() find_char(const string &s, char c, string::size_type() &occurs) { auto r