How to get full/debug log for make command? - cmake

For C/C++ build what option (if it exists) should be used to view all commands which were executed duration (make command).
For a large project, I would like to know how exactly a particular .c file was compiled? What option was provided to gcc/clang?
If I execute
./configure
make
make install
sometimes compiled commands are not visible.

Related

py2exe setup script work only if placed under the same path of the target script

I created the setup.py script to create the exe (where the freeze or setup functions are called with a target script 'target.py'), then I invoke the script as 'python setup.py py2exe'.
However I discovered that the executable is created fine as far as this setup.py script is in the same location of the target.py script. If The two script are not in the same location the created executable does not work because not all parts of the code are included.
I am missing something about a rule of setup.py and target.py script ?
I have verified I am passing correctly the target.py location to the setup.py.
Important, the exe creation does not fail or whatever, simply the created exe is not functional since it is missing something.
Moreover I have an old code (py2exe in py2.7) where the setup and target scripts are not in the smae location and it works.
I expected that the relative position of the target.py script with respect to the setup.py script should not influence the outcome (exe). What I acutally get is a different result.
I have an old code where the two scripts are not in under the same path and it works (with an old py2exe and py2.7)
The documentation is not explicitly mentioning something about this.

Gogland Test Configuration always executed with ./

No matter how I set my build configuration for running my tests the go test tool is always run with ./...
E.G.
runs:
go test -v -cover ./... -run ./svs
Depending on what you need to run you can select different configuration types.
For the one in your picture, Run Kind Directory is selected and that means the IDE will run the tests in the directory you point it at and since the working directory is in the same directory, it will run ./... as that's what it means.
For the Run Kind Package, it will run only the specified package and no other packages, so no /... appended to it.
For the Run Kind File it will run the tests in a single file.
The pattern that you've added, ./svc tells the go tool how to match test names. There you should put valid patterns for test names. If you want to control for which directory / package the tests are run you can use a different run configuration per directory / package since multiple configurations are possible.
Based on your reply you want to run the tests in your whole projects, recursive, without the vendor folder. To do so, create a Run Kind Directory, as you have one already, and make sure sure you are using Go 1.9 as it will automatically ignore the vendor directory when using ./... matching.
Please let me know if you need further details.

determine if clang-format finds .clang-format file (in a shell or cmake script)

what i want to achieve
I want to pack a .clang-format file with my software, which only gets used if the user doesn't provide their own.
My idea so far is to use clang-format -style=file which will find the users .clang-format if it is "located in one of the parent directories of the source file". (Which might be the case because it is in their home directory, or because they are using my package as a git submodule, or because they manually placed it after downloading my software).
If no .clang-format file is found, then the one shipped with my software should be used - e.g. by symlinking to mypackage/auxiliary_files/.clang-format in the top level. I want to do this somewhat automatized from cmake directly or by calling a shell script from cmake (or other).
workflow in short
clang-format finds .clang-format: do nothing (as shell script exit 0; as cmake script set(I-FOUND-CLANG-FORMAT 1) or something similar)
clang-format doesn't find .clang-format: call ln -s auxiliary_files/.clang-format
what I don't want to do
I don't want to write a loop which replicates the search behaviour of clang-format (going one directory up to look for .clang-format until either it's found or the top most directory is reached) to have built-in 100% compatibility.
options i've seen but didn't figure out how to use for my goal
clang-format does not appear to return a non-zero status code if no style file has been provided although style=file is set, even if -fallback-style=none is set. I also don't see in the printout if the fallback option or the regular option is used.

How can I bundle a command line utility in os x application on Mac App Store (using sandbox entitlement)

I have a c++ command line application that I have already compiled into an executable and have added it into my Xcode project. I have also added the "Copy Files" section to the Build Phases tab of the project properties and added my executable with the "Executables" destination. When I build my application I see it in the test.app/Contents/MacOS folder when I View package contents on the test.app that is built.
I also have App Sandbox enabled on the Capabilities tab of the project (so that I can distribute my application through the mac app store.
How can I expose this command line executable that is bundled with my application to the user so that they can run it from the command line (terminal)? I have not been able to find anything on search engines or on StackOverflow about how to get this file (or a symlink to this file) into the users PATH. I tried using an NSTask to create a symlink, but that only works if I disable the App Sandbox (which makes sense). Has anyone done this before? How did you get it to work? Or can these executables only be executed by code within your application?
I don't see a good way to do this. First, a clarification: the PATH is a list of directories that contain executables, not a list of executables; there's no way to add a single executable to the PATH. Instead, what you'd need to do is either put your executable into one of the directories in the user's PATH, or add the directory your executable is in into the PATH.
On OS X, the default PATH is /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin. The first 4 directories shouldn't be modified from the system default, so only /usr/local/bin is a possibility. But creating it (it doesn't exist by default) would require admin (actually root) rights, which isn't allowed by App Store policies. So that's out.
That leaves modifying the user's PATH. The "right" way to do that system-wide is by placing a file in /etc/paths.d, which requires admin (/root) rights, so that's out too. Technically modifying the /etc/paths file would work, but that has the same permissions problem plus it's the wrong way to do customization.
The next possibility is to modify (/create) the user's shell initialization script(s). This'll work, but doing it at all right is going to be messy, because there are several shells the user might use, each with several different possible initialization scripts that the user might or might not have created...
Let's take a very simple case: a user who only ever uses bash, and who doesn't already have any initialization scripts. When a "login" instance of bash starts, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile (in that order), and runs the first one it finds. But your app doesn't know which shell he uses, so you'd better create ~/.profile so zsh and ksh will use it as well. So, your app creates ~/.profile, and puts this in it:
PATH="$PATH:/Applications/MyApp.app/Contents/Helpers"
Great, right? Yup, great, until the user runs something else that wants to set their PATH, it creates ~/.bash_profile, and this overrides your setup. After that, your executable will be in the PATH of zsh and ksh, but not bash. Whee.
And then one day the user decides to use tcsh instead, and it (and csh) have a completely different but equally messy pile of possible init files...

How to install a FindXXX.cmake to a correct location?

I am developing a library which uses CMake to control it. It would be good to provide a "FindXXX.cmake" which locates the library and header files. This file would enable the users to use the command "find_package(XXX)" to find my library.
However, I don't know how to install my lib's "FindXXX.cmake" to an correct location. I failed to find a CMake's build-in mechanism to install a "FindXXX.cmake". In addition, CMake's variable "CMAKE_MODULE_PATH" is a list of directories, so I cannot install according to that vairable because I cannot decide which specific directory to use.
If the copy of CMake is installed to a standard location(i.e. use no prefix etc) then this can be done by placing the file in /usr/share/cmake/Modules/ directory.
If you are going to supply a bundle probably you can add some commands to check if the cmake is available. if yes you can check for cmake --system-information|grep _INCLUDED_SYSTEM_INFO_FILE value from that to get modules directory.
Otherwise there's no way you can do that.
A workaround can be done i.e. if there is a binary in your bundle then you can add a command line option for placing this file.