Do not export install commands if termcolor is a subproject.#67
Do not export install commands if termcolor is a subproject.#67cpp977 wants to merge 2 commits intoikalnytskyi:masterfrom
Conversation
…id of install calls when termcolor is used as a subproject.
|
Hey @cpp977, Thanks for the patch. My cmake-fu is quite rusty, so please help me to understand this a bit better.
|
|
Hey, of course! I will explain how I came to the problem. Could be that they is a better solution. I came to the problem in a project, which exports(installs) only a binary (https://github.com/cpp977/Instantiator). In this project, I include termcolor via the CPM package manager, which is very similar as using the cmake built-in To the 2. question: |
|
I just removed the whole So I'm not confident enough that suggested solution solves the issue. |
…color is processed as a subproject.
|
I am not sure what you did exactly but if the install target is removed, cmake shouldn't install anysthing. |
If termcolor is used as a subproject (e.g. via cpm package manager or via fetch_content()) the install calls should be hidden. This can be achieved by guarding the calls with:
The variable
TERMCOLOR_SUBPROJECTcan be determined at the beginning of the CMakeLists.txt by checking if anotherproject()call is present.