Weird cmake 'errors'

Brad King brad.king at kitware.com
Tue Nov 25 22:32:14 CET 2008


Alexander Neundorf wrote:
> On Tuesday 25 November 2008, Benjamin Reed wrote:
>> On Wed, Nov 19, 2008 at 5:27 PM, Marijn Kruisselbrink
>>
>> <m.kruisselbrink at student.tue.nl> wrote:
>>> When I try to compile any module other than kdelibs on Mac OSX, I get
>>> lots and lots of "CMake Internal Error (please report a bug) in
>>> CMakeLists.txt: GetLibraryNamesInternal called on imported target:
>>> kdecore", and similar lines. Fortunately cmake still manages to generate
>>> correct Makefiles, but it still is annoying. Is this something that is
>>> wrong in our usage of cmake, or
>> I can confirm this issue with the 4.1.80 packages that were just
>> released on the packaging list as well -- kdepimlibs errors out as
>> well.
>>
>> I've made a minimal test-case (attached).  
> 
> Is this really minimal ?

Based on possible paths in source code, I've produced this minimal test 
case that does not depend on KDE:

   cmake_minimum_required(VERSION 2.6)
   project(FOO C)
   add_library(foo SHARED IMPORTED)
   add_executable(bar bar.c)
   target_link_libraries(bar foo)
   install(TARGETS bar DESTINATION bin)

The problem is created only on Mac.  It is when CMake constructs the 
install_name_tool call for target 'bar' to try to map the install_name 
embedded in 'bar' to look for 'foo'.  The code that does this 
incorrectly assumes 'foo' is a non-imported target.  I'm looking into a fix.

-Brad


More information about the Kde-buildsystem mailing list