cmake issue with qt_wrap_cpp

Started by
3 comments, last by fng 13 years, 4 months ago
Hi all!

I currently have a big problem with a piece of soiftware that compiles with cmake. Since someone did a "port selfupdate", I get this error:

CMake Error at CMakeLists.txt:4 (INCLUDE):
include called with wrong number of arguments. Include only takes one
file.

CMake Error at CMakeLists.txt:6 (QT4_WRAP_CPP):
Unknown CMake command "QT4_WRAP_CPP".

The corresponding lines in my cmakelists.txt file are:

INCLUDE(${QT_USE_FILE})

QT4_WRAP_CPP(QTKPT_MOC_FILES glbox.h view.h stexture.h)

Now even back-up versions of the software ceased to compile, which makes me think that it's an update issue, more than a code issue.

Does anyone know what update can cause this behavior? And, better still, how to solve it without downgrading?

I'm very sorry if that's a trivial issue, but it has been keeping me stuck for a long time now :-S

Thanks in advance for all inputs!!
Advertisement
Is there a find_package(Qt4 REQUIRED) if so paste the CMakeLists.txt.
Did you delete CMakeCache.txt and CMakeFiles/ when you switched back to your older version? Otherwise your CMakeCache might be already poisoned with the new unwanted changes.

Otherwise getting CMake working with QT4 can be a little bit daunting. Here is the cmake code that I am using and works well for me:

FIND_PACKAGE (Qt4 REQUIRED)ADD_DEFINITIONS (${QT_DEFINITIONS})SET( QT_USE_QTXML TRUE )SET( QT_USE_QTOPENGL TRUE )SET( QT_WRAP_CPP TRUE )INCLUDE (${QT_USE_FILE})SET ( UI_sources  # all your .ui files)	QT4_WRAP_UI ( UI_headers ${UI_sources})SET ( App_sources  # all your .cpp files)QT4_WRAP_CPP ( MOC_headers  # all header files that need to be moc'ed)ADD_EXECUTABLE ( app_bin  ${App_sources}  ${MOC_headers}  ${UI_headers})


Hope it helps.
-- blog: www.fysx.org
Quote:Original post by fng
Did you delete CMakeCache.txt and CMakeFiles/ when you switched back to your older version? Otherwise your CMakeCache might be already poisoned with the new unwanted changes.

Otherwise getting CMake working with QT4 can be a little bit daunting. Here is the cmake code that I am using and works well for me:

*** Source Snippet Removed ***

Hope it helps.


set(QT_USE_QTXML true) needs to be set before you find_package(Qt4 REQUIRED)
Quote:Original post by SeaBourne
set(QT_USE_QTXML true) needs to be set before you find_package(Qt4 REQUIRED)

Yes! You are correct! Seems to me as if it is then not necessary in my case.

Thanks!

-- blog: www.fysx.org

This topic is closed to new replies.

Advertisement