User forums > Using Code::Blocks
Best way to integrate an "Other" file
burtbick:
Hi,
I've been using CB 10.05 for some time and it is great.
My current project is a C project with several source, and header files.
There is also a "protocol" file that is processed by a separate tool that "compiles" the protocol file and generates a .C and .H file that is included in the project.
I was using a pre-build step for running the protocol "compiler" and while that works it doesn't know that the protocol file has not changed and the .C and .H files don't need to be generated. So it causes all of the files that include the generated .H file to be recompiled when they do not need to be.
So I next tried removing the pre-build step and from the properties for the protocol file I set a custom build using the same command that was used in the pre-build step.
This also works fine, but still compiles the protocol file every time. How can I set up the dependency so that the custom build step for the protocol file only runs when the protocol file has changed?
I've done a preliminary search in the forums, but didn't find a direct answer. If I have missed something in my search, or in the docs, I would appreciate it if someone could point me to the appropriate reference.
Thanks,
Burt
stahta01:
Read this link and see if it helps http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system
Tim S.
burtbick:
Thanks Tim,
That is getting me much closer.
It builds when my protocol file changes and creates the generated .C and .H files.
But it doesn't build the rest of my project on that pass. If I build again it builds the rest of my project that depends on the two generated files.
I can live with that but I'm still missing a piece that should cause the files that include the generated .H file to build when a new file is generated.
I would prefer it if I can configure C:B to rebuild the entire project when the protocol file changes.
I've experimented with the dependency settings that I can find but haven't yet found the way to make the other files build based on either my protocol file changing or the generated .H file.
Is there a way to set up the dependencies so that when my protocol file changes, or the generated .H file which is included in my project changes that the entire project will build with having to do a second build request?
I saw one discussion in the forum where someone was asking a similar question about an option to specify the dependency on a generated file but that was more in the form of a request than a solution.
Do I need to set up some additional rule for the protocol file to generate dependencies?
What am I missing in getting the dependency configured properly?
Thanks again,
Burt
stahta01:
Try right clicking on "protocol" file an adjust file "properties"
Tab Build
slider "Priority Weight" to make the "protocol" file build first.
No idea if that we help or not.
Tim S.
burtbick:
Thanks,
I'd already tried different settings for the priority weight.
I'll live with it for right now, just have to remember to do the second build and when I get some more time I'll dig into it deeper..
Burt
Navigation
[0] Message Index
[#] Next page
Go to full version