Closed petrasvestartas closed 1 year ago
In case ExternalProject_Add doesn't work, you could try cmake's fetchcontent.
Make sure to put a include(FetchContent)
somewhere before you insert the code below.
FetchContent_Declare(
glad
GIT_REPOSITORY https://github.com/Dav1dde/glad.git
GIT_TAG v0.1.36
)
set(GLAD_PROFILE "core" CACHE STRING "OpenGL profile")
set(GLAD_GENERATOR "c" CACHE STRING "Language to generate the binding for")
FetchContent_MakeAvailable(glad)
You can set more options, too, here's an example.
Thank you, could you show how to download github repo and set these properties within external project command?
@drsnuggles8
If I write this, weirdly only github repository is cloned without any glad.c , glad.h present. Any idea why?
This is my code:
ExternalProject_Add(glad
GIT_REPOSITORY https://github.com/Dav1dde/glad.git
GIT_TAG v0.1.36
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DGLAD_PROFILE="core"
-DGLAD_GENERATOR="c"
SOURCE_DIR "${CMAKE_BINARY_DIR}/install/glad"
CONFIGURE_COMMAND "" #do not configure
BUILD_COMMAND "" #do not buld
INSTALL_COMMAND "" #installer for now is empty
)
Hi,
How can I download GLAD using cmake function "ExternalProject_Add" for this specific configuration ?
I found some CMake code on the internet but it does not specify these options: