Re: [CMake] How to support separate debug and release build directories?

2019-07-14 Thread Marc Herbert
> > >> I am not finding it easy to find 'patterns' for these sort of issues. I >> would have thought that configuring a project with separate debug and >> release directories would be quite typical. But it's hard to find the >> recommended way of doing such things. >> > > It is typical: >

Re: [CMake] How to support separate debug and release build directories?

2019-07-14 Thread Marc Herbert
Le ven. 21 juin 2019 à 11:40, Michael Jackson a écrit : > > cd Foo > >mkdir Debug && cd Debug > >cmake -DCMAKE_BUILD_TYPE=Debug ../ > >make -j > > > > We have just created a Debug build in the Debug Directory. Now, the same > is analogous for the Release build. > > > > Cd Foo > >

Re: [CMake] How to support separate debug and release build directories?

2019-06-24 Thread David Aldrich
> > David, > > I think a bit more explanation of the philosophy (at least how I > interpret it) is needed. I see in your emails that you are “targeting > makefiles”. With CMake you need to really stop thinking this way. Rarely do > you need to target any specific build system (although those

Re: [CMake] How to support separate debug and release build directories?

2019-06-21 Thread Michael Jackson
emails. Glad to have you in the CMake community. -- Mike Jackson From: CMake on behalf of David Aldrich Date: Friday, June 21, 2019 at 12:10 PM To: Braden McDaniel Cc: CMake Subject: Re: [CMake] How to support separate debug and release build directories? > What would best practi

Re: [CMake] How to support separate debug and release build directories?

2019-06-21 Thread David Aldrich
> > > 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

Re: [CMake] How to support separate debug and release build directories?

2019-06-21 Thread Braden McDaniel
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

Re: [CMake] How to support separate debug and release build directories?

2019-06-21 Thread David Aldrich
> > > 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

Re: [CMake] How to support separate debug and release build directories?

2019-06-21 Thread Braden McDaniel
On Fri, 2019-06-21 at 14:19 +0100, David Aldrich wrote: > Thanks for the help I have received in the past few days. I am making > incremental improvements to my CMake project and have a new > challenge. I am running CMake 3.13 on Centos 7.6, targeting make. > My CMake file successfully builds

Re: [CMake] How to support separate debug and release build directories?

2019-06-21 Thread David Demelier
Le 21/06/2019 à 15:42, David Aldrich a écrit : Do never test CMAKE_BUILD_TYPE in CMakeLists.txt files, it is ignored in multiple generators (e.g. Visual Studio). Does that mean I shouldn't have this in CMakeLists.txt? : # Specify a Release build by default if(NOT CMAKE_BUILD_TYPE)

Re: [CMake] How to support separate debug and release build directories?

2019-06-21 Thread David Aldrich
> > Do never test CMAKE_BUILD_TYPE in CMakeLists.txt files, it is ignored in > multiple generators (e.g. Visual Studio). > Does that mean I shouldn't have this in CMakeLists.txt? : # Specify a Release build by default if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") message(STATUS

Re: [CMake] How to support separate debug and release build directories?

2019-06-21 Thread David Demelier
Le 21/06/2019 à 15:19, David Aldrich a écrit : I now want to support separate target directories: build/debug and build/release.  I've shown my CMakeLists.txt below. So far I've just added an attempt to support build/debug: if (CMAKE_BUILD_TYPE EQUAL "DEBUG")     message("debug mode")    

[CMake] How to support separate debug and release build directories?

2019-06-21 Thread David Aldrich
Thanks for the help I have received in the past few days. I am making incremental improvements to my CMake project and have a new challenge. I am running CMake 3.13 on Centos 7.6, targeting make. My CMake file successfully builds debug or release targets and puts the executable in an