The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15258 
====================================================================== 
Reported By:                Arkadiusz Miskiewicz
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15258
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-11-21 02:32 EST
Last Modified:              2014-11-21 02:32 EST
====================================================================== 
Summary:                    3.0.2-3.1rc2: _IMPORT_PREFIX  always used even if
absolute paths are in use - thus breaking build
Description: 

cmake 3.0.2 and 3.1rc2 shows this behaviour.

Anyway kde frameworks 5.4 in kcoreaddons generates via cmake
KF5CoreAddonsTargets.cmake which contains:

/usr/lib64/cmake/KF5CoreAddons/KF5CoreAddonsTargets.cmake contains:

    44  set_target_properties(KF5::CoreAddons PROPERTIES
    45    INTERFACE_COMPILE_DEFINITIONS "KCOREADDONS_LIB"
    46    INTERFACE_INCLUDE_DIRECTORIES 
"${_IMPORT_PREFIX}/include/KF5/KCoreAddons;${_IMPORT_PREFIX}/include/KF5"
    47    INTERFACE_LINK_LIBRARIES "Qt5::Core"
    48  )
    49

Note _IMPORT_PREFIX is being used there. Now according to this code:

http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmExportInstallFileGenerator.cxx;h=89071c052ce28a82f57e06d96b2b7d519259c2f0;hb=HEAD#l72

_IMPORT_PREFIX is empty if using absolute paths. Thus I'm ending up with invalid
"/include/KF5/KcoreAdons" paths.

That's becomes visible when trying to build for example kauth which uses
kcoreaddons:

"CMake Error in src/CMakeLists.txt:
  Imported target "KF5::CoreAddons" includes non-existent path

    "/include/KF5/KCoreAddons"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



Steps to Reproduce: 
Build kcoreaddons using such options:
+ CC=x86_64-pld-linux-gcc CXX=x86_64-pld-linux-g++ CPPFLAGS= /usr/bin/cmake
'-DCMAKE_VERBOSE_MAKEFILE=ON' '-DCMAKE_BUILD_TYPE=PLD'
'-DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64' '-DCMAKE_INSTALL_PREFIX:PATH=/usr'
'-DSYSCONF_INSTALL_DIR:PATH=/etc' '-DCMAKE_CXX_FLAGS_PLD=-O2 -fwrapv -pipe
-Wformat -Werror=format-security -gdwarf-4 -fno-debug-types-section
-fvar-tracking-assignments -g2 -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4 -fPIC -march=x86-64 -gdwarf-4 -fno-debug-types-section
-fvar-tracking-assignments -g2  -DNDEBUG -DQT_NO_DEBUG' '-DCMAKE_C_FLAGS_PLD=-O2
-fwrapv -pipe -Wformat -Werror=format-security -gdwarf-4
-fno-debug-types-section -fvar-tracking-assignments -g2 -Wp,-D_FORTIFY_SOURCE=2
-fstack-protector --param=ssp-buffer-size=4 -fPIC -march=x86-64 -gdwarf-4
-fno-debug-types-section -fvar-tracking-assignments -g2  -DNDEBUG -DQT_NO_DEBUG'
'-DCMAKE_Fortran_FLAGS_PLD=-O2 -fwrapv -pipe -Wformat -Werror=format-security
-gdwarf-4 -fno-debug-types-section -fvar-tracking-assignments -g2
-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC
-march=x86-64 -gdwarf-4 -fno-debug-types-section -fvar-tracking-assignments -g2 
-DNDEBUG -DQT_NO_DEBUG' '-DCMAKE_EXE_LINKER_FLAGS_PLD=-Wl,--as-needed
-Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,combreloc '
'-DCMAKE_SHARED_LINKER_FLAGS_PLD=-Wl,--as-needed -Wl,--no-copy-dt-needed-entries
-Wl,-z,relro -Wl,-z,combreloc ' '-DCMAKE_MODULE_LINKER_FLAGS_PLD=-Wl,--as-needed
-Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,combreloc '
'-DLIB_SUFFIX=64' '-DBUILD_SHARED_LIBS:BOOL=ON'
'-DKDE_INSTALL_USE_QT_SYS_PATHS=ON' '-DBIN_INSTALL_DIR=/usr/bin' ../


then build kauth using the same options.

I assume it's unrealistic to expect cmake developers to do such compilations to
reproduce. Anyway looking into how cmake generated KF5CoreAddonsTargets.cmake
always using _IMPORT_PREFIX and the fact that _IMPORT_PREFIX is empty if using
absolute paths should be enough to figure the problem out.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-11-21 02:32 Arkadiusz MiskiewiczNew Issue                                  
 
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to