<HTML>
<HEAD>
<TITLE>Sending Swig options to compiler</TITLE>
</HEAD>
<BODY>
<FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello,<BR>
I’m trying to add an extra option to the swig compile line (-package <packagename>) while generating java wrappers for my project.<BR>
I’m running into a problem when using:<BR>
SET(PACKAGE_NAME test)<BR>
SET_SOURCE_FILES_PROPERTIES( ${INTERFACE_FILES} PROPERTIES CPLUSPLUS ON )<BR>
SET( CMAKE_SWIG_FLAGS "-package ${PACKAGE_NAME}" )<BR>
<BR>
the Makefile contains an erroneous “\” after the –package option which causes the compile to fail.:<BR>
[ 21%] Swig source<BR>
cd /Users/gbivins/work/APIs/test/build-mac/src/java && /opt/local/bin/swig -java -package<B>\ </B>test -outdir /Users/gbivins/work/APIs/test/build-mac/lib/java/myTest -c++ -I/Users/gbivins/work/APIs/installs/include -I/Users/gbivins/work/APIs/test/include -I/System/Library/Frameworks/JavaVM.framework/Headers -o /Users/gbivins/work/APIs/osgswig-new/build-mac/src/java/testJAVA_wrap.cxx /Users/gbivins/work/APIs/test/src/java//test.i<BR>
swig error : Unrecognized option -package test<BR>
Use 'swig -help' for available options.<BR>
make[2]: *** [src/java/testJAVA_wrap.cxx] Error 1<BR>
make[1]: *** [src/java/CMakeFiles/testJava.dir/all] Error 2<BR>
make: *** [all] Error 2<BR>
<BR>
Manually removing the slash from the build.make file corrects the build problem.<BR>
<BR>
I’ve also tried using:<BR>
SET_SOURCE_FILES_PROPERTIES( ${INTERFACE_FILES} PROPERTIES SWIG_FLAGS"-package ${PACKAGE_NAME}")<BR>
<BR>
which yeilds the same results.<BR>
I’m on Mac OSX 10.5.4 using Cmake 2.6.0.<BR>
Gerrick<BR>
</SPAN></FONT></FONT>
</BODY>
</HTML>