View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009060CMakeCMakepublic2009-05-22 03:152016-06-10 14:30
Reportercbielow 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0009060: using altered library names (CMAKE_DEBUG_POSTFIX, or OUTPUT_NAME) leads to broken link dependencies
DescriptionHi,

lets start with code:

[CODE]

## append "d" to debug libs (not executables!)
SET(CMAKE_DEBUG_POSTFIX d);

add_library(myLib ${sources});
target_link_libraries(myLib ${QT_LIBRARIES});

add_executable(myExe myExe.C);

## --> now the trouble starts:

## either:
target_link_libraries(myExe optimized myLib${CMAKE_RELEASE_POSTFIX} debug myLib${CMAKE_DEBUG_POSTFIX})
##--> will break QT dependency of myEXE

## or:
target_link_libraries(myExe myLib);
##--> will generate correct QT dependencies but bad library name (missing postfix) in library list of the VS solution file.

[ENDCODE]

my current workaround is to "manually" add the QT dependency to myExe, but this is bad style.

I tried to set the <CONFIG>_OUTPUT_NAME property, but the issue remained...


greetings
Chris
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0017495)
Brad King (manager)
2009-09-14 18:09

set(CMAKE_DEBUG_POSTFIX d)
add_library(myLib ${sources})
target_link_libraries(myLib ${QT_LIBRARIES})
add_executable(myExe myExe.C)

# This line is correct:
target_link_libraries(myExe myLib)

# This line is wrong:
# target_link_libraries(myExe
# optimized myLib${CMAKE_RELEASE_POSTFIX}
# debug myLib${CMAKE_DEBUG_POSTFIX})
# CMake prefers its own targets to be named.
# When you name the target with the suffix then CMake
# does not recognize it as a target of which it knows.

What is the actual link line produced for myexe in each configuration?

What versions of CMake have you tried?
(0030560)
Brad King (manager)
2012-08-13 10:44

Sending issues I'm not actively working on to the backlog to await someone with time for them.

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it:

 http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer or contributor who has the bandwidth to take it on.
(0041561)
Kitware Robot (administrator)
2016-06-10 14:27

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.

 Issue History
Date Modified Username Field Change
2009-05-22 03:15 cbielow New Issue
2009-09-14 12:44 Bill Hoffman Status new => assigned
2009-09-14 12:44 Bill Hoffman Assigned To => Brad King
2009-09-14 18:09 Brad King Note Added: 0017495
2012-08-13 10:44 Brad King Status assigned => backlog
2012-08-13 10:44 Brad King Note Added: 0030560
2016-06-10 14:27 Kitware Robot Note Added: 0041561
2016-06-10 14:27 Kitware Robot Status backlog => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:30 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team