hyporo-cpp/cmake/external/glad.cmake

49 lines
1.3 KiB
CMake
Raw Normal View History

2022-10-05 21:10:51 +05:00
CPMAddPackage(
NAME glad
GIT_REPOSITORY https://github.com/Dav1dde/glad.git
2023-01-11 14:46:49 +05:00
#VERSION 2.0.2
2022-10-05 21:10:51 +05:00
VERSION 0.1.36
GIT_PROGRESS TRUE
2023-03-13 22:27:09 +05:00
EXCLUDE_FROM_ALL ON
OPTIONS "GLAD_EXPORT OFF" "GLAD_INSTALL OFF"
2022-10-05 21:10:51 +05:00
)
2023-01-11 14:46:49 +05:00
2023-03-13 22:27:09 +05:00
if(glad_ADDED)
set(EXTERNAL_PROJECT_NAME glad)
include(GNUInstallDirs)
add_library(glad::glad ALIAS glad)
install(
TARGETS ${EXTERNAL_PROJECT_NAME}
EXPORT ${EXTERNAL_PROJECT_NAME}Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT runtime
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT devel
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT devel
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT devel
)
install(
EXPORT ${EXTERNAL_PROJECT_NAME}Targets
FILE ${EXTERNAL_PROJECT_NAME}Targets.cmake
NAMESPACE ${EXTERNAL_PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${EXTERNAL_PROJECT_NAME}
COMPONENT devel
)
install(
DIRECTORY ${glad_BINARY_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT devel
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.hpp"
)
endif()