I am using the following Jamfile ( in directory /home/morpheus/base/CDef ) :
lib CDef : [ glob *.cpp ] : static ;
install libCDef
: CDef
: LIB
“/home/morpheus/base_install/lib”
: release
;
install _libCDef_D
: CDef
: LIB
“/home/morpheus/base_install/libdebug”
: debug
;
I was wondering if the two install lines can be changed to one which has both the debug and release directives.
Also to use the libraries in a different Jamfile in a different directory ( /home/morpheus/FSLR ) I am using the following Jamfile to build the exe callFSLR :
lib CDef : : release CDef /home/morpheus/base_install/lib ;
lib CDef : : debug CDef /home/morpheus/base_install/libdebug ;
exe callFSLR : call_FSLR.cpp CDef : : debug release ;
install install-bin
: callFSLR
: “/home/morpheus/base_install/bin” release
;
I believe using “use-project” to refer to CDef in the Jamfile /home/morpheus/base/CDef/Jamfile is probably adviseable ?
(I think some stuff is missing from your jam rules, possibly due to formatting.)
Yes, you definitely can define both the debug and production targets with the same rule, using conditional requirements. An example is even the documentation of the
installrule.I believe your original rules look like
You’ll want to make the
locationfeature dependendent on the variant, like so:As for the second question, yes,
use-projectwould help, although it shouldn’t be necessary. You want to do this../base/CDef//CDefrefers to the target namedCDefdefined in the project (directory)../base/CDef. This refers to the library rule, so boost build will use the version of the library in the bin directory, not the version created by the install rule. (This might matter if you have dynamic library issues.) Also, you don’t need thelib CDefimmediately above this rule.To avoid the clumsiness of the
../base/CDef, you could use theuse-projectrule to make a new definition for the project. Then should you reorganize the directory structure, you only have one place to change it.Another possibility, if you are going to use the one target in this one Jamfile, is to use the alias rule.