Configure the compiler output path in NetBeans

5

Would anyone know how to configure Netbeans, so that when I compile a project, I run the executable in a particular folder? In the project properties, you have the linker option, which I believe is the output of the program, there is this directory:

${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/meu_prog

Does anyone know what these macros mean? How to change this directory?

    
asked by anonymous 08.07.2015 / 15:46

2 answers

2

Yes, it is this location that changes the destination of the file, except that the directory separator is / and not \ .

If there is a directory with the same name as the output file, you may need other settings like putting the .exe at the end of the name in the running configuration ( Propriedades -> Executar -> Comando Executar ).

The documentation of what it means is in the Makefile file, or at least clues to those that are not exactly the same as those listed. In the project, it is located in a folder called Important Files or Important Files in the English version.

  • CND_DISTDIR : distribution directory, where the final files will be;
  • CND_CONF : Does not say, but is the configuration used, it seems equivalent to ${CONF} : It has value Debug , Release or other name you create in the project properties;
  • CND_PLATFORM : the target platform, so vi is the name of the compiler (defined by you) and the host operating system that is building the program. It can be Cygwin_4.x-Windows , or Arduino-Windows , Arduino-Linux , AVR-Linux , etc.

You can also, without changing the program destination, copy it to the location you want by adding the command in the .build-post section of Makefile . If you want to run / debug in the new location change the settings of the Run and Debug commands. Example: after the lines

.build-post: .build-impl
# Add your post 'build' code here...

On Windows, add the line:

${CP} ${CND_ARTIFACT_PATH_${CONF}}.exe ${USERPROFILE}/Desktop/

On Linux, the line is:

${CP} ${CND_ARTIFACT_PATH_${CONF}} ${HOME}/Desktop/

Important : This line starts with a [Tab] character, otherwise it does not work.

Important 2 : ${USERPROFILE}/Desktop/ does not always work. For example: In Windows I changed the folder from my desktop, and this path does not copy the file to my desktop. (Because I changed it's another story) In Linux, the environment I use and does not use the Desktop folder.

    
03.08.2015 / 19:44
0

@Rafael

I needed the same thing, so I found an answer in the English community that served me.

Basically, you can change the directory of the dist folder that contains its .jar (or .exe ) by changing the value of the dist.dir property in the project.properties file (in the case of a project in java) of your project located in the nbproject

dist.dir = dist

To:

dist.dir = /../Desktop 

In my case I put the path to my workspace. Put the full path there of yours.

Response link in English: Link

    
09.07.2015 / 20:04