Error in CMake path

I am trying to create a Visual Studio project for the kinect demo thing, rgbddemo . Following the instructions on the page, I need to set the PATH variable to enable QMAKE from QT. I did this, but I keep getting this error:

CMake error in CMakeLists.txt: 1 (QT4_WRAP_CPP): Unknown CMake command "QT4_WRAP_CPP".

From what I could build from google, this is a problem with CMake, knowing where something from QT is. The above link also mentions that you can set the path for QMAKE in CMake, but I don't know how to do it. Anyone have any suggestions? Thank.

+3
source share
2 answers

You can try to insert a line

FIND_PACKAGE(Qt4)

CMakeLists.txt

INCLUDE("${nestk_BINARY_DIR}/UseNestk.cmake")

qmake . , , cmake.

+3

, CMakeLists.txt .

find_package(Qt4 Required)
include(${QT_USE_FILE}) #contains path to Qt header

#...

qt4_wrap_cpp(MOC_SOURCES ${MY_HEADERS}) #invoking moc 
add_library(MY_LIB ${SOURCES} ${MOC_SOURCES}) #building lib
target_link_libraries(MY_LIB ${QT_LIBRARIES})

qt4_add_resources(MY_QT_RSC ${RESOURCES}) #if you want to compile from resource files
add_library(MY_LIB_2 ${MY_QT_RSC} {SOURCES})
0

All Articles