title: Linking OIS in XCode on OSX with CMake
body: <p>I'm creating a browser plugin that handles joystick input across all browser and platforms. It's working on Linux and Windows, but I'm having trouble linking to the OIS library in XCode.</p>
  
  <p>I've built OIS and get libOIS.a and OIS.dylib and am linking them with CMake as follows:</p>
  
  <pre><code>find_library(CARBON NAMES Carbon)
  find_library(IOKIT NAMES IOKit)
  
  target_link_libraries(${PROJECT_NAME}
   ${PLUGIN_INTERNAL_DEPS}
   ${CARBON}
   ${IOKIT}
   "${CMAKE_CURRENT_SOURCE_DIR}/lib/libOIS.a"
  )
  </code></pre>
  
  <p>But I'm still getting errors every time I try to use the OIS classes from my code and build the project:</p>
  
  <pre><code>ld warning: in /Users/Lana/Documents/STRd6/boomsticks/Boomstick/lib/libOIS.a, missing required architecture x86_64 in file
  
  Undefined symbols:
   "OIS::InputManager::destroyInputSystem(OIS::InputManager*)", referenced from:
       JoysticksHandler::~JoysticksHandler()in Joysticks.o
       JoysticksHandler::~JoysticksHandler()in Joysticks.o
   "OIS::InputManager::createInputSystem(std::multimap&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt;&amp;)", referenced from:
       JoysticksHandler::initialize()       in Joysticks.o
   "OIS::InputManager::enableAddOnFactory(OIS::InputManager::AddOnFactories)", referenced from:
       JoysticksHandler::initialize()       in Joysticks.o
   "OIS::InputManager::getNumberOfDevices(OIS::Type)", referenced from:
       JoysticksHandler::initialize()       in Joysticks.o
   "typeinfo for OIS::Exception", referenced from:
       GCC_except_table44 in Joysticks.o
   "OIS::InputManager::createInputObject(OIS::Type, bool, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)", referenced from:
       JoysticksHandler::initialize()       in Joysticks.o
  ld: symbol(s) not found
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I don't know anything about XCode, but I was able to get the same code building with a very similar process on Linux and Windows.</p>