MantisBT - CMake
View Issue Details
0014961CMake(No Category)public2014-06-05 16:582016-06-10 14:31
vitaut 
Kitware Robot 
normalminoralways
closedmoved 
CMake 2.8.12.2 
 
0014961: CMake doesn't warn about function redefinition
CMake doesn't prevent or produce a warning/error when redefining functions which is very error prone. For example introducing a conflicting function definition in a subproject can easily break the build of the main project.
Consider the following test project:

CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)
function(test)
  message("parent")
endfunction()
add_subdirectory(sub)
test()

sub/CMakeLists.txt:

function(test)
  message("sub")
endfunction()

Running cmake prints "sub" which means that the test function defined in sub/CMakeLists.txt is used and not in CMakeLists.txt. No warnings or error message is produced.
No tags attached.
Issue History
2014-06-05 16:58vitautNew Issue
2014-06-06 08:31Brad KingStatusnew => backlog
2016-06-10 14:29Kitware RobotNote Added: 0042560
2016-06-10 14:29Kitware RobotStatusbacklog => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042560)
Kitware Robot   
2016-06-10 14:29   
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.