Update CMakeLists.txt
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.18)
|
||||||
project(glad
|
project(glad
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
LANGUAGES C
|
LANGUAGES C
|
||||||
@@ -6,8 +6,19 @@ project(glad
|
|||||||
|
|
||||||
file(GLOB_RECURSE HEADERS "include/*.h")
|
file(GLOB_RECURSE HEADERS "include/*.h")
|
||||||
file(GLOB_RECURSE SOURCES "src/*.c")
|
file(GLOB_RECURSE SOURCES "src/*.c")
|
||||||
include_directories("include")
|
find_package(OpenGL REQUIRED)
|
||||||
|
|
||||||
|
include_directories("include")
|
||||||
|
include_directories(${OPENGL_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
if (UNIX AND NOT APPLE)
|
||||||
|
add_library(glad SHARED ${SOURCES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
add_library(glad STATIC ${SOURCES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_library(glad SHARED ${SOURCES})
|
|
||||||
set_target_properties(glad PROPERTIES LINKER_LANGUAGE C)
|
set_target_properties(glad PROPERTIES LINKER_LANGUAGE C)
|
||||||
target_link_libraries(glad PUBLIC GL)
|
target_link_libraries(glad PUBLIC ${OPENGL_LIBRARIES})
|
||||||
|
Reference in New Issue
Block a user