-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (31 loc) · 1.27 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
cmake_minimum_required(VERSION 3.5)
# Project
project(MetalEngine)
# Sources
file(GLOB_RECURSE SOURCES src/*.cpp src/*.c)
file(GLOB_RECURSE HEADERS src/*.hpp src/*.h include/*.hpp include/*.h)
# Executable
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
# Flags
target_compile_options(${PROJECT_NAME} PRIVATE
-std=c++17 -O3 -Wall -Wextra -Werror -Wfloat-equal -Wundef -Wcast-align -Wwrite-strings -Wconversion -Wunreachable-code -Wpedantic
)
# Include directories
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${CMAKE_SOURCE_DIR}/lib/metal-cpp)
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${CMAKE_SOURCE_DIR}/lib/metal-cpp-extensions)
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${CMAKE_SOURCE_DIR}/lib/stb_image)
# Libraries
find_library(APPLE_FWK_FOUNDATION Foundation REQUIRED)
find_library(APPLE_FWK_QUARTZ_CORE QuartzCore REQUIRED)
find_library(APPLE_FWK_METAL Metal REQUIRED)
find_library(APPLE_FWK_METALKIT MetalKit REQUIRED)
find_library(APPLE_FWK_APPKIT AppKit REQUIRED)
# Link libraries
target_link_libraries(${PROJECT_NAME}
${APPLE_FWK_FOUNDATION}
${APPLE_FWK_QUARTZ_CORE}
${APPLE_FWK_METAL}
${APPLE_FWK_METALKIT}
${APPLE_FWK_APPKIT}
)