Author: Zhu Jincan
Our version control tool uses TortoiseSVN + VisualSVN. I am not quite familiar with one of my development team's practices, that is, after downloading code from SVN, I find that to include a third-party library, I need to add an environment variable first, which is similar to THIRD_PARTY_LIB, the value of this environment variable points to the Home Directory of the third-party library. Why not use relative directory paths to include third-party libraries? In this case, the newly added developer can directly compile the source code after downloading the source code, and does not need to manually add any environment variables. Today, I throw this question to the header, which tells me that it is more convenient to manage third-party libraries using environment variables. First, a third-party library has a version upgrade and file change problem, if a relative directory is used, the location of the third-party library is limited. If you want to change it later, you must change the settings of the source code project file one by one, and use environment variables, if this is not the case, you can create a folder for a new third-party library. You only need to change the value in the environment variable. The second is to use the branches and tags branches in SVN (note: branches: indicates the directory where the released version is stored, that is, the stable version released when the project is released is stored in this directory. Tags: the directory where tags are stored .). Because the branches and tags branches in SVN are constantly updated, it is definitely not appropriate to use relative directories, at the same time, when releasing the tag version, you do not need to package the dll of a third-party library when using environment variables, because these dll can be found through environment variables.
In short, the use of relative paths including third-party libraries is temporary convenience, resulting in a lot of inconvenience in the future. Using environment variables although you need to do more work At the beginning, it will have a lot of benefits for future work.