[CMake] Compilation using Qt 4 under windows 7

n0p n0p 0x90.0xn0p at gmail.com
Mon May 17 16:20:00 EDT 2010


Hello,

I have a little application which uses Qt 4. It compiles without problem on
linux but the CMakeLists.txt file
i use under linux seems to not work on windows and i don't understand why.
The CMakeLists.txt file I use
is the following:


cmake_minimum_required(VERSION 2.6)

project(iBusHelper)

set(EXECUTABLE_OUTPUT_PATH bin/)

set(MOC_HEADERS ./include/*.h)

find_package(Qt4 REQUIRED)

include(${QT_USE_FILE})

include_directories(
  include
./
)

set(IBUSHELPER_MOC_SRC
  ./include/animationlawdockmainwindow.h
  ./include/errorsdockmainwindow.h
  ./include/errorsdock.h
  ./include/mainwindow.h
  ./include/parametersdockmainwindow.h
)

set(IBUSHELPER_UI_FILES
  ./forms/animationlawdockmainwindow.ui
  ./forms/errorsdockmainwindow.ui
  ./forms/errorsdock.ui
  ./forms/mainwindow.ui
  ./forms/parametersdockmainwindow.ui
)

set(IBUSHELPER_SRCS_CXX
  ./src/animationlawdockmainwindow.cpp
  ./src/errorsdockmainwindow.cpp
  ./src/errorsdock.cpp
  ./src/mainwindow.cpp
  ./src/parametersdockmainwindow.cpp
)

set(IBUSHELPER_RC
  icons/resource.qrc
)

QT4_ADD_RESOURCES(IBUSHELPER_RC_SRCS ${IBUSHELPER_RC})
QT4_WRAP_UI(IBUSHELPER_SRCS_CXX ${IBUSHELPER_UI_FILES})
QT4_WRAP_CPP(IBUSHELPER_SRCS_CXX ${IBUSHELPER_MOC_SRC})


ADD_EXECUTABLE(iBusHelper ${IBUSHELPER_SRCS_CXX} ${IBUSHELPER_RC_SRCS}
./src/main.cpp)

TARGET_LINK_LIBRARIES(iBusHelper QtGui ${QT_LIBRARY})


The errors I get are this ones:

CMake Error at C:/CMake2.8/share/cmake-2.8/Modules/Qt4Macros.cmake:112
(FILE):
  file Internal CMake error when trying to open file:
  C:/testQtCmake/include/moc_*.cxx_parameters for writing.
Call Stack (most recent call first):
  C:/CMake2.8/share/cmake-2.8/Modules/Qt4Macros.cmake:147
(QT4_CREATE_MOC_COMMAND)
  CMakeLists.txt:23 (QT4_WRAP_CPP)


CMake Error at C:/CMake2.8/share/cmake-2.8/Modules/Qt4Macros.cmake:112
(FILE):
  file Internal CMake error when trying to open file:
  C:/testQtCmake/include/moc_*.cxx_parameters for writing.
Call Stack (most recent call first):
  C:/CMake2.8/share/cmake-2.8/Modules/Qt4Macros.cmake:147
(QT4_CREATE_MOC_COMMAND)
  CMakeLists.txt:23 (QT4_WRAP_CPP)


CMake Error at C:/CMake2.8/share/cmake-2.8/Modules/Qt4Macros.cmake:112
(FILE):
  file Internal CMake error when trying to open file:
  C:/testQtCmake/include/moc_*.cxx_parameters for writing.
Call Stack (most recent call first):
  C:/CMake2.8/share/cmake-2.8/Modules/Qt4Macros.cmake:147
(QT4_CREATE_MOC_COMMAND)
  CMakeLists.txt:23 (QT4_WRAP_CPP)


CMake Error at C:/CMake2.8/share/cmake-2.8/Modules/Qt4Macros.cmake:112
(FILE):
  file Internal CMake error when trying to open file:
  C:/testQtCmake/include/moc_*.cxx_parameters for writing.
Call Stack (most recent call first):
  C:/CMake2.8/share/cmake-2.8/Modules/Qt4Macros.cmake:147
(QT4_CREATE_MOC_COMMAND)
  CMakeLists.txt:23 (QT4_WRAP_CPP)


-- Configuring incomplete, errors occurred!

Does anyone know what's the problem ?? I use CMake 2.8 and Qt 4.6.1 with
MinGW.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100517/b640426f/attachment.htm>


More information about the CMake mailing list