Skip to content
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

Add CMakeLists.txt to GLFW OpenGL3 example #7272

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

plops
Copy link

@plops plops commented Jan 29, 2024

I got used to using CMake and I think would have helped me if the example had a CMakeLists.txt. I did it for this particular example because this is what I'm planning to extend.

I copied CMakeLists.txt file from glfw vulkan example and made it work for the opengl3 glfw example.

I tried it on a gentoo amd64:

martin@archlinux ~/stage/imgui/examples/example_glfw_opengl3/build $ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Including X11 support
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Configuring done (0.7s)
-- Generating done (0.0s)
-- Build files have been written to: /home/martin/stage/imgui/examples/example_glfw_opengl3/build

martin@archlinux ~/stage/imgui/examples/example_glfw_opengl3/build $ ninja
[33/33] Linking CXX executable example_glfw_opengl3
martin@archlinux ~/stage/imgui/examples/example_glfw_opengl3/build $ ls -tlrh
total 1.5M
-rw-r--r-- 1 martin martin 47K Jan 29 20:20 CMakeCache.txt
-rw-r--r-- 1 martin martin 1.7K Jan 29 20:20 cmake_install.cmake
drwxr-xr-x 4 martin martin 4.0K Jan 29 20:20 binary_dir
-rw-r--r-- 1 martin martin 46K Jan 29 20:20 build.ninja
drwxr-xr-x 6 martin martin 4.0K Jan 29 20:20 CMakeFiles
-rwxr-xr-x 1 martin martin 1.4M Jan 29 20:21 example_glfw_opengl3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants