View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013029CMakeModulespublic2012-03-08 08:472014-06-02 08:37
ReporterFabian Hachenberg 
Assigned Tojschueller 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionduplicate 
PlatformIntelOSSuse Linux EnterpriseOS Version10.4
Product VersionCMake 2.8.7 
Target VersionFixed in VersionCMake 3.0 
Summary0013029: 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 Reproduceuse example project (attached file)

cd build
cmake ..
make

TagsNo tags attached.
Attached Filesgz file icon swig_outdir.tar.gz [^] (800 bytes) 2012-03-08 08:48

 Relationships
duplicate of 0013772closedjschueller UseSWIG.cmake does not handle relative paths with parent directories 

  Notes
(0030105)
CD (reporter)
2012-07-22 11:10

This happens because the directory that swig tries to write its wrapper code source file does not exist. A fix is to have cmake create the file before swig is called. See issue 0013042.
(0036033)
Robert Maynard (manager)
2014-06-02 08:37

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-03-08 08:47 Fabian Hachenberg New Issue
2012-03-08 08:48 Fabian Hachenberg File Added: swig_outdir.tar.gz
2012-07-22 11:10 CD Note Added: 0030105
2013-11-26 03:07 jschueller Assigned To => jschueller
2013-11-26 03:07 jschueller Status new => assigned
2013-11-26 03:07 jschueller Relationship added duplicate of 0013772
2013-11-26 03:07 jschueller Status assigned => resolved
2013-11-26 03:07 jschueller Fixed in Version => CMake 3.0
2013-11-26 03:07 jschueller Resolution open => duplicate
2014-06-02 08:37 Robert Maynard Note Added: 0036033
2014-06-02 08:37 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team