<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi,</p>
    <p>I was hoping this would work:</p>
    <pre>$<IF:$<TARGET_PROPERTY:CXX_EXTENSIONS>,${CMAKE_CXX$<TARGET_PROPERTY:CXX_STANDARD>_EXTENSION_COMPILE_OPTION},${CMAKE_CXX$<TARGET_PROPERTY:CXX_STANDARD>_STANDARD_COMPILE_OPTION}>
</pre>
    <p>But apparently it's not legal to calculate a variable name based
      on a generator expression. Is there some elegant way to get want I
      want here or do I have to check specifically for 98, 11, 14, 17,
      20, etc?</p>
    <p>Thanks,</p>
    <p>Chris.<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 6/1/18 8:27 AM, Chris Green wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:9e5d8429-2a33-66a3-4f5a-88dad1a7a5ba@fnal.gov">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <p>Hi,</p>
      <p>I'll give this a shot, thank you. Ideally we'd have a generator
        expression pick up ${std} from the relevant target property, but
        I'll have to play with that since I'm not familiar enough with
        generator expressions to know <i>a priori</i> how this will
        turn out.</p>
      <p>Thanks for your help,</p>
      <p>Chris.<br>
      </p>
       <br>
      <div class="moz-cite-prefix">On 5/30/18 3:12 PM, Chuck Atkins
        wrote:<br>
      </div>
      <blockquote type="cite"
cite="mid:CAOXZzG5kcL_A=RadzcJsDmh9esYBTY=ry-NUSEurHLm9kUab=w@mail.gmail.com">
        <meta http-equiv="Content-Type" content="text/html;
          charset=utf-8">
        <div dir="ltr">Hi Chris.<br>
          <div>
            <div class="gmail_extra">
              <div class="gmail_quote"><br>
                <div>Try using the the
                  CMAKE_CXX${std}_STANDARD_COMPILE_OPTION variable.  For
                  example, the folowing piece of CMake code:</div>
                <div style="margin-left:40px"><span
                    style="font-family:monospace,monospace">cmake_minimum_required(VERSION
                    3.9)<br>
                    <br>
                    project(foo CXX)<br>
                        <br>
                    foreach(std IN ITEMS 98 11 14 17)<br>
                      message("C++${std} std flags:
                    ${CMAKE_CXX${std}_STANDARD_COMPILE_OPTION}")<br>
                      message("C++${std} ext flags:
                    ${CMAKE_CXX${std}_EXTENSION_COMPILE_OPTION}")<br>
                    endforeach()</span><br>
                  <br>
                </div>
                <div>Wll generate for GCC on Linux:</div>
                <div style="margin-left:40px"><span
                    style="font-family:monospace,monospace">-- The CXX
                    compiler identification is GNU 8.1.1<br>
                    -- Check for working CXX compiler: /usr/bin/c++<br>
                    -- Check for working CXX compiler: /usr/bin/c++ --
                    works<br>
                    -- Detecting CXX compiler ABI info<br>
                    -- Detecting CXX compiler ABI info - done<br>
                    -- Detecting CXX compile features<br>
                    -- Detecting CXX compile features - done<br>
                    C++98 std flags: -std=c++98<br>
                    C++98 ext flags: -std=gnu++98<br>
                    C++11 std flags: -std=c++11<br>
                    C++11 ext flags: -std=gnu++11<br>
                    C++14 std flags: -std=c++14<br>
                    C++14 ext flags: -std=gnu++14<br>
                    C++17 std flags: -std=c++1z<br>
                    C++17 ext flags: -std=gnu++1z<br>
                    -- Configuring done</span><br>
                </div>
                <div><br>
                </div>
                <div>PGI on Linux:</div>
                <div style="margin-left:40px"><span
                    style="font-family:monospace,monospace">-- The CXX
                    compiler identification is PGI 18.4.0<br>
                    -- Check for working CXX compiler:
                    /opt/pgi/linux86-64/18.4/bin/pgc++<br>
                    -- Check for working CXX compiler:
                    /opt/pgi/linux86-64/18.4/bin/pgc++ -- works<br>
                    -- Detecting CXX compiler ABI info<br>
                    -- Detecting CXX compiler ABI info - done<br>
                    -- Detecting CXX compile features<br>
                    -- Detecting CXX compile features - done<br>
                    C++98 std flags: -A<br>
                    C++98 ext flags: --gnu_extensions<br>
                    C++11 std flags: --c++11;-A<br>
                    C++11 ext flags: --c++11;--gnu_extensions<br>
                    C++14 std flags: --c++14;-A<br>
                    C++14 ext flags: --c++14;--gnu_extensions<br>
                    C++17 std flags: --c++17;-A<br>
                    C++17 ext flags: --c++17;--gnu_extensions<br>
                    -- Configuring done</span><br>
                  <br>
                </div>
                <div><br>
                </div>
                <div>And for IBM XL on AIX:</div>
                <div>
                  <div style="margin-left:40px"><span
                      style="font-family:monospace,monospace">-- The CXX
                      compiler identification is XL 13.1.3<br>
                      -- Check for working CXX compiler: /usr/bin/xlC<br>
                      -- Check for working CXX compiler: /usr/bin/xlC --
                      works<br>
                      -- Detecting CXX compiler ABI info<br>
                      -- Detecting CXX compiler ABI info - done<br>
                      -- Detecting CXX compile features<br>
                      -- Detecting CXX compile features - done<br>
                      C++98 std flags: -qlanglvl=strict98<br>
                      C++98 ext flags: -qlanglvl=extended<br>
                      C++11 std flags: -qlanglvl=extended0x<br>
                      C++11 ext flags: -qlanglvl=extended0x<br>
                      C++14 std flags: <br>
                      C++14 ext flags: <br>
                      C++17 std flags: <br>
                      C++17 ext flags: <br>
                      -- Configuring done<br>
                      -- Generating done</span><br>
                  </div>
                </div>
                <br>
              </div>
              - Chuck<br>
            </div>
          </div>
        </div>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>