<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div>Alright so I’ve got some very basic skeleton stuff put together using CMake and SWIG. I followed the Python example and poked and prodded at it to make a Java version of the same thing. Then added my stuff to it. So I’ve got:</div>
<div> </div>
<div>FIND_PACKAGE(SWIG REQUIRED)</div>
<div>INCLUDE(${SWIG_USE_FILE})</div>
<div> </div>
<div>FIND_PACKAGE(Java REQUIRED)</div>
<div>INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH})</div>
<div> </div>
<div>INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})</div>
<div> </div>
<div>SET(CMAKE_SWIG_FLAGS "")</div>
<div> </div>
<div>SET(SWIG_SOURCES </div>
<div> <BUNCH OF .H FILES WITH EMBEDDED SWIG HEADER INFO></div>
<div>)</div>
<div> </div>
<div>SET_SOURCE_FILES_PROPERTIES(${SWIG_SOURCES} PROPERTIES CPLUSPLUS ON)</div>
<div>SET_SOURCE_FILES_PROPERTIES(${SWIG_SOURCES} PROPERTIES SWIG_FLAGS "-includeall")</div>
<div>SWIG_ADD_MODULE(<MYWRAPPED_LIB_DLL> Java ${SWIG_SOURCES})</div>
<div>SWIG_LINK_LIBRARIES(<MYWRAPPED_LIB_DLL> <LIB_TO_BE_WRAPPED>)</div>
<div> </div>
<div>Each of the .h files has a special header of this form embedded in them:</div>
<div> </div>
<div>//variousandsundry.h – Does various and sundry things</div>
<div>#ifdef SWIG</div>
<div>%module <MYWRAPPED_LIB_DLL></div>
<div>%{</div>
<div>#include "variousandsundry.h"</div>
<div> %}</div>
<div>#endif //SWIG</div>
<div> </div>
<div>Void foo();</div>
<div>Int bat();</div>
<div> </div>
<div>I sort of expected to see various *.java files created (like variousandsundry.java) and I expected to see a MYWRAPPED_LIB_DLL.dll and a MYWRAPPED_LIB_DLL.jar. All I can easily find is the MYWRAPPED_LIB_DLL.dll. Am I missing something or am I setting
my expectations too high. </div>
<div> </div>
<div>Basically I want to create a java interface to a c++ lib using SWIG as part of my CMake build process. This library has been successfully created before using SWIG so I’m sure it can be done. It’s just a matter of figuring out how integrate it with
the CMake process.</div>
<div> </div>
<div>Michael Caron</div>
<div> </div>
<div><font face="Arial Black, sans-serif" size="5" color="#808080"><b>Nothing is impossible for the man who doesn't have to do it himself.</b><font face="Calibri, sans-serif" size="2" color="#000000">
<br>
</font><font face="Courier New, monospace" size="2" color="#000000">-A. H. Weiler</font><font face="Calibri, sans-serif" size="2" color="#000000">
<br>
</font><font face="Arial, sans-serif" size="2" color="#800000"><i><b>Ops Analysis (BAE Internal) wiki site:</b></i></font><font face="Calibri, sans-serif" size="2" color="#000000"><i><b> </b></i></font><a href="http://bluas0752/display/EWOA/Home"><font face="Arial, sans-serif" size="2" color="#0000FF"><u><i><b>http://bluas0752/display/EWOA/Home</b></i></u></font></a><font face="Calibri, sans-serif" size="2" color="#000000">
</font></font></div>
<div> </div>
<div> </div>
<div> </div>
</font>
</body>
</html>