MantisBT - CMake
View Issue Details
0014018CMakeModulespublic2013-03-15 09:492016-06-10 14:31
luc.touraille 
Kitware Robot 
normalminoralways
closedmoved 
CMake-2-8 
 
0014018: SelectLibraryConfigurations wrongly set basename_LIBRARY
When calling select_library_configurations( basename ) when basename_LIBRARY is already in cache, the macro appends basename_LIBRARY to itself. The cache variable is not modified, but subsequent uses of basename_LIBRARY can be problematic.
1. Create a CMakeLists.txt that uses select_library_configurations and uses the lib_LIBRARY variable afterwards, like this one (also attached):

[code]cmake_minimum_required(VERSION 2.8)

include( SelectLibraryConfigurations )

set( FOO_LIBRARY_RELEASE foo )
set( FOO_LIBRARY_DEBUG foo_d )
set( CMAKE_BUILD_TYPE Release )

select_library_configurations( FOO )

message( STATUS "FOO_LIBRARY = ${FOO_LIBRARY}" )[/code]

2. Run cmake twice.

[code]> cmake .
[...]
-- FOO_LIBRARY = optimized;foo;debug;foo_d
[...]
> cmake .
[...]
-- FOO_LIBRARY = optimized;foo;debug;foo_d;optimized;foo;debug;foo_d
[...][/code]
The issue can be resolved by using a temporary variable for building the list instead of manipulating basename_LIBRARY directly.
No tags attached.
txt CMakeLists.txt (268) 2013-03-15 09:49
https://public.kitware.com/Bug/file/4682/CMakeLists.txt
Issue History
2013-03-15 09:49luc.tourailleNew Issue
2013-03-15 09:49luc.tourailleFile Added: CMakeLists.txt
2016-06-10 14:28Kitware RobotNote Added: 0042250
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042250)
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.