MantisBT - CMake
View Issue Details
0013311CMakeCMakepublic2012-06-18 02:522016-06-10 14:31
Hendrik Sattler 
Alex Neundorf 
normalminoralways
closedmoved 
Debian GNU/Linuxtesting
CMake 2.8.8 
 
0013311: LINK arguments incomplete when using cmake --find_package
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
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-----------------------------------------
No tags attached.
related to 0013266closed Alex Neundorf --find-package seems to be unworkable 
child of 0014676closed Alex Neundorf cmake --find-package summary ticket 
Issue History
2012-06-18 02:52Hendrik SattlerNew Issue
2012-06-18 08:32Brad KingAssigned To => Alex Neundorf
2012-06-18 08:32Brad KingStatusnew => assigned
2012-06-18 16:37Alex NeundorfRelationship addedrelated to 0013266
2012-08-13 14:27Alex NeundorfStatusassigned => backlog
2014-01-01 12:22Alex NeundorfRelationship addedchild of 0014676
2016-06-10 14:28Kitware RobotNote Added: 0042069
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042069)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.