Comments (5)
@salesvictor , @concatime , I execute gl3w_gen.py at the beginning of the CMakelist with a command like:
execute_process(COMMAND python gl3w_gen.py --root ${PROJECT_BINARY_DIR}/libs/gl3w WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/libs/gl3w)
Example: https://github.com/podgorskiy/bimpy/blob/master/CMakeLists.txt#L41
Doing this for many years now, never had problems with it.
from gl3w.
Same issue here.
from gl3w.
I'm using gl3w with FetchContent. I was able to have it working out of the box by commenting one line out:
bwrsandman@1494cee
Try my branch: https://github.com/bwrsandman/gl3w/
from gl3w.
Here's a CMake script I wrote using FetchContent
to include this in my project. It solves two issues I had with the one in this project: The install rules aren't optional, making it difficult, if not impossible, to exclude the sources in a CPack generated installer. I don't want to redistribute the gl3w sources with my app. And the sources are generated at build-time, when they really should be generated pre-build so an IDE can find them before it compiles the first time.
cmake_minimum_required(VERSION 3.24)
find_package(OpenGL REQUIRED)
find_package(PythonInterp REQUIRED)
include(FetchContent)
FetchContent_Declare(gl3w GIT_REPOSITORY "https://github.com/skaslev/gl3w.git" GIT_TAG "master")
message(CHECK_START "Fetching skaslev/gl3w from GitHub")
FetchContent_Populate(gl3w)
message(CHECK_PASS "Done")
message(CHECK_START "Generating gl3w sources")
execute_process(COMMAND ${PYTHON_EXECUTABLE} gl3w_gen.py WORKING_DIRECTORY ${gl3w_SOURCE_DIR} OUTPUT_QUIET)
message(CHECK_PASS "Done")
add_library(gl3w INTERFACE)
target_sources(gl3w INTERFACE
$<BUILD_INTERFACE:${gl3w_SOURCE_DIR}/src/gl3w.c>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_DATAROOTDIR}/gl3w/src/gl3w.c>)
target_sources(gl3w INTERFACE FILE_SET HEADERS
BASE_DIRS
${gl3w_source_dir}/include
FILES
${gl3w_headers})
target_include_directories(gl3w INTERFACE
$<BUILD_INTERFACE:${gl3w_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/gl3w>)
target_link_libraries(gl3w INTERFACE OpenGL::GL ${CMAKE_DL_LIBS})
from gl3w.
Thanks for the script. It works but is not ideal.
from gl3w.
Related Issues (20)
- No S3TC/DXT compression enums HOT 3
- Phyton 2.7.3 error HOT 1
- glfw_test.c issue on Mac HOT 3
- cmake add_subdirectory error.
- Version of gl3w that generates complete stand-alone .h file HOT 3
- some errors when using gl3w , help!!! HOT 3
- How to use gl3w on windows? HOT 1
- What if the function is neither in opengl32.dll nor from wglGetProcAddress? HOT 9
- Is gl3w available as a library by default in Ubuntu? HOT 5
- generated gl3w.h dependent on khrplatform.h HOT 2
- Make gl3wProcs thread-local in C11 version
- glCreateBuffers Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) HOT 2
- gl3w falsely reports OpenGL 3.3 is not supported HOT 3
- Readme file does not mention the --ext flag. HOT 1
- OpenGL 4.6 but get GL3W_ERROR_OPENGL_VERSION HOT 2
- [build] certificate verify failed: unable to get local issuer certificate HOT 4
- Do you need to call gl3wInit for every context? HOT 1
- Gl3w generate a C file but is using C++ stl
- Releases/tags
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gl3w.