PDA

View Full Version : Building QtSql only



lk
17th February 2013, 11:27
Hi,

While building QtSql is possible as part of building the entire Qt project, it builds many more things than just QtSql which may not be required in my case

Is there a way to specify a minimal build for just QtSql and its dependencies?

Also, can one create vcproj files for Visual Studio editor browsing of Qt code when building from VS2010 command prompt?

Thanks
lk

wysota
17th February 2013, 12:29
You can build QtCore and QtSql (and database drivers) manually by calling make in respective subdirectories.

lk
17th February 2013, 14:35
Building QtSql from directory "qtbase\src\sql" is possible after initial build of entire Qt
However, if taking clean sources, this directory does not contain any Makefile file for building

My test platform is Windows Visual Studio command prompt

Ran configure using:
"
configure -prefix %CD%\qtbase -opensource -nomake tests -opengl desktop
"

But the directory 'qtbase\src\sql' contains only the following files
"
02/17/2013 11:26 AM <DIR> .
02/17/2013 11:26 AM <DIR> ..
02/17/2013 11:26 AM <DIR> doc
02/17/2013 11:26 AM <DIR> drivers
02/17/2013 11:26 AM <DIR> kernel
02/17/2013 11:26 AM <DIR> models
12/18/2012 09:03 PM 1,260 README.module
12/18/2012 09:03 PM 384 sql.pro
"

Is there some specific configure command that is required for creating this makefile before build?

[EDIT:
Found an alternative solution:
from directory 'qtbase\src' run:
nmake sub-corelib
nmake sub-sql
]

Thanks
lk

wysota
17th February 2013, 14:51
Building QtSql from directory "qtbase\src\sql" is possible after initial build of entire Qt
However, if taking clean sources, this directory does not contain any Makefile file for building
You need to configure the build first.


Ran configure using:
"
configure -prefix %CD%\qtbase -opensource -nomake tests -opengl desktop
"

But the directory 'qtbase\src\sql' contains only the following files
I'm sure qtbase or qtbase/src contain a Makefile. You probably need to call nmake sub-corelib sub-sql or something similar.

lk
17th February 2013, 16:31
Now that I built the QtSql and QtCore, I have an additional question, which may be asked in a different thread but I thought to add it here

The configure options show there is an option for generating vcproj files
"
configure --help
.
.
* -vcproj ............ Generate VC++ .vcproj files, only if platform
"win32-msvc.net".
.
"

Is this option valid on the free version and creates vcproj files? I tried setting it with

configure -prefix %CD%\qtbase -opensource -nomake tests -opengl desktop -platform win32-msvc.net
and got an error
"
Invalid option "win32-msvc.net" for -platform.
"

wysota
17th February 2013, 17:28
Should be win32-msvc2010.

lk
18th February 2013, 13:57
Tried configuring with win32-msvc2010 and building, and still no visual studio project was created, here is a list of commands:
"
set QMAKESPEC=win32-msvc2010
configure -prefix %CD%\qtbase -opensource -nomake tests -opengl desktop -platform win32-msvc2010 -vcproj
cd qtbase\src
nmake sub-corelib sub-sql
"

However, I did manage to create a visual studio project using the following command:
From the "qtbase\src\sql" path
"
..\..\bin\qmake.exe -tp vc -r -spec win32-msvc2010 sql.pro
"

This created a "Qt5Sql.vcxproj" file

wysota
18th February 2013, 14:10
What do you need the VS project file for?

lk
18th February 2013, 14:49
Better browsing of the code, and possibly a mean to write modified code for Sybase driver

wysota
18th February 2013, 15:03
You don't need a VS project file for any of those. Especially that a driver is not part of QtSql library but rather a standalone subproject.