Re: [CMake] printing CMAKE_CXX_FLAGS_* based on build type

2019-09-29 Thread Eric Doenges
Unfortunately, the standard values for CMAKE_BUILD_TYPE only have their first letter capitalized, i.e. for a release build CMAKE_BUILD_TYPE will normally be "Release". To use it like you want to, it would need to be "RELEASE". To get around this problem, we define an all upper-case BUILD_TYPE

Re: [CMake] printing CMAKE_CXX_FLAGS_* based on build type

2019-09-27 Thread Craig Scott
On Sat, Sep 28, 2019 at 8:15 AM Zdenko Podobny wrote: > Yes, build type is known (e.g value of ${CMAKE_BUILD_TYPE} is shown in > output). I use command like this: > cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% > -DCMAKE_PREFIX_PATH=%INSTALL_DIR% -DCMAKE_BUILD_TYPE=Release > > >

Re: [CMake] printing CMAKE_CXX_FLAGS_* based on build type

2019-09-27 Thread Zdenko Podobny
Yes, build type is known (e.g value of ${CMAKE_BUILD_TYPE} is shown in output). I use command like this: cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_PREFIX_PATH=%INSTALL_DIR% -DCMAKE_BUILD_TYPE=Release Zdenko pi 27. 9. 2019 o 23:54 fdk17 napísal(a): > Are you using a

Re: [CMake] printing CMAKE_CXX_FLAGS_* based on build type

2019-09-27 Thread fdk17
Are you using a generator that uses CMAKE_BUILD_TYPE and has it set to a known value? Build type doesn’t have to be set and multi-config generators don’t use it. On Fri, Sep 27, 2019, at 4:18 PM, Zdenko Podobny wrote: > Hello, > > I try to print CMAKE_CXX_FLAGS_DEBUG/CMAKE_CXX_FLAGS_RELEASE

[CMake] printing CMAKE_CXX_FLAGS_* based on build type

2019-09-27 Thread Zdenko Podobny
Hello, I try to print CMAKE_CXX_FLAGS_DEBUG/CMAKE_CXX_FLAGS_RELEASE as one line statement but is does not work for me: message( STATUS "CXX compiler ${CMAKE_BUILD_TYPE} build options: ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}") Produce empy result, but message( STATUS "CXX compiler Release build