Posts tagged 'c'

CMake & Qt4 (Q3Support)

Updated: this post is obsolete, go to  CMake & Qt4  Modules .

 

Assumption:

Let assume we have a legacy Qt3 system and has been ported to Qt4 with Q3Support Module successfully. Also we want to CMakify it.

 

Problem:

After following the instructions that is available on the Internet like QtNode. We MIGHT end up with the following compilation errors:

* Error(1): 'Q3somthing' : No such file or directory

    • 'Q3MainWindow': No such file or directory

* Error(2) :  'something' : is not a member of "Qt"

    • 'ToolBarDock' : is not a member of 'Qt'
    • 'Dock' : is not a member of 'Qt'

 

Solution:

in CMakeLists.txt

For Error(1) add the following :

# Qt Includes
    INCLUDE(${QT_USE_FILE})
    INCLUDE_DIRECTORIES(${QT_QT3SUPPORT_INCLUDE_DIR})

For Error(2) add the following:

# Qt Definitions
    ADD_DEFINITIONS(${QT_DEFINITIONS})
    ADD_DEFINITIONS(-DQT3_SUPPORT)

 

-DQT3_SUPPORT  almost two days to figure it out ending up with reading QT source-code.  So I hope this will help you.

 

Example:

I made example for this purpose also to show the simplicity and the power of CMake as cross-platform make system.

 

Windows Vista

Windows Vista & NMake(VS2008)

 

image

Linux & Make(gcc)

 

Example File: CMakifyQ3S

Continue reading "CMake & Qt4 (Q3Support)"