[Cmake] QT_WRAP_UI problem?
Steven Boyd
skboyd at ucalgary . ca
Sat, 12 Jul 2003 07:24:43 -0600
This is a multi-part message in MIME format.
--------------30C25225EF5FA2DF698B1750
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I've been trying to build my Qt/VTK project with CMake, and carefully
following a previous e-mail that covered that topic
(http://www . cmake . org/pipermail/cmake/2003-April/001526 . html).
Unfortunately, I get the following error: "No rule to make target
'/visualization_tool.cxx' needed by 'cmake.check_depends'".
I think that the source of my problem is that I'm not using QT_WRAP_UI
correctly. Looking at my CMakeLists.txt file below, can anybody see an
obvious problem? I'm using CMake 1.6.7, linux redhat 9, vtk 4.2.1 and Qt
3.1.
The files in my directory are:
main.cpp (.h)
visRenderEngine.cpp (.h)
visWindow.cpp (.h)
visModel.cpp (.h)
visAimModel.cpp (.h)
visStreamComponent.cpp(.h)
visualization_tool.ui
Also, CMake complains that variable QT_DIR is not found, and suggests I
set that variable to "The directory containing QTConfig.cmake". With Qt
coming installed on my Linux setup, what should I set this variable to?
As a final note, I am able to build a Qt project with CMake that has
only MOC files (Kuebler's vtk_qt package), so I think my problem is
concerning proper use of QT_WRAP_UI.
Thanks,
Steve
CMakeLists.txt
------------------------------------------------------------------------------
PROJECT(vis)
INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
INCLUDE_DIRECTORIES(
${VTKMY_SOURCE_DIR}/Utilities/vtk_qt
${QT_INCLUDE_DIR}
${QT_INCLUDE_PATH}
)
LINK_LIBRARIES (
vtk_qt
vtkRendering
vtkGraphics
vtkHybrid
vtkImaging
vtkIO
vtkFiltering
vtkCommon
vtkzlib
${QT_QT_LIBRARY}
)
ADD_DEFINITIONS( ${QT_DEFINITIONS} )
ADD_DEFINITIONS(-DQT_DLL)
IF (QT_WRAP_CPP)
IF (QT_WRAP_UI)
SET(vis_SRCS
main.cpp
visRenderEngine.cpp
visWindow.cpp
visModel.cpp
visAimModel.cpp
visStreamComponent.cpp
)
SET(vis_UI
visualization_tool.ui
)
# No MOC classes...
SET(vis_MOC_CLASSES
# main.h
# visRenderEngine.h
# visWindow.h
# visModel.h
# visAimModel.h
# visStreamComponent.h
)
QT_WRAP_UI(vis vis_UI_HDRS vis_UI_SRCS vis_UI)
QT_WRAP_CPP(vis vis_MOC_FILES vis_MOC_CLASSES)
ADD_EXECUTABLE(AppVis vis_SRCS vis_UI_SRCS vis_MOC_FILES)
ENDIF (QT_WRAP_UI)
ENDIF (QT_WRAP_CPP)
INSTALL_TARGETS(/bin AppVis)
--------------30C25225EF5FA2DF698B1750
Content-Type: message/rfc822;
name="nsmail7G.TMP"
Content-Transfer-Encoding: 7bit
Content-Description: Undelivered Message
Content-Disposition: inline;
filename="nsmail7G.TMP"
Received: from mhost2.ucalgary.ca (mhost2.ucalgary.ca [136.159.36.11])
by mr2.ucalgary.ca (Postfix) with ESMTP id C48093669E
for <cmake at cmake . org>; Wed, 9 Jul 2003 17:35:50 -0600 (MDT)
Received: from ucalgary.ca (m33.enme.ucalgary.ca [136.159.105.33])
by mhost2.ucalgary.ca (8.11.6/8.11.6) with ESMTP id h69NZn610458
for <cmake at cmake . org>; Wed, 9 Jul 2003 17:35:49 -0600
Message-ID: <3F0CB443 . 604E872 at ucalgary . ca>
Date: Wed, 09 Jul 2003 17:33:08 -0700
From: Steve Boyd <skboyd at ucalgary . ca>
X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: cmake at cmake . org
Subject: CMakeLists.txt for Qt project: QT_WRAP_UI problem??
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-MailScanner: Found to be clean
X-MailScanner-Information: Please contact IT Help Desk at (403) 220-5555 for more information
Hi,
I've been trying to build my Qt/VTK project with CMake, and carefully
following previous e-mails
(http://www . cmake . org/pipermail/cmake/2003-April/001526 . html).
I get the following error: "No rule to make target
'/visualization_tool.cxx' needed by 'cmake.check_depends'.
I think I'm not using QT_WRAP_UI correctly, but I'm not sure. Would
somebody please suggest a correction to my CMakeLists.txt file that may
solve the problem?
I'm using CMake 1.6.7, linux redhat 9, vtk 4.2.1 and Qt 3.1.
The files in my directory are:
main.cpp (.h)
visRenderEngine.cpp (.h)
visWindow.cpp (.h)
visModel.cpp (.h)
visAimModel.cpp (.h)
visStreamComponent.cpp(.h)
visualization_tool.ui
Also, CMake complains that QT_DIR is not found, and suggests I set that
variable to "The directory containing QTConfig.cmake". Although I
haven't set that variable I have been able to successfully build the
vtk_qt package by Kuebler. Perhaps that variable isn't important unless
I'm building with .ui files (Kuebler's package has no .ui files). What
should QT_DIR be set to??
Thanks,
Steve
CMakeLists.txt
------------------------------------------------------------------------------
PROJECT(vis)
INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
INCLUDE_DIRECTORIES(
${VTKMY_SOURCE_DIR}/Utilities/vtk_qt
${QT_INCLUDE_DIR}
${QT_INCLUDE_PATH}
)
LINK_LIBRARIES (
vtk_qt
vtkRendering
vtkGraphics
vtkHybrid
vtkImaging
vtkIO
vtkFiltering
vtkCommon
vtkzlib
${QT_QT_LIBRARY}
)
ADD_DEFINITIONS( ${QT_DEFINITIONS} )
ADD_DEFINITIONS(-DQT_DLL)
IF (QT_WRAP_CPP)
IF (QT_WRAP_UI)
SET(vis_SRCS
main.cpp
visRenderEngine.cpp
visWindow.cpp
visModel.cpp
visAimModel.cpp
visStreamComponent.cpp
)
SET(vis_UI
visualization_tool.ui
)
# No MOC classes...
SET(vis_MOC_CLASSES
# main.h
# visRenderEngine.h
# visWindow.h
# visModel.h
# visAimModel.h
# visStreamComponent.h
)
QT_WRAP_UI(vis vis_UI_HDRS vis_UI_SRCS vis_UI)
QT_WRAP_CPP(vis vis_MOC_FILES vis_MOC_CLASSES)
ADD_EXECUTABLE(AppVis vis_SRCS vis_UI_SRCS vis_MOC_FILES)
ENDIF (QT_WRAP_UI)
ENDIF (QT_WRAP_CPP)
INSTALL_TARGETS(/bin AppVis)
--
Steven Boyd, PhD
Assistant Professor
Department of Mechanical and Manufacturing Engineering
University of Calgary
2500 University Drive, N.W.
Calgary, Alberta, Canada, T2N 1N4
tel. 1.403.220.4173 fax. 1.403.282.8406 skboyd at ucalgary . ca
-------------------------------------------------------------------
--------------30C25225EF5FA2DF698B1750--