On 3/17/2013 6:24 AM, Alexey Kutumov wrote:
> * Double CMake invocation;
What is this issue?
Also, some folks at Kitware have tried this build and said that there is
no way to turn off modules. Is this still the case?
Thanks.
-Bill
on Mon Mar 18 2013, Alexey Kutumov <alexey.kutumov-AT-gmail.com> wrote:
> понедельник, 18 марта 2013 г., 21:20:19 UTC+7 пользователь Bill
> Hoffman написал:
>
> On 3/17/2013 6:24 AM, Alexey Kutumov wrote:
> > * Double CMake invocation;
> What is this issue?
>
> You can find more info here: https://groups.google.com/d/topic/
> ryppl-dev/EMIKsYZYaFE/discussion
Basically, it boils down to the fact that (ahem) we're waiting patiently
for CMake 2.8.11 so we can get rid of this hack. Months ago, Daniel
told me it was about to be released. Was there a snag?
>
> Any idea what's going wrong?
Are you missing a "git submodule update"?
> There is a release-candidate available for 2.8.11, but the 'interface
> targets' feature discussed in the above thread is not part of it. It was
> deferred to the following release.
>
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/6395
:(
:(
on Wed Mar 20 2013, Stephen Kelly <steveire-AT-gmail.com> wrote:
> On Wednesday, March 20, 2013 4:45:59 AM UTC+1, Dave Abrahams wrote:
>>
>>
>> on Mon Mar 18 2013, Alexey Kutumov <alexey.kutumov-AT-gmail.com> wrote:
>>
>> > понедельник, 18 марта 2013 г., 21:20:19 UTC+7 пользователь Bill
>> > Hoffman написал:
>> >
>> > On 3/17/2013 6:24 AM, Alexey Kutumov wrote:
>> > > * Double CMake invocation;
>> > What is this issue?
>> >
>> > You can find more info here: https://groups.google.com/d/topic/
>> > ryppl-dev/EMIKsYZYaFE/discussion
>>
>> Basically, it boils down to the fact that (ahem) we're waiting patiently
>> for CMake 2.8.11 so we can get rid of this hack. Months ago, Daniel
>> told me it was about to be released. Was there a snag?
>>
>>
>
> There is a release-candidate available for 2.8.11, but the 'interface
> targets' feature discussed in the above thread is not part of it. It was
> deferred to the following release.
>
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/6395
> I'm not sure why that feature is needed to resolve the 'run cmake twice'
> issue.
> I tried to build the current state of the boost-cmake stuff, but I'mOh, I've been concentrating on other things for the past week but
> having trouble even finding the right repos and fighting with
> submodules.
generating the submodule references is now bumped to the top of my list.
It doesn't need to be completely /done/, but you might need the
> I was going to wait until the git transition was done before bringing
> up the cmake issue again.
submodules. Actually, even that isn't clear to me. I'd really love it
if Daniel could weigh in here.
--
Daniel Pfeifer wrote:
>> > I'm not sure why that feature is needed to resolve the 'run cmake
>> > twice' issue.
>>
>
> I don't currently see this as an issue that needs to be resolved by a
> workaround.
>
> Usage requirements need two passes.
Why? This seems to be a boost-specific requirement. In general, CMake usage requirements does not require two-passes (unless you mean configure-step and generate-step, which you might, reading below), so I'd like to dig to find out the root cause of why boost does. I'd sort of like to understand from 'first principles' and your basic starting assumptions. Is this a temporary situation?
Is the reason a side effect of wanting to use find_package(BoostAny) for example to set the necessary variables and targets? For the purpose of discussion: Why not just set those variables in the top-level CMakeLists.txt file? Ryppl will generate that file anyway in your future vision, right?
> In my opinion the best way is to use Steve's generator expressions for
> usage requirements, hence using the generator run as the second pass.
I'm not really sure I understand what you wrote here and how it relates to a second pass. Maybe it will become clear when the above is cleared up though.
Thanks,
Steve.
Daniel Pfeifer wrote:
>> > I'm not sure why that feature is needed to resolve the 'run cmake
>> > twice' issue.
>>
>
> I don't currently see this as an issue that needs to be resolved by a
> workaround.
>
> Usage requirements need two passes.
Why? This seems to be a boost-specific requirement. In general, CMake usage requirements does not require two-passes (unless you mean configure-step and generate-step, which you might, reading below), so I'd like to dig to find out the root cause of why boost does. I'd sort of like to understand from 'first principles' and your basic starting assumptions. Is this a temporary situation?
Is the reason a side effect of wanting to use find_package(BoostAny) for example to set the necessary variables and targets?
2013/3/24 Stephen Kelly <stev...@gmail.com>
Why? This seems to be a boost-specific requirement. In general, CMake usage requirements does not require two-passes (unless you mean configure-step and generate-step, which you might, reading below), so I'd like to dig to find out the root cause of why boost does. I'd sort of like to understand from 'first principles' and your basic starting assumptions. Is this a temporary situation?
Yes, I see the generate-step as a second pass. It would not be necessary to separate generation from configuration if both could be done in one step, right?
Is the reason a side effect of wanting to use find_package(BoostAny) for example to set the necessary variables and targets?
It is rather an effect of wanting to let each target specify its direct requirements (only).Lets say we have a target A that depends on a library B. As an implementation detail, B depends on C. C depends on a library D which also has a dependency to B.
The only direct depencency of A is B; thats all the author of A should need to care about. The libraries C and D are not used by A directly. B may even get rid of these dependencies without changing its public interface.If this was not modern C++, B would hide C and D behind its binary interface.
But if B, C, and D are header-only libraries, C and D are required to compile A.Important: That does not change the fact that A does not directly depend on them!A more concrete example: When I write a parser, I don't care whether Spirit uses Proto or not!When CMake generates the target A, it needs to know the dependencies of A, B, C, and D.B, C and D form a cluster; it is impossible to add them in topological order.
Currently, our script writes the dependencies to config files that are read by find_package(). These config files are incomplete until the first run is completed. A second run is necessary to actually use them.With generator expressions, we can add the dependencies as target properties that are evaluated in the generator-step. No config files would be required.
Does that explain it a little bit better?
On Sunday, March 24, 2013 10:10:09 PM UTC+1, Daniel Pfeifer wrote:2013/3/24 Stephen Kelly <stev...@gmail.com>Why? This seems to be a boost-specific requirement. In general, CMake usage requirements does not require two-passes (unless you mean configure-step and generate-step, which you might, reading below), so I'd like to dig to find out the root cause of why boost does. I'd sort of like to understand from 'first principles' and your basic starting assumptions. Is this a temporary situation?
Yes, I see the generate-step as a second pass. It would not be necessary to separate generation from configuration if both could be done in one step, right?
Both are done in one CMake run, yes. Partly you seem to need to do some generation before full configuration, right?
Is the reason a side effect of wanting to use find_package(BoostAny) for example to set the necessary variables and targets?
It is rather an effect of wanting to let each target specify its direct requirements (only).Lets say we have a target A that depends on a library B. As an implementation detail, B depends on C. C depends on a library D which also has a dependency to B.
Ok, I think we need to get concrete, so I added a small test repo here: https://www.gitorious.org/cmake-targets
The first commit implements what you describe in the obvious way, and the second commit adds some subdirectories.
The only direct depencency of A is B; thats all the author of A should need to care about. The libraries C and D are not used by A directly. B may even get rid of these dependencies without changing its public interface.If this was not modern C++, B would hide C and D behind its binary interface.
Just to be clear on you terms here, "not modern C++" == "not-header-only libraries" is what you mean, right?
But if B, C, and D are header-only libraries, C and D are required to compile A.Important: That does not change the fact that A does not directly depend on them!A more concrete example: When I write a parser, I don't care whether Spirit uses Proto or not!When CMake generates the target A, it needs to know the dependencies of A, B, C, and D.B, C and D form a cluster; it is impossible to add them in topological order.
That doesn't seem to be a problem so far in the test repo.
Currently, our script writes the dependencies to config files that are read by find_package(). These config files are incomplete until the first run is completed. A second run is necessary to actually use them.With generator expressions, we can add the dependencies as target properties that are evaluated in the generator-step. No config files would be required.
What would that look like?
The only direct depencency of A is B; thats all the author of A should need to care about. The libraries C and D are not used by A directly. B may even get rid of these dependencies without changing its public interface.If this was not modern C++, B would hide C and D behind its binary interface.
Just to be clear on you terms here, "not modern C++" == "not-header-only libraries" is what you mean, right?
Header-only libraries are an extreme (Complete implementation in header files). The other extreme would be to put only declarations in header files and no implementation at all. Most C++ libraries lie somewhere in between. Boost Libraries usually tend towards the header-only extreme. Even those Boost libraries with a binary component don't abstract all their dependencies behind the binary interface.
When CMake generates the target A, it needs to know the dependencies of A, B, C, and D.B, C and D form a cluster; it is impossible to add them in topological order.
That doesn't seem to be a problem so far in the test repo.Let me quote the CMake 2.8.11-rc1 changelog: "Targets can specify usage requirements for their consumers such as include directories and preprocessor definitions; previously only link dependencies were supported".
Your example uses link dependencies. To make this example work with include directories, we need 2.8.11 or 2.8.12.
Currently, our script writes the dependencies to config files that are read by find_package(). These config files are incomplete until the first run is completed. A second run is necessary to actually use them.With generator expressions, we can add the dependencies as target properties that are evaluated in the generator-step. No config files would be required.
What would that look like?You are the expert, Steve. I hope you can replace the TODOs in the test repo after applying my patch.
I've applied your patch and a new patch to the repo. My new patch is the current only way to do what you want (and doesn't need to cmake runs). Is my new patch something that you in particular wanted to avoid doing?