Sorry, I forget the most important file.
I did link with Qwt.
Here is my CMakeLists.txt:
# set project's name
PROJECT( ThreeSpaceViewer )
OPTION(MYPROJECT_DEBUG
"Build the project using debugging code"
ON)
# this command finds Qt4 libraries and sets all required variables
# note that it's Qt4, not QT4 or qt4
FIND_PACKAGE(Qt4)
IF(QT4_FOUND)
# (QT_USE_FILE is a variable defined by FIND_PACKAGE( Qt4 )
# that contains a path to CMake script)
INCLUDE( ${QT_USE_FILE} )
ELSE(QT4_FOUND)
MESSAGE(FATAL_ERROR
"Cannot build without Qt4. Please set Qt4_DIR.")
ENDIF(QT4_FOUND)
SET(QWT_FOUND "NO")
IF(QT4_FOUND)
FIND_PATH(
QWT_INCLUDE_DIR qwt.h
C:/Qt
C:/Qt/Qwt
C:/Qt/Qwt/src
)
SET(QWT_DEBUG_NAMES qwtd5 )
SET(QWT_RELEASE_NAMES qwtr5 )
FIND_LIBRARY( QWT_DEBUG_LIBRARY
NAMES ${QWT_DEBUG_NAMES}
PATHS /Qt /Qt/Qwt /Qt/Qwt/lib
)
FIND_LIBRARY( QWT_RELEASE_LIBRARY
NAMES ${QWT_RELEASE_NAMES}
PATHS /Qt /Qt/Qwt /Qt/Qwt/lib
)
IF (QWT_DEBUG_LIBRARY OR QWT_RELEASE_LIBRARY)
IF (MYPROJECT_DEBUG)
SET(QWT_LIBRARIES ${QWT_DEBUG_LIBRARY})
SET(QWT_FOUND "YES")
ELSE (MYPROJECT_DEBUG)
SET(QWT_LIBRARIES ${QWT_RELEASE_LIBRARY})
SET(QWT_FOUND "YES")
ENDIF (MYPROJECT_DEBUG)
ENDIF (QWT_DEBUG_LIBRARY OR QWT_RELEASE_LIBRARY)
ENDIF(QT4_FOUND)
INCLUDE_DIRECTORIES( ${QWT_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${ThreeSpaceViewer_SOURCE_DIR} )
INCLUDE_DIRECTORIES( ${ThreeSpaceViewer_BINARY_DIR} )
SET( MY_SRCS
main.cpp
)
SET( MY_HDRS
scatterplot.h
)
# and finally this will run moc:
QT4_WRAP_CPP( MY_MOC_SRCS ${MY_HDRS} )
ADD_EXECUTABLE( ThreeSpaceViewer main.cpp scatterplot.h ${MY_MOC_SRCS} )
TARGET_LINK_LIBRARIES( ThreeSpaceViewer
${LINK_FLAGS}
${QWT_LIBRARIES}
${QT_LIBRARIES}
)
Bookmarks