The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=14520 ====================================================================== Reported By: Adrien Bruneton Assigned To: ====================================================================== Project: CMake Issue ID: 14520 Category: CMake Reproducibility: always Severity: major Priority: normal Status: new ====================================================================== Date Submitted: 2013-10-29 04:08 EDT Last Modified: 2013-10-29 04:08 EDT ====================================================================== Summary: UseSWIG module can generate too long command lines in the build chain Description: The macro SWIG_ADD_SOURCE_TO_MODULE in the standard module UseSWIG can potentially generate too long command lines in the build chain, making the build fail. This macro is called by SWIG_ADD_MODULE (main entry point). The problem typically appears first under Windows (which has tighter restrictions in terms of maximal command line length).
In complex projects it is often the case that identical include directories are repeated several times. The CMake command INCLUDE_DIRECTORIES deals with this situation nicely and only keeps one instance of each directory, and hence one iteration of the "-I/a/b/c" directive. This is not the case when invoking SWIG_ADD_MODULE: the "-I/a/b/c" directive is repeated as many times as the (same) directory was included. Steps to Reproduce: Call SWIG_ADD_MODULE macro in a subdirectory performing (many) redundant includes. Additional Information: Below a proposed patch to the file UseSWIG.cmake helping mitigating the issue. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2013-10-29 04:08 Adrien BrunetonNew Issue 2013-10-29 04:08 Adrien BrunetonFile Added: patch-UseSWIG.patch ====================================================================== -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers