-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not export install commands if termcolor is a subproject. #67
base: master
Are you sure you want to change the base?
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_SUBPROJECT
can be determined at the beginning of the CMakeLists.txt by checking if anotherproject()
call is present.