CMake: Add install rule

Install libGL and its headers to the sysroot directory when
"make install" is executed.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
This commit is contained in:
Paul Cercueil 2026-06-24 01:59:01 +02:00
parent 6ea25ff3c7
commit 134b58f8db
No known key found for this signature in database
GPG Key ID: 73EE6BD2274ABD41

View File

@ -61,6 +61,7 @@ set_target_properties(GL PROPERTIES
COMPILE_DEFINITIONS -DBACKEND_${BACKEND_UPPER}
C_STANDARD 99
INTERPROCEDURAL_OPTIMIZATION ${FLTO_SUPPORTED}
PUBLIC_HEADER "include/GL/gl.h;include/GL/glext.h;include/GL/glu.h;include/GL/glkos.h"
)
target_include_directories(GL PUBLIC ${CMAKE_SOURCE_DIR}/include)
@ -100,6 +101,14 @@ else()
)
endif()
include(GNUInstallDirs)
install(TARGETS GL
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GL
)
function(gen_sample sample)
add_executable(${sample} ${ARGN})
target_link_libraries(${sample} PRIVATE m GL)