Swig and Java Package Flag option not working

Hello All,

I am using CMake and UseSwig() to create some java bindings. All seems to work - but I get an error when trying to pass the “-package” option on to swig (in order to wrap the created java into a java package)

set(CMAKE_SWIG_FLAGS “-doxygen; -package com.package.example”)

Gives this error:

  Swig compile C:/Users/casht/repos/imatest_motion/build_Release/MC_API_JavaPackage/SwigInterface.i for java
CUSTOMBUILD : swig error : Unrecognized option  -package com.package.example [C:\Users\casht\repos\imatest_motion\build_Release\MC_API_JavaPackage\MC_API_JavaPackage.vcxproj]
  Use 'swig -help' for available options.

I’m using cmake 3.25.1 and swig 4.1.1

Any help would be appreciated,

It looks like the spaces are being taken literally. Try:

Many Thanks - That fixed the Issue.