Author Topic: How can I make source files only available for a particular config?  (Read 2772 times)

TurkeyMan

  • Community Member
  • Posts: 22
  • Hero Points: 0
I have tried adding a second <Files> block under <Config>, which would theoretically add extra files only present when that config is active... but that doesn't work.
Perhaps it could be made to work?
Alternatively, some ability to disable specific files from the build at the Config level? (seems more awkward to me, but possibly more desirable in some situations)

Again, it would be really nice if .vpj was documented comprehensively.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6866
  • Hero Points: 528
Re: How can I make source files only available for a particular config?
« Reply #1 on: September 15, 2015, 03:54:23 AM »
The various GUI file listing features list files in all configs. The configs are used for building (compiles) with vsbuild. If you don't use vsbuild's internal make capabilities (i.e. not just executing an external make), the configs won't be useful unless your write your own tool which can process SlickEdit .vpj files. There are GUI features for listing files per project but not per config.

There are sample projects for C++ and Java which use vsbuild's internal make facility which supports configs.

The project tool window allows you to organize your files however you want but it only helps in the project tool window. While you can have more fine grain control than even a config, you will want to choose a layout that doesn't take too much trouble to create and maintain. The project tool window for v20 will have some enhancements and better documentation for users to decide how they want to organize files. At the moment, some of the project tool windows power is a mystery to most users.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6866
  • Hero Points: 528
Re: How can I make source files only available for a particular config?
« Reply #2 on: September 15, 2015, 04:17:55 AM »
I see from your other posts that you are doing Qt builds. If that's what you need config support for, we could send you some samples that are similar to what we do. It uses features that are not supported by the GUI.  In addition, our Qt builds are not at all compatible with qmake. Headers files with classes which inherit from qobject must be in a .qth file. That way we avoid the qmake hacks where you can't use make rules.

TurkeyMan

  • Community Member
  • Posts: 22
  • Hero Points: 0
Re: How can I make source files only available for a particular config?
« Reply #3 on: September 20, 2015, 05:13:35 AM »
Umm, judging by your first reply, I suspect that my post may have almost completely been misunderstood.
In response to your second, I think if you can demonstrate how you manage Qt builds, that would be very valuable, it might reveal tools that can be used in other situations too.

I am using vsbuild, which pretty much just does what the project files are able to express. My problem is being able to make the .vpj express what I need such that vsbuild is able to build properly.
My problems are these, if you can address them:

1. <Files> appear to be a single global entry. I have some config-specific files; how do I make vsbuild selectively build different sets of files when building different configurations? (Config-specific <Files> sets would be a nice solution)

2. Pre-build generated source files need to be compiled among the main build step. If they are not listed in <Files>, they will not be built. If I do list the outputs of pre-build steps in <Files> (ie, these are files that don't exist on disk until the pre-build is complete), I experience a problem where vsbuild refuses to build any files at all; it appears to validate that all source files appearing in <Files> exist before it starts building and stops the build with errors if they don't, which means the generated source files are not generated which is the cause of the build failing.
You must solve this problem if you have Qt builds, so I am very interested to hear how that works.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6866
  • Hero Points: 528
Re: How can I make source files only available for a particular config?
« Reply #4 on: September 20, 2015, 10:31:37 PM »
It sounds like a sample of how we build build qt would help you a lot. The down sides are its not compatible with qmake, requires .qth files (for standard make rules) and you may need to make some edits by hand (especially if you are modifying rules).

Gives us a little time to put this together. We are a little busier than usual this week. This sample will be useful for others.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6866
  • Hero Points: 528
Re: How can I make source files only available for a particular config?
« Reply #5 on: September 24, 2015, 07:24:52 PM »
Here's sample for building Qt applications using vsbuild (not using Qt .pro projects). Classes defined in header files which need to be moc'ed must have a .qth extension instead of .h. It supports SlickEdit's vsbuild, configs, and GNU debugging (linux/mac). So global project settings could be defined for Windows, Linux, and Mac there are separate workspaces for each of platform.