<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 28, 2019 at 8:15 AM Zdenko Podobny <<a href="mailto:zdenop@gmail.com">zdenop@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Yes, build type is known (e.g
value of ${CMAKE_BUILD_TYPE} is shown in output). I use command like this:<div>cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_PREFIX_PATH=%INSTALL_DIR% -DCMAKE_BUILD_TYPE=Release<br></div><div><br></div><div><br clear="all"><div><div dir="ltr" class="gmail-m_7425960830389612563gmail_signature">Zdenko</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">pi 27. 9. 2019 o 23:54 fdk17 <<a href="mailto:fdk17@ftml.net" target="_blank">fdk17@ftml.net</a>> napísal(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u><div><div>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. <br></div><div><br></div><div>On Fri, Sep 27, 2019, at 4:18 PM, Zdenko Podobny wrote:<br></div><blockquote type="cite" id="gmail-m_7425960830389612563gmail-m_-284193789547238913qt"><div dir="ltr"><div>Hello,<br></div><div><br></div><div>I try to print CMAKE_CXX_FLAGS_DEBUG/CMAKE_CXX_FLAGS_RELEASE as one line statement but is does not work for me:<br></div><div><br></div><div>message( STATUS "CXX compiler ${CMAKE_BUILD_TYPE} build options: ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}")<br></div></div></blockquote></div></blockquote></div></div></blockquote><div><br></div><div>CMake variable names are case-sensitive. The value of CMAKE_BUILD_TYPE is likely not all uppercase, so ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}} will almost certainly end up naming a variable that isn't defined.</div><div><br></div><div>Also, as fdk17 has already mentioned, CMAKE_BUILD_TYPE isn't always defined. For multi-configuration generators (e.g. Visual Studio, Xcode), it typically won't be defined and if it was, it would be meaningless. If you have logic switching on CMAKE_BUILD_TYPE, it is usually a sign you are trying to do something you shouldn't (or that you explicitly don't support multi-config generators).</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><blockquote type="cite" id="gmail-m_7425960830389612563gmail-m_-284193789547238913qt"><div dir="ltr"><div></div><div><br></div><div>Produce empy result, but <br></div><div>message(
STATUS "CXX compiler Release build options: ${CMAKE_CXX_FLAGS_RELEASE}")<br></div><div>works as expected.<br></div><div>Is it possible to do it in one line or I have to use if/elseif ?<br></div><div><br></div><div><div><div dir="ltr">Zdenko<br></div></div></div></div></blockquote></div></blockquote></div></div></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div><div><br></div><div>Get the hand-book for every CMake user: <a href="https://crascit.com/professional-cmake/" target="_blank">Professional CMake: A Practical Guide</a><br></div><div>Consulting services (CMake, C++, build/release processes): <a href="https://crascit.com/services" target="_blank">https://crascit.com/services</a></div></div></div></div></div></div></div></div></div></div></div></div></div>