The function you are looking for is called QT4_WRAP_UI (not WARP).
 
You will also need to add an INCLUDE(${QT_USE_FILE}) after finding Qt 4.
 
-Ken


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of xavier delannoy
Sent: Tuesday, January 17, 2006 8:40 AM
To: cmake@cmake.org
Subject: [CMake] CMake & FindQT4.cmake

Hi all,

I try to use CMake with a QT project. I have include FindQT4.cmake but CMake doesn't know : QT4_WARP_UI && QT4_ADD_RESOURCE.

here is the ouput of CMake :

-- This is a CVS repository
-- Using Buildname: Darwin-c++
-- Found Qt-Version ..
CMake Error: Error in cmake code at
Projects/src/gui/CMakeLists.txt:35:
Unknown CMake command "QT4_WARP_UI".
CMake Error: Error in cmake code at
Projects/src/gui/CMakeLists.txt:39:
Unknown CMake command "QT4_ADD_RESOURCE".
-- Configuring done

here is my CMakeLists :
PROJECT(MYPROJECT CXX)

INCLUDE(${CMAKE_ROOT}/Modules/FindQT4.cmake)

ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)

AUX_SOURCE_DIRECTORY( common MYPROJECT_COMMON_SRCS)
AUX_SOURCE_DIRECTORY( customwidget MYPROJECT_CUSTOMWIDGET_SRCS)
AUX_SOURCE_DIRECTORY(${PLATFORM_SUBDIR_SRC} MYPROJECT_PLATFORM_SRCS)

SET(MYPROJECT_SRCS "${MYPROJECT_COMMON_SRCS};${MYPROJECT_CUSTOMWIDGET_SRCS};${MYPROJECT_PLATFORM_SRCS}")

SET(UI_FILES ui/file1.ui ui/file2.ui)

QT4_WARP_UI(UIHeaders ${UI_FILES})
SET_SOURCE_FILES_PROPERTIES(${MYPROJECT_SRCS} PROPERTIES OBJECT_DEPENDS "${UIHeaders}")
                           
QT4_ADD_RESOURCE(ResourceFiles res/resources.rc)

# include directory
INCLUDE_DIRECTORIES(common customwidget ui)

ADD_EXECUTABLE(MyProject ${MYPROJECT_SRCS})

# link with libs
TARGET_LINK_LIBRARIES(MyProject ${QT_LIBRARIES})

Thanks,

Xavier Delannoy
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to