[cmake-developers] [CMake 0014018]: SelectLibraryConfigurations wrongly set basename_LIBRARY

Mantis Bug Tracker mantis at public.kitware.com
Fri Mar 15 09:49:21 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14018 
====================================================================== 
Reported By:                luc.touraille
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14018
Category:                   Modules
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-03-15 09:49 EDT
Last Modified:              2013-03-15 09:49 EDT
====================================================================== 
Summary:                    SelectLibraryConfigurations wrongly set
basename_LIBRARY
Description: 
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.

Steps to Reproduce: 
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]

Additional Information: 
The issue can be resolved by using a temporary variable for building the list
instead of manipulating basename_LIBRARY directly.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-03-15 09:49 luc.touraille  New Issue                                    
2013-03-15 09:49 luc.touraille  File Added: CMakeLists.txt                    
======================================================================




More information about the cmake-developers mailing list