How to configure big 3rd-party lib with individual paths and make it easy to transplant?
When we use big third-party library, considering each computer may have its individual lib path, we set the absolute path in the Visual-Studio Option. So it is not under version control.
Day after day, there are a lot of absolute library setting. When a newbie comes, there are a lot of setting work to do, and it is easy to make mistakes.
How to set big third-party library开发者_开发知识库 appropriately.
Thanks.
Here are some options that we usually do:
Use Environment variables, to avoid absolute path. In this case, each user have some freedom to set the location. Visual studio have some pre-defined variables that you can use, please refer to: msdn Aside from that, you can define your own Environment variables to use, this is quite common in some "big" libraries, for example Boost library.
Use "common" settings that all users must adhere. For example, we can set the rule that the project must be put on specific directory.
Define Pre/Post-Build Events. You can set this events to define some "common grounds" for all users. The common operations that we usually do is to set registry value, copy header file, and copy binary
精彩评论