-
Notifications
You must be signed in to change notification settings - Fork 229
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
Adapt options when built as sub-project #249
Adapt options when built as sub-project #249
Conversation
skipp tests and example build, install only
Shouldn't the test be based on https://stackoverflow.com/questions/25199677/how-to-detect-if-current-scope-has-a-parent-in-cmake? This should prevent problems on Windows due to paths being case-insensitive. Also, AFAIK, the variable should be prefixed with Removing the arguments from I'm unsure about the exact purpose of the part you labelled TODO, it was added by @pleroux0. Paul, is this still required in modern CMake? What exactly does it do and how would it interact with the proposed PR? |
see https://discourse.cmake.org/t/top-project-master-project-vocabulary/412/3 Im not sure about |
For The link you posted tells me that |
https://discourse.cmake.org/t/top-project-master-project-vocabulary/412/5 If have already seen 2 mechanisms to detect that:
I always use option 1. The second option technically isn’t guaranteed, since a project name isn’t required to be unique. |
I've seen that. But that is only a part of what is written there. And quite frankly, just quoting back some part doesn't really explain your view. You are leaving out the third option (the one I was talking about). That third option was added by Brad King, a core developer of CMake. The /5 comment doesn't really show any problem with it, just that the author had some problem which could very well be caused by something else as the author himself explains. Also, in the link to SO that I posted above, option 3 is the accepted answer, the person that wrote it has a gold badge for CMake on SO. And finally, I told you that your solution (option 1) could lead to problems on Windows as you need to compare case-insensitive. See also https://stackoverflow.com/a/42716588/2073257 |
That is simply not true. On OSX, the filesystem is also not case sensitive. I never had problems with this. It seems, you dit not see the main point of my patch: the different behaviour in case of a subproject. No one should make his project in this way. |
I did see that. Isn't the commit which closes this doing just that? |
Thanks, I removed the arguments now. FWIW, they should update the documentation. |
It seems option 1 (what you suggested) actually works, while option 3 (the one I found and used) doesn't. I do not understand why option 3 does not work, but it is what it is. The problem seems to show up when I try and use the updated PEGTL in taoJSON. So, despite the arguments made on SO, let us hope that the case-sensitivity is not a problem anymore. I found some folks saying it was related to CMake converting some paths to lower-case, but this is (hopefully) fixed by now? We'll see. |
skipp tests and example build, install only