title: Linking an external library bundle file on macos with cmake
body: <p>I have a library compiled as a single file that I'm trying to link with <code>cmake</code> but haven't been able to cobble together something that works using existing examples that should be related, eg.</p>
  <p><a href="https://stackoverflow.com/questions/17070488/cmake-link-an-external-library">CMake link an external library</a>
  <a href="https://stackoverflow.com/questions/52028809/cmake-linking-external-libraries">Cmake linking external libraries</a></p>
  <p>What I have so far:</p>
  <pre><code>cmake_minimum_required(VERSION 3.17)
  project(atem)
  
  set(CMAKE_CXX_STANDARD 14)
  set(BMD_API_LIB &quot;BMDSwitcherAPI&quot;)
  set(BMD_API_PATH &quot;/Library/Application Support/Blackmagic Design/Switchers/BMDSwitcherAPI.bundle/Contents/MacOS/&quot;)
  
  find_library(BMDSwitcherAPI ${BMD_API_LIB} PATHS ${BMD_API_PATH})
  
  add_executable(atem main.cpp BMDSwitcherAPIDispatch.cpp)
  
  target_link_libraries(atem ${BMDSwitcherAPI})
  </code></pre>
  <p>The files <code>main.cpp</code> and <code>BMDSwitcherAPIDispatch.cpp</code> exist in the same directory. Building says that the file for the library can't be found, but the binary for the library file for <code>${BMD_API_LIB}</code> cannot be found, but it is definitely at the path given in <code>${BMD_API_PATH}</code>.</p>
  <p>I'm not sure where to go from here.</p>
  <p>Edit: added entire error message</p>
  <pre><code>====================[ Build | atem | Debug ]====================================
  /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/user/Code/atem/cmake-build-debug --target atem -- -j 9
  [ 33%] Linking CXX executable atem
  ld: library not found for -lBMDSwitcherAPI
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[3]: *** [atem] Error 1
  make[2]: *** [CMakeFiles/atem.dir/all] Error 2
  make[1]: *** [CMakeFiles/atem.dir/rule] Error 2
  make: *** [atem] Error 2
  </code></pre>