[cmake-developers] [CMake 0013029]: Use of SWIG fails for out-of-source builds, if the swig interface file is not placed in same directory as CMakeLists.txt

Mantis Bug Tracker mantis at public.kitware.com
Thu Mar 8 08:48:00 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.itk.org/Bug/view.php?id=13029 
====================================================================== 
Reported By:                Fabian Hachenberg
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13029
Category:                   Modules
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-03-08 08:47 EST
Last Modified:              2012-03-08 08:48 EST
====================================================================== 
Summary:                    Use of SWIG fails for out-of-source builds, if the
swig interface file is not placed in same directory as CMakeLists.txt
Description: 
 *simple library project (see attached minimal example)
 *SWIG is employed to create C#-Wrapper
 *SWIG interface file Hello.i is placed in subfolder swig/
 *in-source build works
 *out-of-source build does complain that it cannot find the wrapper files
created by SWIG in subfolder swig/
 *it turns out, that no wrapper source files are created
 *CMAKE_SWIG_OUTDIR is undefined
 *it seems to be irrelevant, where actual source files are placed

As a workaround you can either
 *place Hello.i in the main folder (where CMakeLists.txt relies)
 *add output directory manually: set(CMAKE_SWIG_OUTDIR
${CMAKE_CURRENT_BINARY_DIR}/swig)



Steps to Reproduce: 
use example project (attached file)

cd build
cmake ..
make


====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-03-08 08:47 Fabian HachenbergNew Issue                                    
2012-03-08 08:48 Fabian HachenbergFile Added: swig_outdir.tar.gz                
   
======================================================================




More information about the cmake-developers mailing list