<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello all!</p>
    <p><br>
    </p>
    <div class="_3xX726aBn29LDbsDtzr_6E _1Ap4F5maDtT1E1YuCiaO0r
      D3IL3FD0RFy_mkKLPwL4" style="max-width:800px" data-click-id="text">
      <div style="color:#1A1A1B" class="_292iotee39Lmt0MkQZ2hPV
        RichTextJSON-root">
        <p class="_1qeIAgB0cPwnLhDF9XSiJM">I am trying to follow the
          modern cmake path and use the find_packages()/link libraries
          way.</p>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM">I am using a test scenario in
          which: LIB_B depends on LIB_A and EXEC_A depends on both.</p>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM">I was wondering how you could
          link EXEC_A to the debug lib version of LIB_B and the release
          version of LIB_A or vice versa.</p>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM">On LIB_A I am using
          set(CMAKE_DEBUG_POSTFIX "-debug")<br>
          so my LIB_A is going to be LIB_A-debug when making the debug
          tree. I install them in /usr/local/lib and both reside there.</p>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM">For example let's say I have
          this line of code in LIB_A:</p>
        <pre class="_3GnarIQX9tD_qsgXkfSDz1"><code class="_34q3PgLsx9zIU5BiSOjFoM">#ifdef Release  
printf("THIS IS RELEASE MODE"); 
#endif 
</code></pre>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM">This is going to
          differentiate LIB_A and LIB_A-debug.</p>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM">in EXEC_A I would use</p>
        <pre class="_3GnarIQX9tD_qsgXkfSDz1"><code class="_34q3PgLsx9zIU5BiSOjFoM">find_package(LIBA REQUIRED) 
add_executable(EXEC_A main.cpp) 
target_link_libraries(EXEC_A PUBLIC LIBS::LIBA LIBS::LIBB) 
</code></pre>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM">assuming I have exported the
          libraries in the LIBS namespace.</p>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM">Is there any way to
          differentiate between library versions?</p>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM">EDIT: I am on Linux (centos)
          and using GCC 8. My CMake version is 3.14</p>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM"><br>
        </p>
        <p class="_1qeIAgB0cPwnLhDF9XSiJM"><br>
        </p>
      </div>
    </div>
    <div class="moz-signature">-- <br>
      <title>Email Signature</title>
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <table style="width: 400px; font-size: 9pt; font-family: Arial,
        sans-serif; line-height:normal;" cellspacing="0" cellpadding="0">
        <tbody>
          <tr>
            <td style=" font-size:12pt; font-family:Arial,sans-serif;
              color:#1793ce; padding-bottom:6px; width:259px"> <span
                style="font-family: Arial, sans-serif; color:#cea917;
                font-weight: bold">Stefanos Mitropoulos</span> <span
                style="font-family: Arial, sans-serif; color:#878787;
                font-size: 10pt;"><span style="font-family: Arial,
                  sans-serif; color:#878787"><br>
                  Developer</span></span> </td>
            <td style=" width:141px; padding-bottom:6px;
              text-align:right;"> <a href="http://www.edps.gr"
                target="_blank"><img alt="Logo" style="width:auto;
                  height:36px; border:0;"
                  src="http://www.edps.gr/img/edps_logo.png" height="36"
                  border="0"></a> </td>
          </tr>
          <tr>
            <td style="width:400px; border-top:1px solid;
              border-top-color:#cea917;" colspan="2" width="400"> </td>
          </tr>
          <tr>
            <td style=" font-size: 10pt; font-family: Arial, sans-serif;
              font-weight:bold; color: #2c2c2c; width:400px;"
              colspan="2" width="400"> <span style="font-family: Arial,
                sans-serif; color:#2c2c2c">EDPS S.A.</span> </td>
          </tr>
          <tr>
            <td style=" font-size: 10pt; font-family: Arial, sans-serif;
              color: #2c2c2c; width:400px;" colspan="2" width="400"> <span
                style="font-family: Arial, sans-serif; color:#2c2c2c">t:
                30-210-8993660</span> </td>
          </tr>
          <tr>
            <td style=" font-size: 10pt; font-family: Arial, sans-serif;
              color: #2c2c2c; width:400px;" colspan="2" width="400"> <span
                style="font-family: Arial, sans-serif; color:#2c2c2c">e:
                <a class="moz-txt-link-abbreviated" href="mailto:smitropoulos@edps.gr">smitropoulos@edps.gr</a></span> </td>
          </tr>
          <tr>
            <td style="width:400px;" colspan="2" width="400"> </td>
          </tr>
          <tr>
            <td style=" font-size: 10pt; font-family: Arial, sans-serif;
              font-weight:bold; color: #1793ce; width:200px;
              height:15px;" width="200"> <span
                style="display:inline-block; height:15px; font-family:
                Arial, sans-serif; font-size: 9pt;"><a
                  href="http://www.edps.gr" target="_blank"
                  style="text-decoration:none;"><span
                    style="font-family:Arial, sans-serif; color:#cea917">www.edps.gr</span></a></span>
            </td>
            <td style="width:200px; text-align:right;" width="200"><span
                style="display:inline-block; height:15px;"></span> <br>
            </td>
          </tr>
          <tr>
            <td style="width:400px;" colspan="2" width="400"> </td>
          </tr>
          <tr>
            <td style=" font-size:8pt; font-family:Arial,sans-serif;
              color:#878787; width:400px; text-align:justify;"
              colspan="2" width="400"> <span style="font-family: Arial,
                sans-serif; color:#878787">The content of this email is
                confidential and intended for the recipient specified in
                message only. It is strictly forbidden to share any part
                of this message with any third party, without a written
                consent of the sender. If you received this message by
                mistake, please reply to this message and follow with
                its deletion, so that we can ensure such a mistake does
                not occur in the future.</span> </td>
          </tr>
        </tbody>
      </table>
          <br>
    </div>
  </body>
</html>