Andersama / obs-asio

ASIO plugin for OBS-Studio
GNU General Public License v3.0
664 stars 43 forks source link

Issues in CmakeLists.txt #98

Closed AronHetLam closed 1 year ago

AronHetLam commented 2 years ago

While working on #91 I ran into several complications while trying to build the plugin, which I also mentioned in that issue. However, since I got a build working, I thought I'd make a new issue related to the Cmake file.

The steps I took to get it working

  1. First I cloned obs-studio, and followed their instuctions to get OBS itself to build and run.

  2. I cloned obs-asio into the obs-studio/plugins folder, adding add_subdirectory(obs-asio) to the CMakeFile.txt. I add the CMake values in CMake gui listed in the header of obs-asio's CMakeFile.txt (only adding the JUCE values as described in the Wiki isn't enough...) Trying to configure now gives the following error:

    CMake Error at plugins/obs-asio/CMakeLists.txt:20 (find_package):
      By not providing "FindLibobs.cmake" in CMAKE_MODULE_PATH this project has
      asked CMake to find a package configuration file provided by "Libobs", but
      CMake did not find one.
    
      Could not find a package configuration file provided by "Libobs" with any
      of the following names:
    
        LibobsConfig.cmake
        libobs-config.cmake
    
      Add the installation prefix of "Libobs" to CMAKE_PREFIX_PATH or set
      "Libobs_DIR" to a directory containing one of the above files.  If "Libobs"
      provides a separate development package or SDK, be sure it has been
      installed.

    `Libobs_DIR = Libobs_DIR-NOTFOUND`

  3. I manually set Libobs_DIR to C:/Users/aronh/Documents/Code/obs-studio/build64/libobs. Now it configus and generetes in CMake gui, but the plugin isn't compiled correctly.

  4. I noticed that both obs-asio and win-asio were used in the CMake file in an inconsistent way, breaking references. Changeing it to only obs-asio or win-asio fixed this. Also some paths where incomplete, missing src\. Now the source files actually show in visual studio, and builds and runs as expected.

My conclusion

As this is really the first time I'm using CMake, I'm not sure why it can't find the LibobsConfig.cmake or libobs-config.cmake

I'm quite confident that the CMake file references the sources incorrectly, and that I have been able to fix it. However, I'm not sure if you want it to be obs-asio or win-asio, as the repo and released .dll have each their name. I'll push both versions to my fork in seperate branches, for you to decide.