View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014040CMakeModulespublic2013-03-25 16:242013-10-07 10:04
ReporterJavier 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionno change required 
PlatformlinuxOSred hatOS Version2.3
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0014040: SWIG doesn't support -pacakge
DescriptionI'm trying to generate java wrappers for a C++ interface. I need the wrappers to be in a specific package. This is achieved by passing -package <package> to swig.

When I set SWIG_FLAGS to "-package com.something", swigs yields "Unrecognized option -package com.something"

The reason for this is that in build.cmake, the space is escaped:

...
&& /usr/local/bin/swig -java -package\ com.something ...
 
Steps To Reproducefind_package(JNI REQUIRED)
find_package(SWIG REQUIRED)

include(${SWIG_USE_FILE})
include_directories(${JNI_INCLUDE_DIRS})

set_source_files_properties(example.i PROPERTIES CPLUSPLUS ON)
set_source_files_properties(example.i PROPERTIES SWIG_FLAGS "-package com.something")

swig_add_module(example java example.i example.cpp)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0032699)
Brad King (manager)
2013-03-25 16:34

You're quoting the flags in the CMake source so it thinks you want one flag with a space. Try this instead:

 set_property(SOURCE example.i PROPERTY CPLUSPLUS ON)
 set_property(SOURCE example.i PROPERTY SWIG_FLAGS -package com.something)

or

 set_source_files_properties(example.i PROPERTIES
   CPLUSPLUS ON
   SWIG_FLAGS "-package;com.something" # ;-list of flags
   )
(0032701)
Javier (reporter)
2013-03-26 08:26

Thanks Brad, this worked just fine. I think we can close this issue as invalid.
(0034016)
Robert Maynard (manager)
2013-10-07 10:04

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-03-25 16:24 Javier New Issue
2013-03-25 16:34 Brad King Note Added: 0032699
2013-03-26 08:26 Javier Note Added: 0032701
2013-03-26 08:31 Brad King Status new => resolved
2013-03-26 08:31 Brad King Resolution open => no change required
2013-10-07 10:04 Robert Maynard Note Added: 0034016
2013-10-07 10:04 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team