/LibProjWizard4QtCreator

Wizard to create a library project which can be easily used by other projects

Primary LanguageC++

Wizard to create a library project for QtCreator.
The project generated by this wizard is a subdir project, including the library and it's test application.
This library can be easily included by other projects. Just include the pri file!


Goal: Simply file library dependency resolving.
If project A use this template, project B wants to link against libA, then just add A as a sub-project and include libA.pri in the pro that going to link against libA.


How To Use:
Clone into QtCreator/share/qtcreator/templates/wizards/libproj
Restart your qtcreator. Then you can start with "File > New File or Project > Libraries > Perfect library soluton".

Add an existing depended project:
If project XX depends on project(usally a library) is also use this template, then it very easy to use that project.
Assume the depended project is foo
1. Put that project into depends/
2. Edit depends/depends.pro, add foo or foo/src/libfoo.pro to SUBDIRS
3. Add 
include($$PROJECTROOT/depends/foo/src/libfoo.pri)
after the following lines in $$PROJECTROOT/depends/foo/src/libfoo.pro

PROJECTROOT = $$PWD/..              #optional. suppose the that library project's root dir is $$PWD/..; if that project use the same common.pri as this, PROJECTROOT can be this project's
include(dir_of_XX/libXX.pri)        #resolve depends
preparePaths($$OUT_PWD/../out)      #parameter is the build dir. if not parameter, build dir is Makefile's dir

include($$PROJECTROOT/depends/foo/src/libfoo.pri)  #Add the depends


Building:
RECOMMAND: run qmake with parameters like below recommand to avoid some depends problem
qmake -r "BUILD_DIR=your_build_dir"
YOU MUST use those arguments if you have sub-projects in depends
The default output dir is SRC/out

In QtCreator, all generated files except Makefiles are in 'BUILD_DIR', Makefiles are in 'Build directory', You can change build directory in QtCreator 'Projects/General/Build directory'

Directories:
if BUILD_DIR is out, Qt version is 4.8.5
out---.moc/4.8.5/moc_*.cpp
	  .obj/subprojects/*.o
	  .rcc/4.8.5/qrc_xxx.cpp
	  .ui/4.8.5/ui_*.h
	  bin/target(.exe), depended dll
	  lib_targetos_arch/*.so,*.a,*.lib,*.dll

where targetos is win32, linux etc. arch is x86, x86_64, arm etc.

TODO:
1. depends solution, use a seperate dir
2. deployment
3. res

wbsecg1@gmail.com
2012-02-19
last updated 2012-12-30