Re: [CMake] Appending to CMAKE_CXX_FLAGS

2018-09-12 Thread Eric Noulard
Le mar. 11 sept. 2018 à 22:09, Michael Jackson a écrit : > I add it manually each and every time. I have to tell all new developers > to remember to add the flag otherwise they are still sitting after an hour > waiting on our code to compile wondering why it takes so long. Then it hits > us,

Re: [CMake] Appending to CMAKE_CXX_FLAGS

2018-09-11 Thread Thompson, KT
level of my build system prevent me from needing to customize compile flags for individual targets. I hope this helps. -kt -Original Message- From: CMake On Behalf Of Michael Jackson Sent: Tuesday, September 11, 2018 2:10 PM To: cmake@cmake.org Subject: Re: [CMake] Appending to CMAKE

Re: [CMake] Appending to CMAKE_CXX_FLAGS

2018-09-11 Thread Michael Jackson
I add it manually each and every time. I have to tell all new developers to remember to add the flag otherwise they are still sitting after an hour waiting on our code to compile wondering why it takes so long. Then it hits us, "Oh, Yeah. Open CMake-Gui and set the /MP flag". I'm frustrated at

Re: [CMake] Appending to CMAKE_CXX_FLAGS

2018-09-11 Thread Michael Jackson
: Marc CHEVRIER Date: Tuesday, September 11, 2018 at 1:28 PM To: Michael Jackson Cc: CMake Subject: Re: [CMake] Appending to CMAKE_CXX_FLAGS If you set directory property at the top level CMakeList.txt, before any target definition, all targets will inherit this value. And, because pr

Re: [CMake] Appending to CMAKE_CXX_FLAGS

2018-09-11 Thread Richard A. Smith
On 09/11/2018 01:03 PM, Marc CHEVRIER wrote: The best approach is to use properties (see https://cmake.org/cmake/help/git-master/manual/cmake-properties.7.html). At directory level and target level you can use property 'COMPILE_OPTIONS'.  These properties can be updated using, respectively

Re: [CMake] Appending to CMAKE_CXX_FLAGS

2018-09-11 Thread Innokentiy Alaytsev
Hello! Did you consider adding the flag manually during project configuration? I do not know you use case, but after some thinking about the best way of achieving multiprocess compilation under MSVS with CMake I decided, that the simplest, most portable and flexible is to just add this flag

Re: [CMake] Appending to CMAKE_CXX_FLAGS

2018-09-11 Thread Marc CHEVRIER
Marc CHEVRIER > *Date: *Tuesday, September 11, 2018 at 1:04 PM > *To: *Michael Jackson > *Cc: *CMake > *Subject: *Re: [CMake] Appending to CMAKE_CXX_FLAGS > > > > The best approach is to use properties (see > https://cmake.org/cmake/help/git-master/manual/cmake-proper

Re: [CMake] Appending to CMAKE_CXX_FLAGS

2018-09-11 Thread Michael Jackson
[e] mike.jack...@bluequartz.net [w] www.bluequartz.net From: Marc CHEVRIER Date: Tuesday, September 11, 2018 at 1:04 PM To: Michael Jackson Cc: CMake Subject: Re: [CMake] Appending to CMAKE_CXX_FLAGS The best approach is to use properties (see https://cmake.org/cmake/help/git-master

Re: [CMake] Appending to CMAKE_CXX_FLAGS

2018-09-11 Thread Marc CHEVRIER
The best approach is to use properties (see https://cmake.org/cmake/help/git-master/manual/cmake-properties.7.html). At directory level and target level you can use property 'COMPILE_OPTIONS'. These properties can be updated using, respectively 'add_compile_options' and 'target_compile_options'.

[CMake] Appending to CMAKE_CXX_FLAGS

2018-09-11 Thread Michael Jackson
What is the “modern” way to append to CMAKE_CXX_FLAGS? This is the logic that I would like: If (MSVC)     Set(CMAKE_CXX_FLAGS ${ CMAKE_CXX_FLAGS} “/MP”) Endif() I have always heard that appending to the compile flags in this way is “bad”. What is the best practice for doing