22 lines
587 B
CMake
22 lines
587 B
CMake
cmake_minimum_required(VERSION 3.27)
|
|
project(HelloOpenGL)
|
|
|
|
# Define platform-specific paths and libraries
|
|
if(WIN32)
|
|
# GLFW
|
|
set(GLFW_PATH "C:/libs/glfw-3.3.8.bin.WIN64")
|
|
include_directories(${GLFW_PATH}/include)
|
|
link_directories(${GLFW_PATH}/lib-vc2022)
|
|
|
|
# OpenGL
|
|
find_package(OpenGL REQUIRED)
|
|
elseif(UNIX OR APPLE)
|
|
message(FATAL_ERROR "Linux and macOS platforms are not supported yet.")
|
|
endif()
|
|
|
|
add_executable(${PROJECT_NAME} hello.cpp)
|
|
|
|
if(WIN32)
|
|
target_link_libraries(${PROJECT_NAME} glfw3)
|
|
target_link_libraries(${PROJECT_NAME} OpenGL::GL)
|
|
endif() |