[CMake] Sending Swig options to compiler

Gerrick Bivins gbivins at objectreservoir.com
Tue Jul 15 16:49:27 EDT 2008


Hello,
I¹m trying to add an extra option to the swig compile line (-package
<packagename>) while generating java wrappers for my project.
I¹m running into a problem when using:
SET(PACKAGE_NAME test)
SET_SOURCE_FILES_PROPERTIES( ${INTERFACE_FILES} PROPERTIES CPLUSPLUS ON )
SET( CMAKE_SWIG_FLAGS "-package ${PACKAGE_NAME}" )

 the Makefile contains an erroneous ³\² after the ­package option which
causes the compile to fail.:
[ 21%] Swig source
cd /Users/gbivins/work/APIs/test/build-mac/src/java && /opt/local/bin/swig
-java -package\ 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
swig error : Unrecognized option -package test
Use 'swig -help' for available options.
make[2]: *** [src/java/testJAVA_wrap.cxx] Error 1
make[1]: *** [src/java/CMakeFiles/testJava.dir/all] Error 2
make: *** [all] Error 2

Manually removing the slash from the build.make file corrects the build
problem.

I¹ve also tried using:
SET_SOURCE_FILES_PROPERTIES( ${INTERFACE_FILES} PROPERTIES
SWIG_FLAGS"-package ${PACKAGE_NAME}")

 which yeilds the same results.
I¹m on Mac OSX 10.5.4 using Cmake 2.6.0.
Gerrick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080715/389e163e/attachment.htm>


More information about the CMake mailing list