<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>The <a moz-do-not-send="true"
        href="https://cmake.org/cmake/help/latest/command/list.html">list</a>
      command is what you want. Specifically, list(GET ...) will return
      the index of a string in the list, and list(INSERT ...) and
      list(REMOVE_ITEM ...) or list(REMOVE_AT ...) to insert and remove
      items.<br>
    </p>
    <div class="moz-cite-prefix">Am 13.11.19 um 00:56 schrieb Unnamed
      User:<br>
    </div>
    <blockquote type="cite"
      cite="mid:370603ee-6289-be71-f814-3c559f3e86f1@gmx.at">Hello
      everyone,
      <br>
      <br>
      i'm relative new to CMake and i need a function that does change
      the
      <br>
      order of a list. So for example when i have a list like
      <br>
      <br>
      set(LIBS_TO_BUILD "BOOST;EIGEN;PYTHON;GLUT;GLFW;NLOHMANNJSON")
      <br>
      <br>
      i need a function to swap places like
      <br>
      <br>
      listSwapString("GLUT", "GLFW", ${LIBS_TO_BUILD}).
      <br>
      <br>
      <br>
      The base code for the function look like this, but i don't even
      know how
      <br>
      to get the index of a string inside of a list or how to insert a
      string
      <br>
      at a certain position and move the other strings to the back.
      <br>
      <br>
      function(bsListInsertBefore)
      <br>
          set(options)
      <br>
          set(oneValueArgs SEARCH INSERT RESULT)
      <br>
          set(multiValueArgs LIST)
      <br>
          cmake_parse_arguments(var
      <br>
              "${options}"
      <br>
              "${oneValueArgs}"
      <br>
              "${multiValueArgs}"
      <br>
              "${ARGN}"
      <br>
          )
      <br>
      endfunction()
      <br>
      <br>
      <br>
      I hope i can count on you, for me as a CMake newbie this is a
      great
      <br>
      task, i stil have a bit of a problem with the syntax.
      <br>
      <br>
      <br>
      best regards,
      <br>
      <br>
      Steven Truppe
      <br>
      <br>
    </blockquote>
    <div class="moz-signature">-- <br>
      <div style="width:480px; text-align: left; font-family: Arial,
        Helvetica, sans-serif;">
        <p style="color: #062d64; font-size: 14px; text-align: left;
          font-family: Arial, Helvetica, sans-serif;">
          <b>Dr. Eric Dönges</b>
          <br>
          Senior Software Engineer
        </p>
        <p style="color: #062d64; font-size: 12px; text-align: left;
          font-family: Arial, Helvetica, sans-serif;">MVTec Software
          GmbH | Arnulfstr. 205 | 80634 Munich | Germany
          <br>
          <a style="font-size: 12px; font-family: Arial, Helvetica,
            sans-serif; color: #062d64;"
            href="mailto:mustermann@mvtec.com">doenges@mvtec.com</a> |
          Tel: +49 89 457 695-0 | <a style="font-size: 12px;
            font-family: Arial, Helvetica, sans-serif; color: #062d64;"
            href="http://www.mvtec.com">www.mvtec.com</a>
          <br>
        </p>
        <p>
          <span style="font-size: 12px; font-family: Arial, Helvetica,
            sans-serif; color: #062d64;">Find our privacy policy <a
              style="font-size: 12px; font-family: Arial, Helvetica,
              sans-serif; color: #062d64;"
              href="https://www.mvtec.com/imprint">here</a>.</span> </p>
        <p style="color: #062d64; font-size: 12px; text-align: left;
          font-family: Arial, Helvetica, sans-serif;"><img
src="https://mvtec.com/fileadmin/Redaktion/newsletter/mail-signature/newsletter-icon.png"
            valign="bottom" width="16" height="16"> <a style="font-size:
            12px; font-family: Arial, Helvetica, sans-serif; color:
            #062d64; font-weight: bold;"
            href="https://www.mvtec.com/newsletter">Sign up</a> for our
          MVTec Newsletter!</p>
        <p style="margin: 0px; color: #666; font-size: 12px; text-align:
          left; font-family: Arial, Helvetica, sans-serif;">Geschäftsführer:
          Dr. Wolfgang Eckstein, Dr. Olaf Munkelt<br>
          Amtsgericht München HRB 114695</p>
        <p style="margin: 0px; color: #666; font-size: 12px; text-align:
          left; font-family: Arial, Helvetica, sans-serif;"> </p>
        <img
src="https://www.mvtec.com/fileadmin/Redaktion/newsletter/mail-signature/mvtec-logo-line.png"
          alt="MVTec Software GmbH Logo"></div>
    </div>
  </body>
</html>