On Fri, 2019-06-21 at 15:28 +0100, David Aldrich wrote:
> > > I would also like this to work if I use the make targets e.g.
> > make
> > > debug.
> > 
> > I think that's outside the scope of the Makefile generator.  For
> > that
> > generator, CMAKE_BUILD_TYPE is a configuration-wide setting.  If
> > you
> > want a different configuration, you need a different build
> > directory
> > (where "build directory" is wherever you run cmake).
> 
> If I don't use make targets (so that user can type 'make debug' etc)
> the build command would be more cumbersome:
> 
> cmake3 --build -D CMAKE_BUILD_TYPE=Debug .

Assuming that command actually triggers a reconfigure (when previously
configured with a different CMAKE_BUILD_TYPE), you'll most likely hose
incremental builds of the other build type(s).  (And if it doesn't
trigger a reconfigure in that case, it's pretty certainly not doing
what you want.)

> What would best practice be to provide convenient commands for our
> developers to easily build the target ?

For the Makefile generator, best practice is to use separate build
directories (i.e., places where you run cmake) for different
configurations (i.e., different settings recorded during the
configuration step).

If you want to provide developers with some known set(s) of
configuration settings, I suggest wrapper scripts that invoke cmake
with those settings.

-- 
Braden McDaniel <bra...@endoframe.com>

-- 

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:
https://cmake.org/mailman/listinfo/cmake

Reply via email to