<commit_before>cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

project(glad VERSION 1.0.0 LANGUAGES C)

include(GNUInstallDirs)

set(SOURCE_FILES src/gl.c src/glx.c src/wgl.c)
set(HEADER_FILES include/glad/gl.h include/glad/glx.h include/glad/wgl.h)

if(UNIX)
  list(REMOVE_ITEM SOURCE_FILES "src/wgl.c")
  list(REMOVE_ITEM HEADER_FILES "include/glad/wgl.h")
elseif(WIN32)
  list(REMOVE_ITEM SOURCE_FILES "src/glx.c")
  list(REMOVE_ITEM HEADER_FILES "include/glad/glx.h")
endif()

add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES})

# target_compile_definitions(${PROJECT_NAME} 
#   PRIVATE GLAD_GLAPI_EXPORT_BUILD
#   PUBLIC GLAD_GLAPI_EXPORT)

install(TARGETS ${PROJECT_NAME}
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

target_include_directories(${PROJECT_NAME} 
  PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:include>
  PRIVATE src)

set_target_properties(${PROJECT_NAME} PROPERTIES
  VERSION ${PROJECT_VERSION}
  SOVERSION 1)

install(TARGETS ${PROJECT_NAME} EXPORT gladConfig
  ARCHIVE  DESTINATION ${CMAKE_INSTALL_LIBDIR}
  LIBRARY  DESTINATION ${CMAKE_INSTALL_LIBDIR}
  RUNTIME  DESTINATION ${CMAKE_INSTALL_BINDIR})

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/)

install(EXPORT gladConfig DESTINATION share/glad/cmake)

export(TARGETS ${PROJECT_NAME} FILE gladConfig.cmake)
<commit_msg>update glad cmake<commit_after>cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

project(glad
  VERSION 2.0.0
  LANGUAGES C)

set(SOURCE_FILES
  src/gl.c
  src/vulkan.c)
set(HEADER_FILES
  include/glad/gl.h
  include/glad/vulkan.h
  include/KHR/khrplatform.h
  include/vk_platform.h)

if (UNIX)
  list(APPEND SOURCE_FILES "src/glx.c")
  list(APPEND HEADER_FILES "include/glad/glx.h")
elseif (WIN32)
  list(APPEND SOURCE_FILES "src/wgl.c")
  list(APPEND HEADER_FILES "include/glad/wgl.h")
endif ()

add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES})

target_include_directories(${PROJECT_NAME}
  PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:include>)

# Install
include(GNUInstallDirs)

install(TARGETS ${PROJECT_NAME} EXPORT gladConfig
  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

install(DIRECTORY include/
  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

install(EXPORT gladConfig
  DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glad)

export(TARGETS ${PROJECT_NAME} FILE gladConfig.cmake)

{'fraction_non_alphanumeric': 0.10644910644910645, 'fraction_numerical': 0.006604506604506605, 'mean_word_length': 6.779456193353474, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4912434', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1002, 'n_words': 156}