-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using libopenshot in C++ CMake project #72
Comments
@jonoomph - Any idea on this one? |
NB In #1 it is described a similar problem, but in that case the include issue appears (interestingly on the same Juce header file) already when building libopenshot. In my case, instead, I can build libopenshot, but I cannot use it in a different project. |
So, I have found a temporary solution which I don't really like because it involves changing your src/CMakeLists.txt file, but it works. Before explaining my solution, I should clarify that I have copied libopenshot into my project and I am building it like it was a module of my own project. However, I think this will work even when libopenshot is normally installed into the system, but I haven't tried it yet because it is not a priority for me. So, I have just put, for each include_directories(${PATH}) command in src/CMakeLists.txt file, a call to target_include_directories(openshot PUBLIC ${PATH}) at the end of the file (plus another one for ${headers} variable).
This way, CMake handles the dependencies automatically and I can do, from my libraries, something like:
(This works in my case because openshot is built inside my project, but in general this should be done after an appopriate find_library/find_path or find_package call) where you should set Again, I do not really like this solution, but it's the best I could do to make this work. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
System Details:
Issue Description and steps to reproduce:
Sorry for the very basic questions, I am probably missing some basic CMake concept. The issue is pretty simple: I have a C++ CMake project and I want to use Openshot to produce a video.
1)I cannot find a Cmake module to be able to do find_package(openshot). But this is secondary, I have written my finder, but it seems odd to me that it is not already provided in a CMake-based project.
2) Once I find the openshot library, I cannot do #include "OpenShot.h" because it doesn't find the external dependencies (like JuceLibraries/*.h in openshot-audio library). Usually, when I write my own libraries, I solve this just by using target_link_libraries, but this relies on the writer of the library to have defined an include interface in a target_include_directories.
Again, I am probably missing something very easy, so forgive me but as you probably know CMake's documentation really lacks on clarity (in my opinion, at least).
The text was updated successfully, but these errors were encountered: