aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/gl3w/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/gl3w/CMakeLists.txt')
-rw-r--r--vcpkg/ports/gl3w/CMakeLists.txt40
1 files changed, 40 insertions, 0 deletions
diff --git a/vcpkg/ports/gl3w/CMakeLists.txt b/vcpkg/ports/gl3w/CMakeLists.txt
new file mode 100644
index 0000000..41f75b2
--- /dev/null
+++ b/vcpkg/ports/gl3w/CMakeLists.txt
@@ -0,0 +1,40 @@
+cmake_minimum_required(VERSION 3.9)
+project(gl3w C)
+
+find_package(OpenGL REQUIRED)
+find_path(GLCOREARB_H NAMES GL/glcorearb.h)
+
+add_library(gl3w src/gl3w.c)
+
+target_include_directories(gl3w
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:include>
+ PRIVATE
+ ${GLCOREARB_H}
+ ${OPENGL_INCLUDE_DIR}
+)
+
+if(BUILD_SHARED_LIBS)
+ target_compile_definitions(gl3w PRIVATE "-DGL3W_API=__declspec(dllexport)")
+endif()
+
+target_link_libraries(gl3w PRIVATE ${OPENGL_LIBRARIES})
+
+install(TARGETS gl3w
+ EXPORT gl3wExport
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+
+install(
+ EXPORT gl3wExport
+ FILE gl3wConfig.cmake
+ NAMESPACE unofficial::gl3w::
+ DESTINATION share/gl3w
+)
+
+if(NOT DISABLE_INSTALL_HEADERS)
+ install(FILES include/GL/gl3w.h DESTINATION include/GL)
+endif()