openframeworks / openframeworks/openFrameworks
use of as a library in my cmake project
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
Hi, the of project is compiled by make system, But in my case, my project is compiled by cmake, and I want to link of's .so/.a libraries into my project. I saw the makefile and compile command line:
g++ -c -g3 -DDEBUG -Wall -Werror=return-type -DGCC_HAS_REGEX -std=c++17 -DOF_USING_GTK -Wall -Werror=return-type -DGCC_HAS_REGEX -std=c++17 -pthread -D_REENTRANT -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/AL -I/usr/include/x86_64-linux-gnu -I/usr/include/rtaudio -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/../include/include -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/fmod/include -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/glm/include -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/glm/include/glm -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/glm/include/glm/detail -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/glm/include/glm/ext -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/glm/include/glm/simd -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/glm/include/glm/gtc -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/glm/include/glm/gtx -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/json/include -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/kiss/include -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/pugixml/include -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/tess2/include -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/utf8/include -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/utf8/include/utf8 -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/sound -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/communication -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/events -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/math -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/utils -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/3d -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/types -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/app -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/video -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/graphics -I/mnt/data/projects/jd-third-party/src/of-0.12/libs/openFrameworks/gl -pthread -D_REENTRANT -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/AL -I/usr/include/x86_64-linux-gnu -I/usr/include/rtaudio -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/../include/include -I/mnt/data/projects/jd-third-party/src/of-0.12/addons/ofxAssimpModelLoader/src -I/mnt/data/projects/jd-third-party/src/of-0.12/addons/ofxAssimpModelLoader/libs -I/mnt/data/projects/jd-third-party/src/of-0.12/addons/ofxAssimpModelLoader/libs/assimp -MMD -MP -MF /mnt/data/projects/jd-third-party/src/of-0.12/addons/obj/linux64/Debug/ofxAssimpModelLoader/src/ofxAssimpModelLoader.d -MT /mnt/data/projects/jd-third-party/src/of-0.12/addons/obj/linux64/Debug/ofxAssimpModelLoader/src/ofxAssimpModelLoader.o -o /mnt/data/projects/jd-third-party/src/of-0.12/addons/obj/linux64/Debug/ofxAssimpModelLoader/src/ofxAssimpModelLoader.o -c /mnt/data/projects/jd-third-party/src/of-0.12/addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.cpp
, so I want to link the commond line's libs by target_link_libraries / target_include_directories in cmake. Is there any problem in this way? and aother question: I saw when addons is used by of project, the addon source code is compiled with my code together, So, I must add the addon's to my cmake's add_executable ?
In general, I want to use of as a library, link to my program( which is not compiled by cmake), process ofAppNoWindow / ofRunMainLoop in my source code, can you give me some compile's advices? thankyou!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the repository's Makefile and the existing addon build flow described in the issue, including how ofAppNoWindow and ofRunMainLoop are used. Determine whether CMake library consumption and addon inclusion are supported, then document or define the required integration path and its completion criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100