I want to use a modified C++ header library in my own open source project, but not sure what is the usual way to do it.
For example, to use the original header library "CUB" in my project, I only need to:
- download CUB
- include the "umbrella" header file in my source file
- specify the path to the location of cub in my computer in compilation file
However, I modified some source files (fewer than five files) in cub and want to use the modified CUB in my project. Of course I can simply change the path in the compilation file to the location of the modified library on my local computer. But I don't know how to show this change on GitHub as an open-source project.
The only way I can think about is asking other users to download both of my project and the modified header library, but I feel like this is an ugly way, especially when other users have already downloaded the original library in their computers for other uses.
I am new to C++, so any explanation relates to C++ header library and template library will be appreciated.
Your seem to be under the impression that you should keep the library separate from your project, but you should not.
If you are going to modify CUB and use this modified version in your project, you should make it part of your project. For example, you could put it into a
3rd-partyfolder inside of your project directory. In order to make your own changes visible, you could also create a submodule inside your repository:This way, when people visit your main repository, they can navigate to your modified
cub-forkedrepository on GitHub too.You can add
3rd-party/cub-forkedto your include path for easy including of its header files.