<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>6972</bug_id>
          
          <creation_ts>2014-11-16 22:16:54 +0000</creation_ts>
          <short_desc>breaks build of software using cmake packages due to hardcoded paths</short_desc>
          <delta_ts>2016-10-05 12:57:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>configuration</component>
          <version>1.7</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Matthieu Gallien">matthieu_gallien</reporter>
          <assigned_to name="Alexander Kanavin">alex.kanavin</assigned_to>
          <cc>jku</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>47045</commentid>
    <comment_count>0</comment_count>
    <who name="Matthieu Gallien">matthieu_gallien</who>
    <bug_when>2014-11-16 22:16:54 +0000</bug_when>
    <thetext>In d3995ac14ba05c0420f15f264f7e9d0c3af71f74, the cmake call have been changed to provide all paths with hardcoded values. This is causing hardcoded paths in package files generated by cmake (i.e. exampleTargets-noconfig.cmake).
Those packages then fail when one depends on them because the paths are hardwired to /usr/lib or /usr/include.
In Dora, the same packages build fine.
The files generated by cmake should not contain hardcoded path since the files they reference should be located with relative path.

The error is the following:
| CMake Error at /home/mgallien/boards/poky/build/tmp/sysroots/netsam9x25/usr/lib/cmake/KF5DNSSD/KF5DNSSDTargets.cmake:64 (message):
|   The imported target &quot;KF5::DNSSD&quot; references the file
| 
|      &quot;/usr/lib/libKF5DNSSD.so.5.4.0&quot;
| 
|   but this file does not exist.  Possible reasons include:
| 
|   * The file was deleted, renamed, or moved to another location.
| 
|   * An install or uninstall procedure did not complete successfully.
| 
|   * The installation package was faulty and contained
| 
|      &quot;/home/mgallien/boards/poky/build/tmp/sysroots/netsam9x25/usr/lib/cmake/KF5DNSSD/KF5DNSSDTargets.cmake&quot;
| 
|   but not all the files it references.

I believe the problem is not in cmake itself because we are asking it to use absolute paths. Those absolute paths will then trigger differing behavior in cmake when generating package files. Those package files no longer work.

Best regards</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47048</commentid>
    <comment_count>1</comment_count>
    <who name="Matthieu Gallien">matthieu_gallien</who>
    <bug_when>2014-11-17 10:22:17 +0000</bug_when>
    <thetext>Please have a look to this bug I reported some time ago against cmake for details about why hard coded paths may create problems (http://public.kitware.com/Bug/print_bug_page.php?bug_id=14041).

Best regards</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66934</commentid>
    <comment_count>2</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2016-10-05 12:57:14 +0000</bug_when>
    <thetext>I believe this has been fixed by following commit. Please reopen if this is not the case.

commit 7afa09db2e10896c8da91f7d19a569b13e34a7b7
Author: Thomas Witt &lt;Thomas.Witt@bmw.de&gt;
Date:   Mon Aug 22 16:27:11 2016 +0200

    cmake.bbclass: call cmake with a relative path
    
    CMake wants a relative path for CMAKE_INSTALL_*DIR, an absolute path
    breaks cross-compilation. This fact is documented in the following
    ticket: https://cmake.org/Bug/view.php?id=14367
    
    $sysconfdir and $localstatedir are not relative to $prefix, so they are
    still set as absolute paths. With his change ${PROJECT}Targets.cmake
    that are generated by cmakes &quot;export&quot; function will contain relative
    paths instead of absolute ones.
    
    (From OE-Core rev: c03b32bd71dbe04f2f239556fea0b53215e403d7)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>