Qmake using separate folders for sources and headers without modifying .pro - qmake

I'm want to compile meshlab(http://sourceforge.net/p/meshlab/code/HEAD/tree/) and put the generated file outside the source directory to keep the source clean. Is it possible to just specify a build directory as the way in cmake?
The answer in this post Qmake and Make using separate folders for sources and headers, requires to modify the .pro file and doesn't work in my case. Users may want to specify the build dir path as they like, right?

I think what are trying to do is a QMake Shadow Build. This question about Manually Configuring Shadow Builds in QMake should help you.

Related

Rebar3: How do I refer to source artifacts of a library from erlang?

I have have library with an artifact: src/lib/prelude.kind that I'd like to access. However, when I call the library code from a different project (which has the library set up as a dependency), the file src/lib/prelude.kind doesn't exist.
I can solve this problem by hardcoding the file location as _build/default/lib/kind/src/prelude.kind instead, but I'd rather not hardcode the Rebar3 default profile path.
Is there a way to refer to _build/default/lib or whatever the current profile location is from Erlang in a Rebar3 project?
You should use code:lib_dir/2
I'd make sure that the file is available with rebar3's artifacts (and move it out of the src subdir)

Not able to resolve path in electron between pre and post packaging

I have two conditions, one is electron is able to fetch files before electron has packaged. But I am not able to fetch the same files after electron has packaged.
For Example, I use path.resolve to .ini file present in parent directory. When I build electron package it is built two directories below. And I want the built package to still use the same .ini file.
path.resolve(__dirname,'../design.ini');
**Pre Package **
C:\cygwin64\home\xyz\Dev\xyz\abc\parent_dir\design.ini
**Post Package **
C:\cygwin64\home\xyz\Dev\xyz\abc\parent_dir\win64\abc\resources\app.asar\design.ini
Please not I build with asar enabled, Since the paths are different between pre and post, files are not fetched
I use `path.join`` and specify the specific path for internal assets – since I know it in advance and it isn't going to change:
var p1 = path.join(__dirname,'preferences", 'design.ini');
Haven't had any problems – even with asar enabled.
Did you try to use app.getPath() instead of path.resolve(...) ?

Can BUILD files have arbitrary file extensions?

I am aware that bazel accepts both BUILD and BUILD.bazel as valid filenames.
The android tools seem to also have a BUILD.tools file.
In general, does bazel have any restrictions for a BUILD file's extension? For example, could i have BUILD.generated to delineate generate BUILD files from non-generated BUILD files?
The .tools extension is part of building Bazel itself. From the perspective of Bazel, it's just any ordinary file. It gets picked up here: https://github.com/bazelbuild/bazel/blob/bbc8ed16aee07c3ba9321d58aa4c0ffc55fa2ba9/tools/android/BUILD#L197
then eventually gets processed here: https://github.com/bazelbuild/bazel/blob/c816b89a2224c3c318f1228755ef41c53975f45c/src/create_embedded_tools.py#L74
For the use case you mention, one way to go about it is to generate a .bzl file with a meaningful name that contains a macro that you can call from a BUILD or BUILD.bazel file. That way you can separate the generated rules from manually maintained rules. This is similar to how generate_workspace works: https://docs.bazel.build/versions/master/generate-workspace.html

How to keep generated source code for proto files in bazel?

I have studied https://blog.bazel.build/2017/02/27/protocol-buffers.html . The project I want to hack on is written in Go. At the moment, if I run the build command I can see the compiled binary but I don't see the *.pb.go files anywhere. I want to keep the generated *.pb.go files in the same folder where *.proto files are so that my IDE (Intellij Goland) can find and index them.
Can you please help me how to get this working? If you can show me how to do that for the github.com/cgrushko/proto_library project, I should be able to try that in my particular project.
Bazel will not output generated files (such as .pb.go) into the source tree. They go into the output directories (bazel-out/<config> or bazel-genfiles/<config>). Temporary solution might be to add those as source roots to goland. The real solution is to use https://ij.bazel.build/. It has some Go support, and the team is actively working on improving it.

How to add library paths in Delphi 10

I am trying to install GLscene but getting problems with the source file locations.
It says in the install instructions to add the GLscene source directories into the global library path in tool/options/Delphi options/Library, which I have done but it has no effect.
I can add the source directories into each package project directory and it then compiles, but I would rather have it accessible globally.
The GLscene library items I have entered are,
C:\Users\Andy\Documents\Embarcadero\Studio\Projects\GLScene_VCL\Source
C:\Users\Andy\Documents\Embarcadero\Studio\Projects\GLScene_VCL\Source\Shaders
C:\Users\Andy\Documents\Embarcadero\Studio\Projects\GLScene_VCL\Source\DesignTime
Which are all correct,
anybody know any reason why the compiler can't find the files in these directories?
The compiler will search for source files on the library path. Note that there are separate library paths for different targets, e.g. Win32, Win64 etc.
If you have source files that cannot be found, then they are not in the library path that you specified.
Personally I don't like the approach of using search paths for source files. I like everything under my project directory so that I can check out from my VCS and have everything I need to build right there. A search path based approach makes serious development very difficult because you cannot maintain branches. What if you have old versions to maintain that use old versions of your libraries?
Well this is a bit late but it could help someone else.
Try and add the paths to both the Library Path and the Debug DCU Path.
Recent Delphi versions have different build configurations for Release and Debug and my guess is that the Debug configuration only searches in the Debug DCU Path.

Resources