Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Enhancements to the CB Build System
scarphin:
The main purpose of these enhancements is to provide native Qt support with little or no user intervention within CB build system. Before going into discussion I want to make sure that none of these enhancements are specific to Qt, they are just improvements of current functionality which can be used for any other tool or framework. I'll try to submit further patches according to the directions I get here.
1- This patch provides an automatic compilation priority (weight) setting for new files added to the project. User Interfaces '.ui' in Qt (similar to .xrc files of wxwidgets) need to be compiled before the including header needs to access them and this patch saves the user to set each '.ui' file's weight manually. Patch here -> https://sourceforge.net/p/codeblocks/tickets/140/
2- This patch allows macros like $(project_file) etc... in the 'generated files' input in 'advanced compiler options' dialogue so generated intermediate files can go into their own folders like 'project_dir/generated_files/...'. Although my tests on Win7 and XP doesn't yield a problem, I'm not sure with this patch as my implementation is simpler than the current implementation and I suspect there must be a reason why it is not implemented like that in the first place. So please comment. Patch here -> https://sourceforge.net/p/codeblocks/tickets/141/
LETARTARE:
Hello,
do you have any examples of how to test your patches ?
Regards
scarphin:
Sure,
1- Create a new Qt project,
2- Set Qt directory and/or other compiler and/or linker options if needed,
3- Create a folder named 'gen' under projects directory,
4- Create a new '.ui' extension in 'compiler advanced options' for project's compiler,
5- Insert
--- Code: ---path_to_qt_bin\uic.exe $file -o $(project_dir)gen\ui_$file_name.h
--- End code ---
into 'command line macro' with correct path,
6- Insert
--- Code: ---$(project_dir)gen\ui_$file_name.h
--- End code ---
into 'generated files',
7- Set 'weight' to some value below 50,
8- Build the project.
As a result (if I haven't missed anything) a new header file under 'gen' directory will be generated before compilation starts. I'm attaching a zipped sample project with an already added '.ui' file which needs a 'qt' global variable to be set to build correctly. Settings in the 'advanced compiler options' need to be manually entered though. And the compiler for the project may need to set again correctly.
LETARTARE:
Hello,
thank you for the example, it works.
I tested with 'svn10127' and 'compiler1.patch'
I used the command line
--- Quote ---$(#qt47)\bin\uic.exe $file -o $(project_dir)gen\ui_$file_name.h
--- End quote ---
See the attached picture.
1- create the directory 'gen' automatically,
2- each 'Build' is reconstructed systematically,
3- no trace of the pre-generation line,
4- the generated files are not stored in the project,
I think we can use the same approach for 'namefile.qrc -> 'qrc_namefile.cpp': nevertheless we must each file manually intervene.
Remains the most complicated, files containing macros to manage signals and slots.
Faced with this difficulty, I used the last two years a plugin script that does all the work.
I have proposed a binary version. See the discussion http://forums.codeblocks.org/index.php/topic,20000.msg136816.html#msg136816
You could try it and give me your results.
Best regards
scarphin:
Thanks for testing...
--- Quote from: LETARTARE on February 26, 2015, 10:58:43 am ---1- create the directory 'gen' automatically,
2- each 'Build' is reconstructed systematically,
3- no trace of the pre-generation line,
4- the generated files are not stored in the project,
--- End quote ---
I'm assuming these are what you think should be. If so:
1- That would be nice but pre/post-build steps are also designed that way and it's an advanced feature in the end, the user should know what he/she is doing,
2- I don't know what you mean here,
3- I definitely want to see that in the logs so it should be there,
4- I sometimes check the generated files for reference. Searching through the project folders is not practical for that.
--- Quote from: LETARTARE on February 26, 2015, 10:58:43 am ---I think we can use the same approach for 'namefile.qrc -> 'qrc_namefile.cpp': nevertheless we must each file manually intervene.
--- End quote ---
Sure, as I've mentioned before those enhancements are for general use, not just for Qt specific files (.ui, .qrc, ...) but for all custom tools (yacc, bison ...). If you mean the setting of custom extensions in advanced compiler options by 'manual intervention', theoretically the user will just have to do that only once in his/her entire Qt career. I don't think it's that bad.
--- Quote from: LETARTARE on February 26, 2015, 10:58:43 am ---Remains the most complicated, files containing macros to manage signals and slots.
--- End quote ---
I also have an enhancement of functionality for that. It will need a little user intervention though, but no more than a few clicks. And again it won't be specific to Qt. Yet a couple of bugs in the project loader and file addition code needs to be addressed first. I'm still waiting for developer opinions to continue as I'd like to move on step by step.
--- Quote from: LETARTARE on February 26, 2015, 10:58:43 am ---Faced with this difficulty, I used the last two years a plugin script that does all the work.
I have proposed a binary version. See the discussion http://forums.codeblocks.org/index.php/topic,20000.msg136816.html#msg136816
You could try it and give me your results.
--- End quote ---
I'm aware of your plugin and I think it's nice to have everything automated. But I don't think a plugin is the way to go for Qt. Reasons being:
1- Your plugin will be dead the moment you no longer maintain it and I don't think it will ever make its way into the officially supported plugins. Even if it makes it, it will still be dead when you quit maintaining it. There have been plugins before and they were all dead the moment sdk version changed because of lack of maintenance. Unfortunately that's how things go in CB (no offense meant to CB developers, it's just the way I see it is).
2- It will be specific to Qt usage, not general like for other custom tools.
3- I believe CB already has a capable build system to manage Qt and other tools which only needs simple enhancements.
I don't mean to discredit your plugin. I'm just expressing my reasons and I'll try it when I find some spare time.
Navigation
[0] Message Index
[#] Next page
Go to full version