[CMake] qt4 with cmake's question
孙高勇
sungaoyong at gmail.com
Thu Sep 7 23:43:18 EDT 2006
i succeed use cmake to build a qt4's example's imageviewer in windows,build
with mingw32.the programe run with a console with cmake build ,if use
qmake,the programe run without console,why?
and how to forbid to show console with cmake?
this is my cmakelist.txt
project(imageviewer)
cmake_minimum_required(VERSION 2.4.0)
find_package(Qt4 REQUIRED)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
# the next line sets up include and link directories and defines some
variables that we will use.
# you can modify the behavior by setting some variables, e.g.
# set(QT_USE_OPENGL TRUE)
# -> this will cause cmake to include and link against the OpenGL module
#set(QT_USE_QTMAIN TRUE)
include(${QT_USE_FILE})
# the variable "qtproject_SRCS" contains all .cpp files of this project
set(imageviewer_SRCS
main.cpp
imageviewer.cpp
)
# tell cmake to create .moc files for all files in the variable
qtproject_SRCS that require such a file.
# note: this assumes that you use #include "header.moc" in your files
QT4_AUTOMOC(${imageviewer_SRCS})
#QT4_GENERATE_MOC(${imageviewer_SRCS})
ADD_DEFINITIONS(-DQT_NO_DEBUG )
# create an executable file named "qtproject" from the source files in the
variable "qtproject_SRCS".
add_executable(imageviewer ${imageviewer_SRCS})
# link the "qtproject" target against the Qt libraries. which libraries
exactly, is defined by the "include(${QT_USE_FILE})" line above, which sets
up this variable.
target_link_libraries(imageviewer ${QT_LIBRARIES})
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060908/52e0cad1/attachment.htm
More information about the CMake
mailing list