[cmake-developers] Support for version suffixes

2017-03-27 Thread Roger Leigh

Hi folks,

I'd like to bring this issue to your attention to canvas some feedback 
regarding the use of version suffixes:


  https://gitlab.kitware.com/cmake/cmake/issues/16716

This is basically a proposal to allow an optional version suffix like 
"-rc3", "-beta1" etc. in addition to the existing 
major.minor.patch.tweak pattern, for better interoperability with 
systems and software releases already using such suffixes, and also to 
permit the use of such suffixes by CMake projects for their own 
purposes.  A version suffix would be usable anywhere currently using 4 
digit versions, with all the necessary functionality in CMake being 
updated to handle this.


The proposal linked above contains a much more detailed rationale and 
suggested implementation strategy.  I'd be very happy to hear any 
thoughts anyone has regarding this either on the above issue, or here.



Thanks all,
Roger
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Build multiple CMake projects

2017-03-27 Thread Daniel Pfeifer
On Fri, Mar 24, 2017 at 7:35 PM,  wrote:

> Hi,
>
> I have some CMake projects which depend on each other. They provide Config
> scripts (all generated with the help of CMakePackageConfigHelpers) and the
> CMake projects find there dependencies with find_package(). Even the
> transitive dependencies are correctly modelled (exported to the Config
> scripts with find_dependency).
>
> The setup in general is fine. The only drawback is that I have to build
> and install them manually in the correct order. For example A depends on B
> depends on C, I have to build+install first C, than B, then A ...
>
> The number of projects are getting more and more and it's getting harder
> to build them.
>
> So my question:
> a) Is there a CMake way to generate a dependency graph and build them in
> the correct order, i.e., the same as CMake does within a project with the
> targets but this time on project level?
> b) What possiblities are provided by CMake to support this?
> c) Are there tools you can recommend?
>

Make sure that your projects can be used both as a sub-project and as a
installed package. That means: if the installed package provides a target
called C::C, create an alias target with that name, so that projects A and
B can use that name in target_link_libraries in both cases.
The next thing is to make sure that `find_package(C REQUIRED)` finds the
installed package when it supposed to be used, but does nothing when C is
used as a sub-project. This can be achieved by overriding the
`find_package` command. The original command can be called by prefixing it
with _. Your top-level project might look like this:

set(subprojects A B C)

macro(find_package name)
  if("${name}" IN_LIST subprojects)
set("${name}_FOUND" TRUE)
  else()
_find_package("${name}" ${ARGN})
  endif()
endmacro()

add_subdirectory(A)
add_subdirectory(B)
add_subdirectory(C)
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] Build multiple CMake projects

2017-03-27 Thread Petr Kmoch
Hi Jerry,

from your description, it seems like you might be looking for the CMake
module ExternalProject:
https://cmake.org/cmake/help/latest/module/ExternalProject.html

The idea is that you create a "superbuild" CMake project which consists of
ExternalProject_Add calls and related infrastructure, specifying
dependencies between the projects etc. Building this "superbuild" will then
result in acquiring, building, and installing the individual external
projects, in proper order.

Petr


On 24 March 2017 at 19:35,  wrote:

> Hi,
>
> I have some CMake projects which depend on each other. They provide Config
> scripts (all generated with the help of CMakePackageConfigHelpers) and the
> CMake projects find there dependencies with find_package(). Even the
> transitive dependencies are correctly modelled (exported to the Config
> scripts with find_dependency).
>
> The setup in general is fine. The only drawback is that I have to build
> and install them manually in the correct order. For example A depends on B
> depends on C, I have to build+install first C, than B, then A ...
>
> The number of projects are getting more and more and it's getting harder
> to build them.
>
> So my question:
> a) Is there a CMake way to generate a dependency graph and build them in
> the correct order, i.e., the same as CMake does within a project with the
> targets but this time on project level?
> b) What possiblities are provided by CMake to support this?
> c) Are there tools you can recommend?
>
> jerry
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake-developers
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers