2023-10-10 19:22:32 +00:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(glew-cmake-test LANGUAGES C)
|
2015-06-22 12:06:50 +00:00
|
|
|
|
|
|
|
find_package(GLEW REQUIRED CONFIG)
|
2015-11-10 10:53:16 +00:00
|
|
|
find_package(GLEW REQUIRED CONFIG) # call twice to test multiple call
|
2015-06-22 12:06:50 +00:00
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
|
|
|
|
add_executable(cmake-test main.c)
|
|
|
|
set_target_properties(cmake-test PROPERTIES DEBUG_POSTFIX _d)
|
|
|
|
target_link_libraries(cmake-test PRIVATE GLEW::GLEW ${OPENGL_LIBRARIES})
|
|
|
|
target_include_directories(cmake-test PRIVATE ${OPENGL_INCLUDE_DIR})
|
|
|
|
|
|
|
|
target_compile_definitions(cmake-test PRIVATE
|
2023-10-10 19:22:32 +00:00
|
|
|
-DGLEW_CMAKE_TEST_CONFIG=$<CONFIG>
|
2015-06-22 12:06:50 +00:00
|
|
|
-DGLEW_CMAKE_TEST_TARGET_FILE_NAME=$<TARGET_FILE_NAME:GLEW::GLEW>
|
|
|
|
-DGLEW_CMAKE_TEST_TARGET_TYPE=$<TARGET_PROPERTY:GLEW::GLEW,TYPE>
|
|
|
|
)
|
|
|
|
|
2023-03-23 04:36:44 +00:00
|
|
|
install(TARGETS cmake-test DESTINATION bin COMPONENT Runtime)
|