The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=14961 ====================================================================== Reported By: vitaut Assigned To: ====================================================================== Project: CMake Issue ID: 14961 Category: (No Category) Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2014-06-05 16:58 EDT Last Modified: 2014-06-05 16:58 EDT ====================================================================== Summary: CMake doesn't warn about function redefinition Description: 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.
Steps to Reproduce: 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. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2014-06-05 16:58 vitaut New Issue ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers