Add CMakeLists.txt to GLFW OpenGL3 example #7272
Open
+39
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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