[cmake-developers] [CMake 0014459]: SWIG_ADD_MODULE does not create sub directory

Mantis Bug Tracker mantis at public.kitware.com
Fri Oct 4 06:33:37 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14459 
====================================================================== 
Reported By:                Joakim Söderberg
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14459
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-10-04 06:33 EDT
Last Modified:              2013-10-04 06:33 EDT
====================================================================== 
Summary:                    SWIG_ADD_MODULE does not create sub directory
Description: 
When using SWIG_ADD_MODULE to create wrappers, passing the input file from a sub
directory there will be an error when trying to build since swig tries to write
it's output to a directory that does not exist.



Steps to Reproduce: 
The example works fine:
SWIG_ADD_MODULE(example python example.i example.cxx)

This does not work (the input is in a subdirectory):
SWIG_ADD_MODULE(example python subdir/example.i subdir/example.cxx)

This will result in the following error (since SWIG tries to write it's ouput
file to a non-existing directory under the build dir)

Unable to open file ****/build/subdir/examplePYTHON_wrap.c: No such file or
directory

This can be fixed by manually creating the directory:
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/subdir)

This is not obvious or mentioned in the documentation. SWIG_ADD_MODULE should
create the directory it's trying to output to.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-10-04 06:33 Joakim SöderbergNew Issue                                    
======================================================================




More information about the cmake-developers mailing list