-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (44 loc) · 1.68 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
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.7)
project(fey)
include_directories(deps/glad)
include_directories(deps/glfw/include)
include_directories(deps/glm)
include_directories(deps/soil/inc)
include_directories(deps/stb)
add_subdirectory(deps)
find_package(Vulkan REQUIRED)
include_directories(${Vulkan_INCLUDE_DIR})
include_directories(inc)
include_directories(inc/vertexLayouts)
include_directories(inc/uniformLayouts)
include_directories(inc/controllers)
include_directories(inc/resources)
include_directories(inc/resources/baseResources)
include_directories(inc/resources/opengl)
include_directories(inc/resources/vulkan)
include_directories(inc/fixtures)
include_directories(inc/physics)
include_directories(inc/physics/colliders)
include_directories(inc/graphicsEngines)
file(GLOB_RECURSE SOURCES "src/*.cpp")
add_executable(fey ${SOURCES})
set(LINKED_LIBRARIES glfw glad soil ${GLFW_LIBRARIES} ${Vulkan_LIBRARY})
set(DATA_DESTINATION feyData)
set(COPY_DATA feyData)
if(WIN32)
set(LINKED_LIBRARIES ${LINKED_LIBRARIES} opengl32)
set(DATA_DESTINATION Debug/feyData)
else()
set(GCC_COMPILE_FLAGS "-g -std=c++11")
add_definitions(${GCC_COMPILE_FLAGS})
if(APPLE)
find_library(OPENGL_LOCATION OpenGL)
set(LINKED_LIBRARIES ${LINKED_LIBRARIES} ${OPENGL_LOCATION})
elseif(UNIX)
set(LINKED_LIBRARIES ${LINKED_LIBRARIES} GL)
endif()
endif()
target_link_libraries(fey ${LINKED_LIBRARIES})
add_custom_command(TARGET fey POST_BUILD COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/scripts/copyData.pl ${CMAKE_CURRENT_SOURCE_DIR}/${COPY_DATA} ${DATA_DESTINATION})
install(TARGETS fey DESTINATION games)
install(DIRECTORY feyData DESTINATION games DIRECTORY_PERMISSIONS WORLD_READ WORLD_WRITE WORLD_EXECUTE)