This commit is contained in:
2024-03-10 14:59:19 +11:00
parent de7bb2e548
commit 2f39d31874
2 changed files with 20 additions and 19 deletions

View File

@@ -3,9 +3,17 @@ project(Lesson10 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 98)
find_package(SDL2 REQUIRED)
find_package(SDL3 REQUIRED CONFIG)
find_package(OpenGL REQUIRED)
add_executable(Lesson10 Lesson10.cpp)
target_link_libraries(Lesson10 SDL2::SDL2 OpenGL::GL)
set_property(TARGET Lesson10 PROPERTY CXX_STANDARD 98)
target_link_libraries(Lesson10 SDL3::SDL3 OpenGL::GL)
target_compile_options(Lesson10 PRIVATE -Wall -Wextra -pedantic)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
get_property(SDL3_IMPORTED_LOCATION TARGET SDL3::SDL3 PROPERTY IMPORTED_LOCATION)
if (SDL3_IMPORTED_LOCATION MATCHES "^/Library/Frameworks/")
target_link_options(Lesson10 PRIVATE -Wl,-rpath,/Library/Frameworks)
endif()
endif()