<br>Hi Gaëtan,<br><br>Thanks for pointing out the prior bug about porting cableswig to Debian.  As I&#39;ve discovered previously, Debian is quick to adopt and resolve porting issues, more so than most other open-source porting systems; so it&#39;s no surprise someone on Debian has picked up this issue already.  It looks like the diff file attached to that bug report could be used to patch the cvs checkout.<br>
<br>Before I leap off that cliff, it would be best to have an authoritative perspective on that patch and whether it is the &quot;right&quot; or preferred solution to this installation problem for a stand-alone cableswig port.<br>
<br>Here is the diff from that bug report:<br><br><span style="font-family: courier new,monospace;">##############BEGIN DIFF</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">diff -u -r cableswig-0.1.0+cvs20080107.orig/SWIG/CMakeLists.txt cableswig-0.1.0+cvs20080107.new/SWIG/CMakeLists.txt</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">--- cableswig-0.1.0+cvs20080107.orig/SWIG/CMakeLists.txt    2007-01-10 10:31:37.000000000 -0600</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+++ cableswig-0.1.0+cvs20080107.new/SWIG/CMakeLists.txt    2008-01-07 22:54:23.000000000 -0600</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">@@ -25,6 +25,10 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> SET(SWIG_CXX &quot;\&quot;${CMAKE_CXX_COMPILER}\&quot;&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> SET(SWIG_PLATFORM &quot;\&quot;${CMAKE_SYSTEM}-${CMAKE_C_COMPILER}\&quot;&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+# Install support library.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+SET(SWIG_LIB_INSTALL</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+  ${CMAKE_INSTALL_PREFIX}/${CableSwig_INSTALL_ROOT}lib/CableSwig/SWIGLib)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">@@ -158,7 +162,4 @@</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> CONFIGURE_FILE(${SWIG_SOURCE_DIR}/<a href="http://SWIGConfig.cmake.in">SWIGConfig.cmake.in</a></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   ${SWIG_BINARY_DIR}/SWIGConfig.cmake @ONLY IMMEDIATE)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-# Install support library.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-SET(SWIG_LIB_INSTALL</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-  ${CMAKE_INSTALL_PREFIX}/${CableSwig_INSTALL_ROOT}lib/CableSwig/SWIGLib)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> SUBDIRS(Lib)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Only in cableswig-0.1.0+cvs20080107.new/SWIG: CMakeLists.txt~</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">##############END DIFF</span><br>
<br><br>The CMakeLists.txt file from the CVS (date 20090514) is attached.  This is NOT the same file used to generate the diff above, it is the &quot;current&quot; cvs file that I&#39;m using at the moment for the MacPorts port (we need some kind of date tag to ensure the port is identical and working for a particular checkout).  Note these lines in this CMakeLists.txt:<br>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">##############BEGIN snips from cableswig-cvs-20090514/SWIG/CMakeLists.txt</span><br>


<span style="font-family: courier new,monospace;">  6 SET(-swig_lib- ${SWIG_SOURCE_DIR}/Lib)<br></span><span style="font-family: courier new,monospace;">...</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> 22 SET(SWIG_LIBDIR &quot;${CMAKE_INSTALL_PREFIX}/lib&quot;)<br>
 23 SET(LIBDIR &quot;\&quot;${SWIG_LIBDIR}\&quot;&quot;)<br> 24 SET(SWIG_LIB &quot;\&quot;${SWIG_SOURCE_DIR}/Lib\&quot;&quot;)<br></span><span style="font-family: courier new,monospace;">...</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">118 SET(SWIG_MODULES_PATH ${SWIG_SOURCE_DIR}/CMake)<br></span><span style="font-family: courier new,monospace;">...</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">148 SET(SWIG_EXECUTABLE &quot;${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/swig&quot;)<br>
149 SET(SWIG_LIB_DIR &quot;${SWIG_SOURCE_DIR}/Lib&quot;)<br>150 SET(SWIG_COMMON_INCLUDES &quot;${SWIG_LIB_DIR}&quot;)<br></span><span style="font-family: courier new,monospace;">...</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">155 # Prepare find/use files<br>156 SET(SWIG_USE_FILE ${SWIG_SOURCE_DIR}/UseSWIG.cmake)<br>157 SET(SWIG_USING_SWIG ${SWIG_SOURCE_DIR}/CMake/UsingSwig.cmake)<br>158 CONFIGURE_FILE(${SWIG_SOURCE_DIR}/<a href="http://SWIGConfig.cmake.in">SWIGConfig.cmake.in</a><br>
159   ${SWIG_BINARY_DIR}/SWIGConfig.cmake @ONLY IMMEDIATE)<br>160 <br>161 # Install support library.<br>162 SET(SWIG_LIB_INSTALL<br>163   ${CMAKE_INSTALL_PREFIX}/${CableSwig_INSTALL_ROOT}lib/CableSwig/SWIGLib)<br>164 SUBDIRS(Lib)<br>
</span><span style="font-family: courier new,monospace;">##############END cableswig-20090514/SWIG/CMakeLists.txt</span><br>

<br><br>So, the diff in the bug report will not apply directly to this cvs version of the CMakeLists.txt file.  Now, there are numerous variables that appear to define something related to the SWIG library location.  A simple solution is to identify THE variable that will be most effective in setting the SWIGLib search path for the cswig binary so that it will look for the library below the INSTALL_PREFIX/lib path (i.e.: <span style="font-family: courier new,monospace;">INSTALL_PREFIX/lib/CableSwig/SWIGLib</span>).  If that variable can be set using a -D option to cmake, the problem could be resolved easily.  Without an intimate knowledge of cableswig, I cannot determine how to resolve the problem.<br>
<br>Take care,<br>Darren<br><br><br><br><br><div class="gmail_quote">2009/5/17 Gaëtan Lehmann <span dir="ltr">&lt;<a href="mailto:gaetan.lehmann@jouy.inra.fr">gaetan.lehmann@jouy.inra.fr</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi Darren,<br>
<br>
Could it be related to <a href="http://www.itk.org/Bug/view.php?id=6224" target="_blank">http://www.itk.org/Bug/view.php?id=6224</a> ?<br>
<br>
Gaëtan<br>
<br>
<br>
Le 16 mai 09 à 04:32, Darren Weber a écrit :<div><div></div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi Luis,<br>
<br>
Thanks for pointing out the tutorial, nice tip.  I do have a successful build, but it seems that I need something more than a vanilla build and install.  I apologize in advance for this long email, but there&#39;s no other way than this to explain the situation.  I may need a patch to somehow change how the cswig binary finds the SWIGLib directory.<br>

<br>
I&#39;m a registered MacPorts developer and my focus is on porting kitware tools into the MacPorts system (see http://<a href="http://www.macports.org/" target="_blank">www.macports.org/</a>).  I got involved in this so that I can document the dependencies and the build configuration in a functional system for OSX software distribution that will replicate a given installation on any compatible OSX system, with MacPorts installed.<br>

<br>
In order to use MacPorts, all the configuration details are saved in a Portfile in the MacPorts svn, i.e.:<br>
<a href="http://svn.macports.org/repository/macports/" target="_blank">http://svn.macports.org/repository/macports/</a><br>
<br>
The Portfiles are pseudo tcl scripts.  The content is fairly easy to read too, even if you don&#39;t know tcl.  For example, this is the Portfile I&#39;ve been working on for vtk 5.4.0:<br>
<a href="http://svn.macports.org/repository/macports/trunk/dports/graphics/vtk-devel/Portfile" target="_blank">http://svn.macports.org/repository/macports/trunk/dports/graphics/vtk-devel/Portfile</a><br>
Similarly, this is the Portfile for itk 3.12.0 (still a work in progress):<br>
<a href="http://svn.macports.org/repository/macports/trunk/dports/graphics/InsightToolkit/Portfile" target="_blank">http://svn.macports.org/repository/macports/trunk/dports/graphics/InsightToolkit/Portfile</a><br>
Also, here is a recent commit on a cableswig Portfile (a work in progress):<br>
<a href="http://svn.macports.org/repository/macports/trunk/dports/devel/cableswig/Portfile" target="_blank">http://svn.macports.org/repository/macports/trunk/dports/devel/cableswig/Portfile</a><br>
<br>
One thing to understand about MacPorts is that all the configuration and builds occur in a *temporary* workspace and the &#39;make install&#39; is directed to a *temporary* DESTDIR within the workspace.  Once all the files are installed in the DESTDIR, the MacPorts system scans and logs all the files, then &quot;installs&quot; them to a software repository.  The final &quot;activation&quot; is actually a process of hardlinks from the CMAKE_INSTALL_PATH to this software repository.  A library or application can be &quot;deactivated&quot; by simply removing the hard links and it can be immediately re-activated by creating the hard links again.  It&#39;s a neat system that includes dependency resolution and it&#39;s sweet when it all works well.<br>

<br>
Note that the cmake variables have been updated to the following (which must be defined using the command line cmake with -D options for variables; ${prefix} is &#39;/opt/local&#39;):<br>
<br>
configure.args-append \<br>
    -DBISON_YACC:FILEPATH=${prefix}/bin/bison \<br>
    -DCMAKE_BUILD_TYPE:STRING=Release \<br>
    -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \<br>
    -DCMAKE_OSX_SYSROOT=${universal_sysroot} \<br>
    -DCMAKE_SKIP_RPATH:BOOL=OFF \<br>
    -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \<br>
    -DCSWIG_USE_SYSTEM_GCCXML:BOOL=ON \<br>
    -DSWIG_BUILD_EXAMPLES:BOOL=OFF \<br>
    -DBUILD_TESTING:BOOL=OFF<br>
<br>
<br>
Here&#39;s a summary of the build and installation to the DESTDIR (everything works):<br>
<br>
[... snip the build details ...]<br>
<br>
Install the project...<br>
/opt/local/bin/cmake -P cmake_install.cmake<br>
-- Install configuration: &quot;Release&quot;<br>
-- Installing: /opt/local/var/macports/build/_Users_dweber_ports_devel_cableswig/work/destroot/opt/local/lib/CableSwig/CableSwigConfig.cmake<br>
-- Installing: /opt/local/var/macports/build/_Users_dweber_ports_devel_cableswig/work/destroot/opt/local/lib/CableSwig/SWIGLib/_std_deque.i<br>
...[snip a few files]...<br>
<br>
<br>
[ dweber@X ~/ports/devel/cableswig ]$ ll work/destroot/opt/local/bin/<br>
total 1.8M<br>
-rwxr-xr-x 1 root admin 445K 2009-05-15 18:42 cableidx*<br>
-rwxr-xr-x 1 root admin 1.4M 2009-05-15 18:43 cswig*<br>
<br>
[ dweber@X ~/ports/devel/cableswig ]$ ll work/destroot/opt/local/lib/CableSwig/<br>
total 4.0K<br>
-rw-r--r--  1 root admin 314 2009-05-15 18:37 CableSwigConfig.cmake<br>
drwxr-xr-x 21 root admin 714 2009-05-15 18:43 SWIGLib/<br>
[ dweber@X ~/ports/devel/cableswig ]$ ll work/destroot/opt/local/lib/CableSwig/SWIGLib/<br>
total 96K<br>
-rw-r--r--  1 root admin 4.1K 2003-04-09 10:34 _std_deque.i<br>
-rw-r--r--  1 root admin  659 2004-02-18 06:45 allkw.swg<br>
-rw-r--r--  1 root admin 2.9K 2004-02-18 06:45 carrays.i<br>
-rw-r--r--  1 root admin 2.5K 2004-02-18 06:45 cdata.i<br>
-rw-r--r--  1 root admin 2.2K 2004-02-18 06:45 cmalloc.i<br>
-rw-r--r--  1 root admin 7.3K 2004-06-15 08:26 common.swg<br>
-rw-r--r--  1 root admin 6.2K 2003-04-09 10:34 constraints.i<br>
-rw-r--r--  1 root admin 3.6K 2004-02-18 06:45 cpointer.i<br>
-rw-r--r--  1 root admin   78 2003-04-09 10:34 cstring.i<br>
-rw-r--r--  1 root admin 8.6K 2004-02-18 06:45 exception.i<br>
drwxr-xr-x 14 root admin  476 2009-05-15 18:43 java/<br>
-rw-r--r--  1 root admin 2.0K 2004-02-18 06:45 math.i<br>
-rw-r--r--  1 root admin  115 2003-04-09 10:34 pointer.i<br>
drwxr-xr-x 33 root admin 1.1K 2009-05-15 18:43 python/<br>
-rw-r--r--  1 root admin  118 2003-04-09 10:34 std_deque.i<br>
-rw-r--r--  1 root admin  276 2004-02-18 06:45 stl.i<br>
-rw-r--r--  1 root admin  13K 2004-02-18 06:45 swig.swg<br>
-rw-r--r--  1 root admin   74 2004-02-18 06:45 swigrun.i<br>
drwxr-xr-x 15 root admin  510 2009-05-15 18:43 tcl/<br>
<br>
<br>
<br>