Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Qt compilation environment support #160

Closed
12 tasks done
waruqi opened this issue Feb 27, 2018 · 4 comments
Closed
12 tasks done

Add Qt compilation environment support #160

waruqi opened this issue Feb 27, 2018 · 4 comments

Comments

@waruqi
Copy link
Member

waruqi commented Feb 27, 2018

  • Qt rules for target
    • rule("qt.static")
    • rule("qt.shared")
    • rule("qt.console")
    • rule("qt.application")
      • widgets application (ui/moc)
      • quick application (qml)
  • Support Platforms
    • gcc_32/64 (linux)
    • clang_32/64 (macosx)
    • msvc*_32/64 (windows)
    • mingw*_32/64 (windows)
@waruqi waruqi added this to the 2.1.10 milestone Feb 27, 2018
@waruqi
Copy link
Member Author

waruqi commented Apr 14, 2018

We will provide some qt rules #167 to implement it, for example:

target("qt_console")
    add_rules("qt.console")
    add_files("src/*.cpp")
target("qt_static_library")
    add_rules("qt.static")
    add_files("src/*.cpp")
    add_frameworks("QtNetwork", "QtGui")

Qt Quick Application (qml):

-- add target
target("qt_quickapp")
    add_rules("qt.application")
    add_files("src/*.cpp") 
    add_files("src/qml.qrc")
    add_frameworks("QtQuick")

Qt Widgets Application (ui/moc):

-- add target
target("qt_widgetapp")
    add_rules("qt.application")
    add_files("src/*.cpp") 
    add_files("src/mainwindow.ui")
    add_files("src/mainwindow.h")  -- add files with Q_OBJECT meta (only for qt.moc)
    add_frameworks("QtWidgets")

@waruqi
Copy link
Member Author

waruqi commented Apr 23, 2018

Create Qt empty project:

Console:

$ xmake create -l c++ -t console_qt test

Static Libary:

$ xmake create -l c++ -t static_qt test

Dynamic Libary:

$ xmake create -l c++ -t shared_qt test

Quick Application:

$ xmake create -l c++ -t quickapp_qt test

@waruqi
Copy link
Member Author

waruqi commented Apr 23, 2018

Please set the Qt sdk directory manunally If Qt SDK not found.

$ xmake f --qt=~/Qt/Qt5.9.1

Please set the arch If only x86_64 SDK exists on windows:

$ xmake f --qt=~/Qt/Qt5.9.1 -a x64

Use Qt/mingw SDK on windows:

$ xmake f -p mingw --qt=~/Qt/Qt5.9.1 -a [i386|x86_64]

@waruqi
Copy link
Member Author

waruqi commented Apr 23, 2018

finished!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant