Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Generating MSVC 2013 project (.vcxproj) file using qmake (Qt 5.9.5)



  • I want to generate MSVC 2013 project (.vcxproj) file from Qt .pro file using command (embedded inside an EXE).

    This is the command (which is generated by the Qt AddIn in Visual Studio 2013) I use:

    qmake.exe -tp vc MyProject.pro -o MyProject_Tmp.vcxproj QMAKE_INCDIR_QT=$(QTDIR)\\include QMAKE_LIBDIR=$(QTDIR)\\lib QMAKE_MOC=$(QTDIR)\\bin\\moc.exe QMAKE_QMAKE=$(QTDIR)\\bin\\qmake.exe
    

    This command worked well with Qt 5.6.0 + MSVC 2013, but not working with Qt 5.9.5 + MSVC 2013.

    The new Qt 5.9.5 qmake generates (by default) a .qmake.stash file with following content:

    QMAKE_CXX.INCDIRS = \
        "C:\\Program Files (x86)\\Microsoft Visual Studio\\VC98\\atl\\include" \
        "C:\\Program Files (x86)\\Microsoft Visual Studio\\VC98\\mfc\\include" \
        "C:\\Program Files (x86)\\Microsoft Visual Studio\\VC98\\include"
    QMAKE_CXX.LIBDIRS = \
        "C:\\Program Files (x86)\\Microsoft Visual Studio\\VC98\\mfc\\lib" \
        "C:\\Program Files (x86)\\Microsoft Visual Studio\\VC98\\lib"
    QMAKE_CXX.QT_COMPILER_STDCXX = 1
    QMAKE_CXX.QMAKE_MSC_VER = 1200
    QMAKE_CXX.QMAKE_MSC_FULL_VER = 12008804
    QMAKE_CXX.COMPILER_MACROS = \
        QT_COMPILER_STDCXX \
        QMAKE_MSC_VER \
        QMAKE_MSC_FULL_VER
    

    which is compatible with MSVC 2008 but not with MSVC 2013. I want the qmake command to generate MSVC 2013 compatible .qmake.stash with the following (or similar) content:

    QMAKE_CXX.INCDIRS = \
        "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\INCLUDE" \
        "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\ATLMFC\\INCLUDE" \
        "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared" \
        "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um" \
        "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt"
    QMAKE_CXX.LIBDIRS = \
        "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\LIB\\amd64" \
        "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\ATLMFC\\LIB\\amd64" \
        "C:\\Program Files (x86)\\Windows Kits\\8.1\\lib\\winv6.3\\um\\x64"
    QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
    QMAKE_CXX.QMAKE_MSC_VER = 1800
    QMAKE_CXX.QMAKE_MSC_FULL_VER = 180040629
    QMAKE_CXX.COMPILER_MACROS = \
        QT_COMPILER_STDCXX \
        QMAKE_MSC_VER \
        QMAKE_MSC_FULL_VER
    

    I believe there should be a way to configure the qmake so that it generates MSVC 2013 compatible .qmake.stash file.

    Any help is much appreciated.


Log in to reply