on Tue Nov 20 2012, Stephen Kelly <steveire-AT-gmail.com> wrote:
> Hi,
>
> I'm trying to patch the repos up a bit to try out my new cmake target
> usage requirements features, but the you-must-run-cmake-twice stuff is
> getting in the way and confusing me.
Daniel Pfeifer is the expert on that part, but IIUC it is there because
there are dependency cycles among some of the libraries, which only get
fully resolved by CMake if we run it twice.
> As far as I know, that trick is only needed as a workaround for the
> lack of the 'multiple export sets' feature which is new in CMake
> 2.8.10 (http://public.kitware.com/Bug/view.php?id=12588).
I'm not entirely sure, but from reading the ticket it sounds plausible.
> If we can bump the dependency to that version of CMake, we can remove
> the trick and make the cmake code more simple.
> Thoughts? Volunteers? I might be able to do it, but I'm not sure how
> much and how many areas the trick touches in order to remove it.
Hopefully Daniel will jump in here soon. I think, except for Daniel,
you're probably the person around here most qualified to do it. :-)
on Tue Nov 20 2012, Daniel Pfeifer <purplekarrot-AT-gmail.com> wrote:
> Am Dienstag, 20. November 2012 18:38:30 UTC+1 schrieb Dave Abrahams:
>
>
> In my opinion, we can set the minimum required version of CMake to
> 2.8.11, even if that is not even released yet.
How will we even test it, in that case?
on Tue Nov 20 2012, Daniel Pfeifer <purplekarrot-AT-gmail.com> wrote:
> On Tuesday, November 20, 2012 10:26:04 PM UTC+1, Dave Abrahams wrote:
>
>
> on Tue Nov 20 2012, Daniel Pfeifer <purplekarrot-AT-gmail.com>
> wrote:
>
> > Am Dienstag, 20. November 2012 18:38:30 UTC+1 schrieb Dave
> Abrahams:
> >
> >
> > In my opinion, we can set the minimum required version of CMake
> to
> > 2.8.11, even if that is not even released yet.
>
> How will we even test it, in that case?
>
>
> By using a development version of CMake.
Where do we get that from?
Am Dienstag, 20. November 2012 18:38:30 UTC+1 schrieb Dave Abrahams:
on Tue Nov 20 2012, Stephen Kelly <steveire-AT-gmail.com> wrote:
> Hi,
>
> I'm trying to patch the repos up a bit to try out my new cmake target
> usage requirements features, but the you-must-run-cmake-twice stuff is
> getting in the way and confusing me.
Daniel Pfeifer is the expert on that part, but IIUC it is there because
there are dependency cycles among some of the libraries, which only get
fully resolved by CMake if we run it twice.
> As far as I know, that trick is only needed as a workaround for the
> lack of the 'multiple export sets' feature which is new in CMake
> 2.8.10 (http://public.kitware.com/Bug/view.php?id=12588).
I'm not entirely sure, but from reading the ticket it sounds plausible.
> If we can bump the dependency to that version of CMake, we can remove
> the trick and make the cmake code more simple.The second CMake-run is a temporary workaround. I am more than happy if we can get rid of it.The reason for that workaround are circular dependencies. Each project finds its dependencies with `find_package()' which loads the according <project>_config.cmake files for the build tree.These config files are generated in each CMake-run. In the first run, not all config files are usable yet, hence a second run is required.
Another workaround is that we generate the config files "manually" instead of using `install(EXPORT ...)'. This workaround is obsolete with 2.8.10.
To obsolete the first workaround, I think we need 2.8.11 and your interface targets, Steve.In my opinion, we can set the minimum required version of CMake to 2.8.11, even if that is not even released yet.
Am Dienstag, 20. November 2012 22:23:26 UTC+1 schrieb Daniel Pfeifer:Am Dienstag, 20. November 2012 18:38:30 UTC+1 schrieb Dave Abrahams:
on Tue Nov 20 2012, Stephen Kelly <steveire-AT-gmail.com> wrote:
> Hi,
>
> I'm trying to patch the repos up a bit to try out my new cmake target
> usage requirements features, but the you-must-run-cmake-twice stuff is
> getting in the way and confusing me.
Daniel Pfeifer is the expert on that part, but IIUC it is there because
there are dependency cycles among some of the libraries, which only get
fully resolved by CMake if we run it twice.
> As far as I know, that trick is only needed as a workaround for the
> lack of the 'multiple export sets' feature which is new in CMake
> 2.8.10 (http://public.kitware.com/Bug/view.php?id=12588).
I'm not entirely sure, but from reading the ticket it sounds plausible.
> If we can bump the dependency to that version of CMake, we can remove
> the trick and make the cmake code more simple.The second CMake-run is a temporary workaround. I am more than happy if we can get rid of it.The reason for that workaround are circular dependencies. Each project finds its dependencies with `find_package()' which loads the according <project>_config.cmake files for the build tree.These config files are generated in each CMake-run. In the first run, not all config files are usable yet, hence a second run is required.
If all targets are part of the same buildsystem (as they currently are), then, yes, my topic should help. If the plan is to eventually build boost libraries standalone, then I think the bootstrapping will remain a bit complex until the dependencies are reduced.
Am Dienstag, 20. November 2012 23:38:46 UTC+1 schrieb Stephen Kelly:
Am Dienstag, 20. November 2012 22:23:26 UTC+1 schrieb Daniel Pfeifer:Am Dienstag, 20. November 2012 18:38:30 UTC+1 schrieb Dave Abrahams:
on Tue Nov 20 2012, Stephen Kelly <steveire-AT-gmail.com> wrote:
> Hi,
>
> I'm trying to patch the repos up a bit to try out my new cmake target
> usage requirements features, but the you-must-run-cmake-twice stuff is
> getting in the way and confusing me.
Daniel Pfeifer is the expert on that part, but IIUC it is there because
there are dependency cycles among some of the libraries, which only get
fully resolved by CMake if we run it twice.
> As far as I know, that trick is only needed as a workaround for the
> lack of the 'multiple export sets' feature which is new in CMake
> 2.8.10 (http://public.kitware.com/Bug/view.php?id=12588).
I'm not entirely sure, but from reading the ticket it sounds plausible.
> If we can bump the dependency to that version of CMake, we can remove
> the trick and make the cmake code more simple.The second CMake-run is a temporary workaround. I am more than happy if we can get rid of it.The reason for that workaround are circular dependencies. Each project finds its dependencies with `find_package()' which loads the according <project>_config.cmake files for the build tree.These config files are generated in each CMake-run. In the first run, not all config files are usable yet, hence a second run is required.
If all targets are part of the same buildsystem (as they currently are), then, yes, my topic should help. If the plan is to eventually build boost libraries standalone, then I think the bootstrapping will remain a bit complex until the dependencies are reduced.Do you think so? When a library is built standalone, it will call `find_package()' to import the targets it depends on. When the dependencies are part of the same buildsystem, that `find_package()' call is not necessary: At generation time, there will be a target for each dependency.
The library does not know whether it is part of a monolithic build or not, so the `find_package()' function should be used and then be disabled (somehow) in the top level project. Something like:set(BoostFilesystem_IS_PART_OF_THE_BUILDSYSTEM ON)set(BoostSystem_IS_PART_OF_THE_BUILDSYSTEM ON)add_subdirectory(boost/filesystem)add_subdirectory(boost/system)The `find_package(BoostSystem)' inside `boost/filesystem/CMakeLists.txt' should do nothing at all, because by setting `BoostSystem_IS_PART_OF_THE_BUILDSYSTEM', we guarantee that at configuration time there will be an interface `boost::system' that can be resolved. All other dependencies are expected to be installed on the system.
That top-level `CMakeLists.txt' file with all the `set(*_IS_PART_OF_THE_BUILDSYSTEM ON)' and `add_subdirectory(*)' calls shall be automatically generated by the Ryppl tool.Do you thinkt that would be possible?
The library does not know whether it is part of a monolithic build or not, so the `find_package()' function should be used and then be disabled (somehow) in the top level project. Something like:set(BoostFilesystem_IS_PART_OF_THE_BUILDSYSTEM ON)set(BoostSystem_IS_PART_OF_THE_BUILDSYSTEM ON)add_subdirectory(boost/filesystem)add_subdirectory(boost/system)The `find_package(BoostSystem)' inside `boost/filesystem/CMakeLists.txt' should do nothing at all, because by setting `BoostSystem_IS_PART_OF_THE_BUILDSYSTEM', we guarantee that at configuration time there will be an interface `boost::system' that can be resolved. All other dependencies are expected to be installed on the system.
Or just put a conditional around the find_package:
if (NOT TARGET boost::system)
find_package(BoostSystem)
endif()
a) downloaded as a prebuilt archive, Ryppl will write "set(Dependency_DIR <path>)" where <path> is where the archive was extracted to.
b) part of the buildsystem, Ryppl will write "add_subdirectory(..)".c) installed on the system, Ryppl writes nothing.