Issues in CmakeLists.txt
AronHetLam opened this issue · comments
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
-
First I cloned obs-studio, and followed their instuctions to get OBS itself to build and run.
-
I cloned obs-asio into the
obs-studio/plugins
folder, addingadd_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.
-
I manually set
Libobs_DIR
toC:/Users/aronh/Documents/Code/obs-studio/build64/libobs
. Now it configus and generetes in CMake gui, but the plugin isn't compiled correctly. -
I noticed that both
obs-asio
andwin-asio
were used in the CMake file in an inconsistent way, breaking references. Changeing it to onlyobs-asio
orwin-asio
fixed this. Also some paths where incomplete, missingsrc\
. 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.