[CMake] Compilation using Qt 4 under windows 7

Ryan Pavlik rpavlik at iastate.edu
Mon May 17 17:03:11 EDT 2010


Don't use * (filename globs) - write out each individual filename for 
MOC_HEADERS
(although it looks like you're not using that variable? not sure what 
exactly is going on here)

If that doesn't help, let us know.

Ryan

On 05/17/2010 03:20 PM, n0p n0p wrote:
> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpavlik at iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik

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


More information about the CMake mailing list