[CMake] CMAKE_BUILD_TYPE and exact control of compiler options

2015-10-12 Thread René J . V . Bertin
Hello, I'm using cmake in conjunction with a packaging/distribution system that aims to control the compiler and linker flags, a priori via the usual environment variables. (We're talking about MacPorts.) Using one of the CMAKE_BUILD_TYPE presets, the value of those env. variables appears at

Re: [CMake] CMAKE_BUILD_TYPE and exact control of compiler options

2015-10-12 Thread René J . V . Bertin
René J. V. Bertin wrote: Similarly, is there a way to set preprocessor variables (cf. https://cmake.org/Bug/view.php?id=12928 which has been silent for a long time)? One could do -DINCLUDE_DIRECTORIES=${CPPFLAGS}, but that may lead to unexpected results if CPPFLAGS contains something other than

Re: [CMake] CMAKE_BUILD_TYPE and exact control of compiler options

2015-10-12 Thread Andreas Pakulat
Hi, On Mon, Oct 12, 2015 at 10:39 AM, René J. V. wrote: > Hello, > > I'm using cmake in conjunction with a packaging/distribution system that > aims to > control the compiler and linker flags, a priori via the usual environment > variables. (We're talking about MacPorts.) > > Using one of the CM

Re: [CMake] CMAKE_BUILD_TYPE and exact control of compiler options

2015-10-12 Thread René J . V . Bertin
Andreas Pakulat wrote: > No this is not possible in general. A CMakeLists.txt file can always just > set their own compiler/linker flags. Which would require patching each and every one of them, which isn't exactly desirable. >> - Out of curiosity, what's special about the CMAKE_BUILD_TYPE=Deb

Re: [CMake] CMAKE_BUILD_TYPE and exact control of compiler options

2015-10-13 Thread Dan Liew
Hi, > - If not, what is the best/official way to get exact control over the compiler > and linker options used? I had to do something similar recently where I didn't want ``-DNDEBUG`` to be in any of the configurations. I used ``CMAKE_USER_MAKE_RULES_OVERRIDE `` to set the path to file contain

Re: [CMake] CMAKE_BUILD_TYPE and exact control of compiler options

2015-10-13 Thread René J . V . Bertin
Dan Liew wrote: > Hi, > > >> - If not, what is the best/official way to get exact control over the >> compiler and linker options used? > > I had to do something similar recently where I didn't want > ``-DNDEBUG`` to be in any of the configurations. > > I used ``CMAKE_USER_MAKE_RULES_OVERRIDE