title: Problems having CMake access SWIG and link a java library to an existing C++ project
body: <p>I am modifying a CMake file of an existing open source project written in C++ to try to link it to a SWIG Java interface file. The code I have pieced together from other forums and tinkering around is this : </p>
  
  <pre><code>    FIND_PACKAGE(SWIG REQUIRED)
      INCLUDE(${SWIG_USE_FILE})
      INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH})
      INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/avogadro/src)
      SET(CMAKE_SWIG_FLAGS "")
      SET_SOURCE_FILES_PROPERTIES(mainwindow.i PROPERTIES CPLUSPLUS ON)
      SET_SOURCE_FILES_PROPERTIES(mainwindow.i PROPERTIES SWIG_FLAGS "-includeall")
      SWIG_ADD_MODULE(mainwindow java mainwindow.i mainwindow_wrap.c)
      SWIG_LINK_LIBRARIES(mainwindow ${JAVA_LIBRARIES})
  </code></pre>
  
  <p>Is there anything wrong with what I have written/found? When I run the cmake command, it builds. Yet when I run make -j3 (I need to do this to access the newly integrated libraries later on), it crashes, giving the very ambiguous error message "make: <em>*</em> [all] Error 2 "</p>
  
  <p>Thanks! </p>