Source Folder Name Variable lazarus / 9-Editor ---------------------------------------------------------------------- PaulW · 2012-02-26 17:58 In the IDE, is there a variable for the prjoect's source folder?  I want to direct my executable output to an alternate directory.  For example,  I have edited the Project/Options/Compiler Options/Paths/Target file name (-o) to: Code: [Select]$(home)/Lazarus_Projects/First Test/$NameOnly($ProjFile())I would like to dynamically replace the words "First Test" in the above with the name fo the folder in which the source is located - just the source folder, not the entire source path. BTW, I swear I saw an option in the IDE to define or, at least view, the $(variables), but now I can't find it.  Please point me to the right place. Lazarus Version: 0.9.30.2-2 FPC Version: 2.6.0 SVN Revision: x86_64-linux-gtk 2 ---------------------------------------------------------------------- User137 · 2012-02-26 19:26 Does it go into source folder if you change -o to just: Code: [Select]$NameOnly($ProjFile()) At least it does on win32. ---------------------------------------------------------------------- PaulW · 2012-02-26 19:42 Thanks User137, Yes, it does go into the source folder. My issue is that i do not want it to go into the source folder.  I want it to go into another folder, the name of which is the same as the name (not path) of the source folder, but in another directory.  Bottom line, I'm looking for a variable similar to $NameOnly($ProjFile()) that contains only the source folder name for the current project. ---------------------------------------------------------------------- Leledumbo · 2012-02-27 03:28 From here, does $(ProjPath) fulfill what you want? ---------------------------------------------------------------------- PaulW · 2012-02-27 21:43 Thanks, Leledumbo. Unfortunately, $(ProjPath) includes the full project path, not just the project folder. I found the reference you quoted for "IDE Macros in paths and filenames" of interest; however, I could not find anything that returned just the folder name.  I also thought about creating an environmental variable in Linux and Win7 that was specific for the desired location of the output file.  However, I could not figure out a way to extract that variable; tried "Env($MyEnvVarName)", but no luck - returned nil. Looks like I'll have to hard code the path I need in project options target file name as:   "E:\Users\Paul\Lazarus_Projects\Moneydance\$NameOnly($ProjFile())" for Win7 or   "/home/paul/Lazarus_Projects/Moneydance/$NameOnly($ProjFile())" for Linux. OOPS:  That won't work since the target file name is stored in the .compiled file, which when using the above approach, stores the full target path.  What I really need is a path variable that I can put in the target file name that will be recognized by both the Windows and Linux Lazarus IDEs.