[cmake-developers] [CMake 0013311]: LINK arguments incomplete when using cmake --find_package

Mantis Bug Tracker mantis at public.kitware.com
Mon Jun 18 02:52:27 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13311 
====================================================================== 
Reported By:                Hendrik Sattler
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13311
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-06-18 02:52 EDT
Last Modified:              2012-06-18 02:52 EDT
====================================================================== 
Summary:                    LINK arguments incomplete when using cmake
--find_package
Description: 
Hi,

I try the following commands with my projects config file. It is not installed
but the build tree is registered with export(TARGET).

$ cmake -DNAME=OpenObex -DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=COMPILE
--find-package
-I/home/hendrik/projects/obex/openobex/repository/include

$ cmake -DNAME=OpenObex -DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=LINK
--find-package
-rdynamic lib/libopenobex.so.1.6
-Wl,-rpath,/home/hendrik/projects/obex/openobex/repository/build/lib

I think the latter is missing the complete path to the library or alternatively
a -L entry so it should look the same as using it internally.

This probably also happends with a *-config.cmake file installed in a
non-standard location.

HS

Additional Information: 
openobex-config.cmake:
-------------------------------snip-----------------------------------------
get_filename_component(OpenObex_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if (EXISTS "${OpenObex_CMAKE_DIR}/lib/openobex-build.cmake")
  #in build tree
  include(${OpenObex_CMAKE_DIR}/lib/openobex-build.cmake)
  include(${OpenObex_CMAKE_DIR}/lib/openobex-build-settings.cmake)

  set(OpenObex_INCLUDE_DIRS ${OpenObex_SOURCE_DIR}/include)

else ()
  #in installed tree
  include(${OpenObex_CMAKE_DIR}/openobex-target.cmake)

  set(OpenObex_CMAKE_REL_INCLUDE_DIR "../../../include")
  get_filename_component(OpenObex_ABS_INCLUDE_DIR
    "${OpenObex_CMAKE_DIR}/${OpenObex_CMAKE_REL_INCLUDE_DIR}" ABSOLUTE)

  set(OpenObex_INCLUDE_DIRS "${OpenObex_ABS_INCLUDE_DIR}")
endif()

set(OpenObex_LIBRARIES openobex)
-------------------------------snip-----------------------------------------

lib/openobex-build.cmake:
-------------------------------snip-----------------------------------------
# Generated by CMake 2.8.8

IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
   MESSAGE(FATAL_ERROR "CMake >= 2.6.0 required")
ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
CMAKE_POLICY(PUSH)
CMAKE_POLICY(VERSION 2.6)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------

# Commands may need to know the format version.
SET(CMAKE_IMPORT_FILE_VERSION 1)

# Create imported target openobex
ADD_LIBRARY(openobex SHARED IMPORTED)

# Import target "openobex" for configuration "Debug"
SET_PROPERTY(TARGET openobex APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
SET_TARGET_PROPERTIES(openobex PROPERTIES
  IMPORTED_LOCATION_DEBUG
"/home/hendrik/projects/obex/openobex/repository/build/lib/libopenobex.so.1.6"
  IMPORTED_SONAME_DEBUG "libopenobex.so.2"
  )

# Commands beyond this point should not need to know the version.
SET(CMAKE_IMPORT_FILE_VERSION)
CMAKE_POLICY(POP)
-------------------------------snip-----------------------------------------

lib/openobex-build-settings.cmake:
-------------------------------snip-----------------------------------------
set(OpenObex_SOURCE_DIR "/home/hendrik/projects/obex/openobex/repository")
-------------------------------snip-----------------------------------------

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-06-18 02:52 Hendrik SattlerNew Issue                                    
======================================================================




More information about the cmake-developers mailing list